xunge/DecIR huggingface dataset:
void initIR() {
  (*(unsigned int *)0x4000C018) |= 12000;
  (*(unsigned int *)0xE000E104) |= 0x200;
  (*(unsigned int *)0x4000C014) |= 3;
}


x86 assembly (clang, -O0):
<initIR>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4000c018,%eax
mov    (%rax),%ecx
or     $0x2ee0,%ecx
mov    $0x4000c018,%eax
mov    %ecx,(%rax)
mov    $0xe000e104,%eax
mov    (%rax),%ecx
or     $0x200,%ecx
mov    $0xe000e104,%eax
mov    %ecx,(%rax)
mov    $0x4000c014,%eax
mov    (%rax),%ecx
or     $0x3,%ecx
mov    $0x4000c014,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<initIR>:
orl    $0x2ee0,0x4000c018
mov    $0xe000e104,%eax
orb    $0x2,0x1(%rax)
orb    $0x3,0x4000c014
03
ret

LLVM IR (-O0):
define void @initIR() {
%1 = load i32, i32* inttoptr (i64 1073791000 to i32*)
%2 = or i32 %1, 12000
store i32 %2, i32* inttoptr (i64 1073791000 to i32*)
%3 = load i32, i32* inttoptr (i64 3758153988 to i32*)
%4 = or i32 %3, 512
store i32 %4, i32* inttoptr (i64 3758153988 to i32*)
%5 = load i32, i32* inttoptr (i64 1073790996 to i32*)
%6 = or i32 %5, 3
store i32 %6, i32* inttoptr (i64 1073790996 to i32*)
ret void
}

LLVM IR (-O2):
define void @initIR() {
%1 = load i32, i32* inttoptr (i64 1073791000 to i32*)
%2 = or i32 %1, 12000
store i32 %2, i32* inttoptr (i64 1073791000 to i32*)
%3 = load i32, i32* inttoptr (i64 3758153988 to i32*)
%4 = or i32 %3, 512
store i32 %4, i32* inttoptr (i64 3758153988 to i32*)
%5 = load i32, i32* inttoptr (i64 1073790996 to i32*)
%6 = or i32 %5, 3
store i32 %6, i32* inttoptr (i64 1073790996 to i32*)
ret void
}
float __glsl_max(float x, float y) { return x > y ? x : y; }


x86 assembly (clang, -O0):
<__glsl_max>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    112c <__glsl_max+0x2c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1136 <__glsl_max+0x36>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<__glsl_max>:
maxss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @__glsl_max(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp ogt float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %3
br label %12
10: ; preds = %2
%11 = load float, float* %4
br label %12
12: ; preds = %10, %8
%13 = phi float [ %9, %8 ], [ %11, %10 ]
ret float %13
}

