xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fulltest(int, char const **);
int /*<<< orphan*/ shorturl_number_plus_localtime(int, char const **);
int /*<<< orphan*/ shorturl_plus_localtime(int, char const **);
int main(int argc, const char *argv[]) {
  if (argc == 2) {
    shorturl_plus_localtime(argc, argv);
  } else if (argc == 1) {
    shorturl_number_plus_localtime(argc, argv);
  } else {
    fulltest(argc, argv);
  }
  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)
cmpl   $0x2,-0x8(%rbp)
jne    1161 <main+0x31>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <shorturl_plus_localtime@plt>
jmp    118d <main+0x5d>
cmpl   $0x1,-0x8(%rbp)
jne    117c <main+0x4c>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <shorturl_number_plus_localtime@plt>
jmp    1188 <main+0x58>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <fulltest@plt>
jmp    118d <main+0x5d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
je     1147 <main+0x17>
cmp    $0x2,%edi
jne    1153 <main+0x23>
mov    $0x2,%edi
call   1050 <shorturl_plus_localtime@plt>
jmp    1158 <main+0x28>
mov    $0x1,%edi
call   1030 <shorturl_number_plus_localtime@plt>
jmp    1158 <main+0x28>
call   1040 <fulltest@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 = load i32, i32* %4
%7 = icmp eq i32 %6, 2
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* %4
%10 = load i8**, i8*** %5
%11 = call i32 @shorturl_plus_localtime(i32 %9, i8** %10)
br label %24
12: ; preds = %2
%13 = load i32, i32* %4
%14 = icmp eq i32 %13, 1
br i1 %14, label %15, label %19
15: ; preds = %12
%16 = load i32, i32* %4
%17 = load i8**, i8*** %5
%18 = call i32 @shorturl_number_plus_localtime(i32 %16, i8** %17)
br label %23
19: ; preds = %12
%20 = load i32, i32* %4
%21 = load i8**, i8*** %5
%22 = call i32 @fulltest(i32 %20, i8** %21)
br label %23
23: ; preds = %19, %15
br label %24
24: ; preds = %23, %8
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
switch i32 %0, label %7 [
i32 2, label %3
i32 1, label %5
]
3: ; preds = %2
%4 = tail call i32 @shorturl_plus_localtime(i32 2, i8** %1)
br label %9
5: ; preds = %2
%6 = tail call i32 @shorturl_number_plus_localtime(i32 1, i8** %1)
br label %9
7: ; preds = %2
%8 = tail call i32 @fulltest(i32 %0, i8** %1)
br label %9
9: ; preds = %5, %7, %3
ret i32 0
}
int test_imm_C6uint16_mem(unsigned short *val) {
  return ((*val) & (0xC6 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_C6uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 198
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  int /*<<< orphan*/ fts_name;
};
typedef TYPE_1__ FTSENT;

/* Variables and functions */
int strcmp(int /*<<< orphan*/, int /*<<< orphan*/);
int nsort(const FTSENT *const *a, const FTSENT *const *b) {
  return (strcmp((*a)->fts_name, (*b)->fts_name));
}


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

x86 assembly (clang, -O2):
<nsort>:
mov    (%rdi),%rax
mov    (%rax),%edi
mov    (%rsi),%rax
mov    (%rax),%esi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
%struct.TYPE_4__ = type { i32 }
define i32 @nsort(%struct.TYPE_4__** %0, %struct.TYPE_4__** %1) {
%3 = alloca %struct.TYPE_4__**
%4 = alloca %struct.TYPE_4__**
store %struct.TYPE_4__** %0, %struct.TYPE_4__*** %3
store %struct.TYPE_4__** %1, %struct.TYPE_4__*** %4
%5 = load %struct.TYPE_4__**, %struct.TYPE_4__*** %3
%6 = load %struct.TYPE_4__*, %struct.TYPE_4__** %5
%7 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = load %struct.TYPE_4__**, %struct.TYPE_4__*** %4
%10 = load %struct.TYPE_4__*, %struct.TYPE_4__** %9
%11 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call i32 @strcmp(i32 %8, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.TYPE_4__ = type { i32 }
define i32 @nsort(%struct.TYPE_4__** nocapture %0, %struct.TYPE_4__** nocapture %1) {
%3 = load %struct.TYPE_4__*, %struct.TYPE_4__** %0
%4 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %3, i64 0, i32 0
%5 = load i32, i32* %4
%6 = load %struct.TYPE_4__*, %struct.TYPE_4__** %1
%7 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %6, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i32 @strcmp(i32 %5, i32 %8)
ret i32 %9
}
void testfunc2(void) {}


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

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

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

LLVM IR (-O2):
define void @testfunc2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void display_help(void) {
  printf(
      "Usage: nanddump [OPTIONS] MTD-device\n"
      "Dumps the contents of a nand mtd partition.\n"
      "\n"
      "           --help     	        display this help and exit\n"
      "           --version  	        output version information and exit\n"
      "-f file    --file=file          dump to file\n"
      "-i         --ignoreerrors       ignore errors\n"
      "-l length  --length=length      length\n"
      "-o         --omitoob            omit oob data\n"
      "-b         --omitbad            omit bad blocks from the dump\n"
      "-p         --prettyprint        print nice (hexdump)\n"
      "-s addr    --startaddress=addr  start address\n");
  exit(0);
}


x86 assembly (clang, -O0):
<display_help>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<display_help>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [545 x i8] c"Usage: nanddump [OPTIONS] MTD-device\0ADumps the contents of a nand mtd partition.\0A\0A --help \09 display this help and exit\0A --version \09 output version information and exit\0A-f file --file=file dump to file\0A-i --ignoreerrors ignore errors\0A-l length --length=length length\0A-o --omitoob omit oob data\0A-b --omitbad omit bad blocks from the dump\0A-p --prettyprint print nice (hexdump)\0A-s addr --startaddress=addr start address\0A\00"
define void @display_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([545 x i8], [545 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [544 x i8] c"Usage: nanddump [OPTIONS] MTD-device\0ADumps the contents of a nand mtd partition.\0A\0A --help \09 display this help and exit\0A --version \09 output version information and exit\0A-f file --file=file dump to file\0A-i --ignoreerrors ignore errors\0A-l length --length=length length\0A-o --omitoob omit oob data\0A-b --omitbad omit bad blocks from the dump\0A-p --prettyprint print nice (hexdump)\0A-s addr --startaddress=addr start address\00"
define void @display_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([544 x i8], [544 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ itob(int, char *, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverse(char *);
int main(void) {
  int n = 3234;
  char out[1000];
  itob(n, out, 16);
  reverse(out);
  printf("%s\n", out);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xca2,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x3f0(%rbp),%rsi
mov    $0x10,%edx
call   1050 <itob@plt>
lea    -0x3f0(%rbp),%rdi
call   1030 <reverse@plt>
lea    -0x3f0(%rbp),%rsi
lea    0xe89(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x3f0,%rsp
mov    %rsp,%rbx
mov    $0xca2,%edi
mov    %rbx,%rsi
mov    $0x10,%edx
call   1050 <itob@plt>
mov    %rbx,%rdi
call   1030 <reverse@plt>
lea    0xea4(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [1000 x i8]
store i32 0, i32* %1
store i32 3234, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%6 = call i32 @itob(i32 %4, i8* %5, i32 16)
%7 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%8 = call i32 @reverse(i8* %7)
%9 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @itob(i32 3234, i8* %2, i32 16)
%4 = call i32 @reverse(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
double exp(double);
double exp1(double x) { return x < -50.0 ? 0.0 : exp(x); }


x86 assembly (clang, -O0):
<exp1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    113d <exp1+0x2d>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    114c <exp1+0x3c>
movsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exp1>:
movsd  0xee8(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1123 <exp1+0x13>
xorpd  %xmm0,%xmm0
ret
jmp    1030 <exp@plt>

LLVM IR (-O0):
define double @exp1(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, -5.000000e+01
br i1 %4, label %5, label %6
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load double, double* %2
%8 = call double @exp(double %7)
br label %9
9: ; preds = %6, %5
%10 = phi double [ 0.000000e+00, %5 ], [ %8, %6 ]
ret double %10
}

LLVM IR (-O2):
define double @exp1(double %0) {
%2 = fcmp olt double %0, -5.000000e+01
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call double @exp(double %0)
br label %5
5: ; preds = %1, %3
%6 = phi double [ %4, %3 ], [ 0.000000e+00, %1 ]
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void show_usage() {
  printf("\nUsage: mem_debug -a <address> -n <pages>\n"
         "  -h            Help (this message)\n"
         "  -a <address>  Hex address to start the map\n"
         "  -n <pages>    Number of pages to map\n\n");
}


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

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

LLVM IR (-O0):
@.str = [164 x i8] c"\0AUsage: mem_debug -a <address> -n <pages>\0A -h Help (this message)\0A -a <address> Hex address to start the map\0A -n <pages> Number of pages to map\0A\0A\00"
define void @show_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([164 x i8], [164 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [163 x i8] c"\0AUsage: mem_debug -a <address> -n <pages>\0A -h Help (this message)\0A -a <address> Hex address to start the map\0A -n <pages> Number of pages to map\0A\00"
define void @show_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([163 x i8], [163 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int downloadFile(int, char *, char *);
int main(int argc, char *argv[]) {
  int _PORT_U = 3059;
  return downloadFile(_PORT_U, "temp.jpg", "w");
}


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   $0xbf3,-0x14(%rbp)
mov    -0x14(%rbp),%edi
lea    0xec9(%rip),%rsi
lea    0xecb(%rip),%rdx
call   1030 <downloadFile@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rsi
lea    0xeeb(%rip),%rdx
mov    $0xbf3,%edi
jmp    1030 <downloadFile@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"temp.jpg\00"
@.str.1 = [2 x i8] c"w\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 3059, i32* %6
%7 = load i32, i32* %6
%8 = call i32 @downloadFile(i32 %7, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 %8
}

LLVM IR (-O2):
@.str = [9 x i8] c"temp.jpg\00"
@.str.1 = [2 x i8] c"w\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @downloadFile(i32 3059, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 %3
}
/* Variables and functions */
void *malloc(int);
void *f3() { return malloc(4 * sizeof(int)); }


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10,%edi
call   1030 <malloc@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @f3() {
%1 = call i8* @malloc(i32 16)
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @f3() {
%1 = tail call dereferenceable_or_null(16) i8* @malloc(i32 16)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ allot_float(float);
int /*<<< orphan*/ dpush(int /*<<< orphan*/);
void box_float(float flo) { dpush(allot_float(flo)); }


x86 assembly (clang, -O0):
<box_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <allot_float@plt>
mov    %eax,%edi
call   1030 <dpush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<box_float>:
push   %rax
call   1040 <allot_float@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <dpush@plt>

LLVM IR (-O0):
define void @box_float(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @allot_float(float %3)
%5 = call i32 @dpush(i32 %4)
ret void
}

LLVM IR (-O2):
define void @box_float(float %0) {
%2 = tail call i32 @allot_float(float %0)
%3 = tail call i32 @dpush(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_bad_descrip();
int /*<<< orphan*/ test_copy();
int /*<<< orphan*/ test_devnull();
int /*<<< orphan*/ test_multiple_descriptors();
int /*<<< orphan*/ test_open_path();
int /*<<< orphan*/ test_read();
int /*<<< orphan*/ test_readwrite();
int main(int argc, char **argv) {
  test_read();
  test_devnull();
  test_multiple_descriptors();
  test_readwrite();
  test_copy();
  test_bad_descrip();
  test_open_path();
  printf("Test passed!\n");
  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   1070 <test_read@plt>
mov    $0x0,%al
call   1090 <test_devnull@plt>
mov    $0x0,%al
call   10a0 <test_multiple_descriptors@plt>
mov    $0x0,%al
call   1060 <test_readwrite@plt>
mov    $0x0,%al
call   1030 <test_copy@plt>
mov    $0x0,%al
call   1040 <test_bad_descrip@plt>
mov    $0x0,%al
call   1080 <test_open_path@plt>
lea    0xe32(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <test_read@plt>
xor    %eax,%eax
call   1090 <test_devnull@plt>
xor    %eax,%eax
call   10a0 <test_multiple_descriptors@plt>
xor    %eax,%eax
call   1060 <test_readwrite@plt>
xor    %eax,%eax
call   1040 <test_copy@plt>
xor    %eax,%eax
call   1050 <test_bad_descrip@plt>
xor    %eax,%eax
call   1080 <test_open_path@plt>
lea    0xe47(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Test passed!\0A\00"
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_read()
%7 = call i32 (...) @test_devnull()
%8 = call i32 (...) @test_multiple_descriptors()
%9 = call i32 (...) @test_readwrite()
%10 = call i32 (...) @test_copy()
%11 = call i32 (...) @test_bad_descrip()
%12 = call i32 (...) @test_open_path()
%13 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Test passed!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_read()
%4 = tail call i32 (...) @test_devnull()
%5 = tail call i32 (...) @test_multiple_descriptors()
%6 = tail call i32 (...) @test_readwrite()
%7 = tail call i32 (...) @test_copy()
%8 = tail call i32 (...) @test_bad_descrip()
%9 = tail call i32 (...) @test_open_path()
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void I2CStretchClockEnable(unsigned long ulBase) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000000))) |= 0x00000080;
}


x86 assembly (clang, -O0):
<I2CStretchClockEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
or     $0x80,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CStretchClockEnable>:
orq    $0x80,(%rdi)
ret

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

LLVM IR (-O2):
define void @I2CStretchClockEnable(i64 %0) {
%2 = inttoptr i64 %0 to i64*
%3 = load volatile i64, i64* %2
%4 = or i64 %3, 128
store volatile i64 %4, i64* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printArray(int *, int);
int /*<<< orphan*/ quicksort(int *, int /*<<< orphan*/, int);
int main() {
  int arr[] = {1, 4, 3, 2, 5, 45, 11, 0, 13, 25};
  printArray(arr, 10);
  quicksort(arr, 0, 9);
  printArray(arr, 10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1050 <printArray@plt>
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x9,%edx
call   1030 <quicksort@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1050 <printArray@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
mov    0xef4(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebc(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1040 <printArray@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x9,%edx
call   1030 <quicksort@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1040 <printArray@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.arr = [10 x i32] [i32 1, i32 4, i32 3, i32 2, i32 5, i32 45, i32 11, i32 0, i32 13, i32 25]
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
store i32 0, i32* %1
%3 = bitcast [10 x i32]* %2 to i8*
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%5 = call i32 @printArray(i32* %4, i32 10)
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%7 = call i32 @quicksort(i32* %6, i32 0, i32 9)
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%9 = call i32 @printArray(i32* %8, i32 10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [10 x i32] [i32 1, i32 4, i32 3, i32 2, i32 5, i32 45, i32 11, i32 0, i32 13, i32 25]
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @printArray(i32* %3, i32 10)
%5 = call i32 @quicksort(i32* %3, i32 0, i32 9)
%6 = call i32 @printArray(i32* %3, i32 10)
ret i32 0
}
double minf(const double x, const double y) {
  if (x <= y) {
    return x;
  } else {
    return y;
  }
}


x86 assembly (clang, -O0):
<minf>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1131 <minf+0x31>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    113b <minf+0x3b>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<minf>:
movapd %xmm0,%xmm2
cmplesd %xmm1,%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @minf(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %5
%8 = fcmp ole double %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load double, double* %4
store double %10, double* %3
br label %13
11: ; preds = %2
%12 = load double, double* %5
store double %12, double* %3
br label %13
13: ; preds = %11, %9
%14 = load double, double* %3
ret double %14
}

LLVM IR (-O2):
define double @minf(double %0, double %1) {
%3 = fcmp ole double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
void test___atomic_fetch_and_2(int *mem) { __atomic_fetch_and(mem, 1, 4); }


x86 assembly (clang, -O0):
<test___atomic_fetch_and_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    %ecx,-0x18(%rbp)
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%esi
mov    %eax,%edx
and    %esi,%edx
lock cmpxchg %edx,(%rcx)
sete   %cl
mov    %eax,-0x24(%rbp)
test   $0x1,%cl
mov    %eax,-0x14(%rbp)
jne    114b <test___atomic_fetch_and_2+0x4b>
jmp    1122 <test___atomic_fetch_and_2+0x22>
mov    -0x24(%rbp),%eax
mov    %eax,-0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test___atomic_fetch_and_2>:
lock andl $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @test___atomic_fetch_and_2(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
store i32 1, i32* %3
%6 = load i32, i32* %3
%7 = atomicrmw and i32* %5, i32 %6 acq_rel
store i32 %7, i32* %4
%8 = load i32, i32* %4
ret void
}

LLVM IR (-O2):
define void @test___atomic_fetch_and_2(i32* nocapture %0) {
%2 = atomicrmw and i32* %0, i32 1 acq_rel
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(void *);
void *calloc(int, size_t const);
void *new (const void *type, ...) {
  const size_t size = *(const size_t *)type;
  void *p = calloc(1, size);
  assert(p);
  return p;
}


x86 assembly (clang, -O0):
<new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<new>:
push   %rbx
mov    (%rdi),%rsi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @new(i8* %0, ...) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to i64*
%7 = load i64, i64* %6
store i64 %7, i64* %3
%8 = load i64, i64* %3
%9 = call i8* @calloc(i32 1, i64 %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = call i32 @assert(i8* %10)
%12 = load i8*, i8** %4
ret i8* %12
}

LLVM IR (-O2):
define i8* @new(i8* nocapture %0, ...) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = tail call i8* @calloc(i32 1, i64 %3)
%5 = tail call i32 @assert(i8* %4)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, size_t);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *xmalloc(size_t sz) {
  void *data = NULL;
  if (!(data = malloc(sz))) {
    fprintf(stderr, "failed to malloc %Zu bytes, exiting\n", sz);
    exit(1);
  }
  return data;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    117e <xmalloc+0x4e>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe91(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <malloc@plt>
test   %rax,%rax
je     1140 <xmalloc+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"failed to malloc %Zu bytes, exiting\0A\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
store i8* null, i8** %3
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %12, label %7
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = load i64, i64* %2
%10 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i64 %9)
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"failed to malloc %Zu bytes, exiting\0A\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i64 %0)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, int);
int /*<<< orphan*/ stdout;
void print_json_exec(int proc_pid, int proc_tgid) {
  fprintf(stdout,
          "{\"type\": \"exec\" \"pid\": %d, "
          "\"tgid\": %d}\n",
          proc_pid, proc_tgid);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<print_json_exec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xebc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_json_exec>:
push   %rbx
mov    %esi,%ecx
mov    %edi,%edx
mov    0x2eb4(%rip),%rbx
mov    (%rbx),%edi
lea    0xecb(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [40 x i8] c"{\22type\22: \22exec\22 \22pid\22: %d, \22tgid\22: %d}\0A\00"
define void @print_json_exec(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @stdout
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
%9 = load i32, i32* @stdout
%10 = call i32 @fflush(i32 %9)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [40 x i8] c"{\22type\22: \22exec\22 \22pid\22: %d, \22tgid\22: %d}\0A\00"
define void @print_json_exec(i32 %0, i32 %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%5 = load i32, i32* @stdout
%6 = tail call i32 @fflush(i32 %5)
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int check_pw(char *guess) {
  char pw[] = "opensaysme";
  return (0 == strcmp(pw, guess));
}


x86 assembly (clang, -O0):
<check_pw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0xedd(%rip),%rax
mov    %rax,-0x13(%rbp)
mov    0xeda(%rip),%ax
mov    %ax,-0xb(%rbp)
mov    0xed2(%rip),%al
mov    %al,-0x9(%rbp)
lea    -0x13(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_pw>:
sub    $0x18,%rsp
mov    %rdi,%rsi
movabs $0x737961736e65706f,%rax
61 79 73
mov    %rax,0x8(%rsp)
movl   $0x656d73,0xf(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.check_pw.pw = [11 x i8] c"opensaysme\00"
define i32 @check_pw(i8* %0) {
%2 = alloca i8*
%3 = alloca [11 x i8]
store i8* %0, i8** %2
%4 = bitcast [11 x i8]* %3 to i8*
%5 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 0
%6 = load i8*, i8** %2
%7 = call i64 @strcmp(i8* %5, i8* %6)
%8 = icmp eq i64 0, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
@__const.check_pw.pw = [11 x i8] c"opensaysme\00"
define i32 @check_pw(i8* %0) {
%2 = alloca [11 x i8]
%3 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%4 = call i64 @strcmp(i8* %3, i8* %0)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
_Bool Int__EQ_(int x, int y) { return x == y; }


x86 assembly (clang, -O0):
<Int__EQ_>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Int__EQ_>:
cmp    %esi,%edi
sete   %al
ret

LLVM IR (-O0):
define zeroext i1 @Int__EQ_(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 eq i32 %5, %6
ret i1 %7
}

LLVM IR (-O2):
define zeroext i1 @Int__EQ_(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
ret i1 %3
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SYS_futex;
int syscall(int /*<<< orphan*/, int *, int, int, struct timespec const *, int *,
            int);
int futex(int *uaddr, int futex_op, int val, const struct timespec *timeout,
          int *uaddr2, int val3) {
  return syscall(SYS_futex, uaddr, futex_op, val, timeout, uaddr2, val3);
}


x86 assembly (clang, -O0):
<futex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
mov    -0x24(%rbp),%eax
mov    %eax,(%rsp)
call   1030 <syscall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<futex>:
push   %rax
mov    %r8,%rax
mov    %rcx,%r8
mov    %edx,%ecx
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ebb(%rip),%rdi
mov    (%rdi),%edi
mov    %r9d,(%rsp)
mov    %rax,%r9
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@SYS_futex = global i32 0
define i32 @futex(i32* %0, i32 %1, i32 %2, %struct.timespec* %3, i32* %4, i32 %5) {
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca %struct.timespec*
%11 = alloca i32*
%12 = alloca i32
store i32* %0, i32** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store %struct.timespec* %3, %struct.timespec** %10
store i32* %4, i32** %11
store i32 %5, i32* %12
%13 = load i32, i32* @SYS_futex
%14 = load i32*, i32** %7
%15 = load i32, i32* %8
%16 = load i32, i32* %9
%17 = load %struct.timespec*, %struct.timespec** %10
%18 = load i32*, i32** %11
%19 = load i32, i32* %12
%20 = call i32 @syscall(i32 %13, i32* %14, i32 %15, i32 %16, %struct.timespec* %17, i32* %18, i32 %19)
ret i32 %20
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@SYS_futex = global i32 0
define i32 @futex(i32* %0, i32 %1, i32 %2, %struct.timespec* %3, i32* %4, i32 %5) {
%7 = load i32, i32* @SYS_futex
%8 = tail call i32 @syscall(i32 %7, i32* %0, i32 %1, i32 %2, %struct.timespec* %3, i32* %4, i32 %5)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ alloc_failed();
size_t add(size_t a, size_t b) {
  size_t sum = a + b;
  if (sum < a)
    alloc_failed();
  return sum;
}


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    1141 <add+0x31>
mov    $0x0,%al
call   1030 <alloc_failed@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
push   %rbx
mov    %rdi,%rbx
add    %rsi,%rbx
jae    1120 <add+0x10>
xor    %eax,%eax
call   1030 <alloc_failed@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @add(i64 %0, i64 %1) {
%3 = add i64 %1, %0
%4 = icmp ult i64 %3, %0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @alloc_failed()
br label %7
7: ; preds = %5, %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ OTDR(int, int, int, int);
void op_ED_0xbb(void) {
  OTDR(12, 17, 5, 9);
  return;
}


x86 assembly (clang, -O0):
<op_ED_0xbb>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc,%edi
mov    $0x11,%esi
mov    $0x5,%edx
mov    $0x9,%ecx
call   1030 <OTDR@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_ED_0xbb>:
mov    $0xc,%edi
mov    $0x11,%esi
mov    $0x5,%edx
mov    $0x9,%ecx
jmp    1030 <OTDR@plt>

LLVM IR (-O0):
define void @op_ED_0xbb() {
%1 = call i32 @OTDR(i32 12, i32 17, i32 5, i32 9)
ret void
}

LLVM IR (-O2):
define void @op_ED_0xbb() {
%1 = tail call i32 @OTDR(i32 12, i32 17, i32 5, i32 9)
ret void
}
/* Variables and functions */
double cos(double);
double g(double x) { return cos(x); }


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

x86 assembly (clang, -O2):
<g>:
jmp    1030 <cos@plt>

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

LLVM IR (-O2):
define double @g(double %0) {
%2 = tail call double @cos(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ set_io_bit(int, int);
void TOSH_SET_RFM_CTL1_PIN() { set_io_bit(0x43, 6); }


x86 assembly (clang, -O0):
<TOSH_SET_RFM_CTL1_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0x43,%edi
mov    $0x6,%esi
call   1030 <set_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_SET_RFM_CTL1_PIN>:
mov    $0x43,%edi
mov    $0x6,%esi
jmp    1030 <set_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_SET_RFM_CTL1_PIN() {
%1 = call i32 @set_io_bit(i32 67, i32 6)
ret void
}

LLVM IR (-O2):
define void @TOSH_SET_RFM_CTL1_PIN() {
%1 = tail call i32 @set_io_bit(i32 67, i32 6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CMT1_delay_core(int, int);
void CMT1_delay_ms(int n) { CMT1_delay_core(2500, n); }


x86 assembly (clang, -O0):
<CMT1_delay_ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x9c4,%edi
call   1030 <CMT1_delay_core@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CMT1_delay_ms>:
mov    %edi,%esi
mov    $0x9c4,%edi
jmp    1030 <CMT1_delay_core@plt>

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

LLVM IR (-O2):
define void @CMT1_delay_ms(i32 %0) {
%2 = tail call i32 @CMT1_delay_core(i32 2500, i32 %0)
ret void
}
/* Variables and functions */
scalar_t__ rintf(float);
long lrintf(float x) { return (long)rintf(x); }


x86 assembly (clang, -O0):
<lrintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <rintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lrintf>:
jmp    1030 <rintf@plt>

LLVM IR (-O0):
define i64 @lrintf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @rintf(float %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @lrintf(float %0) {
%2 = tail call i64 @rintf(float %0)
ret i64 %2
}
void VIDSoftResize(unsigned int w, unsigned int h, int on) {}


x86 assembly (clang, -O0):
<VIDSoftResize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @VIDSoftResize(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
define void @VIDSoftResize(i32 %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, float *);
float get_p(void) {
  float P;
  printf("Provide a value for P (pitch diameter of pinion): ");
  scanf("%f", &P);
  assert(P > 0);
  return P;
}


x86 assembly (clang, -O0):
<get_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_p>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
lea    0xeef(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
movss  0x4(%rsp),%xmm0
xorps  %xmm1,%xmm1
xor    %edi,%edi
ucomiss %xmm1,%xmm0
seta   %dil
call   1040 <assert@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [51 x i8] c"Provide a value for P (pitch diameter of pinion): \00"
@.str.1 = [3 x i8] c"%f\00"
define float @get_p() {
%1 = alloca float
%2 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%4 = load float, float* %1
%5 = fcmp ogt float %4, 0.000000e+00
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load float, float* %1
ret float %8
}

LLVM IR (-O2):
@.str = [51 x i8] c"Provide a value for P (pitch diameter of pinion): \00"
@.str.1 = [3 x i8] c"%f\00"
define float @get_p() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = fcmp ogt float %5, 0.000000e+00
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load float, float* %1
ret float %9
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: moveit -a servera -b serverb [-n num] [-B bid]"
                  " [-v vbucketmigrator] [-o options]\n");
  exit(EXIT_FAILURE);
}


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    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [89 x i8] c"Usage: moveit -a servera -b serverb [-n num] [-B bid] [-v vbucketmigrator] [-o options]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [89 x i8] c"Usage: moveit -a servera -b serverb [-n num] [-B bid] [-v vbucketmigrator] [-o options]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
void foo318() {}


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

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

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

LLVM IR (-O2):
define void @foo318() {
ret void
}
long long longlong_ignoring_shortint(long long x, short int y) { return x; }


x86 assembly (clang, -O0):
<longlong_ignoring_shortint>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @longlong_ignoring_shortint(i64 %0, i16 signext %1) {
%3 = alloca i64
%4 = alloca i16
store i64 %0, i64* %3
store i16 %1, i16* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @longlong_ignoring_shortint(i64 returned %0, i16 signext %1) {
ret i64 %0
}
int cmp(void *a, void *b) {
  int *x = a, *y = b;
  return *x - *y;
}


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = sub nsw i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %5, %6
ret i32 %7
}
void msm_watchdog_reset(unsigned int timeout) {}


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

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

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

LLVM IR (-O2):
define void @msm_watchdog_reset(i32 %0) {
ret void
}
void or32_nop(struct CPU *cpu, struct control *cont) {
  cpu = cpu;
  cont = cont;
}


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

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

LLVM IR (-O0):
%struct.CPU = type opaque
%struct.control = type opaque
define void @or32_nop(%struct.CPU* %0, %struct.control* %1) {
%3 = alloca %struct.CPU*
%4 = alloca %struct.control*
store %struct.CPU* %0, %struct.CPU** %3
store %struct.control* %1, %struct.control** %4
%5 = load %struct.CPU*, %struct.CPU** %3
store %struct.CPU* %5, %struct.CPU** %3
%6 = load %struct.control*, %struct.control** %4
store %struct.control* %6, %struct.control** %4
ret void
}

LLVM IR (-O2):
%struct.CPU = type opaque
%struct.control = type opaque
define void @or32_nop(%struct.CPU* nocapture %0, %struct.control* nocapture %1) {
ret void
}
float MakeComparisonDistance(float shadowBufferDepth, int slice) {
  return shadowBufferDepth;
}


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

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

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

LLVM IR (-O2):
define float @MakeComparisonDistance(float returned %0, i32 %1) {
ret float %0
}
/* Type definitions */
struct TreeNode {
  int dummy;
};

/* Variables and functions */
struct TreeNode *helper(char **);
struct TreeNode *deserialize(char *s) {
  return helper(&s);
}


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

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

LLVM IR (-O0):
%struct.TreeNode = type { i32 }
define %struct.TreeNode* @deserialize(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call %struct.TreeNode* @helper(i8** %2)
ret %struct.TreeNode* %3
}

LLVM IR (-O2):
%struct.TreeNode = type { i32 }
define %struct.TreeNode* @deserialize(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call %struct.TreeNode* @helper(i8** %2)
ret %struct.TreeNode* %3
}