xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
char fgetc(int /*<<< orphan*/ *);
scalar_t__ isspace(char);
char ReadToNextChar(FILE *fv) {
  char ch;
  ch = fgetc(fv);
  while (!feof(fv) && isspace(ch))
    ch = fgetc(fv);
  return ch;
}


x86 assembly (clang, -O0):
<ReadToNextChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <feof@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xa(%rbp)
jne    1174 <ReadToNextChar+0x44>
movsbl -0x9(%rbp),%edi
call   1040 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
test   $0x1,%al
jne    1184 <ReadToNextChar+0x54>
jmp    1195 <ReadToNextChar+0x65>
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %al,-0x9(%rbp)
jmp    1148 <ReadToNextChar+0x18>
movsbl -0x9(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadToNextChar>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
nopw   0x0(%rax,%rax,1)
call   1030 <fgetc@plt>
mov    %eax,%ebx
mov    %r14,%rdi
call   1050 <feof@plt>
test   %eax,%eax
jne    1165 <ReadToNextChar+0x35>
movsbl %bl,%edi
call   1040 <isspace@plt>
test   %rax,%rax
je     1165 <ReadToNextChar+0x35>
mov    %r14,%rdi
jmp    1140 <ReadToNextChar+0x10>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define signext i8 @ReadToNextChar(i32* %0) {
%2 = alloca i32*
%3 = alloca i8
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call signext i8 @fgetc(i32* %4)
store i8 %5, i8* %3
br label %6
6: ; preds = %16, %1
%7 = load i32*, i32** %2
%8 = call i32 @feof(i32* %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i8, i8* %3
%12 = call i64 @isspace(i8 signext %11)
%13 = icmp ne i64 %12, 0
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ false, %6 ], [ %13, %10 ]
br i1 %15, label %16, label %19
16: ; preds = %14
%17 = load i32*, i32** %2
%18 = call signext i8 @fgetc(i32* %17)
store i8 %18, i8* %3
br label %6
19: ; preds = %14
%20 = load i8, i8* %3
ret i8 %20
}

LLVM IR (-O2):
define signext i8 @ReadToNextChar(i32* nocapture %0) {
%2 = tail call signext i8 @fgetc(i32* %0)
%3 = tail call i32 @feof(i32* %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %1, %9
%6 = phi i8 [ %10, %9 ], [ %2, %1 ]
%7 = tail call i64 @isspace(i8 signext %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %5
%10 = tail call signext i8 @fgetc(i32* %0)
%11 = tail call i32 @feof(i32* %0)
%12 = icmp eq i32 %11, 0
br i1 %12, label %5, label %13
13: ; preds = %5, %9, %1
%14 = phi i8 [ %2, %1 ], [ %10, %9 ], [ %6, %5 ]
ret i8 %14
}
void buddy_stop_server(void *master) {}


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

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

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

LLVM IR (-O2):
define void @buddy_stop_server(i8* nocapture %0) {
ret void
}
/* Variables and functions */
long long l_abs(long long *);
long long intr_wrap_103(long long p1) { return l_abs(&p1); }


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

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

LLVM IR (-O0):
define i64 @intr_wrap_103(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i64 @l_abs(i64* %2)
ret i64 %3
}

LLVM IR (-O2):
define i64 @intr_wrap_103(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i64 @l_abs(i64* %2)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ glViewport(int /*<<< orphan*/, int /*<<< orphan*/, int, int);
void resize(int w, int h) {
  if (h == 0)
    h = 1;
  glViewport(0, 0, w, h);
}


x86 assembly (clang, -O0):
<resize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    112f <resize+0x1f>
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
xor    %esi,%esi
mov    %esi,%edi
call   1030 <glViewport@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resize>:
mov    %edi,%edx
test   %esi,%esi
mov    $0x1,%ecx
cmovne %esi,%ecx
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <glViewport@plt>

LLVM IR (-O0):
define void @resize(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 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %2
store i32 1, i32* %4
br label %8
8: ; preds = %7, %2
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @glViewport(i32 0, i32 0, i32 %9, i32 %10)
ret void
}

LLVM IR (-O2):
define void @resize(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i32 1, i32 %1
%5 = tail call i32 @glViewport(i32 0, i32 0, i32 %0, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, const char *argv[]) {
  int x, y;
  x = 2;
  y = 3;
  while (x < y) {
    printf("x < y\n");
    if (x == y) {
      printf("x = y\n");
    } else {
      x++;
    }
  }
  printf("x = %d\n", x);
  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   $0x2,-0x14(%rbp)
movl   $0x3,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    117b <main+0x6b>
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jne    116d <main+0x5d>
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1176 <main+0x66>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1134 <main+0x24>
mov    -0x14(%rbp),%esi
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"x < y\0A\00"
@.str.1 = [7 x i8] c"x = y\0A\00"
@.str.2 = [8 x i8] c"x = %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 2, i32* %6
store i32 3, i32* %7
br label %8
8: ; preds = %22, %2
%9 = load i32, i32* %6
%10 = load i32, i32* %7
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %23
12: ; preds = %8
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = icmp eq i32 %14, %15
br i1 %16, label %17, label %19
17: ; preds = %12
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %22
19: ; preds = %12
%20 = load i32, i32* %6
%21 = add nsw i32 %20, 1
store i32 %21, i32* %6
br label %22
22: ; preds = %19, %17
br label %8
23: ; preds = %8
%24 = load i32, i32* %6
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %24)
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [8 x i8] c"x = %d\0A\00"
@str = [6 x i8] c"x < y\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 3)
ret i32 0
}
int r(void) { return r(); }


x86 assembly (clang, -O0):
<r>:
push   %rbp
mov    %rsp,%rbp
call   1030 <r@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<r>:
jmp    1100 <r>

LLVM IR (-O0):
define i32 @r() {
%1 = call i32 @r()
ret i32 %1
}

LLVM IR (-O2):
define i32 @r() {
br label %1
1: ; preds = %1, %0
br label %1
}
int main() { return 1 << -1; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 poison
}
void go_south_east(int *lat, int *lon) {
  --*lat;
  ++*lon;
}


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

x86 assembly (clang, -O2):
<go_south_east>:
addl   $0xffffffff,(%rdi)
addl   $0x1,(%rsi)
ret

LLVM IR (-O0):
define void @go_south_east(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 = add nsw i32 %6, -1
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = add nsw i32 %9, 1
store i32 %10, i32* %8
ret void
}

LLVM IR (-O2):
define void @go_south_east(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = add nsw i32 %3, -1
store i32 %4, i32* %0
%5 = load i32, i32* %1
%6 = add nsw i32 %5, 1
store i32 %6, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void lmc_init() { srand(time(NULL)); }


x86 assembly (clang, -O0):
<lmc_init>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lmc_init>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <srand@plt>

LLVM IR (-O0):
define void @lmc_init() {
%1 = call i32 @time(i32* null)
%2 = call i32 @srand(i32 %1)
ret void
}

LLVM IR (-O2):
define void @lmc_init() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0xa8() {
  Assert_real((isalnum(168) == 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_isalnum.c",
              845, ("isalnum should be 0 for 0xa8"));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0xa8>:
push   %rax
mov    $0xa8,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x34d,%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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xa8\00"
define void @t_isalnum_0xa8() {
%1 = call i64 @isalnum(i32 168)
%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 845, i8* getelementptr inbounds ([29 x i8], [29 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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xa8\00"
define void @t_isalnum_0xa8() {
%1 = tail call i64 @isalnum(i32 168)
%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 845, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
unsigned short Decode(unsigned short input) {
  switch (input) {
  case 0:
    return 0x3F;
  case 1:
    return 0x06;
  case 2:
    return 0x5B;
  case 3:
    return 0x4F;
  case 4:
    return 0x66;
  case 5:
    return 0x6D;
  case 6:
    return 0x7D;
  case 7:
    return 0x07;
  case 8:
    return 0x7F;
  case 9:
    return 0x6F;
  default:
    return 0x00;
  }
}


x86 assembly (clang, -O0):
<Decode>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x9,%rax
ja     119f <Decode+0x9f>
mov    -0x10(%rbp),%rax
lea    0xed8(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movw   $0x3f,-0x2(%rbp)
jmp    11a5 <Decode+0xa5>
movw   $0x6,-0x2(%rbp)
jmp    11a5 <Decode+0xa5>
movw   $0x5b,-0x2(%rbp)
jmp    11a5 <Decode+0xa5>
movw   $0x4f,-0x2(%rbp)
jmp    11a5 <Decode+0xa5>
movw   $0x66,-0x2(%rbp)
jmp    11a5 <Decode+0xa5>
movw   $0x6d,-0x2(%rbp)
jmp    11a5 <Decode+0xa5>
movw   $0x7d,-0x2(%rbp)
jmp    11a5 <Decode+0xa5>
movw   $0x7,-0x2(%rbp)
jmp    11a5 <Decode+0xa5>
movw   $0x7f,-0x2(%rbp)
jmp    11a5 <Decode+0xa5>
movw   $0x6f,-0x2(%rbp)
jmp    11a5 <Decode+0xa5>
movw   $0x0,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Decode>:
cmp    $0x9,%di
ja     1116 <Decode+0x16>
movswq %di,%rax
lea    0xeef(%rip),%rcx
movzwl (%rcx,%rax,2),%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define zeroext i16 @Decode(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %3
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
switch i32 %5, label %16 [
i32 0, label %6
i32 1, label %7
i32 2, label %8
i32 3, label %9
i32 4, label %10
i32 5, label %11
i32 6, label %12
i32 7, label %13
i32 8, label %14
i32 9, label %15
]
6: ; preds = %1
store i16 63, i16* %2
br label %17
7: ; preds = %1
store i16 6, i16* %2
br label %17
8: ; preds = %1
store i16 91, i16* %2
br label %17
9: ; preds = %1
store i16 79, i16* %2
br label %17
10: ; preds = %1
store i16 102, i16* %2
br label %17
11: ; preds = %1
store i16 109, i16* %2
br label %17
12: ; preds = %1
store i16 125, i16* %2
br label %17
13: ; preds = %1
store i16 7, i16* %2
br label %17
14: ; preds = %1
store i16 127, i16* %2
br label %17
15: ; preds = %1
store i16 111, i16* %2
br label %17
16: ; preds = %1
store i16 0, i16* %2
br label %17
17: ; preds = %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6
%18 = load i16, i16* %2
ret i16 %18
}

LLVM IR (-O2):
@switch.table.Decode = [10 x i16] [i16 63, i16 6, i16 91, i16 79, i16 102, i16 109, i16 125, i16 7, i16 127, i16 111]
define zeroext i16 @Decode(i16 zeroext %0) {
%2 = icmp ult i16 %0, 10
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i16 %0 to i64
%5 = getelementptr inbounds [10 x i16], [10 x i16]* @switch.table.Decode, i64 0, i64 %4
%6 = load i16, i16* %5
br label %7
7: ; preds = %1, %3
%8 = phi i16 [ %6, %3 ], [ 0, %1 ]
ret i16 %8
}
unsigned int random() {
  static unsigned int z = 521288629;
  static unsigned int w = 362436069;
  z = 36969 * (z & 65535) + (z >> 16);
  w = 18000 * (w & 65535) + (w >> 16);
  return (z << 16) + w;
}


x86 assembly (clang, -O0):
<random>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f16(%rip),%eax
and    $0xffff,%eax
imul   $0x9069,%eax,%eax
mov    0x2f05(%rip),%ecx
shr    $0x10,%ecx
add    %ecx,%eax
mov    %eax,0x2efa(%rip)
mov    0x2ef8(%rip),%eax
and    $0xffff,%eax
imul   $0x4650,%eax,%eax
mov    0x2ee7(%rip),%ecx
shr    $0x10,%ecx
add    %ecx,%eax
mov    %eax,0x2edc(%rip)
mov    0x2ed2(%rip),%eax
shl    $0x10,%eax
add    0x2ecd(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<random>:
mov    0x2f1a(%rip),%eax
movzwl %ax,%ecx
imul   $0x9069,%ecx,%ecx
shr    $0x10,%eax
add    %ecx,%eax
mov    %eax,0x2f06(%rip)
mov    0x2f04(%rip),%ecx
movzwl %cx,%edx
imul   $0x4650,%edx,%edx
shr    $0x10,%ecx
add    %edx,%ecx
mov    %ecx,0x2ef0(%rip)
shl    $0x10,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
@random.z = internal global i32 521288629
@random.w = internal global i32 362436069
define i32 @random() {
%1 = load i32, i32* @random.z
%2 = and i32 %1, 65535
%3 = mul i32 36969, %2
%4 = load i32, i32* @random.z
%5 = lshr i32 %4, 16
%6 = add i32 %3, %5
store i32 %6, i32* @random.z
%7 = load i32, i32* @random.w
%8 = and i32 %7, 65535
%9 = mul i32 18000, %8
%10 = load i32, i32* @random.w
%11 = lshr i32 %10, 16
%12 = add i32 %9, %11
store i32 %12, i32* @random.w
%13 = load i32, i32* @random.z
%14 = shl i32 %13, 16
%15 = load i32, i32* @random.w
%16 = add i32 %14, %15
ret i32 %16
}

LLVM IR (-O2):
@random.z = internal unnamed_addr global i32 521288629
@random.w = internal unnamed_addr global i32 362436069
define i32 @random() {
%1 = load i32, i32* @random.z
%2 = and i32 %1, 65535
%3 = mul nuw i32 %2, 36969
%4 = lshr i32 %1, 16
%5 = add nuw i32 %3, %4
store i32 %5, i32* @random.z
%6 = load i32, i32* @random.w
%7 = and i32 %6, 65535
%8 = mul nuw nsw i32 %7, 18000
%9 = lshr i32 %6, 16
%10 = add nuw nsw i32 %8, %9
store i32 %10, i32* @random.w
%11 = shl i32 %5, 16
%12 = add i32 %10, %11
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, int);
int tundev_set_nonblocking(int fd) {
  int flags;
  flags = fcntl(fd, F_GETFL, 0);
  return fcntl(fd, F_SETFL, flags | O_NONBLOCK);
}


x86 assembly (clang, -O0):
<tundev_set_nonblocking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    0x2ea1(%rip),%rax
or     (%rax),%edx
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tundev_set_nonblocking>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    0x2eae(%rip),%rcx
mov    (%rcx),%esi
mov    0x2eb5(%rip),%rcx
or     (%rcx),%eax
mov    %ebx,%edi
mov    %eax,%edx
pop    %rbx
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @tundev_set_nonblocking(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @F_GETFL
%6 = call i32 @fcntl(i32 %4, i32 %5, i32 0)
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = load i32, i32* @F_SETFL
%9 = load i32, i32* %3
%10 = load i32, i32* @O_NONBLOCK
%11 = or i32 %9, %10
%12 = call i32 @fcntl(i32 %7, i32 %8, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @tundev_set_nonblocking(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 @fcntl(i32 %0, i32 %2, i32 0)
%4 = load i32, i32* @F_SETFL
%5 = load i32, i32* @O_NONBLOCK
%6 = or i32 %5, %3
%7 = tail call i32 @fcntl(i32 %0, i32 %4, i32 %6)
ret i32 %7
}
void __attribute__((used)) _pololu_atmel_studio_6_workaround(void) {
  static volatile unsigned char w = 1;
  w++;
}


x86 assembly (clang, -O0):
<_pololu_atmel_studio_6_workaround>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f16(%rip),%al
add    $0x1,%al
mov    %al,0x2f0e(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_pololu_atmel_studio_6_workaround>:
addb   $0x1,0x2f19(%rip)
ret

LLVM IR (-O0):
@_pololu_atmel_studio_6_workaround.w = internal global i8 1
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (void ()* @_pololu_atmel_studio_6_workaround to i8*)], section "llvm.metadata"
define void @_pololu_atmel_studio_6_workaround() {
%1 = load volatile i8, i8* @_pololu_atmel_studio_6_workaround.w
%2 = add i8 %1, 1
store volatile i8 %2, i8* @_pololu_atmel_studio_6_workaround.w
ret void
}

LLVM IR (-O2):
@_pololu_atmel_studio_6_workaround.w = internal global i8 1
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (void ()* @_pololu_atmel_studio_6_workaround to i8*)], section "llvm.metadata"
define void @_pololu_atmel_studio_6_workaround() {
%1 = load volatile i8, i8* @_pololu_atmel_studio_6_workaround.w
%2 = add i8 %1, 1
store volatile i8 %2, i8* @_pololu_atmel_studio_6_workaround.w
ret void
}
int main() {
  unsigned char uc;
  uc = 0x55;
  uc = 0xAA;
  uc = 0x00;
  uc = 0xFF;
  uc = 0x80;
  uc = 0x01;
  uc = 0x7F;
  uc = 0xFE;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movb   $0x55,-0x5(%rbp)
movb   $0xaa,-0x5(%rbp)
movb   $0x0,-0x5(%rbp)
movb   $0xff,-0x5(%rbp)
movb   $0x80,-0x5(%rbp)
movb   $0x1,-0x5(%rbp)
movb   $0x7f,-0x5(%rbp)
movb   $0xfe,-0x5(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i8 85, i8* %2
store i8 -86, i8* %2
store i8 0, i8* %2
store i8 -1, i8* %2
store i8 -128, i8* %2
store i8 1, i8* %2
store i8 127, i8* %2
store i8 -2, i8* %2
ret i32 0
}

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

/* Variables and functions */
uint32_t halReadReg32(uintptr_t physicalAddress) {
  volatile uint32_t *ptr = (uint32_t *)physicalAddress;
  return *ptr;
}


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

x86 assembly (clang, -O2):
<halReadReg32>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @halReadReg32(i64 %0) {
%2 = alloca i64
%3 = alloca i32*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = inttoptr i64 %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = load volatile i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @halReadReg32(i64 %0) {
%2 = inttoptr i64 %0 to i32*
%3 = load volatile i32, i32* %2
ret i32 %3
}
__attribute__((no)) int bar(int i) {
  asm("");
  if (i)
    bar(i - 1);
  else
    check_backtrace();
  return 1;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1145 <bar+0x25>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <bar@plt>
jmp    114c <bar+0x2c>
mov    $0x0,%al
call   1040 <check_backtrace@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
test   %edi,%edi
je     1125 <bar+0x15>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0xffffffff,%edi
jne    1120 <bar+0x10>
push   %rax
xor    %eax,%eax
call   1030 <check_backtrace@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @bar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 %6, 1
%8 = call i32 @bar(i32 %7)
br label %11
9: ; preds = %1
%10 = call i32 (...) @check_backtrace()
br label %11
11: ; preds = %9, %5
ret i32 1
}

LLVM IR (-O2):
define i32 @bar(i32 %0) {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
%2 = icmp eq i32 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %3
7: ; preds = %3, %1
%8 = tail call i32 (...) @check_backtrace()
ret i32 1
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
void store32(void *dst, uint32_t w) {
  uint8_t *p = (uint8_t *)dst;
  p[0] = (uint8_t)(w >> 0);
  p[1] = (uint8_t)(w >> 8);
  p[2] = (uint8_t)(w >> 16);
  p[3] = (uint8_t)(w >> 24);
}


x86 assembly (clang, -O0):
<store32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x0,%eax
movslq %eax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
movslq %eax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
movslq %eax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,0x10(%rax)
mov    -0xc(%rbp),%eax
sar    $0x18,%eax
movslq %eax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,0x18(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<store32>:
movslq %esi,%rax
mov    %rax,(%rdi)
mov    %eax,%ecx
sar    $0x8,%ecx
movslq %ecx,%rcx
mov    %rcx,0x8(%rdi)
mov    %eax,%ecx
sar    $0x10,%ecx
movslq %ecx,%rcx
mov    %rcx,0x10(%rdi)
sar    $0x18,%eax
cltq
mov    %rax,0x18(%rdi)
ret

LLVM IR (-O0):
define void @store32(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i64*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i64*
store i64* %7, i64** %5
%8 = load i32, i32* %4
%9 = ashr i32 %8, 0
%10 = sext i32 %9 to i64
%11 = load i64*, i64** %5
%12 = getelementptr inbounds i64, i64* %11, i64 0
store i64 %10, i64* %12
%13 = load i32, i32* %4
%14 = ashr i32 %13, 8
%15 = sext i32 %14 to i64
%16 = load i64*, i64** %5
%17 = getelementptr inbounds i64, i64* %16, i64 1
store i64 %15, i64* %17
%18 = load i32, i32* %4
%19 = ashr i32 %18, 16
%20 = sext i32 %19 to i64
%21 = load i64*, i64** %5
%22 = getelementptr inbounds i64, i64* %21, i64 2
store i64 %20, i64* %22
%23 = load i32, i32* %4
%24 = ashr i32 %23, 24
%25 = sext i32 %24 to i64
%26 = load i64*, i64** %5
%27 = getelementptr inbounds i64, i64* %26, i64 3
store i64 %25, i64* %27
ret void
}

LLVM IR (-O2):
define void @store32(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i64*
%4 = sext i32 %1 to i64
store i64 %4, i64* %3
%5 = ashr i32 %1, 8
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 8
%8 = bitcast i8* %7 to i64*
store i64 %6, i64* %8
%9 = ashr i32 %1, 16
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %0, i64 16
%12 = bitcast i8* %11 to i64*
store i64 %10, i64* %12
%13 = ashr i32 %1, 24
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %0, i64 24
%16 = bitcast i8* %15 to i64*
store i64 %14, i64* %16
ret void
}
long neli(int a, int b) { return -(a != b); }


x86 assembly (clang, -O0):
<neli>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%ecx
xor    %eax,%eax
sub    %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<neli>:
xor    %eax,%eax
cmp    %esi,%edi
setne  %al
neg    %rax
ret

LLVM IR (-O0):
define i64 @neli(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 = icmp ne i32 %5, %6
%8 = zext i1 %7 to i32
%9 = sub nsw i32 0, %8
%10 = sext i32 %9 to i64
ret i64 %10
}

LLVM IR (-O2):
define i64 @neli(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, %1
%4 = sext i1 %3 to i64
ret i64 %4
}
/* Variables and functions */
long strlen(char const *);
long get_read_length(const char *r) {
  long n = strlen(r);
  if (r[n - 1] == '\n') {
    return (n - 1);
  }
  return (n);
}


x86 assembly (clang, -O0):
<get_read_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    1153 <get_read_length+0x43>
mov    -0x18(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    115b <get_read_length+0x4b>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_read_length>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
lea    -0x1(%rax),%rcx
cmpb   $0xa,-0x1(%rbx,%rax,1)
cmove  %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @get_read_length(i8* %0) {
%2 = alloca i64
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @strlen(i8* %5)
store i64 %6, i64* %4
%7 = load i8*, i8** %3
%8 = load i64, i64* %4
%9 = sub nsw i64 %8, 1
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 10
br i1 %13, label %14, label %17
14: ; preds = %1
%15 = load i64, i64* %4
%16 = sub nsw i64 %15, 1
store i64 %16, i64* %2
br label %19
17: ; preds = %1
%18 = load i64, i64* %4
store i64 %18, i64* %2
br label %19
19: ; preds = %17, %14
%20 = load i64, i64* %2
ret i64 %20
}

LLVM IR (-O2):
define i64 @get_read_length(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, -1
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 10
%7 = select i1 %6, i64 %3, i64 %2
ret i64 %7
}
/* Variables and functions */
char *getlogin();
int getlogin_test() {
  char const *tmp = getlogin();
  return tmp == NULL;
}


x86 assembly (clang, -O0):
<getlogin_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getlogin@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getlogin_test>:
push   %rax
xor    %eax,%eax
call   1030 <getlogin@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @getlogin_test() {
%1 = alloca i8*
%2 = call i8* (...) @getlogin()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = icmp eq i8* %3, null
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @getlogin_test() {
%1 = tail call i8* (...) @getlogin()
%2 = icmp eq i8* %1, null
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ extractFunction();
int main() {
  extractFunction();
  return (0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <extractFunction@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @extractFunction()
ret i32 0
}
void XDeleteProperty() {}


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

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

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

LLVM IR (-O2):
define void @XDeleteProperty() {
ret void
}
unsigned int powerOfTwo(int exp) {
  if (exp)
    return (2 * powerOfTwo(exp - 1));
  return 1;
}


x86 assembly (clang, -O0):
<powerOfTwo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     113b <powerOfTwo+0x2b>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <powerOfTwo@plt>
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1142 <powerOfTwo+0x32>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<powerOfTwo>:
test   %edi,%edi
je     1124 <powerOfTwo+0x14>
push   %rax
add    $0xffffffff,%edi
call   1030 <powerOfTwo@plt>
add    %eax,%eax
add    $0x8,%rsp
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @powerOfTwo(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi i32 [ %8, %5 ], [ 1, %1 ]
ret i32 %4
5: ; preds = %1
%6 = add nsw i32 %0, -1
%7 = tail call i32 @powerOfTwo(i32 %6)
%8 = shl i32 %7, 1
br label %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ EOF;
scalar_t__ fputc(char, int /*<<< orphan*/ *);
int putf(FILE *putp, char c) {
  if (fputc(c, putp) == EOF)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<putf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
mov    -0x10(%rbp),%rsi
movsbl %al,%edi
call   1030 <fputc@plt>
mov    0x2eb0(%rip),%rcx
cmp    (%rcx),%rax
jne    114d <putf+0x3d>
movl   $0x0,-0x4(%rbp)
jmp    1154 <putf+0x44>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putf>:
push   %rax
mov    %rdi,%rax
mov    %esi,%edi
mov    %rax,%rsi
call   1030 <fputc@plt>
mov    0x2ec3(%rip),%rdx
xor    %ecx,%ecx
cmp    (%rdx),%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@EOF = global i64 0
define i32 @putf(i32* %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i8
store i32* %0, i32** %4
store i8 %1, i8* %5
%6 = load i8, i8* %5
%7 = load i32*, i32** %4
%8 = call i64 @fputc(i8 signext %6, i32* %7)
%9 = load i64, i64* @EOF
%10 = icmp eq i64 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 0, i32* %3
br label %13
12: ; preds = %2
store i32 1, i32* %3
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@EOF = global i64 0
define i32 @putf(i32* nocapture %0, i8 signext %1) {
%3 = tail call i64 @fputc(i8 signext %1, i32* %0)
%4 = load i64, i64* @EOF
%5 = icmp ne i64 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ bar(unsigned int);
void foo(void) {
  unsigned i, a;
  for (i = 0; i < 5; i++)
    a = i * i;
  bar(a);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jae    1141 <foo+0x31>
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <foo+0xf>
mov    -0x8(%rbp),%edi
call   1030 <bar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    $0x10,%edi
jmp    1030 <bar@plt>

LLVM IR (-O0):
define void @foo() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %10, %0
%4 = load i32, i32* %1
%5 = icmp ult i32 %4, 5
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = load i32, i32* %1
%8 = load i32, i32* %1
%9 = mul i32 %7, %8
store i32 %9, i32* %2
br label %10
10: ; preds = %6
%11 = load i32, i32* %1
%12 = add i32 %11, 1
store i32 %12, i32* %1
br label %3
13: ; preds = %3
%14 = load i32, i32* %2
%15 = call i32 @bar(i32 %14)
ret void
}

LLVM IR (-O2):
define void @foo() {
%1 = tail call i32 @bar(i32 16)
ret void
}
/* Variables and functions */
int count_word(char *);
int /*<<< orphan*/ fill_tab(char **, char *);
scalar_t__ malloc(int);
char **ft_split_whitespaces(char *str) {
  int nbr;
  char **tab;
  nbr = count_word(str);
  tab = (char **)malloc(sizeof(char *) * (nbr + 1));
  fill_tab(tab, str);
  return (tab);
}


x86 assembly (clang, -O0):
<ft_split_whitespaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <count_word@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <fill_tab@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_split_whitespaces>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <count_word@plt>
lea    0x8(,%rax,8),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1040 <fill_tab@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8** @ft_split_whitespaces(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8**
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @count_word(i8* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 1
%9 = sext i32 %8 to i64
%10 = mul i64 8, %9
%11 = trunc i64 %10 to i32
%12 = call i64 @malloc(i32 %11)
%13 = inttoptr i64 %12 to i8**
store i8** %13, i8*** %4
%14 = load i8**, i8*** %4
%15 = load i8*, i8** %2
%16 = call i32 @fill_tab(i8** %14, i8* %15)
%17 = load i8**, i8*** %4
ret i8** %17
}

LLVM IR (-O2):
define i8** @ft_split_whitespaces(i8* %0) {
%2 = tail call i32 @count_word(i8* %0)
%3 = shl i32 %2, 3
%4 = add i32 %3, 8
%5 = tail call i64 @malloc(i32 %4)
%6 = inttoptr i64 %5 to i8**
%7 = tail call i32 @fill_tab(i8** %6, i8* %0)
ret i8** %6
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ mallocInt();
int /*<<< orphan*/ mallocString();
int main(int argc, char **argv) {
  mallocInt();
  mallocString();
  return EXIT_SUCCESS;
}


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    $0x0,%al
call   1030 <mallocInt@plt>
mov    $0x0,%al
call   1040 <mallocString@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <mallocInt@plt>
xor    %eax,%eax
call   1040 <mallocString@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
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 = call i32 (...) @mallocInt()
%7 = call i32 (...) @mallocString()
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @mallocInt()
%4 = tail call i32 (...) @mallocString()
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
long long signed_poly(long long sum, long x) {
  sum += (long long)(long)sum * (long long)x;
  return sum;
}


x86 assembly (clang, -O0):
<signed_poly>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
add    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<signed_poly>:
imul   %rdi,%rsi
lea    (%rsi,%rdi,1),%rax
ret

LLVM IR (-O0):
define i64 @signed_poly(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = mul nsw i64 %5, %6
%8 = load i64, i64* %3
%9 = add nsw i64 %8, %7
store i64 %9, i64* %3
%10 = load i64, i64* %3
ret i64 %10
}

LLVM IR (-O2):
define i64 @signed_poly(i64 %0, i64 %1) {
%3 = mul nsw i64 %1, %0
%4 = add nsw i64 %3, %0
ret i64 %4
}
/* Variables and functions */
scalar_t__ sdeco_get_int32();
unsigned int sdeco_get_uint32(void) { return (unsigned int)sdeco_get_int32(); }


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

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

LLVM IR (-O0):
define i32 @sdeco_get_uint32() {
%1 = call i64 (...) @sdeco_get_int32()
%2 = trunc i64 %1 to i32
ret i32 %2
}

LLVM IR (-O2):
define i32 @sdeco_get_uint32() {
%1 = tail call i64 (...) @sdeco_get_int32()
%2 = trunc i64 %1 to i32
ret i32 %2
}
void lif_close_phy_device(descriptor) { close(descriptor); }


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

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

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

LLVM IR (-O2):
define void @lif_close_phy_device(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @close to i32 (i32, ...)*)(i32 %0)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void AESAuthLengthSet(uint32_t ui32Base, uint32_t ui32Length) {
  ASSERT(ui32Base == 0x44036000);
  (*((volatile uint32_t *)(ui32Base + 0x0000005C))) = ui32Length;
}


x86 assembly (clang, -O0):
<AESAuthLengthSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x44036000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x5c,%eax
cltq
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AESAuthLengthSet>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
cmp    $0x44036000,%ebp
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebp,%rax
mov    %ebx,0x5c(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @AESAuthLengthSet(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, 1141071872
%7 = zext i1 %6 to i32
%8 = call i32 @ASSERT(i32 %7)
%9 = load i32, i32* %4
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 92
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
store volatile i32 %9, i32* %13
ret void
}

LLVM IR (-O2):
define void @AESAuthLengthSet(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1141071872
%4 = zext i1 %3 to i32
%5 = tail call i32 @ASSERT(i32 %4)
%6 = add nsw i32 %0, 92
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
store volatile i32 %1, i32* %8
ret void
}
void close_input_methods(void) {}


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

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

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

LLVM IR (-O2):
define void @close_input_methods() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void I2C4_ER_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @I2C4_ER_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @I2C4_ER_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "Folosire: clip [opțiuni] AAAA-LL-ZZ\n");
  fprintf(stderr, "\n");
  fprintf(stderr, "  -q = suprimă unele mesaje informative\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xedb(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
lea    0xec8(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xee5(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xed9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [38 x i8] c"Folosire: clip [op\C8\9Biuni] AAAA-LL-ZZ\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [42 x i8] c" -q = suprim\C4\83 unele mesaje informative\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [38 x i8] c"Folosire: clip [op\C8\9Biuni] AAAA-LL-ZZ\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [42 x i8] c" -q = suprim\C4\83 unele mesaje informative\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage(void) { printf("Usage: touch full_filename ...\n"); }


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

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

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

LLVM IR (-O2):
@str = [31 x i8] c"Usage: touch full_filename ...\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main(void) {
  int i;
  float x;
  for (i = 0; i <= 100; i++) {
    x = i / 100.0;
    printf("x =  %f\n", x);
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     1169 <main+0x59>
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xec3(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xorpd  %xmm0,%xmm0
mov    $0x65,%ebp
lea    0xeed(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsd  %xmm0,(%rsp)
movsd  (%rsp),%xmm0
divsd  0xebe(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  (%rsp),%xmm0
addsd  0xead(%rip),%xmm0
add    $0xffffffff,%ebp
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"x = %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
store i32 0, i32* %1
store i32 0, i32* %2
br label %4
4: ; preds = %14, %0
%5 = load i32, i32* %2
%6 = icmp sle i32 %5, 100
br i1 %6, label %7, label %17
7: ; preds = %4
%8 = load i32, i32* %2
%9 = sitofp i32 %8 to double
%10 = fdiv double %9, 1.000000e+02
%11 = fptrunc double %10 to float
store float %11, float* %3
%12 = load float, float* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float %12)
br label %14
14: ; preds = %7
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
br label %4
17: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"x = %f\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %7, %1 ]
%3 = sitofp i32 %2 to double
%4 = fdiv double %3, 1.000000e+02
%5 = fptrunc double %4 to float
%6 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float %5)
%7 = add nuw nsw i32 %2, 1
%8 = icmp eq i32 %7, 101
br i1 %8, label %9, label %1
9: ; preds = %1
ret i32 0
}