xunge/DecIR huggingface dataset:
char *strcpy(char *dest, const char *src) {
  const char *s = src;
  char *d = dest;
  while ((*d++ = *s++))
    ;
  return dest;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%al
mov    -0x20(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     114b <strcpy+0x4b>
jmp    111c <strcpy+0x1c>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0xd6() {
  Assert_real((isalpha(214) == 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_isalpha.c",
              1075, ("isalpha should be 0 for 0xd6"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0xd6>:
push   %rax
mov    $0xd6,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x433,%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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xd6\00"
define void @t_isalpha_0xd6() {
%1 = call i64 @isalpha(i32 214)
%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 1075, 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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xd6\00"
define void @t_isalpha_0xd6() {
%1 = tail call i64 @isalpha(i32 214)
%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 1075, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int cairo_code_draw_envSpeedLabel_get_height() { return 12; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_envSpeedLabel_get_height() {
ret i32 12
}

LLVM IR (-O2):
define i32 @cairo_code_draw_envSpeedLabel_get_height() {
ret i32 12
}
/* Variables and functions */
int /*<<< orphan*/ unregister_beep_func();
void module_dispose_func() {
  unregister_beep_func();
  return;
}


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

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

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

LLVM IR (-O2):
define void @module_dispose_func() {
%1 = tail call i32 (...) @unregister_beep_func()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ alarm(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void MyHandler(int sig) {
  static int beeps = 0;
  printf("Beep\n");
  if (++beeps < 5) {
    alarm(1);
  } else {
    printf("BOOM!\n");
    exit(0);
  }
}


x86 assembly (clang, -O0):
<MyHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eef(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ee6(%rip)
cmp    $0x5,%eax
jge    116e <MyHandler+0x3e>
mov    $0x1,%edi
call   1040 <alarm@plt>
jmp    1181 <MyHandler+0x51>
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MyHandler>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2ef9(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2ef0(%rip)
cmp    $0x3,%eax
jg     115c <MyHandler+0x2c>
mov    $0x1,%edi
pop    %rax
jmp    1040 <alarm@plt>
lea    0xea2(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@MyHandler.beeps = internal global i32 0
@.str = [6 x i8] c"Beep\0A\00"
@.str.1 = [7 x i8] c"BOOM!\0A\00"
define void @MyHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @MyHandler.beeps
%5 = add nsw i32 %4, 1
store i32 %5, i32* @MyHandler.beeps
%6 = icmp slt i32 %5, 5
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @alarm(i32 1)
br label %12
9: ; preds = %1
%10 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @exit(i32 0)
unreachable
12: ; preds = %7
ret void
}

LLVM IR (-O2):
@MyHandler.beeps = internal unnamed_addr global i32 0
@str = [5 x i8] c"Beep\00"
@str.2 = [6 x i8] c"BOOM!\00"
define void @MyHandler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%3 = load i32, i32* @MyHandler.beeps
%4 = add nsw i32 %3, 1
store i32 %4, i32* @MyHandler.beeps
%5 = icmp slt i32 %3, 4
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @alarm(i32 1)
ret void
8: ; preds = %1
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.2, i64 0, i64 0))
%10 = tail call i32 @exit(i32 0)
unreachable
}
int squarenum(int col, int row) { return (row / 3) * 3 + (col / 3); }


x86 assembly (clang, -O0):
<squarenum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
imul   $0x3,%eax,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<squarenum>:
movslq %esi,%rcx
imul   $0x55555556,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rax
add    %edx,%eax
lea    (%rax,%rax,2),%eax
movslq %edi,%rdx
imul   $0x55555556,%rdx,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
shr    $0x20,%rdx
add    %esi,%edx
add    %ecx,%edx
sub    %ecx,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @squarenum(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 = sdiv i32 %5, 3
%7 = mul nsw i32 %6, 3
%8 = load i32, i32* %3
%9 = sdiv i32 %8, 3
%10 = add nsw i32 %7, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @squarenum(i32 %0, i32 %1) {
%3 = srem i32 %1, 3
%4 = sdiv i32 %0, 3
%5 = add i32 %4, %1
%6 = sub i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double const, double const);
void glmPrintMatrix2d(const double m[4]) {
  printf("[ %f %f ]\n", m[0], m[2]);
  printf("[ %f %f ]\n\n", m[1], m[3]);
}


x86 assembly (clang, -O0):
<glmPrintMatrix2d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm1
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm1
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmPrintMatrix2d>:
push   %rbx
mov    %rdi,%rbx
movsd  (%rdi),%xmm0
movsd  0x10(%rdi),%xmm1
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
movsd  0x8(%rbx),%xmm0
movsd  0x18(%rbx),%xmm1
lea    0xed1(%rip),%rdi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"[ %f %f ]\0A\00"
@.str.1 = [12 x i8] c"[ %f %f ]\0A\0A\00"
define void @glmPrintMatrix2d(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = load double*, double** %2
%7 = getelementptr inbounds double, double* %6, i64 2
%8 = load double, double* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), double %5, double %8)
%10 = load double*, double** %2
%11 = getelementptr inbounds double, double* %10, i64 1
%12 = load double, double* %11
%13 = load double*, double** %2
%14 = getelementptr inbounds double, double* %13, i64 3
%15 = load double, double* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), double %12, double %15)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"[ %f %f ]\0A\00"
@.str.1 = [12 x i8] c"[ %f %f ]\0A\0A\00"
define void @glmPrintMatrix2d(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 2
%4 = load double, double* %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), double %2, double %4)
%6 = getelementptr inbounds double, double* %0, i64 1
%7 = load double, double* %6
%8 = getelementptr inbounds double, double* %0, i64 3
%9 = load double, double* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), double %7, double %9)
ret void
}
/* Variables and functions */
int snprintf(char *, int, char *, int);
int __get_pin_directory(char *dest, int pin) {
  return snprintf(dest, 128,
                  "/sys/class/gpio/gpio"
                  "%d/",
                  pin & 0xFF);
}


x86 assembly (clang, -O0):
<__get_pin_directory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    $0x80,%esi
lea    0xec8(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__get_pin_directory>:
movzbl %sil,%ecx
lea    0xee5(%rip),%rdx
mov    $0x80,%esi
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"/sys/class/gpio/gpio%d/\00"
define i32 @__get_pin_directory(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = and i32 %6, 255
%8 = call i32 @snprintf(i8* %5, i32 128, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@.str = [24 x i8] c"/sys/class/gpio/gpio%d/\00"
define i32 @__get_pin_directory(i8* %0, i32 %1) {
%3 = and i32 %1, 255
%4 = tail call i32 @snprintf(i8* %0, i32 128, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ TEST_runTests();
int main(int argc, char **argv) {
  TEST_runTests();
  return 0;
}


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 <TEST_runTests@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @TEST_runTests()
ret i32 0
}
/* Variables and functions */
int rand();
int getRandomNumber(int minNum, int maxNum) {
  int randomNum = 0, backupMax = maxNum;
  maxNum++;
  do {
    randomNum = rand() % maxNum + minNum;
  } while ((randomNum < minNum) || (randomNum > backupMax));
  return randomNum;
}


x86 assembly (clang, -O0):
<getRandomNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0x8(%rbp)
add    -0x4(%rbp),%edx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%al
cmp    -0x4(%rbp),%ecx
mov    %al,-0x11(%rbp)
jl     1162 <getRandomNumber+0x52>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
setg   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1134 <getRandomNumber+0x24>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRandomNumber>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebx
lea    0x1(%r14),%ebp
nopl   (%rax)
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebp
lea    (%rdx,%rbx,1),%eax
test   %edx,%edx
js     1120 <getRandomNumber+0x10>
cmp    %r14d,%eax
jg     1120 <getRandomNumber+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @getRandomNumber(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
store i32 0, i32* %5
%7 = load i32, i32* %4
store i32 %7, i32* %6
%8 = load i32, i32* %4
%9 = add nsw i32 %8, 1
store i32 %9, i32* %4
br label %10
10: ; preds = %24, %2
%11 = call i32 (...) @rand()
%12 = load i32, i32* %4
%13 = srem i32 %11, %12
%14 = load i32, i32* %3
%15 = add nsw i32 %13, %14
store i32 %15, i32* %5
br label %16
16: ; preds = %10
%17 = load i32, i32* %5
%18 = load i32, i32* %3
%19 = icmp slt i32 %17, %18
br i1 %19, label %24, label %20
20: ; preds = %16
%21 = load i32, i32* %5
%22 = load i32, i32* %6
%23 = icmp sgt i32 %21, %22
br label %24
24: ; preds = %20, %16
%25 = phi i1 [ true, %16 ], [ %23, %20 ]
br i1 %25, label %10, label %26
26: ; preds = %24
%27 = load i32, i32* %5
ret i32 %27
}

LLVM IR (-O2):
define i32 @getRandomNumber(i32 %0, i32 %1) {
%3 = add nsw i32 %1, 1
br label %4
4: ; preds = %4, %2
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, %3
%7 = add nsw i32 %6, %0
%8 = icmp slt i32 %6, 0
%9 = icmp sgt i32 %7, %1
%10 = select i1 %8, i1 true, i1 %9
br i1 %10, label %4, label %11
11: ; preds = %4
ret i32 %7
}
float _Complex sub_float_cr(float _Complex a, float b) { return a - b; }


x86 assembly (clang, -O0):
<sub_float_cr>:
push   %rbp
mov    %rsp,%rbp
movlpd %xmm0,-0x10(%rbp)
movss  %xmm1,-0x14(%rbp)
movss  -0x10(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
movss  -0x14(%rbp),%xmm2
subss  %xmm2,%xmm1
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0x4(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub_float_cr>:
subss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define <2 x float> @sub_float_cr(<2 x float> %0, float %1) {
%3 = alloca { float, float }
%4 = alloca { float, float }
%5 = alloca float
%6 = bitcast { float, float }* %4 to <2 x float>*
store <2 x float> %0, <2 x float>* %6
store float %1, float* %5
%7 = getelementptr inbounds { float, float }, { float, float }* %4, i32 0, i32 0
%8 = load float, float* %7
%9 = getelementptr inbounds { float, float }, { float, float }* %4, i32 0, i32 1
%10 = load float, float* %9
%11 = load float, float* %5
%12 = fsub float %8, %11
%13 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 0
%14 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 1
store float %12, float* %13
store float %10, float* %14
%15 = bitcast { float, float }* %3 to <2 x float>*
%16 = load <2 x float>, <2 x float>* %15
ret <2 x float> %16
}

LLVM IR (-O2):
define <2 x float> @sub_float_cr(<2 x float> %0, float %1) {
%3 = extractelement <2 x float> %0, i64 0
%4 = fsub float %3, %1
%5 = insertelement <2 x float> %0, float %4, i64 0
ret <2 x float> %5
}
void abort() {
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<abort>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <abort+0x9>
jmp    1109 <abort+0x9>

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

LLVM IR (-O0):
define void @abort() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @abort() {
br label %1
1: ; preds = %1, %0
br label %1
}
void mdp4_wfd_init(int cndx) {}


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

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

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

LLVM IR (-O2):
define void @mdp4_wfd_init(i32 %0) {
ret void
}
/* Variables and functions */
scalar_t__ isnan(float);
int __ocl_isordered_float(float src1, float src2) {
  return isnan(src1) || isnan(src2) ? 0 : 1;
}


x86 assembly (clang, -O0):
<__ocl_isordered_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <isnan@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    1152 <__ocl_isordered_float+0x42>
movss  -0x8(%rbp),%xmm0
call   1030 <isnan@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%dl
mov    $0x1,%eax
xor    %ecx,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ocl_isordered_float>:
push   %rax
movss  %xmm1,0x4(%rsp)
call   1030 <isnan@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1128 <__ocl_isordered_float+0x18>
pop    %rcx
ret
movss  0x4(%rsp),%xmm0
call   1030 <isnan@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @__ocl_isordered_float(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 = call i64 @isnan(float %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %2
%9 = load float, float* %4
%10 = call i64 @isnan(float %9)
%11 = icmp ne i64 %10, 0
br label %12
12: ; preds = %8, %2
%13 = phi i1 [ true, %2 ], [ %11, %8 ]
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 0, i32 1
ret i32 %15
}

LLVM IR (-O2):
define i32 @__ocl_isordered_float(float %0, float %1) {
%3 = tail call i64 @isnan(float %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i64 @isnan(float %1)
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 0, %2 ], [ %8, %5 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ recv(int, void *, size_t, int);
ssize_t myrecv(int sockfd, void *buf, size_t len, int flags) {
  return recv(sockfd, buf, len, flags);
}


x86 assembly (clang, -O0):
<myrecv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <recv@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myrecv>:
jmp    1030 <recv@plt>

LLVM IR (-O0):
define i32 @myrecv(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i64, i64* %7
%12 = load i32, i32* %8
%13 = call i32 @recv(i32 %9, i8* %10, i64 %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @myrecv(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = tail call i32 @recv(i32 %0, i8* %1, i64 %2, i32 %3)
ret i32 %5
}
void test1(void) {
  extern double foo1;
  extern double bar1(double);
}


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

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

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

LLVM IR (-O2):
define void @test1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ record_linux_param_description(char *, char *, char *);
void module_param_desc_beta(void) {
  record_linux_param_description(
      "tcp_vegas.c", "beta", "upper bound of packets in network (scale by 2)");
}


x86 assembly (clang, -O0):
<module_param_desc_beta>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeea(%rip),%rsi
lea    0xee8(%rip),%rdx
call   1030 <record_linux_param_description@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<module_param_desc_beta>:
lea    0xee9(%rip),%rdi
lea    0xeee(%rip),%rsi
lea    0xeec(%rip),%rdx
jmp    1030 <record_linux_param_description@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"tcp_vegas.c\00"
@.str.1 = [5 x i8] c"beta\00"
@.str.2 = [47 x i8] c"upper bound of packets in network (scale by 2)\00"
define void @module_param_desc_beta() {
%1 = call i32 @record_linux_param_description(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"tcp_vegas.c\00"
@.str.1 = [5 x i8] c"beta\00"
@.str.2 = [47 x i8] c"upper bound of packets in network (scale by 2)\00"
define void @module_param_desc_beta() {
%1 = tail call i32 @record_linux_param_description(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int f424(int *);
int f425(int *p) { return f424(p); }


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

x86 assembly (clang, -O2):
<f425>:
jmp    1030 <f424@plt>

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

LLVM IR (-O2):
define i32 @f425(i32* %0) {
%2 = tail call i32 @f424(i32* %0)
ret i32 %2
}
/* Variables and functions */
long double log10(double);
__attribute__((weak)) long double log10l(long double x) {
  return log10((double)x);
}


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

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

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

LLVM IR (-O2):
define weak x86_fp80 @log10l(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call x86_fp80 @log10(double %2)
ret x86_fp80 %3
}
/* Variables and functions */
int /*<<< orphan*/ long_line();
int /*<<< orphan*/ printf(char *, int);
void bar(int x) {
  printf("%d\n", x);
  long_line();
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <long_line@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <long_line@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @bar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 (...) @long_line()
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @bar(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 (...) @long_line()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *);
void **fdopen(int fd, const char *mode) {
  printk("Write fdopen()\n");
  return 0;
}


x86 assembly (clang, -O0):
<fdopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printk@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdopen>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printk@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Write fdopen()\0A\00"
define i8** @fdopen(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = call i32 @printk(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i8** null
}

LLVM IR (-O2):
@.str = [16 x i8] c"Write fdopen()\0A\00"
define noalias i8** @fdopen(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32 @printk(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i8** null
}
int isatty(int fd) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @isatty(i32 %0) {
ret i32 0
}
void emit_int64(struct processor_explicatory_state *process_state,
                struct modern_stream *stream, void *stream_state,
                struct modern_vfile *vfile, void *vfile_state) {}


x86 assembly (clang, -O0):
<emit_int64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_int64(%struct.processor_explicatory_state* %0, %struct.modern_stream* %1, i8* %2, %struct.modern_vfile* %3, i8* %4) {
%6 = alloca %struct.processor_explicatory_state*
%7 = alloca %struct.modern_stream*
%8 = alloca i8*
%9 = alloca %struct.modern_vfile*
%10 = alloca i8*
store %struct.processor_explicatory_state* %0, %struct.processor_explicatory_state** %6
store %struct.modern_stream* %1, %struct.modern_stream** %7
store i8* %2, i8** %8
store %struct.modern_vfile* %3, %struct.modern_vfile** %9
store i8* %4, i8** %10
ret void
}

LLVM IR (-O2):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_int64(%struct.processor_explicatory_state* nocapture %0, %struct.modern_stream* nocapture %1, i8* nocapture %2, %struct.modern_vfile* nocapture %3, i8* nocapture %4) {
ret void
}
R0AX1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{ r0 = (((int *)11111111)[x1]); }


x86 assembly (clang, -O0):
<R0AX1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
movslq -0x14(%rbp),%rcx
mov    $0xa98ac7,%eax
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @R0AX1(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32* %4, i32** %12
store i32* %5, i32** %13
%14 = load i32, i32* %11
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* inttoptr (i64 11111111 to i32*), i64 %15
%17 = load i32, i32* %16
store i32 %17, i32* %8
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
define i32 @R0AX1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture readnone %5) {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int sigprocmask(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void call_sigprocmask(int how, sigset_t *new_set, sigset_t *old_set) {
  int error = sigprocmask(how, new_set, old_set);
  if (error) {
    fprintf(stderr, "sigprocmask: %s\n", strerror(errno));
  }
}


x86 assembly (clang, -O0):
<call_sigprocmask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <sigprocmask@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     118c <call_sigprocmask+0x5c>
mov    0x2e79(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    0x2e65(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x20(%rbp),%edi
mov    %rax,%rdx
lea    0xe79(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_sigprocmask>:
push   %rbx
call   1030 <sigprocmask@plt>
test   %eax,%eax
je     1163 <call_sigprocmask+0x33>
mov    0x2e9f(%rip),%rax
mov    (%rax),%ebx
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xea8(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
pop    %rbx
jmp    1040 <fprintf@plt>
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"sigprocmask: %s\0A\00"
@errno = global i32 0
define void @call_sigprocmask(i32 %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%8 = load i32, i32* %4
%9 = load i32*, i32** %5
%10 = load i32*, i32** %6
%11 = call i32 @sigprocmask(i32 %8, i32* %9, i32* %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %3
%15 = load i32, i32* @stderr
%16 = load i32, i32* @errno
%17 = call i8* @strerror(i32 %16)
%18 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %17)
br label %19
19: ; preds = %14, %3
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"sigprocmask: %s\0A\00"
@errno = global i32 0
define void @call_sigprocmask(i32 %0, i32* %1, i32* %2) {
%4 = tail call i32 @sigprocmask(i32 %0, i32* %1, i32* %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %3
%7 = load i32, i32* @stderr
%8 = load i32, i32* @errno
%9 = tail call i8* @strerror(i32 %8)
%10 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %6, %3
ret void
}
void RandomFunc(unsigned int input[1], unsigned int output[1]) {
  unsigned int state[1];
  unsigned int local1;
  {
    state[0UL] = input[0UL] + 4284877637U;
    local1 = 0UL;
    while (local1 < 1UL) {
      state[local1] *= state[local1];
      local1 += 2UL;
    }
    output[0UL] = state[0UL] - 2699719578U;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0xff660b45,%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    $0x1,%rax
jae    1150 <RandomFunc+0x50>
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp,%rax,4),%ecx
mov    -0x18(%rbp),%eax
imul   -0x14(%rbp,%rax,4),%ecx
mov    %ecx,-0x14(%rbp,%rax,4)
mov    -0x18(%rbp),%eax
add    $0x2,%rax
mov    %eax,-0x18(%rbp)
jmp    1121 <RandomFunc+0x21>
mov    -0x14(%rbp),%ecx
sub    $0xa0ea739a,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    $0xff660b45,%eax
add    (%rdi),%eax
imul   %eax,%eax
add    $0x5f158c66,%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [1 x i32]
%6 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 0
%9 = load i32, i32* %8
%10 = add i32 %9, -10089659
%11 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
store i32 %10, i32* %11
store i32 0, i32* %6
br label %12
12: ; preds = %16, %2
%13 = load i32, i32* %6
%14 = zext i32 %13 to i64
%15 = icmp ult i64 %14, 1
br i1 %15, label %16, label %30
16: ; preds = %12
%17 = load i32, i32* %6
%18 = zext i32 %17 to i64
%19 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 %18
%20 = load i32, i32* %19
%21 = load i32, i32* %6
%22 = zext i32 %21 to i64
%23 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 %22
%24 = load i32, i32* %23
%25 = mul i32 %24, %20
store i32 %25, i32* %23
%26 = load i32, i32* %6
%27 = zext i32 %26 to i64
%28 = add i64 %27, 2
%29 = trunc i64 %28 to i32
store i32 %29, i32* %6
br label %12
30: ; preds = %12
%31 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%32 = load i32, i32* %31
%33 = sub i32 %32, -1595247718
%34 = load i32*, i32** %4
%35 = getelementptr inbounds i32, i32* %34, i64 0
store i32 %33, i32* %35
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = add i32 %3, -10089659
%5 = mul i32 %4, %4
%6 = add i32 %5, 1595247718
store i32 %6, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_ioline_is_drained() {
  printf("NOT IMPLEMENTED:"
         "pa_ioline_is_drained"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [38 x i8] c"NOT IMPLEMENTED:pa_ioline_is_drained\0A\00"
define i32 @pa_ioline_is_drained() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [37 x i8] c"NOT IMPLEMENTED:pa_ioline_is_drained\00"
define i32 @pa_ioline_is_drained() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void printArr(unsigned int arr[], int length, void (*fptr)(unsigned int)) {
  int i;
  for (i = 0; i < length; i++) {
    (*fptr)(arr[i]);
  }
}


x86 assembly (clang, -O0):
<printArr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1145 <printArr+0x45>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq -0x1c(%rbp),%rdx
mov    (%rcx,%rdx,4),%edi
call   *%rax
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111a <printArr+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArr>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1130 <printArr+0x30>
mov    %rdx,%r14
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%edi
call   *%r14
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1120 <printArr+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

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


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

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

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

LLVM IR (-O2):
define void @_k_memproof_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HDR_WriteBinaryFile(unsigned char *, unsigned long, int,
                                       int /*<<< orphan*/);
void HDR_LastWord_Translate(unsigned char *pHDRMsg, unsigned long ulMsgLen) {
  HDR_WriteBinaryFile(pHDRMsg, ulMsgLen, 2, 0);
}


x86 assembly (clang, -O0):
<HDR_LastWord_Translate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x2,%edx
xor    %ecx,%ecx
call   1030 <HDR_WriteBinaryFile@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HDR_LastWord_Translate>:
mov    $0x2,%edx
xor    %ecx,%ecx
jmp    1030 <HDR_WriteBinaryFile@plt>

LLVM IR (-O0):
define void @HDR_LastWord_Translate(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i32 @HDR_WriteBinaryFile(i8* %5, i64 %6, i32 2, i32 0)
ret void
}

LLVM IR (-O2):
define void @HDR_LastWord_Translate(i8* %0, i64 %1) {
%3 = tail call i32 @HDR_WriteBinaryFile(i8* %0, i64 %1, i32 2, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *);
int /*<<< orphan*/ stderr;
void rtpp_modman_insert_fin(void *pub) {
  fprintf(stderr,
          "Method rtpp_modman@%p::insert (rtpp_modman_insert) is invoked after "
          "destruction\x0a",
          pub);
  abort();
}


x86 assembly (clang, -O0):
<rtpp_modman_insert_fin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<rtpp_modman_insert_fin>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [81 x i8] c"Method rtpp_modman@%p::insert (rtpp_modman_insert) is invoked after destruction\0A\00"
define void @rtpp_modman_insert_fin(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [81 x i8] c"Method rtpp_modman@%p::insert (rtpp_modman_insert) is invoked after destruction\0A\00"
define void @rtpp_modman_insert_fin(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @abort()
unreachable
}
int test_imm_B4int64_lowword_mem(long long *val) {
  return ((*val) & (0xB4 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B4int64_lowword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
and    $0xb4,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_B4int64_lowword_mem>:
testb  $0xb4,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_B4int64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 180
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_B4int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 180
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(unsigned long);
int /*<<< orphan*/ printf(char *, int, unsigned long);
__attribute__((__noreturn__)) void exitfunc0(int status, void *arg) {
  printf("Executing exitfunc"
         "0"
         " (status=%d, arg=%lu)\n",
         status, (unsigned long)arg);
  exit((unsigned long)arg);
}


x86 assembly (clang, -O0):
<exitfunc0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exitfunc0>:
push   %rbx
mov    %rsi,%rbx
mov    %edi,%esi
lea    0xed3(%rip),%rdi
mov    %rbx,%rdx
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"Executing exitfunc0 (status=%d, arg=%lu)\0A\00"
define void @exitfunc0(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = ptrtoint i8* %6 to i64
%8 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %5, i64 %7)
%9 = load i8*, i8** %4
%10 = ptrtoint i8* %9 to i64
%11 = call i32 @exit(i64 %10)
unreachable
}

LLVM IR (-O2):
@.str = [42 x i8] c"Executing exitfunc0 (status=%d, arg=%lu)\0A\00"
define void @exitfunc0(i32 %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %0, i64 %3)
%5 = tail call i32 @exit(i64 %3)
unreachable
}
const char *vercmp_digit_end(const char *v) {
  while (*v >= '0' && *v <= '9') {
    v++;
  }
  return v;
}


x86 assembly (clang, -O0):
<vercmp_digit_end>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x9(%rbp)
jl     112d <vercmp_digit_end+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113d <vercmp_digit_end+0x3d>
jmp    114e <vercmp_digit_end+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <vercmp_digit_end+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vercmp_digit_end>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
add    $0xd0,%cl
cmp    $0xa,%cl
jb     1110 <vercmp_digit_end+0x10>
ret

LLVM IR (-O0):
define i8* @vercmp_digit_end(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %15, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp sge i32 %6, 48
br i1 %7, label %8, label %13
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp sle i32 %11, 57
br label %13
13: ; preds = %8, %3
%14 = phi i1 [ false, %3 ], [ %12, %8 ]
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %2
br label %3
18: ; preds = %13
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
define i8* @vercmp_digit_end(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = add i8 %4, -48
%6 = icmp ult i8 %5, 10
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %2, label %8
8: ; preds = %2
ret i8* %3
}
void fill_hex(char *out, unsigned char val) {
  const char hex[] = "0123456789abcdef";
  out[0] = hex[(val >> 4) & 0xf];
  out[1] = hex[val & 0xf];
}


x86 assembly (clang, -O0):
<fill_hex>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    0xeeb(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xee8(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xee6(%rip),%al
mov    %al,-0x10(%rbp)
movzbl -0x9(%rbp),%eax
sar    $0x4,%eax
and    $0xf,%eax
cltq
mov    -0x20(%rbp,%rax,1),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
movzbl -0x9(%rbp),%eax
and    $0xf,%eax
cltq
mov    -0x20(%rbp,%rax,1),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_hex>:
mov    %esi,%eax
mov    %rax,%rcx
shr    $0x4,%rcx
lea    0xef0(%rip),%rdx
mov    (%rcx,%rdx,1),%cl
mov    %cl,(%rdi)
and    $0xf,%eax
mov    (%rax,%rdx,1),%al
mov    %al,0x1(%rdi)
ret

LLVM IR (-O0):
@__const.fill_hex.hex = [17 x i8] c"0123456789abcdef\00"
define void @fill_hex(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca [17 x i8]
store i8* %0, i8** %3
store i8 %1, i8* %4
%6 = bitcast [17 x i8]* %5 to i8*
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = ashr i32 %8, 4
%10 = and i32 %9, 15
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [17 x i8], [17 x i8]* %5, i64 0, i64 %11
%13 = load i8, i8* %12
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 0
store i8 %13, i8* %15
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = and i32 %17, 15
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [17 x i8], [17 x i8]* %5, i64 0, i64 %19
%21 = load i8, i8* %20
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i64 1
store i8 %21, i8* %23
ret void
}

LLVM IR (-O2):
@__const.fill_hex.hex = [17 x i8] c"0123456789abcdef\00"
define void @fill_hex(i8* nocapture writeonly %0, i8 zeroext %1) {
%3 = zext i8 %1 to i32
%4 = lshr i32 %3, 4
%5 = zext i32 %4 to i64
%6 = getelementptr inbounds [17 x i8], [17 x i8]* @__const.fill_hex.hex, i64 0, i64 %5
%7 = load i8, i8* %6
store i8 %7, i8* %0
%8 = and i32 %3, 15
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds [17 x i8], [17 x i8]* @__const.fill_hex.hex, i64 0, i64 %9
%11 = load i8, i8* %10
%12 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %11, i8* %12
ret void
}