Last active
August 29, 2015 14:07
-
-
Save sharth/691452010c1e935bf384 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Function Attrs: nounwind ssp uwtable | |
define i32 @main() #0 { | |
%1 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([3 x i8]* @.str, i64 0, i64 0), double 3.500000e+00) #3 | |
ret i32 0 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LCPI0_0: | |
.quad 4615063718147915776 ## double 3.5 | |
.section __TEXT,__text,regular,pure_instructions | |
.globl _main | |
.align 4, 0x90 | |
_main: ## @main | |
.cfi_startproc | |
## BB#0: | |
pushq %rbp | |
Ltmp2: | |
.cfi_def_cfa_offset 16 | |
Ltmp3: | |
.cfi_offset %rbp, -16 | |
movq %rsp, %rbp | |
Ltmp4: | |
.cfi_def_cfa_register %rbp | |
leaq L_.str(%rip), %rdi | |
movsd LCPI0_0(%rip), %xmm0 | |
movb $1, %al | |
callq _printf | |
xorl %eax, %eax | |
popq %rbp | |
retq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
float mid(float a, float b); | |
int main() { | |
printf("%f", mid(2.0, 5.0)); | |
return 0; | |
} | |
float mid(float a, float b) { | |
return (a + b)*0.5; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment