xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcat2(char *, char *);
int main() {
  char s[] = {'h', 'e', 'l', 'l', 'o', ' ', '\0'};
  char t[] = {'w', 'o', 'r', 'l', 'd', '\0'};
  strcat2(s, t);
  printf("s = %s\n", s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x7(%rbp)
mov    0xecc(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xec4(%rip),%al
mov    %al,-0x1(%rbp)
mov    0xebc(%rip),%eax
mov    %eax,-0xd(%rbp)
mov    0xeb6(%rip),%ax
mov    %ax,-0x9(%rbp)
lea    -0x7(%rbp),%rdi
lea    -0xd(%rbp),%rsi
call   1030 <strcat2@plt>
lea    -0x7(%rbp),%rsi
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x206f6c,0xb(%rsp)
movl   $0x6c6c6568,0x8(%rsp)
6c
movw   $0x64,0x4(%rsp)
movl   $0x6c726f77,(%rsp)
lea    0x8(%rsp),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1030 <strcat2@plt>
lea    0xeb3(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s = [7 x i8] c"hello \00"
@__const.main.t = [6 x i8] c"world\00"
@.str = [8 x i8] c"s = %s\0A\00"
define i32 @main() {
%1 = alloca [7 x i8]
%2 = alloca [6 x i8]
%3 = bitcast [7 x i8]* %1 to i8*
%4 = bitcast [6 x i8]* %2 to i8*
%5 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%7 = call i32 @strcat2(i8* %5, i8* %6)
%8 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [7 x i8] c"hello \00"
@__const.main.t = [6 x i8] c"world\00"
@.str = [8 x i8] c"s = %s\0A\00"
define i32 @main() {
%1 = alloca [7 x i8]
%2 = alloca [6 x i8]
%3 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%5 = call i32 @strcat2(i8* %3, i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Variables and functions */
int getlineuser(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  int len;
  char line[1000];
  while ((len = getlineuser(line, 1000)) > 0)
    if (len > 80)
      printf("\n %s \n", 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 <getlineuser@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 <getlineuser@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 <getlineuser@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 = [7 x i8] c"\0A %s \0A\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 @getlineuser(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 ([7 x i8], [7 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 = [7 x i8] c"\0A %s \0A\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 @getlineuser(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 ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %10
10: ; preds = %8, %5
%11 = call i32 @getlineuser(i8* %2, i32 1000)
%12 = icmp sgt i32 %11, 0
br i1 %12, label %5, label %13
13: ; preds = %10, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int ba() {
  printf(
      "%s\n",
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/vmiklos/vmexam/refs/heads/master/multi/bar.c");
}


x86 assembly (clang, -O0):
<ba>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
lea    0xede(%rip),%rsi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ba>:
lea    0xee9(%rip),%rdi
lea    0xee6(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [135 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/vmiklos/vmexam/refs/heads/master/multi/bar.c\00"
define i32 @ba() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str.1, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [135 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/vmiklos/vmexam/refs/heads/master/multi/bar.c\00"
define i32 @ba() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str.1, i64 0, i64 0))
ret i32 undef
}
void INT_Excep_USB0_USBR0(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_USB0_USBR0() {
ret void
}
char *compose_get_users() {
  char *execStr = "SELECT * FROM users";
  return execStr;
}


x86 assembly (clang, -O0):
<compose_get_users>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compose_get_users>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [20 x i8] c"SELECT * FROM users\00"
define i8* @compose_get_users() {
%1 = alloca i8*
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
@.str = [20 x i8] c"SELECT * FROM users\00"
define i8* @compose_get_users() {
ret i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0)
}
void pc_clear_bit(unsigned int nr, unsigned long *bitmap) {
  unsigned long offset = nr / ((int)sizeof(unsigned long) * 8);
  unsigned long bit = nr & (((int)sizeof(unsigned long) * 8) - 1);
  bitmap[offset] &= ~(1UL << bit);
}


x86 assembly (clang, -O0):
<pc_clear_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x6,%eax
mov    %eax,%eax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3f,%eax
mov    %eax,%eax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rcx
mov    $0x1,%edx
shl    %cl,%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
and    (%rax,%rcx,8),%rdx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<pc_clear_bit>:
mov    %edi,%ecx
mov    %edi,%eax
mov    $0xfffffffffffffffe,%rdx
rol    %cl,%rdx
shr    $0x6,%eax
and    %rdx,(%rsi,%rax,8)
ret

LLVM IR (-O0):
define void @pc_clear_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64
store i32 %0, i32* %3
store i64* %1, i64** %4
%7 = load i32, i32* %3
%8 = udiv i32 %7, 64
%9 = zext i32 %8 to i64
store i64 %9, i64* %5
%10 = load i32, i32* %3
%11 = and i32 %10, 63
%12 = zext i32 %11 to i64
store i64 %12, i64* %6
%13 = load i64, i64* %6
%14 = shl i64 1, %13
%15 = xor i64 %14, -1
%16 = load i64*, i64** %4
%17 = load i64, i64* %5
%18 = getelementptr inbounds i64, i64* %16, i64 %17
%19 = load i64, i64* %18
%20 = and i64 %19, %15
store i64 %20, i64* %18
ret void
}

LLVM IR (-O2):
define void @pc_clear_bit(i32 %0, i64* nocapture %1) {
%3 = lshr i32 %0, 6
%4 = zext i32 %3 to i64
%5 = and i32 %0, 63
%6 = zext i32 %5 to i64
%7 = shl nuw i64 1, %6
%8 = xor i64 %7, -1
%9 = getelementptr inbounds i64, i64* %1, i64 %4
%10 = load i64, i64* %9
%11 = and i64 %10, %8
store i64 %11, i64* %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void cothran16() { printf("cothran16 likes sandwiches\n"); }


x86 assembly (clang, -O0):
<cothran16>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cothran16>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"cothran16 likes sandwiches\0A\00"
define void @cothran16() {
%1 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [27 x i8] c"cothran16 likes sandwiches\00"
define void @cothran16() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret void
}
void finish_bitfield(int *off, int *bitoff) {
  *off += (*bitoff + 8) / 8;
  *bitoff = -1;
}


x86 assembly (clang, -O0):
<finish_bitfield>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
add    $0x8,%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
movl   $0xffffffff,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<finish_bitfield>:
mov    (%rsi),%eax
lea    0x8(%rax),%ecx
add    $0xf,%eax
test   %ecx,%ecx
cmovns %ecx,%eax
sar    $0x3,%eax
add    %eax,(%rdi)
movl   $0xffffffff,(%rsi)
ret

LLVM IR (-O0):
define void @finish_bitfield(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load i32, i32* %5
%7 = add nsw i32 %6, 8
%8 = sdiv i32 %7, 8
%9 = load i32*, i32** %3
%10 = load i32, i32* %9
%11 = add nsw i32 %10, %8
store i32 %11, i32* %9
%12 = load i32*, i32** %4
store i32 -1, i32* %12
ret void
}

LLVM IR (-O2):
define void @finish_bitfield(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = add nsw i32 %3, 8
%5 = sdiv i32 %4, 8
%6 = load i32, i32* %0
%7 = add nsw i32 %5, %6
store i32 %7, i32* %0
store i32 -1, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x66() {
  Assert_real((isupper(102) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isupper.c",
              515, ("isupper should be 0 for f"));
}


x86 assembly (clang, -O0):
<t_isupper_0x66>:
push   %rbp
mov    %rsp,%rbp
mov    $0x66,%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x203,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isupper_0x66>:
push   %rax
mov    $0x66,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x203,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for f\00"
define void @t_isupper_0x66() {
%1 = call i64 @isupper(i32 102)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 515, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for f\00"
define void @t_isupper_0x66() {
%1 = tail call i64 @isupper(i32 102)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 515, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ countSort(int *, int, int);
int findMax(int *, int);
void radixSort(int A[], int length) {
  int max = findMax(A, length);
  int position;
  for (position = 1; max / position > 0; position *= 10) {
    countSort(A, length, position);
  }
}


x86 assembly (clang, -O0):
<radixSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <findMax@plt>
mov    %eax,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x10(%rbp),%eax
cltd
idivl  -0x14(%rbp)
cmp    $0x0,%eax
jle    1170 <radixSort+0x50>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <countSort@plt>
imul   $0xa,-0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1145 <radixSort+0x25>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<radixSort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %rdi,%r15
call   1040 <findMax@plt>
test   %eax,%eax
jle    115b <radixSort+0x3b>
mov    %eax,%ebp
mov    $0x1,%ebx
nopl   (%rax)
mov    %r15,%rdi
mov    %r14d,%esi
mov    %ebx,%edx
call   1030 <countSort@plt>
add    %ebx,%ebx
lea    (%rbx,%rbx,4),%ebx
mov    %ebp,%eax
cltd
idiv   %ebx
test   %eax,%eax
jg     1140 <radixSort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @radixSort(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%7 = load i32*, i32** %3
%8 = load i32, i32* %4
%9 = call i32 @findMax(i32* %7, i32 %8)
store i32 %9, i32* %5
store i32 1, i32* %6
br label %10
10: ; preds = %20, %2
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = sdiv i32 %11, %12
%14 = icmp sgt i32 %13, 0
br i1 %14, label %15, label %23
15: ; preds = %10
%16 = load i32*, i32** %3
%17 = load i32, i32* %4
%18 = load i32, i32* %6
%19 = call i32 @countSort(i32* %16, i32 %17, i32 %18)
br label %20
20: ; preds = %15
%21 = load i32, i32* %6
%22 = mul nsw i32 %21, 10
store i32 %22, i32* %6
br label %10
23: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @radixSort(i32* %0, i32 %1) {
%3 = tail call i32 @findMax(i32* %0, i32 %1)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %2, %5
%6 = phi i32 [ %8, %5 ], [ 1, %2 ]
%7 = tail call i32 @countSort(i32* %0, i32 %1, i32 %6)
%8 = mul nsw i32 %6, 10
%9 = sdiv i32 %3, %8
%10 = icmp sgt i32 %9, 0
br i1 %10, label %5, label %11
11: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PrintBits(unsigned int);
unsigned int RotateRight(unsigned int, int);
int main() {
  unsigned x = 2348601274;
  PrintBits(x);
  PrintBits(RotateRight(x, 5));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x8bfccfba,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <PrintBits@plt>
mov    -0x4(%rbp),%edi
mov    $0x5,%esi
call   1040 <RotateRight@plt>
mov    %eax,%edi
call   1030 <PrintBits@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x8bfccfba,%edi
call   1030 <PrintBits@plt>
mov    $0x8bfccfba,%edi
mov    $0x5,%esi
call   1040 <RotateRight@plt>
mov    %eax,%edi
call   1030 <PrintBits@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 -1946366022, i32* %1
%2 = load i32, i32* %1
%3 = call i32 @PrintBits(i32 %2)
%4 = load i32, i32* %1
%5 = call i32 @RotateRight(i32 %4, i32 5)
%6 = call i32 @PrintBits(i32 %5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @PrintBits(i32 -1946366022)
%2 = tail call i32 @RotateRight(i32 -1946366022, i32 5)
%3 = tail call i32 @PrintBits(i32 %2)
ret i32 0
}
/* Variables and functions */
float noise2(float, float);
float lovrMathNoise2(float x, float y) { return noise2(x, y) * .5f + .5f; }


x86 assembly (clang, -O0):
<lovrMathNoise2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <noise2@plt>
movss  0xec7(%rip),%xmm1
mulss  %xmm1,%xmm0
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lovrMathNoise2>:
push   %rax
call   1030 <noise2@plt>
movss  0xee2(%rip),%xmm1
mulss  %xmm1,%xmm0
addss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @lovrMathNoise2(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @noise2(float %5, float %6)
%8 = call float @llvm.fmuladd.f32(float %7, float 5.000000e-01, float 5.000000e-01)
ret float %8
}

LLVM IR (-O2):
define float @lovrMathNoise2(float %0, float %1) {
%3 = tail call float @noise2(float %0, float %1)
%4 = tail call float @llvm.fmuladd.f32(float %3, float 5.000000e-01, float 5.000000e-01)
ret float %4
}
void thing(void) {}


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

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

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

LLVM IR (-O2):
define void @thing() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, float);
void imprimeMedia(char *nome, float media) {
  printf("\n%s, você ficou com média de %.2f pontos.\n", nome, media);
}


x86 assembly (clang, -O0):
<imprimeMedia>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
movss  -0xc(%rbp),%xmm0
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprimeMedia>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [45 x i8] c"\0A%s, voc\C3\AA ficou com m\C3\A9dia de %.2f pontos.\0A\00"
define void @imprimeMedia(i8* %0, float %1) {
%3 = alloca i8*
%4 = alloca float
store i8* %0, i8** %3
store float %1, float* %4
%5 = load i8*, i8** %3
%6 = load float, float* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %5, float %6)
ret void
}

LLVM IR (-O2):
@.str = [45 x i8] c"\0A%s, voc\C3\AA ficou com m\C3\A9dia de %.2f pontos.\0A\00"
define void @imprimeMedia(i8* %0, float %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %0, float %1)
ret void
}
int test(int x, int (*f)(void)) { return x == 0 ? 0 : f(); }


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1123 <test+0x23>
xor    %eax,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <test+0x29>
call   *-0x10(%rbp)
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
test   %edi,%edi
je     1106 <test+0x6>
jmp    *%rsi
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @test(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 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %2
br label %11
8: ; preds = %2
%9 = load i32 ()*, i32 ()** %4
%10 = call i32 %9()
br label %11
11: ; preds = %8, %7
%12 = phi i32 [ 0, %7 ], [ %10, %8 ]
ret i32 %12
}

LLVM IR (-O2):
define i32 @test(i32 %0, i32 ()* nocapture %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 %1()
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ %5, %4 ], [ 0, %2 ]
ret i32 %7
}
/* Type definitions */
struct sk_buff {
  int dummy;
};
struct mpls_shim_hdr {
  int dummy;
};

/* Variables and functions */
scalar_t__ skb_network_header(struct sk_buff const *);
struct mpls_shim_hdr *mpls_hdr(const struct sk_buff *skb) {
  return (struct mpls_shim_hdr *)skb_network_header(skb);
}


x86 assembly (clang, -O0):
<mpls_hdr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <skb_network_header@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpls_hdr>:
jmp    1030 <skb_network_header@plt>

LLVM IR (-O0):
%struct.mpls_shim_hdr = type { i32 }
%struct.sk_buff = type { i32 }
define %struct.mpls_shim_hdr* @mpls_hdr(%struct.sk_buff* %0) {
%2 = alloca %struct.sk_buff*
store %struct.sk_buff* %0, %struct.sk_buff** %2
%3 = load %struct.sk_buff*, %struct.sk_buff** %2
%4 = call i64 @skb_network_header(%struct.sk_buff* %3)
%5 = inttoptr i64 %4 to %struct.mpls_shim_hdr*
ret %struct.mpls_shim_hdr* %5
}

LLVM IR (-O2):
%struct.mpls_shim_hdr = type { i32 }
%struct.sk_buff = type { i32 }
define %struct.mpls_shim_hdr* @mpls_hdr(%struct.sk_buff* %0) {
%2 = tail call i64 @skb_network_header(%struct.sk_buff* %0)
%3 = inttoptr i64 %2 to %struct.mpls_shim_hdr*
ret %struct.mpls_shim_hdr* %3
}
void progExecuteBYE(void *vp) {}


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

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

LLVM IR (-O0):
define void @progExecuteBYE(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
define void @progExecuteBYE(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
int /*<<< orphan*/ ft_putstr(char *);
int /*<<< orphan*/ ft_sort_argv(int, char **);
int main(int argc, char **argv) {
  int i;
  i = 1;
  ft_sort_argv(argc, argv);
  while (i != argc) {
    ft_putstr(argv[i]);
    ft_putchar('\n');
    i++;
  }
  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)
movl   $0x1,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <ft_sort_argv@plt>
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     118e <main+0x5e>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1050 <ft_putstr@plt>
mov    $0xa,%edi
call   1040 <ft_putchar@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1159 <main+0x29>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
call   1030 <ft_sort_argv@plt>
cmp    $0x1,%ebp
je     116c <main+0x3c>
mov    %ebp,%ebp
mov    $0x1,%ebx
nopw   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1050 <ft_putstr@plt>
mov    $0xa,%edi
call   1040 <ft_putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1150 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @ft_sort_argv(i32 %0, i8** %1)
%4 = icmp eq i32 %0, 1
br i1 %4, label %15, label %5
5: ; preds = %2
%6 = zext i32 %0 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 1, %5 ], [ %13, %7 ]
%9 = getelementptr inbounds i8*, i8** %1, i64 %8
%10 = load i8*, i8** %9
%11 = tail call i32 @ft_putstr(i8* %10)
%12 = tail call i32 @ft_putchar(i8 signext 10)
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %15, label %7
15: ; preds = %7, %2
ret i32 0
}
void show_mouse(void) {}


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

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

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

LLVM IR (-O2):
define void @show_mouse() {
ret void
}
void dummy_background(int color) { color = color; }


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

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

LLVM IR (-O0):
define void @dummy_background(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
store i32 %3, i32* %2
ret void
}

LLVM IR (-O2):
define void @dummy_background(i32 %0) {
ret void
}
int ned_getdouble(d)
double *d;
{
  char s[100 + 1];
  if (ned_gets(s) < 0)
    return (-1);
  sscanf(s, "%lf", d);
  return (0);
}


x86 assembly (clang, -O0):
<ned_getdouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
mov    $0x0,%al
call   1030 <ned_gets@plt>
cmp    $0x0,%eax
jge    114f <ned_getdouble+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    116c <ned_getdouble+0x4c>
lea    -0x80(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xea2(%rip),%rsi
mov    $0x0,%al
call   1040 <sscanf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ned_getdouble>:
push   %r14
push   %rbx
sub    $0x68,%rsp
mov    %rdi,%r14
xor    %ebx,%ebx
mov    %rsp,%rdi
xor    %eax,%eax
call   1030 <ned_gets@plt>
test   %eax,%eax
js     1150 <ned_getdouble+0x30>
lea    0xebf(%rip),%rsi
mov    %rsp,%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <sscanf@plt>
jmp    1155 <ned_getdouble+0x35>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
define i32 @ned_getdouble(double* %0) {
%2 = alloca i32
%3 = alloca double*
%4 = alloca [101 x i8]
store double* %0, double** %3
%5 = getelementptr inbounds [101 x i8], [101 x i8]* %4, i64 0, i64 0
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @ned_gets to i32 (i8*, ...)*)(i8* %5)
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %13
9: ; preds = %1
%10 = getelementptr inbounds [101 x i8], [101 x i8]* %4, i64 0, i64 0
%11 = load double*, double** %3
%12 = call i32 (i8*, i8*, ...) @sscanf(i8* %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %11)
store i32 0, i32* %2
br label %13
13: ; preds = %9, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
define i32 @ned_getdouble(double* %0) {
%2 = alloca [101 x i8]
%3 = getelementptr inbounds [101 x i8], [101 x i8]* %2, i64 0, i64 0
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @ned_gets to i32 (i8*, ...)*)(i8* %3)
%5 = icmp slt i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 (i8*, i8*, ...) @sscanf(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %0)
br label %8
8: ; preds = %1, %6
%9 = phi i32 [ 0, %6 ], [ -1, %1 ]
ret i32 %9
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t orrim1(uint32_t x) { return x | -1; }


x86 assembly (clang, -O0):
<orrim1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @orrim1(i32 %0) {
ret i32 -1
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int varint32(char *data, int32_t *value) {
  int32_t result = 0;
  int shifts = 0;
  do {
    result |= ((0x7F & *data) << (shifts * 7));
    shifts++;
  } while ((*data++ & 0x80));
  *value = result;
  return shifts;
}


x86 assembly (clang, -O0):
<varint32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
and    $0x7f,%eax
imul   $0x7,-0x18(%rbp),%ecx
shl    %cl,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
and    $0x80,%eax
cmp    $0x0,%eax
jne    111a <varint32+0x1a>
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<varint32>:
xor    %ecx,%ecx
xor    %eax,%eax
xor    %r9d,%r9d
nopw   0x0(%rax,%rax,1)
movzbl (%rdi,%rax,1),%r8d
mov    %r8d,%edx
and    $0x7f,%edx
shl    %cl,%edx
or     %edx,%r9d
add    $0x1,%rax
add    $0x7,%ecx
test   $0x80,%r8b
jne    1110 <varint32+0x10>
mov    %r9d,(%rsi)
ret

LLVM IR (-O0):
define i32 @varint32(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i32* %1, i32** %4
store i32 0, i32* %5
store i32 0, i32* %6
br label %7
7: ; preds = %19, %2
%8 = load i8*, i8** %3
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = and i32 127, %10
%12 = load i32, i32* %6
%13 = mul nsw i32 %12, 7
%14 = shl i32 %11, %13
%15 = load i32, i32* %5
%16 = or i32 %15, %14
store i32 %16, i32* %5
%17 = load i32, i32* %6
%18 = add nsw i32 %17, 1
store i32 %18, i32* %6
br label %19
19: ; preds = %7
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %3
%22 = load i8, i8* %20
%23 = sext i8 %22 to i32
%24 = and i32 %23, 128
%25 = icmp ne i32 %24, 0
br i1 %25, label %7, label %26
26: ; preds = %19
%27 = load i32, i32* %5
%28 = load i32*, i32** %4
store i32 %27, i32* %28
%29 = load i32, i32* %6
ret i32 %29
}

LLVM IR (-O2):
define i32 @varint32(i8* nocapture %0, i32* nocapture writeonly %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %14, %3 ]
%5 = phi i32 [ 0, %2 ], [ %12, %3 ]
%6 = phi i32 [ 0, %2 ], [ %13, %3 ]
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = and i32 %8, 127
%10 = mul nsw i32 %6, 7
%11 = shl i32 %9, %10
%12 = or i32 %11, %5
%13 = add nuw nsw i32 %6, 1
%14 = getelementptr inbounds i8, i8* %4, i64 1
%15 = and i32 %8, 128
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %3
17: ; preds = %3
store i32 %12, i32* %1
ret i32 %13
}
int tolower(c)
int c;
{ return (__tolower(c)); }


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <__tolower@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @tolower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, ...) bitcast (i32 (...)* @__tolower to i32 (i32, ...)*)(i32 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @__tolower to i32 (i32, ...)*)(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ IsLeapYear(int);
int MonthDays(int month, int year) {
  switch (month) {
  case 2:
    if (IsLeapYear(year))
      return (29);
    return (28);
  case 4:
  case 6:
  case 9:
  case 11:
    return (30);
  default:
    return (31);
  }
}


x86 assembly (clang, -O0):
<MonthDays>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x2,%eax
je     1176 <MonthDays+0x66>
jmp    1132 <MonthDays+0x22>
mov    -0x10(%rbp),%eax
sub    $0x4,%eax
je     119f <MonthDays+0x8f>
jmp    1143 <MonthDays+0x33>
mov    -0x10(%rbp),%eax
sub    $0x6,%eax
je     119f <MonthDays+0x8f>
jmp    1154 <MonthDays+0x44>
mov    -0x10(%rbp),%eax
sub    $0x9,%eax
je     119f <MonthDays+0x8f>
jmp    1165 <MonthDays+0x55>
mov    -0x10(%rbp),%eax
sub    $0xb,%eax
je     119f <MonthDays+0x8f>
jmp    11ab <MonthDays+0x9b>
mov    -0xc(%rbp),%edi
call   1030 <IsLeapYear@plt>
cmp    $0x0,%eax
je     1193 <MonthDays+0x83>
movl   $0x1d,-0x4(%rbp)
jmp    11b2 <MonthDays+0xa2>
movl   $0x1c,-0x4(%rbp)
jmp    11b2 <MonthDays+0xa2>
movl   $0x1e,-0x4(%rbp)
jmp    11b2 <MonthDays+0xa2>
movl   $0x1f,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MonthDays>:
cmp    $0xb,%edi
ja     1142 <MonthDays+0x32>
mov    $0x1e,%eax
mov    $0xa50,%ecx
bt     %edi,%ecx
jae    1125 <MonthDays+0x15>
ret
cmp    $0x2,%edi
jne    1142 <MonthDays+0x32>
push   %rax
mov    %esi,%edi
call   1030 <IsLeapYear@plt>
cmp    $0x1,%eax
mov    $0x1d,%eax
sbb    $0x0,%eax
add    $0x8,%rsp
ret
mov    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @MonthDays(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
switch i32 %6, label %14 [
i32 2, label %7
i32 4, label %13
i32 6, label %13
i32 9, label %13
i32 11, label %13
]
7: ; preds = %2
%8 = load i32, i32* %5
%9 = call i32 @IsLeapYear(i32 %8)
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 29, i32* %3
br label %15
12: ; preds = %7
store i32 28, i32* %3
br label %15
13: ; preds = %2, %2, %2, %2
store i32 30, i32* %3
br label %15
14: ; preds = %2
store i32 31, i32* %3
br label %15
15: ; preds = %14, %13, %12, %11
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @MonthDays(i32 %0, i32 %1) {
switch i32 %0, label %7 [
i32 2, label %3
i32 4, label %8
i32 6, label %8
i32 9, label %8
i32 11, label %8
]
3: ; preds = %2
%4 = tail call i32 @IsLeapYear(i32 %1)
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 28, i32 29
br label %8
7: ; preds = %2
br label %8
8: ; preds = %2, %2, %2, %2, %3, %7
%9 = phi i32 [ 31, %7 ], [ %6, %3 ], [ 30, %2 ], [ 30, %2 ], [ 30, %2 ], [ 30, %2 ]
ret i32 %9
}
/* Variables and functions */
char toupper(char);
char *ucfirst(char *str) {
  str[0] = toupper(str[0]);
  return str;
}


x86 assembly (clang, -O0):
<ucfirst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ucfirst>:
push   %rbx
mov    %rdi,%rbx
movsbl (%rdi),%edi
call   1030 <toupper@plt>
mov    %al,(%rbx)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @ucfirst(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = call signext i8 @toupper(i8 signext %5)
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 0
store i8 %6, i8* %8
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
define i8* @ucfirst(i8* returned %0) {
%2 = load i8, i8* %0
%3 = tail call signext i8 @toupper(i8 signext %2)
store i8 %3, i8* %0
ret i8* %0
}
/* Variables and functions */
void *memcpy(void *, void *, int);
void *xxalloc(int);
void *xxmemdup(void *src, int size) {
  void *dst = xxalloc(size);
  return memcpy(dst, src, size);
}


x86 assembly (clang, -O0):
<xxmemdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <xxalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1040 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xxmemdup>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    %esi,%edi
call   1030 <xxalloc@plt>
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <memcpy@plt>

LLVM IR (-O0):
define i8* @xxmemdup(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = call i8* @xxalloc(i32 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = load i8*, i8** %3
%10 = load i32, i32* %4
%11 = call i8* @memcpy(i8* %8, i8* %9, i32 %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @xxmemdup(i8* %0, i32 %1) {
%3 = tail call i8* @xxalloc(i32 %1)
%4 = tail call i8* @memcpy(i8* %3, i8* %0, i32 %1)
ret i8* %4
}
/* Variables and functions */
unsigned int sys_call(int, unsigned int, unsigned int, int /*<<< orphan*/,
                      int /*<<< orphan*/);
unsigned int barrier_init(unsigned int index, unsigned int count) {
  return sys_call(0x18, index, count, 0, 0);
}


x86 assembly (clang, -O0):
<barrier_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    $0x18,%edi
xor    %r8d,%r8d
mov    %r8d,%ecx
call   1030 <sys_call@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<barrier_init>:
mov    %esi,%edx
mov    %edi,%esi
mov    $0x18,%edi
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <sys_call@plt>

LLVM IR (-O0):
define i32 @barrier_init(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 = load i32, i32* %4
%7 = call i32 @sys_call(i32 24, i32 %5, i32 %6, i32 0, i32 0)
ret i32 %7
}

LLVM IR (-O2):
define i32 @barrier_init(i32 %0, i32 %1) {
%3 = tail call i32 @sys_call(i32 24, i32 %0, i32 %1, i32 0, i32 0)
ret i32 %3
}
int svc_base_initialize(void *data) { return data != 0; }


x86 assembly (clang, -O0):
<svc_base_initialize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<svc_base_initialize>:
xor    %eax,%eax
test   %rdi,%rdi
setne  %al
ret

LLVM IR (-O0):
define i32 @svc_base_initialize(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @svc_base_initialize(i8* readnone %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int PAPI_set_multiplex(int);
void papif_set_multiplex__(int *EventSet, int *check) {
  *check = PAPI_set_multiplex(*EventSet);
}


x86 assembly (clang, -O0):
<papif_set_multiplex__>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <PAPI_set_multiplex@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_set_multiplex__>:
push   %rbx
mov    %rsi,%rbx
mov    (%rdi),%edi
call   1030 <PAPI_set_multiplex@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @papif_set_multiplex__(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 = load i32, i32* %5
%7 = call i32 @PAPI_set_multiplex(i32 %6)
%8 = load i32*, i32** %4
store i32 %7, i32* %8
ret void
}

LLVM IR (-O2):
define void @papif_set_multiplex__(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = tail call i32 @PAPI_set_multiplex(i32 %3)
store i32 %4, i32* %1
ret void
}
int ti_adx_start(double const *options) { return ((int)options[0] - 1) * 2; }


x86 assembly (clang, -O0):
<ti_adx_start>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cvttsd2si (%rax),%eax
sub    $0x1,%eax
shl    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ti_adx_start>:
cvttsd2si (%rdi),%eax
add    %eax,%eax
add    $0xfffffffe,%eax
ret

LLVM IR (-O0):
define i32 @ti_adx_start(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 = fptosi double %5 to i32
%7 = sub nsw i32 %6, 1
%8 = mul nsw i32 %7, 2
ret i32 %8
}

LLVM IR (-O2):
define i32 @ti_adx_start(double* nocapture %0) {
%2 = load double, double* %0
%3 = fptosi double %2 to i32
%4 = shl i32 %3, 1
%5 = add i32 %4, -2
ret i32 %5
}
int sesc_yield(int tid) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @sesc_yield(i32 %0) {
ret i32 1
}
/* Variables and functions */
int pipe2(int *, int /*<<< orphan*/);
int main(void) {
  int pipefds[2];
  return pipe2(pipefds, 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xc(%rbp),%rdi
xor    %esi,%esi
call   1030 <pipe2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <pipe2@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i32]
store i32 0, i32* %1
%3 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%4 = call i32 @pipe2(i32* %3, i32 0)
ret i32 %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [2 x i32]
%2 = bitcast [2 x i32]* %1 to i8*
%3 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%4 = call i32 @pipe2(i32* %3, i32 0)
ret i32 %4
}
int(ars_d_set_ipopt_ts)(struct ars_packet *pkt, int layer, char *f, char *v) {
  return 0;
}


x86 assembly (clang, -O0):
<ars_d_set_ipopt_ts>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ars_packet = type opaque
define i32 @ars_d_set_ipopt_ts(%struct.ars_packet* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca %struct.ars_packet*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store %struct.ars_packet* %0, %struct.ars_packet** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
ret i32 0
}

LLVM IR (-O2):
%struct.ars_packet = type opaque
define i32 @ars_d_set_ipopt_ts(%struct.ars_packet* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i8* nocapture readnone %3) {
ret i32 0
}
int apple_bl_register(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @apple_bl_register() {
ret i32 0
}
int equal_string(void *s1, void *s2) { return 0; }


x86 assembly (clang, -O0):
<equal_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @equal_string(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430GeneralIOP__30__IO__clr();
void Msp430GpioC__7__HplGeneralIO__clr(void) {
  HplMsp430GeneralIOP__30__IO__clr();
}


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

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

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

LLVM IR (-O2):
define void @Msp430GpioC__7__HplGeneralIO__clr() {
%1 = tail call i32 (...) @HplMsp430GeneralIOP__30__IO__clr()
ret void
}
/* Variables and functions */
int gmx_genpr(int, char **);
int main(int argc, char *argv[]) { return gmx_genpr(argc, argv); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <gmx_genpr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <gmx_genpr@plt>

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
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @gmx_genpr(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @gmx_genpr(i32 %0, i8** %1)
ret i32 %3
}
/* Type definitions */
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
unsigned long now_ms(void) {
  struct timespec t;
  clock_gettime(CLOCK_REALTIME, &t);
  unsigned long sec = t.tv_sec * 1000;
  unsigned long msec = (t.tv_nsec + 500000) / 1000000;
  return sec + msec;
}


x86 assembly (clang, -O0):
<now_ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3e8,-0x8(%rbp),%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x7a120,%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
cltq
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<now_ms>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
movslq (%rsp),%rax
mov    $0x7a120,%ecx
add    0x4(%rsp),%ecx
imul   $0x3e8,%rax,%rdx
movslq %ecx,%rax
imul   $0x431bde83,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x32,%rax
add    %ecx,%eax
cltq
add    %rdx,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
@CLOCK_REALTIME = global i32 0
define i64 @now_ms() {
%1 = alloca %struct.timespec
%2 = alloca i64
%3 = alloca i64
%4 = load i32, i32* @CLOCK_REALTIME
%5 = call i32 @clock_gettime(i32 %4, %struct.timespec* %1)
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%7 = load i32, i32* %6
%8 = mul nsw i32 %7, 1000
%9 = sext i32 %8 to i64
store i64 %9, i64* %2
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%11 = load i32, i32* %10
%12 = add nsw i32 %11, 500000
%13 = sdiv i32 %12, 1000000
%14 = sext i32 %13 to i64
store i64 %14, i64* %3
%15 = load i64, i64* %2
%16 = load i64, i64* %3
%17 = add i64 %15, %16
ret i64 %17
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
@CLOCK_REALTIME = global i32 0
define i64 @now_ms() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_REALTIME
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, 1000
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%10 = load i32, i32* %9
%11 = add nsw i32 %10, 500000
%12 = sdiv i32 %11, 1000000
%13 = sext i32 %12 to i64
%14 = add nsw i64 %13, %8
ret i64 %14
}