xunge/DecIR huggingface dataset:
void ft_striteri(char *s, void (*f)(unsigned int, char *)) {
  unsigned int i;
  i = 0;
  while (s[i] != '\0') {
    f(i, &s[i]);
    i++;
  }
}


x86 assembly (clang, -O0):
<ft_striteri>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114c <ft_striteri+0x4c>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%ecx
add    %rcx,%rsi
call   *%rax
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <ft_striteri+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_striteri>:
push   %r15
push   %r14
push   %rbx
cmpb   $0x0,(%rdi)
je     1133 <ft_striteri+0x33>
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
mov    %rdi,%rsi
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%edi
call   *%r14
add    $0x1,%ebx
lea    (%r15,%rbx,1),%rsi
cmpb   $0x0,(%r15,%rbx,1)
jne    1120 <ft_striteri+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @ft_striteri(i8* %0, void (i32, i8*)* %1) {
%3 = alloca i8*
%4 = alloca void (i32, i8*)*
%5 = alloca i32
store i8* %0, i8** %3
store void (i32, i8*)* %1, void (i32, i8*)** %4
store i32 0, i32* %5
br label %6
6: ; preds = %14, %2
%7 = load i8*, i8** %3
%8 = load i32, i32* %5
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %23
14: ; preds = %6
%15 = load void (i32, i8*)*, void (i32, i8*)** %4
%16 = load i32, i32* %5
%17 = load i8*, i8** %3
%18 = load i32, i32* %5
%19 = zext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
%21 = load i32, i32* %5
%22 = add i32 %21, 1
store i32 %22, i32* %5
br label %6
23: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @ft_striteri(i8* %0, void (i32, i8*)* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %10, %5 ], [ %0, %2 ]
%7 = phi i32 [ %8, %5 ], [ 0, %2 ]
tail call void %1(i32 %7, i8* %6)
%8 = add i32 %7, 1
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret void
}
int is_leap(int year) {
  if ((year % 400 == 0) || (year % 100 != 0 && year % 4 == 0))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<is_leap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1143 <is_leap+0x43>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     114f <is_leap+0x4f>
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    114f <is_leap+0x4f>
movl   $0x1,-0x4(%rbp)
jmp    1156 <is_leap+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_leap>:
imul   $0xc28f5c29,%edi,%eax
add    $0x51eb850,%eax
mov    %eax,%ecx
ror    $0x4,%ecx
cmp    $0xa3d70b,%ecx
jb     1130 <is_leap+0x30>
ror    $0x2,%eax
cmp    $0x28f5c29,%eax
setae  %al
test   $0x3,%dil
sete   %cl
and    %al,%cl
movzbl %cl,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @is_leap(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = srem i32 %4, 400
%6 = icmp eq i32 %5, 0
br i1 %6, label %15, label %7
7: ; preds = %1
%8 = load i32, i32* %3
%9 = srem i32 %8, 100
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i32, i32* %3
%13 = srem i32 %12, 4
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %11, %1
store i32 1, i32* %2
br label %17
16: ; preds = %11, %7
store i32 0, i32* %2
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @is_leap(i32 %0) {
%2 = srem i32 %0, 400
%3 = icmp eq i32 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp ne i32 %5, 0
%7 = and i32 %0, 3
%8 = icmp eq i32 %7, 0
%9 = and i1 %6, %8
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %4, %1
%12 = phi i32 [ 1, %1 ], [ %10, %4 ]
ret i32 %12
}
int ft_toupper(int c) {
  if (c >= (unsigned char)'a' && c <= (unsigned char)'z')
    return (c - 32);
  return (c);
}


x86 assembly (clang, -O0):
<ft_toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x61,-0x8(%rbp)
jl     1129 <ft_toupper+0x29>
cmpl   $0x7a,-0x8(%rbp)
jg     1129 <ft_toupper+0x29>
mov    -0x8(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <ft_toupper+0x2f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_toupper>:
lea    -0x61(%rdi),%ecx
lea    -0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @ft_toupper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 122
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 32
store i32 %11, i32* %2
br label %14
12: ; preds = %6, %1
%13 = load i32, i32* %3
store i32 %13, i32* %2
br label %14
14: ; preds = %12, %9
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @ft_toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
int init_curMode() { return 0; }


x86 assembly (clang, -O0):
<init_curMode>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_curMode>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @init_curMode() {
ret i32 0
}

LLVM IR (-O2):
define i32 @init_curMode() {
ret i32 0
}
char complement(char c) {
  if (c == 'G')
    return 'C';
  else if (c == 'C')
    return 'G';
  else if (c == 'A')
    return 'T';
  else if (c == 'T')
    return 'A';
  else
    return c;
}


x86 assembly (clang, -O0):
<complement>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x47,%eax
jne    1120 <complement+0x20>
movb   $0x43,-0x1(%rbp)
jmp    1168 <complement+0x68>
movsbl -0x2(%rbp),%eax
cmp    $0x43,%eax
jne    1136 <complement+0x36>
movb   $0x47,-0x1(%rbp)
jmp    1168 <complement+0x68>
movsbl -0x2(%rbp),%eax
cmp    $0x41,%eax
jne    114c <complement+0x4c>
movb   $0x54,-0x1(%rbp)
jmp    1168 <complement+0x68>
movsbl -0x2(%rbp),%eax
cmp    $0x54,%eax
jne    1162 <complement+0x62>
movb   $0x41,-0x1(%rbp)
jmp    1168 <complement+0x68>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<complement>:
lea    -0x41(%rdi),%ecx
cmp    $0x13,%cl
ja     1120 <complement+0x20>
mov    $0x43,%al
movzbl %cl,%ecx
lea    0xeec(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0x54,%al
ret
mov    %edi,%eax
ret
mov    $0x47,%al
ret
mov    $0x41,%al
ret

LLVM IR (-O0):
define signext i8 @complement(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 71
br i1 %6, label %7, label %8
7: ; preds = %1
store i8 67, i8* %2
br label %25
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 67
br i1 %11, label %12, label %13
12: ; preds = %8
store i8 71, i8* %2
br label %25
13: ; preds = %8
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 65
br i1 %16, label %17, label %18
17: ; preds = %13
store i8 84, i8* %2
br label %25
18: ; preds = %13
%19 = load i8, i8* %3
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 84
br i1 %21, label %22, label %23
22: ; preds = %18
store i8 65, i8* %2
br label %25
23: ; preds = %18
%24 = load i8, i8* %3
store i8 %24, i8* %2
br label %25
25: ; preds = %23, %22, %17, %12, %7
%26 = load i8, i8* %2
ret i8 %26
}

LLVM IR (-O2):
define signext i8 @complement(i8 signext %0) {
switch i8 %0, label %5 [
i8 71, label %6
i8 67, label %2
i8 65, label %3
i8 84, label %4
]
2: ; preds = %1
br label %6
3: ; preds = %1
br label %6
4: ; preds = %1
br label %6
5: ; preds = %1
br label %6
6: ; preds = %1, %5, %4, %3, %2
%7 = phi i8 [ 71, %2 ], [ 84, %3 ], [ 65, %4 ], [ %0, %5 ], [ 67, %1 ]
ret i8 %7
}
/* Variables and functions */
int fun0(int, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int i0 = argv[0][0];
  int i1 = argv[0][1];
  printf("%d\n", fun0(i0, i1));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl 0x1(%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1030 <fun0@plt>
mov    %eax,%esi
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    (%rsi),%rax
movsbl (%rax),%edi
movsbl 0x1(%rax),%esi
call   1030 <fun0@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%7 = load i8**, i8*** %4
%8 = getelementptr inbounds i8*, i8** %7, i64 0
%9 = load i8*, i8** %8
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
store i32 %12, i32* %5
%13 = load i8**, i8*** %4
%14 = getelementptr inbounds i8*, i8** %13, i64 0
%15 = load i8*, i8** %14
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
store i32 %18, i32* %6
%19 = load i32, i32* %5
%20 = load i32, i32* %6
%21 = call i32 @fun0(i32 %19, i32 %20)
%22 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %21)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = getelementptr inbounds i8, i8* %3, i64 1
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = tail call i32 @fun0(i32 %5, i32 %8)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}
void pollen_interfaces_Gpio_targetInit__I() {}


x86 assembly (clang, -O0):
<pollen_interfaces_Gpio_targetInit__I>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pollen_interfaces_Gpio_targetInit__I>:
ret

LLVM IR (-O0):
define void @pollen_interfaces_Gpio_targetInit__I() {
ret void
}

LLVM IR (-O2):
define void @pollen_interfaces_Gpio_targetInit__I() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ display_msg();
int /*<<< orphan*/ init_app();
void main(void) {
  init_app();
  while (1) {
    display_msg();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <init_app@plt>
mov    $0x0,%al
call   1040 <display_msg@plt>
jmp    112b <main+0xb>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <init_app@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <display_msg@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @init_app()
br label %2
2: ; preds = %0, %2
%3 = call i32 (...) @display_msg()
br label %2
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @init_app()
br label %2
2: ; preds = %0, %2
%3 = tail call i32 (...) @display_msg()
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ foo();
main() {
  int i;
  for (i = 100000; i >= 0; i--) {
    foo();
    foo();
    foo();
    foo();
    foo();
    foo();
    foo();
    foo();
    foo();
    foo();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x186a0,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1184 <main+0x74>
mov    $0x0,%al
call   1030 <foo@plt>
mov    $0x0,%al
call   1030 <foo@plt>
mov    $0x0,%al
call   1030 <foo@plt>
mov    $0x0,%al
call   1030 <foo@plt>
mov    $0x0,%al
call   1030 <foo@plt>
mov    $0x0,%al
call   1030 <foo@plt>
mov    $0x0,%al
call   1030 <foo@plt>
mov    $0x0,%al
call   1030 <foo@plt>
mov    $0x0,%al
call   1030 <foo@plt>
mov    $0x0,%al
call   1030 <foo@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xfffe795f,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1030 <foo@plt>
inc    %ebx
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 100000, i32* %2
br label %3
3: ; preds = %17, %0
%4 = load i32, i32* %2
%5 = icmp sge i32 %4, 0
br i1 %5, label %6, label %20
6: ; preds = %3
%7 = call i32 (...) @foo()
%8 = call i32 (...) @foo()
%9 = call i32 (...) @foo()
%10 = call i32 (...) @foo()
%11 = call i32 (...) @foo()
%12 = call i32 (...) @foo()
%13 = call i32 (...) @foo()
%14 = call i32 (...) @foo()
%15 = call i32 (...) @foo()
%16 = call i32 (...) @foo()
br label %17
17: ; preds = %6
%18 = load i32, i32* %2
%19 = add nsw i32 %18, -1
store i32 %19, i32* %2
br label %3
20: ; preds = %3
%21 = load i32, i32* %1
ret i32 %21
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 100000, %0 ], [ %13, %1 ]
%3 = tail call i32 (...) @foo()
%4 = tail call i32 (...) @foo()
%5 = tail call i32 (...) @foo()
%6 = tail call i32 (...) @foo()
%7 = tail call i32 (...) @foo()
%8 = tail call i32 (...) @foo()
%9 = tail call i32 (...) @foo()
%10 = tail call i32 (...) @foo()
%11 = tail call i32 (...) @foo()
%12 = tail call i32 (...) @foo()
%13 = add nsw i32 %2, -1
%14 = icmp eq i32 %2, 0
br i1 %14, label %15, label %1
15: ; preds = %1
ret i32 0
}
func() {}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
ret

LLVM IR (-O0):
define i32 @func() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @func() {
ret i32 undef
}
/* Variables and functions */
unsigned char gfx_inb(int);
int /*<<< orphan*/ gfx_outb(int, unsigned char);
void disable_Centaurus_9211_chip_select(void) {
  unsigned char cs_port_val;
  cs_port_val = gfx_inb(0xE4);
  gfx_outb(0xE4, (unsigned char)(cs_port_val & ~0x01));
  return;
}


x86 assembly (clang, -O0):
<disable_Centaurus_9211_chip_select>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xe4,%edi
call   1030 <gfx_inb@plt>
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0xfffffffe,%eax
mov    $0xe4,%edi
movzbl %al,%esi
call   1040 <gfx_outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disable_Centaurus_9211_chip_select>:
push   %rax
mov    $0xe4,%edi
call   1030 <gfx_inb@plt>
and    $0xfe,%al
movzbl %al,%esi
mov    $0xe4,%edi
pop    %rax
jmp    1040 <gfx_outb@plt>

LLVM IR (-O0):
define void @disable_Centaurus_9211_chip_select() {
%1 = alloca i8
%2 = call zeroext i8 @gfx_inb(i32 228)
store i8 %2, i8* %1
%3 = load i8, i8* %1
%4 = zext i8 %3 to i32
%5 = and i32 %4, -2
%6 = trunc i32 %5 to i8
%7 = call i32 @gfx_outb(i32 228, i8 zeroext %6)
ret void
}

LLVM IR (-O2):
define void @disable_Centaurus_9211_chip_select() {
%1 = tail call zeroext i8 @gfx_inb(i32 228)
%2 = and i8 %1, -2
%3 = tail call i32 @gfx_outb(i32 228, i8 zeroext %2)
ret void
}
void fun2(void) {}


x86 assembly (clang, -O0):
<fun2>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun2>:
ret

LLVM IR (-O0):
define void @fun2() {
ret void
}

LLVM IR (-O2):
define void @fun2() {
ret void
}
void genbgez_out() {}


x86 assembly (clang, -O0):
<genbgez_out>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genbgez_out>:
ret

LLVM IR (-O0):
define void @genbgez_out() {
ret void
}

LLVM IR (-O2):
define void @genbgez_out() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
void input(int *time) {
  printf("Enter the time in seconds: \n");
  scanf("%d", time);
}


x86 assembly (clang, -O0):
<input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xeda(%rip),%rdi
call   1040 <scanf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<input>:
push   %rbx
mov    %rdi,%rbx
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <scanf@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Enter the time in seconds: \0A\00"
@.str.1 = [3 x i8] c"%d\00"
define void @input(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%4 = load i32*, i32** %2
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
ret void
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [28 x i8] c"Enter the time in seconds: \00"
define void @input(i32* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %0)
ret void
}
/* Type definitions */
struct UPnPService {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, short);
void RNDResponseSink_RenderingControl_GetVerticalKeystone(
    struct UPnPService *Service, int ErrorCode, void *User,
    short CurrentVerticalKeystone) {
  printf("RND Invoke Response: "
         "RenderingControl/GetVerticalKeystone[ErrorCode:%d](%d)\r\n",
         ErrorCode, CurrentVerticalKeystone);
}


x86 assembly (clang, -O0):
<RNDResponseSink_RenderingControl_GetVerticalKeystone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cx,%ax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ax,-0x1a(%rbp)
mov    -0xc(%rbp),%esi
lea    0xecc(%rip),%rdi
movswl -0x1a(%rbp),%edx
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RNDResponseSink_RenderingControl_GetVerticalKeystone>:
lea    0xee9(%rip),%rdi
mov    %ecx,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.UPnPService = type { i32 }
@.str = [78 x i8] c"RND Invoke Response: RenderingControl/GetVerticalKeystone[ErrorCode:%d](%d)\0D\0A\00"
define void @RNDResponseSink_RenderingControl_GetVerticalKeystone(%struct.UPnPService* %0, i32 %1, i8* %2, i16 signext %3) {
%5 = alloca %struct.UPnPService*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i16
store %struct.UPnPService* %0, %struct.UPnPService** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i16 %3, i16* %8
%9 = load i32, i32* %6
%10 = load i16, i16* %8
%11 = call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0), i32 %9, i16 signext %10)
ret void
}

LLVM IR (-O2):
%struct.UPnPService = type { i32 }
@.str = [78 x i8] c"RND Invoke Response: RenderingControl/GetVerticalKeystone[ErrorCode:%d](%d)\0D\0A\00"
define void @RNDResponseSink_RenderingControl_GetVerticalKeystone(%struct.UPnPService* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i16 signext %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0), i32 %1, i16 signext %3)
ret void
}
/* Variables and functions */
long double nearbyint(double);
__attribute__((weak)) long double nearbyintl(long double x) {
  return nearbyint((double)x);
}


x86 assembly (clang, -O0):
<nearbyintl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <nearbyint@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nearbyintl>:
fldt   0x8(%rsp)
fstpl  -0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
jmp    1030 <nearbyint@plt>

LLVM IR (-O0):
define weak x86_fp80 @nearbyintl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call x86_fp80 @nearbyint(double %4)
ret x86_fp80 %5
}

LLVM IR (-O2):
define weak x86_fp80 @nearbyintl(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call x86_fp80 @nearbyint(double %2)
ret x86_fp80 %3
}
/* Variables and functions */
int strlen(const char *str) {
  int n = 0;
  while (*str++)
    ++n;
  return n;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1135 <strlen+0x35>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111c <strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %9, %1
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i32 1
store i8* %6, i8** %2
%7 = load i8, i8* %5
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %4
12: ; preds = %4
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
FILE *file_stats_gnuplot_init(char *filename) {
  FILE *f;
  f = fopen(filename, "wa");
  return f;
}


x86 assembly (clang, -O0):
<file_stats_gnuplot_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_stats_gnuplot_init>:
lea    0xee9(%rip),%rsi
jmp    1030 <fopen@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"wa\00"
define i32* @file_stats_gnuplot_init(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %5, i32** %3
%6 = load i32*, i32** %3
ret i32* %6
}

LLVM IR (-O2):
@.str = [3 x i8] c"wa\00"
define noalias i32* @file_stats_gnuplot_init(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32* %2
}
/* Variables and functions */
double param(float);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float x;
  printf("Digite o raio de uma esfera: ");
  scanf(" %f", &x);
  printf("\nO volume de uma esfera eh %f \n", param(x));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
movss  -0x4(%rbp),%xmm0
call   1040 <param@plt>
lea    0xebb(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
movss  0x4(%rsp),%xmm0
call   1040 <param@plt>
lea    0xec0(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Digite o raio de uma esfera: \00"
@.str.1 = [4 x i8] c" %f\00"
@.str.2 = [32 x i8] c"\0AO volume de uma esfera eh %f \0A\00"
define i32 @main() {
%1 = alloca float
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float* %1)
%4 = load float, float* %1
%5 = call double @param(float %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), double %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"Digite o raio de uma esfera: \00"
@.str.1 = [4 x i8] c" %f\00"
@.str.2 = [32 x i8] c"\0AO volume de uma esfera eh %f \0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = call double @param(float %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), double %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ a();
void b1() { a(); }


x86 assembly (clang, -O0):
<b1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <a@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<b1>:
xor    %eax,%eax
jmp    1030 <a@plt>

LLVM IR (-O0):
define void @b1() {
%1 = call i32 (...) @a()
ret void
}

LLVM IR (-O2):
define void @b1() {
%1 = tail call i32 (...) @a()
ret void
}
/* Variables and functions */
unsigned int __get_cpsr();
int /*<<< orphan*/ __set_cpsr(unsigned int);
unsigned enableFIQ(void) {
  unsigned _cpsr;
  _cpsr = __get_cpsr();
  __set_cpsr(_cpsr & ~0x00000040);
  return _cpsr;
}


x86 assembly (clang, -O0):
<enableFIQ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <__get_cpsr@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
and    $0xffffffbf,%edi
call   1030 <__set_cpsr@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enableFIQ>:
push   %rbx
xor    %eax,%eax
call   1040 <__get_cpsr@plt>
mov    %eax,%ebx
mov    %eax,%edi
and    $0xffffffbf,%edi
call   1030 <__set_cpsr@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @enableFIQ() {
%1 = alloca i32
%2 = call i32 (...) @__get_cpsr()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = and i32 %3, -65
%5 = call i32 @__set_cpsr(i32 %4)
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
define i32 @enableFIQ() {
%1 = tail call i32 (...) @__get_cpsr()
%2 = and i32 %1, -65
%3 = tail call i32 @__set_cpsr(i32 %2)
ret i32 %1
}
/* Variables and functions */
void *calloc(void *ptr, int size) { return ptr; }


x86 assembly (clang, -O0):
<calloc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calloc>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i8* @calloc(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
ret i8* %5
}

LLVM IR (-O2):
define i8* @calloc(i8* readnone returned %0, i32 %1) {
ret i8* %0
}
unsigned short sldt(void) {
  unsigned short seg;
  __asm__ volatile("sldt %0" : "=rm"(seg));
  return (seg);
}


x86 assembly (clang, -O0):
<sldt>:
push   %rbp
mov    %rsp,%rbp
sldt   -0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sldt>:
sldt   -0x2(%rsp)
movzwl -0x2(%rsp),%eax
ret

LLVM IR (-O0):
define zeroext i16 @sldt() {
%1 = alloca i16
%2 = load i16, i16* %1
ret i16 %2
}

LLVM IR (-O2):
define zeroext i16 @sldt() {
%1 = alloca i16
%2 = bitcast i16* %1 to i8*
%3 = load i16, i16* %1
ret i16 %3
}
/* Variables and functions */
int /*<<< orphan*/ pci_init();
void task_pci() {
  pci_init();
  while (1) {
  }
}


x86 assembly (clang, -O0):
<task_pci>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <pci_init@plt>
jmp    111b <task_pci+0xb>

x86 assembly (clang, -O2):
<task_pci>:
push   %rax
xor    %eax,%eax
call   1030 <pci_init@plt>
nopl   0x0(%rax,%rax,1)
jmp    1120 <task_pci+0x10>

LLVM IR (-O0):
define void @task_pci() {
%1 = call i32 (...) @pci_init()
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
define void @task_pci() {
%1 = tail call i32 (...) @pci_init()
br label %2
2: ; preds = %0, %2
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ LC_TIME;
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int /*<<< orphan*/ tzset();
__attribute__((__cold__)) __attribute__((__no__)) int main_init_once(void) {
  setlocale(LC_TIME, "C");
  tzset();
  return 1;
}


x86 assembly (clang, -O0):
<main_init_once>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <setlocale@plt>
mov    $0x0,%al
call   1030 <tzset@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main_init_once>:
push   %rax
mov    0x2f80(%rip),%rax
mov    (%rax),%edi
lea    0xf8f(%rip),%rsi
call   1040 <setlocale@plt>
xor    %eax,%eax
call   1030 <tzset@plt>
mov    $0x1,%eax
pop    %rcx
ret
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax

LLVM IR (-O0):
@LC_TIME = global i32 0
@.str = [2 x i8] c"C\00"
define i32 @main_init_once() {
%1 = load i32, i32* @LC_TIME
%2 = call i32 @setlocale(i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @tzset()
ret i32 1
}

LLVM IR (-O2):
@LC_TIME = global i32 0
@.str = [2 x i8] c"C\00"
define i32 @main_init_once() {
%1 = load i32, i32* @LC_TIME
%2 = tail call i32 @setlocale(i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @tzset()
ret i32 1
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int type;
};
typedef TYPE_1__ XCreateWindowEvent;

/* Variables and functions */
void set_XCreateWindowEvent_type(void *_p, int _v) {
  ((XCreateWindowEvent *)_p)->type = (int)_v;
}


x86 assembly (clang, -O0):
<set_XCreateWindowEvent_type>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XCreateWindowEvent_type>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XCreateWindowEvent_type(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XCreateWindowEvent_type(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ dram_node_to_cpu(int /*<<< orphan*/);
int get_total_energy_consumed(int /*<<< orphan*/, int, double *);
int get_dram_total_energy_consumed(uint64_t node,
                                   double *total_energy_consumed_joules) {
  uint64_t cpu = dram_node_to_cpu(node);
  return get_total_energy_consumed(cpu, 0x619, total_energy_consumed_joules);
}


x86 assembly (clang, -O0):
<get_dram_total_energy_consumed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <dram_node_to_cpu@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    $0x619,%esi
call   1040 <get_total_energy_consumed@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_dram_total_energy_consumed>:
push   %rbx
mov    %rsi,%rbx
call   1030 <dram_node_to_cpu@plt>
mov    %eax,%edi
mov    $0x619,%esi
mov    %rbx,%rdx
pop    %rbx
jmp    1040 <get_total_energy_consumed@plt>

LLVM IR (-O0):
define i32 @get_dram_total_energy_consumed(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca i32
store i32 %0, i32* %3
store double* %1, double** %4
%6 = load i32, i32* %3
%7 = call i32 @dram_node_to_cpu(i32 %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load double*, double** %4
%10 = call i32 @get_total_energy_consumed(i32 %8, i32 1561, double* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @get_dram_total_energy_consumed(i32 %0, double* %1) {
%3 = tail call i32 @dram_node_to_cpu(i32 %0)
%4 = tail call i32 @get_total_energy_consumed(i32 %3, i32 1561, double* %1)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ d;

/* Variables and functions */
int /*<<< orphan*/ dump_data(float *, int);
int /*<<< orphan*/ scanf(char *, float *);
int main(int argc, char *argv[]) {
  float d;
  scanf("%f", &d);
  dump_data(&d, sizeof(d));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
lea    -0x14(%rbp),%rdi
mov    $0x4,%esi
call   1030 <dump_data@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
lea    0xc(%rsp),%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <dump_data@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %6)
%8 = call i32 @dump_data(float* %6, i32 4)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca float
%4 = bitcast float* %3 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %3)
%6 = call i32 @dump_data(float* %3, i32 4)
ret i32 0
}
/* Type definitions */
struct sigaction {
  void (*sa_handler)(int);
  int /*<<< orphan*/ sa_mask;
  scalar_t__ sa_flags;
};

/* Variables and functions */
int sigaction(int, struct sigaction *, int /*<<< orphan*/ *);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int set_signal_handler(int signo, void (*handler)(int)) {
  struct sigaction sa;
  sa.sa_flags = 0;
  sigemptyset(&sa.sa_mask);
  sa.sa_handler = handler;
  return sigaction(signo, &sa, NULL);
}


x86 assembly (clang, -O0):
<set_signal_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
lea    -0x28(%rbp),%rdi
add    $0x8,%rdi
call   1040 <sigemptyset@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x28(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigaction@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_signal_handler>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
movq   $0x0,0x10(%rsp)
lea    0x8(%rsp),%rdi
call   1040 <sigemptyset@plt>
mov    %rbx,(%rsp)
mov    %rsp,%rsi
mov    %ebp,%edi
xor    %edx,%edx
call   1030 <sigaction@plt>
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.sigaction = type { void (i32)*, i32, i64 }
define i32 @set_signal_handler(i32 %0, void (i32)* %1) {
%3 = alloca i32
%4 = alloca void (i32)*
%5 = alloca %struct.sigaction
store i32 %0, i32* %3
store void (i32)* %1, void (i32)** %4
%6 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %5, i32 0, i32 2
store i64 0, i64* %6
%7 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %5, i32 0, i32 1
%8 = call i32 @sigemptyset(i32* %7)
%9 = load void (i32)*, void (i32)** %4
%10 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %5, i32 0, i32 0
store void (i32)* %9, void (i32)** %10
%11 = load i32, i32* %3
%12 = call i32 @sigaction(i32 %11, %struct.sigaction* %5, i32* null)
ret i32 %12
}

LLVM IR (-O2):
%struct.sigaction = type { void (i32)*, i32, i64 }
define i32 @set_signal_handler(i32 %0, void (i32)* %1) {
%3 = alloca %struct.sigaction
%4 = bitcast %struct.sigaction* %3 to i8*
%5 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %3, i64 0, i32 2
store i64 0, i64* %5
%6 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %3, i64 0, i32 1
%7 = call i32 @sigemptyset(i32* %6)
%8 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %3, i64 0, i32 0
store void (i32)* %1, void (i32)** %8
%9 = call i32 @sigaction(i32 %0, %struct.sigaction* %3, i32* null)
ret i32 %9
}
void destroy_resolver(void) {}


x86 assembly (clang, -O0):
<destroy_resolver>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroy_resolver>:
ret

LLVM IR (-O0):
define void @destroy_resolver() {
ret void
}

LLVM IR (-O2):
define void @destroy_resolver() {
ret void
}
int get_return_code() { return 42; }


x86 assembly (clang, -O0):
<get_return_code>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2a,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_return_code>:
mov    $0x2a,%eax
ret

LLVM IR (-O0):
define i32 @get_return_code() {
ret i32 42
}

LLVM IR (-O2):
define i32 @get_return_code() {
ret i32 42
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ init_by_array(int /*<<< orphan*/ *, int);
void prng_seed(uint32_t seed) { init_by_array(&seed, 1); }


x86 assembly (clang, -O0):
<prng_seed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
mov    $0x1,%esi
call   1030 <init_by_array@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prng_seed>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x1,%esi
call   1030 <init_by_array@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @prng_seed(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @init_by_array(i32* %2, i32 1)
ret void
}

LLVM IR (-O2):
define void @prng_seed(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @init_by_array(i32* %2, i32 1)
ret void
}
/* Variables and functions */
int ngetline(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  int len;
  char line[1000];
  while ((len = ngetline(line, 1000)) > 0) {
    if (len > 80)
      printf("%s", line);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1040 <ngetline@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1171 <main+0x51>
cmpl   $0x50,-0x8(%rbp)
jle    116c <main+0x4c>
lea    -0x3f0(%rbp),%rsi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
jmp    1132 <main+0x12>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1040 <ngetline@plt>
test   %eax,%eax
jle    1173 <main+0x53>
lea    0xebe(%rip),%r14
mov    %rsp,%rbx
jmp    1161 <main+0x41>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1040 <ngetline@plt>
test   %eax,%eax
jle    1173 <main+0x53>
cmp    $0x51,%eax
jb     1150 <main+0x30>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
jmp    1150 <main+0x30>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [1000 x i8]
store i32 0, i32* %1
br label %4
4: ; preds = %14, %0
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%6 = call i32 @ngetline(i8* %5, i32 1000)
store i32 %6, i32* %2
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %4
%9 = load i32, i32* %2
%10 = icmp sgt i32 %9, 80
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%13 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %12)
br label %14
14: ; preds = %11, %8
br label %4
15: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @ngetline(i8* %2, i32 1000)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %0, %10
%6 = phi i32 [ %11, %10 ], [ %3, %0 ]
%7 = icmp ugt i32 %6, 80
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %10
10: ; preds = %8, %5
%11 = call i32 @ngetline(i8* %2, i32 1000)
%12 = icmp sgt i32 %11, 0
br i1 %12, label %5, label %13
13: ; preds = %10, %0
ret i32 0
}
int Q_isnan(float x) {
  union {
    float f;
    unsigned int i;
  } t;
  t.f = x;
  t.i &= 0x7FFFFFFF;
  t.i = 0x7F800000 - t.i;
  return (int)((unsigned int)t.i >> 31);
}


x86 assembly (clang, -O0):
<Q_isnan>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x7fffffff,%eax
mov    %eax,-0x8(%rbp)
mov    $0x7f800000,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x1f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_isnan>:
movd   %xmm0,%ecx
and    $0x7fffffff,%ecx
xor    %eax,%eax
cmp    $0x7f800001,%ecx
setae  %al
ret

LLVM IR (-O0):
%union.anon = type { float }
define i32 @Q_isnan(float %0) {
%2 = alloca float
%3 = alloca %union.anon
store float %0, float* %2
%4 = load float, float* %2
%5 = bitcast %union.anon* %3 to float*
store float %4, float* %5
%6 = bitcast %union.anon* %3 to i32*
%7 = load i32, i32* %6
%8 = and i32 %7, 2147483647
store i32 %8, i32* %6
%9 = bitcast %union.anon* %3 to i32*
%10 = load i32, i32* %9
%11 = sub i32 2139095040, %10
%12 = bitcast %union.anon* %3 to i32*
store i32 %11, i32* %12
%13 = bitcast %union.anon* %3 to i32*
%14 = load i32, i32* %13
%15 = lshr i32 %14, 31
ret i32 %15
}

LLVM IR (-O2):
define i32 @Q_isnan(float %0) {
%2 = bitcast float %0 to i32
%3 = and i32 %2, 2147483647
%4 = icmp ugt i32 %3, 2139095040
%5 = zext i1 %4 to i32
ret i32 %5
}
float glmComputeQuaternionNormd(const double q[4]) {
  return q[0] * q[0] + q[1] * q[1] + q[2] * q[2] + q[3] * q[3];
}


x86 assembly (clang, -O0):
<glmComputeQuaternionNormd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
mulsd  0x8(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmComputeQuaternionNormd>:
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  0x10(%rdi),%xmm1
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  0x18(%rdi),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @glmComputeQuaternionNormd(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = load double*, double** %2
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = load double*, double** %2
%10 = getelementptr inbounds double, double* %9, i64 1
%11 = load double, double* %10
%12 = load double*, double** %2
%13 = getelementptr inbounds double, double* %12, i64 1
%14 = load double, double* %13
%15 = fmul double %11, %14
%16 = call double @llvm.fmuladd.f64(double %5, double %8, double %15)
%17 = load double*, double** %2
%18 = getelementptr inbounds double, double* %17, i64 2
%19 = load double, double* %18
%20 = load double*, double** %2
%21 = getelementptr inbounds double, double* %20, i64 2
%22 = load double, double* %21
%23 = call double @llvm.fmuladd.f64(double %19, double %22, double %16)
%24 = load double*, double** %2
%25 = getelementptr inbounds double, double* %24, i64 3
%26 = load double, double* %25
%27 = load double*, double** %2
%28 = getelementptr inbounds double, double* %27, i64 3
%29 = load double, double* %28
%30 = call double @llvm.fmuladd.f64(double %26, double %29, double %23)
%31 = fptrunc double %30 to float
ret float %31
}

LLVM IR (-O2):
define float @glmComputeQuaternionNormd(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = fmul double %4, %4
%6 = tail call double @llvm.fmuladd.f64(double %2, double %2, double %5)
%7 = getelementptr inbounds double, double* %0, i64 2
%8 = load double, double* %7
%9 = tail call double @llvm.fmuladd.f64(double %8, double %8, double %6)
%10 = getelementptr inbounds double, double* %0, i64 3
%11 = load double, double* %10
%12 = tail call double @llvm.fmuladd.f64(double %11, double %11, double %9)
%13 = fptrunc double %12 to float
ret float %13
}
void break10() {}


x86 assembly (clang, -O0):
<break10>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<break10>:
ret

LLVM IR (-O0):
define void @break10() {
ret void
}

LLVM IR (-O2):
define void @break10() {
ret void
}
/* Type definitions */
typedef int u_int16_t;
typedef int /*<<< orphan*/ u_char;

/* Variables and functions */
void __put_unaligned_be16(u_int16_t val, u_char *p) {
  *p++ = val >> 8;
  *p++ = val;
}


x86 assembly (clang, -O0):
<__put_unaligned_be16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x10(%rbp)
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x10(%rbp)
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__put_unaligned_be16>:
mov    %edi,%eax
sar    $0x8,%eax
mov    %eax,(%rsi)
mov    %edi,0x4(%rsi)
ret

LLVM IR (-O0):
define void @__put_unaligned_be16(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32, i32* %3
%6 = ashr i32 %5, 8
%7 = load i32*, i32** %4
%8 = getelementptr inbounds i32, i32* %7, i32 1
store i32* %8, i32** %4
store i32 %6, i32* %7
%9 = load i32, i32* %3
%10 = load i32*, i32** %4
%11 = getelementptr inbounds i32, i32* %10, i32 1
store i32* %11, i32** %4
store i32 %9, i32* %10
ret void
}

LLVM IR (-O2):
define void @__put_unaligned_be16(i32 %0, i32* nocapture writeonly %1) {
%3 = ashr i32 %0, 8
%4 = getelementptr inbounds i32, i32* %1, i64 1
store i32 %3, i32* %1
store i32 %0, i32* %4
ret void
}
int main(int argc, const char *argv[]) { return 0; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}