LLVM IR (-O2):
define float @__glsl_max(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
void run_msdos(void) { return; }


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

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

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

LLVM IR (-O2):
define void @run_msdos() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void flush(void) { fflush(stdout); }


x86 assembly (clang, -O0):
<flush>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<flush>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @flush() {
%1 = load i32, i32* @stdout
%2 = call i32 @fflush(i32 %1)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @flush() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fflush(i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ j64_eobj_encode(char *, int);
int /*<<< orphan*/ memset(char *, char, int);
scalar_t__ strcmp(char *, char *);
int test_eobj_encode_2(void) {
  char buf[2 + 1];
  memset(buf, '\0', sizeof(buf));
  j64_eobj_encode(buf, 2);
  return strcmp(buf, "{}") == 0;
}


x86 assembly (clang, -O0):
<test_eobj_encode_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x3(%rbp),%rdi
xor    %esi,%esi
mov    $0x3,%edx
call   1040 <memset@plt>
lea    -0x3(%rbp),%rdi
mov    $0x2,%esi
call   1030 <j64_eobj_encode@plt>
lea    -0x3(%rbp),%rdi
lea    0xe9f(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_eobj_encode_2>:
push   %rbx
sub    $0x10,%rsp
lea    0xd(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x3,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <j64_eobj_encode@plt>
lea    0xea3(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"{}\00"
define i32 @test_eobj_encode_2() {
%1 = alloca [3 x i8]
%2 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i8 signext 0, i32 3)
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%5 = call i32 @j64_eobj_encode(i8* %4, i32 2)
%6 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%7 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
@.str = [3 x i8] c"{}\00"
define i32 @test_eobj_encode_2() {
%1 = alloca [3 x i8]
%2 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i8 signext 0, i32 3)
%4 = call i32 @j64_eobj_encode(i8* %2, i32 2)
%5 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0xb4() {
  Assert_real((isalnum(180) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalnum.c",
              905, ("isalnum should be 0 for 0xb4"));
}


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

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

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xb4\00"
define void @t_isalnum_0xb4() {
%1 = call i64 @isalnum(i32 180)
%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 905, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xb4\00"
define void @t_isalnum_0xb4() {
%1 = tail call i64 @isalnum(i32 180)
%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 905, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print(char *, int);
int /*<<< orphan*/ read(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  char c[100];
  int n;
  read(c);
  scanf("%d", &n);
  print(c, n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
call   1040 <read@plt>
lea    0xeae(%rip),%rdi
lea    -0x74(%rbp),%rsi
call   1050 <scanf@plt>
lea    -0x70(%rbp),%rdi
mov    -0x74(%rbp),%esi
call   1030 <print@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = bitcast i32* %2 to i8*
%5 = call i32 @read(i8* %3)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
%8 = call i32 @print(i8* %3, i32 %7)
ret i32 0
}
/* Variables and functions */
int file_write(char const *, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
int file_writenum(const char *fname, int val) {
  char buff[10];
  snprintf(buff, 10, "%d\n", val);
  return file_write(fname, buff);
}


x86 assembly (clang, -O0):
<file_writenum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x16(%rbp),%rdi
mov    -0xc(%rbp),%ecx
mov    $0xa,%esi
lea    0xebe(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x16(%rbp),%rsi
call   1040 <file_write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_writenum>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %esi,%ecx
mov    %rdi,%rbx
lea    0xecd(%rip),%rdx
lea    0xe(%rsp),%r14
mov    %r14,%rdi
mov    $0xa,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <file_write@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @file_writenum(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [10 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %4
%8 = call i32 @snprintf(i8* %6, i32 10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i8*, i8** %3
%10 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%11 = call i32 @file_write(i8* %9, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @file_writenum(i8* %0, i32 %1) {
%3 = alloca [10 x i8]
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%6 = call i32 @file_write(i8* %0, i8* %4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ qSort(int *, int /*<<< orphan*/, int);
void quickSort(int a[], int n) { qSort(a, 0, n - 1); }


x86 assembly (clang, -O0):
<quickSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1030 <qSort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quickSort>:
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <qSort@plt>

LLVM IR (-O0):
define void @quickSort(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 = sub nsw i32 %6, 1
%8 = call i32 @qSort(i32* %5, i32 0, i32 %7)
ret void
}

LLVM IR (-O2):
define void @quickSort(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @qSort(i32* %0, i32 0, i32 %3)
ret void
}
void ScaleSlope() {}


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

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

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

LLVM IR (-O2):
define void @ScaleSlope() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_ext_device_manager_read() {
  printf("NOT IMPLEMENTED:"
         "pa_ext_device_manager_read"
         "\n");
}


x86 assembly (clang, -O0):
<pa_ext_device_manager_read>:
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_ext_device_manager_read>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [43 x i8] c"NOT IMPLEMENTED:pa_ext_device_manager_read\00"
define i32 @pa_ext_device_manager_read() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void infoSetStopHits(void) {
  printf("Stop after arg words are generated.%s", "\n");
}


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

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

LLVM IR (-O0):
@.str = [38 x i8] c"Stop after arg words are generated.%s\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @infoSetStopHits() {
%1 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"Stop after arg words are generated.%s\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @infoSetStopHits() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
void printValue(unsigned int n) { printf("%u ", n); }


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

x86 assembly (clang, -O2):
<printValue>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%u \00"
define void @printValue(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)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%u \00"
define void @printValue(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
void print_node(void *data) { printf("%lu ", (int64_t)data); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%lu \00"
define void @print_node(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void dump_array(char **str) {
  while (**str != '\0') {
    printf("%c\n", **str);
    (*str)++;
  }
}


x86 assembly (clang, -O0):
<dump_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1158 <dump_array+0x48>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
lea    0xec3(%rip),%rdi
movsbl (%rax),%esi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    111c <dump_array+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_array>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%rax
mov    (%rax),%al
test   %al,%al
je     114d <dump_array+0x3d>
mov    %rdi,%rbx
lea    0xed9(%rip),%r14
nopw   0x0(%rax,%rax,1)
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    (%rbx),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rbx)
movzbl 0x1(%rax),%eax
test   %al,%al
jne    1130 <dump_array+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%c\0A\00"
define void @dump_array(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %1, %5
%6 = phi i8 [ %10, %5 ], [ %3, %1 ]
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %6)
%8 = load i8*, i8** %0
%9 = getelementptr inbounds i8, i8* %8, i64 1
store i8* %9, i8** %0
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _SC_OPEN_MAX;
int /*<<< orphan*/ close(int /*<<< orphan*/);
int sysconf(int /*<<< orphan*/);
void closeall(int fd) {
  int fdlimit = sysconf(_SC_OPEN_MAX);
  while (fd < fdlimit)
    close(fd++);
}


x86 assembly (clang, -O0):
<closeall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    115d <closeall+0x3d>
mov    -0x4(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
call   1030 <close@plt>
jmp    113c <closeall+0x1c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closeall>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
cmp    %ebx,%eax
jle    1151 <closeall+0x31>
mov    %eax,%r14d
nopl   0x0(%rax,%rax,1)
lea    0x1(%rbx),%ebp
mov    %ebx,%edi
call   1030 <close@plt>
mov    %ebp,%ebx
cmp    %ebp,%r14d
jne    1140 <closeall+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@_SC_OPEN_MAX = global i32 0
define void @closeall(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* @_SC_OPEN_MAX
%5 = call i32 @sysconf(i32 %4)
store i32 %5, i32* %3
br label %6
6: ; preds = %10, %1
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
%13 = call i32 @close(i32 %11)
br label %6
14: ; preds = %6
ret void
}

LLVM IR (-O2):
@_SC_OPEN_MAX = global i32 0
define void @closeall(i32 %0) {
%2 = load i32, i32* @_SC_OPEN_MAX
%3 = tail call i32 @sysconf(i32 %2)
%4 = icmp sgt i32 %3, %0
br i1 %4, label %5, label %10
5: ; preds = %1, %5
%6 = phi i32 [ %7, %5 ], [ %0, %1 ]
%7 = add i32 %6, 1
%8 = tail call i32 @close(i32 %6)
%9 = icmp eq i32 %7, %3
br i1 %9, label %10, label %5
10: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sem_timedwait(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int main(void) {
  sem_timedwait(NULL, NULL);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @sem_timedwait(i32* null, i32* null)
ret i32 0
}
void CONF_get_number(void) {}


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

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

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

LLVM IR (-O2):
define void @CONF_get_number() {
ret void
}
long fib(int x) {
  if (x == 0 || x == 1)
    return 1;
  else
    return fib(x - 1) + fib(x - 2);
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     112f <fib+0x1f>
cmpl   $0x1,-0xc(%rbp)
jne    113c <fib+0x2c>
movq   $0x1,-0x8(%rbp)
jmp    1164 <fib+0x54>
mov    -0xc(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%r14d
cmp    $0x2,%edi
jb     1147 <fib+0x37>
mov    %edi,%ebx
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    -0x1(%rbx),%edi
call   1030 <fib@plt>
add    $0xfffffffe,%ebx
add    %rax,%r14
cmp    $0x1,%ebx
ja     1130 <fib+0x20>
add    $0x1,%r14
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @fib(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i64 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i64 @fib(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i64 %7, %5
%10 = icmp ult i32 %8, 2
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = add i64 %9, 1
br label %13
13: ; preds = %11, %1
%14 = phi i64 [ 1, %1 ], [ %12, %11 ]
ret i64 %14
}
int iFunAdd(int a, int b) { return a + b; }


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

x86 assembly (clang, -O2):
<iFunAdd>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @iFunAdd(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @iFunAdd(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
char *concatenate(char *, char *, int, char const *, char const *);
char *get_task_launcher_file(const char *job_dir, const char *attempt_dir) {
  return concatenate("%s/%s/taskjvm.sh", "task_script_path", 2, job_dir,
                     attempt_dir);
}


x86 assembly (clang, -O0):
<get_task_launcher_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
lea    0xed1(%rip),%rdi
lea    0xedb(%rip),%rsi
mov    $0x2,%edx
call   1030 <concatenate@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_task_launcher_file>:
mov    %rsi,%r8
mov    %rdi,%rcx
lea    0xee3(%rip),%rdi
lea    0xeed(%rip),%rsi
mov    $0x2,%edx
jmp    1030 <concatenate@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"%s/%s/taskjvm.sh\00"
@.str.1 = [17 x i8] c"task_script_path\00"
define i8* @get_task_launcher_file(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i8* @concatenate(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 2, i8* %5, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
@.str = [17 x i8] c"%s/%s/taskjvm.sh\00"
@.str.1 = [17 x i8] c"task_script_path\00"
define i8* @get_task_launcher_file(i8* %0, i8* %1) {
%3 = tail call i8* @concatenate(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 2, i8* %0, i8* %1)
ret i8* %3
}
/* Type definitions */
struct memorycontainer {
  int dummy;
};

/* Variables and functions */
struct memorycontainer *
createUnaryGeneralMathsExpression(struct memorycontainer *, int);
struct memorycontainer *
createATanExpression(struct memorycontainer *expression) {
  return createUnaryGeneralMathsExpression(expression, 0x0006);
}


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

x86 assembly (clang, -O2):
<createATanExpression>:
mov    $0x6,%esi
jmp    1030 <createUnaryGeneralMathsExpression@plt>

LLVM IR (-O0):
%struct.memorycontainer = type { i32 }
define %struct.memorycontainer* @createATanExpression(%struct.memorycontainer* %0) {
%2 = alloca %struct.memorycontainer*
store %struct.memorycontainer* %0, %struct.memorycontainer** %2
%3 = load %struct.memorycontainer*, %struct.memorycontainer** %2
%4 = call %struct.memorycontainer* @createUnaryGeneralMathsExpression(%struct.memorycontainer* %3, i32 6)
ret %struct.memorycontainer* %4
}

LLVM IR (-O2):
%struct.memorycontainer = type { i32 }
define %struct.memorycontainer* @createATanExpression(%struct.memorycontainer* %0) {
%2 = tail call %struct.memorycontainer* @createUnaryGeneralMathsExpression(%struct.memorycontainer* %0, i32 6)
ret %struct.memorycontainer* %2
}
long long int wbt_mq_msg_status_waiting_ack() { return 0; }


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

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

LLVM IR (-O0):
define i64 @wbt_mq_msg_status_waiting_ack() {
ret i64 0
}

LLVM IR (-O2):
define i64 @wbt_mq_msg_status_waiting_ack() {
ret i64 0
}
void write16u(unsigned char *s, unsigned short i, int bigendian) {
  if (bigendian) {
    s[1] = (i >> 8) & 0xff;
    s[0] = (i >> 0) & 0xff;
  } else {
    s[0] = (i >> 8) & 0xff;
    s[1] = (i >> 0) & 0xff;
  }
}


x86 assembly (clang, -O0):
<write16u>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     114a <write16u+0x4a>
movzwl -0xa(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
movzwl -0xa(%rbp),%eax
sar    $0x0,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
jmp    1173 <write16u+0x73>
movzwl -0xa(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
movzwl -0xa(%rbp),%eax
sar    $0x0,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<write16u>:
mov    %esi,%eax
shr    $0x8,%eax
test   %edx,%edx
mov    %esi,%ecx
cmove  %eax,%ecx
mov    %cl,(%rdi)
cmove  %esi,%eax
mov    %al,0x1(%rdi)
ret

LLVM IR (-O0):
define void @write16u(i8* %0, i16 zeroext %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i16
%6 = alloca i32
store i8* %0, i8** %4
store i16 %1, i16* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %24
9: ; preds = %3
%10 = load i16, i16* %5
%11 = zext i16 %10 to i32
%12 = ashr i32 %11, 8
%13 = and i32 %12, 255
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 %14, i8* %16
%17 = load i16, i16* %5
%18 = zext i16 %17 to i32
%19 = ashr i32 %18, 0
%20 = and i32 %19, 255
%21 = trunc i32 %20 to i8
%22 = load i8*, i8** %4
%23 = getelementptr inbounds i8, i8* %22, i64 0
store i8 %21, i8* %23
br label %39
24: ; preds = %3
%25 = load i16, i16* %5
%26 = zext i16 %25 to i32
%27 = ashr i32 %26, 8
%28 = and i32 %27, 255
%29 = trunc i32 %28 to i8
%30 = load i8*, i8** %4
%31 = getelementptr inbounds i8, i8* %30, i64 0
store i8 %29, i8* %31
%32 = load i16, i16* %5
%33 = zext i16 %32 to i32
%34 = ashr i32 %33, 0
%35 = and i32 %34, 255
%36 = trunc i32 %35 to i8
%37 = load i8*, i8** %4
%38 = getelementptr inbounds i8, i8* %37, i64 1
store i8 %36, i8* %38
br label %39
39: ; preds = %24, %9
ret void
}

LLVM IR (-O2):
define void @write16u(i8* nocapture writeonly %0, i16 zeroext %1, i32 %2) {
%4 = icmp eq i32 %2, 0
%5 = lshr i16 %1, 8
%6 = select i1 %4, i16 %5, i16 %1
%7 = select i1 %4, i16 %1, i16 %5
%8 = trunc i16 %6 to i8
store i8 %8, i8* %0
%9 = trunc i16 %7 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %9, i8* %10
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
int /*<<< orphan*/ printid(float *);
int main() {
  float a[2] = {2, 3};
  a[1] *= a[0];
  print("a 2.000000 6.000000");
  printid(a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
lea    0xeb8(%rip),%rdi
call   1030 <print@plt>
lea    -0xc(%rbp),%rdi
call   1040 <printid@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movabs $0x4040000040000000,%rax
mov    %rax,(%rsp)
movl   $0x40c00000,0x4(%rsp)
40
lea    0xec2(%rip),%rdi
call   1030 <print@plt>
mov    %rsp,%rdi
call   1040 <printid@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.a = [2 x float] [float 2.000000e+00, float 3.000000e+00]
@.str = [20 x i8] c"a 2.000000 6.000000\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x float]
store i32 0, i32* %1
%3 = bitcast [2 x float]* %2 to i8*
%4 = getelementptr inbounds [2 x float], [2 x float]* %2, i64 0, i64 0
%5 = load float, float* %4
%6 = getelementptr inbounds [2 x float], [2 x float]* %2, i64 0, i64 1
%7 = load float, float* %6
%8 = fmul float %7, %5
store float %8, float* %6
%9 = call i32 @print(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%10 = getelementptr inbounds [2 x float], [2 x float]* %2, i64 0, i64 0
%11 = call i32 @printid(float* %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"a 2.000000 6.000000\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to [2 x float]*
%3 = bitcast i64* %1 to i8*
store i64 4629700418010611712, i64* %1
%4 = bitcast i64* %1 to float*
%5 = getelementptr inbounds [2 x float], [2 x float]* %2, i64 0, i64 1
store float 6.000000e+00, float* %5
%6 = tail call i32 @print(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printid(float* %4)
ret i32 0
}
int main() {
  int asdf[] = {1, 2, 3};
  return asdf[2];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0xeee(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xeec(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.asdf = [3 x i32] [i32 1, i32 2, i32 3]
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
store i32 0, i32* %1
%3 = bitcast [3 x i32]* %2 to i8*
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 2
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
ret i32 3
}
int dbl_cmp(double *x, double *y) {
  double tmp;
  tmp = *x - *y;
  return (tmp > 0 ? 1 : tmp < 0 ? -1 : 0);
}


x86 assembly (clang, -O0):
<dbl_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1140 <dbl_cmp+0x40>
mov    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1159 <dbl_cmp+0x59>
movsd  -0x18(%rbp),%xmm1
xorps  %xmm0,%xmm0
xor    %eax,%eax
mov    $0xffffffff,%ecx
ucomisd %xmm1,%xmm0
cmova  %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbl_cmp>:
movsd  (%rdi),%xmm0
subsd  (%rsi),%xmm0
xorpd  %xmm1,%xmm1
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
neg    %ecx
ucomisd %xmm1,%xmm0
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @dbl_cmp(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%6 = load double*, double** %3
%7 = load double, double* %6
%8 = load double*, double** %4
%9 = load double, double* %8
%10 = fsub double %7, %9
store double %10, double* %5
%11 = load double, double* %5
%12 = fcmp ogt double %11, 0.000000e+00
br i1 %12, label %13, label %14
13: ; preds = %2
br label %19
14: ; preds = %2
%15 = load double, double* %5
%16 = fcmp olt double %15, 0.000000e+00
%17 = zext i1 %16 to i64
%18 = select i1 %16, i32 -1, i32 0
br label %19
19: ; preds = %14, %13
%20 = phi i32 [ 1, %13 ], [ %18, %14 ]
ret i32 %20
}

LLVM IR (-O2):
define i32 @dbl_cmp(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = fsub double %3, %4
%6 = fcmp ogt double %5, 0.000000e+00
%7 = fcmp olt double %5, 0.000000e+00
%8 = sext i1 %7 to i32
%9 = select i1 %6, i32 1, i32 %8
ret i32 %9
}
signed char signedchar_ignoring_longdouble(signed char x, long double y) {
  return x;
}


x86 assembly (clang, -O0):
<signedchar_ignoring_longdouble>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
fldt   0x10(%rbp)
mov    %al,-0x1(%rbp)
fstpt  -0x20(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<signedchar_ignoring_longdouble>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define signext i8 @signedchar_ignoring_longdouble(i8 returned signext %0, x86_fp80 %1) {
ret i8 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ perror(char *);
FILE *d_open_op_file(char *fname) {
  FILE *fp;
  fp = fopen(fname, "w");
  if (fp == NULL) {
    perror("File open failed\n");
    exit(1);
  }
  return fp;
}


x86 assembly (clang, -O0):
<d_open_op_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1030 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1171 <d_open_op_file+0x41>
lea    0xea0(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_open_op_file>:
push   %rax
lea    0xec8(%rip),%rsi
call   1030 <fopen@plt>
test   %rax,%rax
je     1144 <d_open_op_file+0x14>
pop    %rcx
ret
lea    0xeb7(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
@.str.1 = [18 x i8] c"File open failed\0A\00"
define i32* @d_open_op_file(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = icmp eq i32* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %1
%12 = load i32*, i32** %3
ret i32* %12
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
@.str.1 = [18 x i8] c"File open failed\0A\00"
define noalias i32* @d_open_op_file(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int fs_lssec(char *parameter) { fprintf(stderr, "lssec: UNDER DEVELOPMENT\n"); }


x86 assembly (clang, -O0):
<fs_lssec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    0xed4(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fs_lssec>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"lssec: UNDER DEVELOPMENT\0A\00"
define i32 @fs_lssec(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i32, i32* @stderr
%5 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"lssec: UNDER DEVELOPMENT\0A\00"
define i32 @fs_lssec(i8* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int dlink_is_empty();
int is_empty() { return dlink_is_empty(); }


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

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

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

LLVM IR (-O2):
define i32 @is_empty() {
%1 = tail call i32 (...) @dlink_is_empty()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
void closeWithError(char *error) {
  char errMsj[50];
  sprintf(errMsj,
          "\x1B[31m"
          "%s"
          "\033[0m",
          error);
  perror(errMsj);
  exit(1);
}


x86 assembly (clang, -O0):
<closeWithError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xeb5(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x40(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<closeWithError>:
push   %rbx
sub    $0x40,%rsp
mov    %rdi,%rdx
lea    0xec1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"\1B[31m%s\1B[0m\00"
define void @closeWithError(i8* %0) {
%2 = alloca i8*
%3 = alloca [50 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%8 = call i32 @perror(i8* %7)
%9 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [12 x i8] c"\1B[31m%s\1B[0m\00"
define void @closeWithError(i8* %0) {
%2 = alloca [50 x i8]
%3 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @perror(i8* %3)
%6 = tail call i32 @exit(i32 1)
unreachable
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ height;
};
struct TYPE_4__ {
  TYPE_1__ xconfigurerequest;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xconfigurerequest_height(void *_p) {
  return (int)((XEvent *)_p)->xconfigurerequest.height;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i32 @get_XEvent_xconfigurerequest_height(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @get_XEvent_xconfigurerequest_height(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
int b2() { return 3; }


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

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

LLVM IR (-O0):
define i32 @b2() {
ret i32 3
}

LLVM IR (-O2):
define i32 @b2() {
ret i32 3
}
/* Variables and functions */
int /*<<< orphan*/ GL_BLEND;
int /*<<< orphan*/ GL_ONE;
int /*<<< orphan*/ glBlendFunc(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ glClearColor(double, double, double, double);
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
void init(void) {
  glClearColor(1.0, 1.0, 0.0, 0.0);
  glBlendFunc(GL_ONE, GL_ONE);
  glEnable(GL_BLEND);
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
movsd  0xec4(%rip),%xmm1
xorps  %xmm3,%xmm3
movaps %xmm1,%xmm0
movaps %xmm3,%xmm2
call   1050 <glClearColor@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
mov    0x2e7e(%rip),%rax
mov    (%rax),%esi
call   1030 <glBlendFunc@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
call   1040 <glEnable@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
movsd  0xec7(%rip),%xmm0
xorps  %xmm2,%xmm2
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm1
call   1050 <glClearColor@plt>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
mov    %edi,%esi
call   1030 <glBlendFunc@plt>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <glEnable@plt>

LLVM IR (-O0):
@GL_ONE = global i32 0
@GL_BLEND = global i32 0
define void @init() {
%1 = call i32 @glClearColor(double 1.000000e+00, double 1.000000e+00, double 0.000000e+00, double 0.000000e+00)
%2 = load i32, i32* @GL_ONE
%3 = load i32, i32* @GL_ONE
%4 = call i32 @glBlendFunc(i32 %2, i32 %3)
%5 = load i32, i32* @GL_BLEND
%6 = call i32 @glEnable(i32 %5)
ret void
}

LLVM IR (-O2):
@GL_ONE = global i32 0
@GL_BLEND = global i32 0
define void @init() {
%1 = tail call i32 @glClearColor(double 1.000000e+00, double 1.000000e+00, double 0.000000e+00, double 0.000000e+00)
%2 = load i32, i32* @GL_ONE
%3 = tail call i32 @glBlendFunc(i32 %2, i32 %2)
%4 = load i32, i32* @GL_BLEND
%5 = tail call i32 @glEnable(i32 %4)
ret void
}
int islower(int c) { return (96 < c && c < 123); }


x86 assembly (clang, -O0):
<islower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    $0x60,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x5(%rbp)
jge    1124 <islower+0x24>
cmpl   $0x7b,-0x4(%rbp)
setl   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<islower>:
add    $0xffffff9f,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @islower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 96, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 123
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @islower(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char n;
  scanf("%c", &n);
  printf("%c\n", 'z' - (n - 'a'));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x5(%rbp),%ecx
sub    $0x61,%ecx
mov    $0x7a,%eax
sub    %ecx,%eax
lea    0xeaf(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>
mov    $0xdb,%al
sub    0x7(%rsp),%al
movsbl %al,%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = sub nsw i32 %5, 97
%7 = sub nsw i32 122, %6
%8 = trunc i32 %7 to i8
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@.str.1 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = sub i8 -37, %3
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext %4)
ret i32 0
}
unsigned long int div15_exit(unsigned long int const i,
                             unsigned long int const result) {
  (void)i;
  return result - 1;
}


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

x86 assembly (clang, -O2):
<div15_exit>:
lea    -0x1(%rsi),%rax
ret

LLVM IR (-O0):
define i64 @div15_exit(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = sub i64 %6, 1
ret i64 %7
}

LLVM IR (-O2):
define i64 @div15_exit(i64 %0, i64 %1) {
%3 = add i64 %1, -1
ret i64 %3
}