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

/* Variables and functions */
int errno;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int do_touch1(const char *fname) {
  FILE *fp;
  fp = fopen(fname, "w");
  if (fp == NULL) {
    return -errno;
  }
  fclose(fp);
  return 0;
}


x86 assembly (clang, -O0):
<do_touch1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115e <do_touch1+0x3e>
xor    %eax,%eax
mov    0x2e8c(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    116e <do_touch1+0x4e>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_touch1>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     113e <do_touch1+0x1e>
mov    %rax,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    0x2e9b(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
@errno = global i32 0
define i32 @do_touch1(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %6, i32** %4
%7 = load i32*, i32** %4
%8 = icmp eq i32* %7, null
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* @errno
%11 = sub nsw i32 0, %10
store i32 %11, i32* %2
br label %15
12: ; preds = %1
%13 = load i32*, i32** %4
%14 = call i32 @fclose(i32* %13)
store i32 0, i32* %2
br label %15
15: ; preds = %12, %9
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
@errno = global i32 0
define i32 @do_touch1(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 = load i32, i32* @errno
%6 = sub nsw i32 0, %5
br label %9
7: ; preds = %1
%8 = tail call i32 @fclose(i32* %2)
br label %9
9: ; preds = %7, %4
%10 = phi i32 [ %6, %4 ], [ 0, %7 ]
ret i32 %10
}
double two_i_plus_x(int i, double x) { return 2.0 * i + x; }


x86 assembly (clang, -O0):
<two_i_plus_x>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<two_i_plus_x>:
cvtsi2sd %edi,%xmm1
addsd  %xmm1,%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @two_i_plus_x(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
%5 = load i32, i32* %3
%6 = sitofp i32 %5 to double
%7 = load double, double* %4
%8 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %6, double %7)
ret double %8
}

LLVM IR (-O2):
define double @two_i_plus_x(i32 %0, double %1) {
%3 = sitofp i32 %0 to double
%4 = tail call double @llvm.fmuladd.f64(double %3, double 2.000000e+00, double %1)
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ chtype;

/* Variables and functions */
int /*<<< orphan*/ bkgd(int /*<<< orphan*/);
int check_arg_count(int, int);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_return(int /*<<< orphan*/);
void cmd_bkgd(int nargs, char **args) {
  chtype *ch;
  if (check_arg_count(nargs, 1) == 1)
    return;
  ch = (chtype *)args[0];
  report_count(1);
  report_return(bkgd(ch[0]));
}


x86 assembly (clang, -O0):
<cmd_bkgd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1040 <check_arg_count@plt>
cmp    $0x1,%eax
jne    116a <cmd_bkgd+0x2a>
jmp    1191 <cmd_bkgd+0x51>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    $0x1,%edi
call   1050 <report_count@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
call   1060 <bkgd@plt>
mov    %eax,%edi
call   1030 <report_return@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_bkgd>:
push   %rbx
mov    %rsi,%rbx
mov    $0x1,%esi
call   1040 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1155 <cmd_bkgd+0x15>
pop    %rbx
ret
mov    (%rbx),%rbx
mov    $0x1,%edi
call   1050 <report_count@plt>
mov    (%rbx),%edi
call   1060 <bkgd@plt>
mov    %eax,%edi
pop    %rbx
jmp    1030 <report_return@plt>

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

LLVM IR (-O2):
define void @cmd_bkgd(i32 %0, i8** nocapture %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %12, label %5
5: ; preds = %2
%6 = bitcast i8** %1 to i32**
%7 = load i32*, i32** %6
%8 = tail call i32 @report_count(i32 1)
%9 = load i32, i32* %7
%10 = tail call i32 @bkgd(i32 %9)
%11 = tail call i32 @report_return(i32 %10)
br label %12
12: ; preds = %2, %5
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ BusyWait(int);
scalar_t__ getpin();
int /*<<< orphan*/ setpin0();
int /*<<< orphan*/ setpinhiz();
uint32_t resetbus(void) {
  uint32_t devicepresent = 0;
  setpin0();
  BusyWait(((uint32_t)(((((double)480 * (double)(5 * 11059200)) /
                         ((double)(7) * 1000.0f * 1000.0f))) +
                       0.5f)));
  setpinhiz();
  BusyWait(((uint32_t)(((((double)70 * (double)(5 * 11059200)) /
                         ((double)(7) * 1000.0f * 1000.0f))) +
                       0.5f)));
  if (getpin() == 0)
    devicepresent = 1;
  BusyWait(((uint32_t)(((((double)410 * (double)(5 * 11059200)) /
                         ((double)(7) * 1000.0f * 1000.0f))) +
                       0.5f)));
  return devicepresent;
}


x86 assembly (clang, -O0):
<resetbus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <setpin0@plt>
mov    $0xed0,%edi
call   1040 <BusyWait@plt>
mov    $0x0,%al
call   1050 <setpinhiz@plt>
mov    $0x229,%edi
call   1040 <BusyWait@plt>
mov    $0x0,%al
call   1060 <getpin@plt>
cmp    $0x0,%rax
jne    1189 <resetbus+0x49>
movl   $0x1,-0x4(%rbp)
mov    $0xca7,%edi
call   1040 <BusyWait@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resetbus>:
push   %rbx
xor    %eax,%eax
call   1030 <setpin0@plt>
mov    $0xed0,%edi
call   1040 <BusyWait@plt>
xor    %eax,%eax
call   1050 <setpinhiz@plt>
mov    $0x229,%edi
call   1040 <BusyWait@plt>
xor    %eax,%eax
call   1060 <getpin@plt>
xor    %ebx,%ebx
test   %rax,%rax
sete   %bl
mov    $0xca7,%edi
call   1040 <BusyWait@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @resetbus() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @setpin0()
%3 = call i32 @BusyWait(i32 3792)
%4 = call i32 (...) @setpinhiz()
%5 = call i32 @BusyWait(i32 553)
%6 = call i64 (...) @getpin()
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %0
store i32 1, i32* %1
br label %9
9: ; preds = %8, %0
%10 = call i32 @BusyWait(i32 3239)
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
define i32 @resetbus() {
%1 = tail call i32 (...) @setpin0()
%2 = tail call i32 @BusyWait(i32 3792)
%3 = tail call i32 (...) @setpinhiz()
%4 = tail call i32 @BusyWait(i32 553)
%5 = tail call i64 (...) @getpin()
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
%8 = tail call i32 @BusyWait(i32 3239)
ret i32 %7
}
_Bool SignalingLess(double f1, double f2) { return f1 < f2; }


x86 assembly (clang, -O0):
<SignalingLess>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SignalingLess>:
ucomisd %xmm0,%xmm1
seta   %al
ret

LLVM IR (-O0):
define zeroext i1 @SignalingLess(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
ret i1 %7
}

LLVM IR (-O2):
define zeroext i1 @SignalingLess(double %0, double %1) {
%3 = fcmp olt double %0, %1
ret i1 %3
}
/* Variables and functions */
int getfirst(int *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int a[] = {1, 2, 3};
  printf("%d\n", getfirst(a));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x1c(%rbp)
mov    0xec1(%rip),%eax
mov    %eax,-0x14(%rbp)
lea    -0x1c(%rbp),%rdi
call   1030 <getfirst@plt>
mov    %eax,%esi
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xede(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xecb(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <getfirst@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.a = [3 x i32] [i32 1, i32 2, i32 3]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [3 x i32]
%4 = bitcast [3 x i32]* %3 to i8*
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%6 = call i32 @getfirst(i32* %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int INT_MAX;
int /*<<< orphan*/ printf(char *);
int rand();
void main() {
  int intRand = rand();
  if (intRand <= INT_MAX) {
    printf("Always prints\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <rand@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2eac(%rip),%rcx
cmp    (%rcx),%eax
jg     1150 <main+0x30>
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <rand@plt>
mov    0x2eb9(%rip),%rcx
cmp    (%rcx),%eax
jle    1135 <main+0x15>
pop    %rax
ret
lea    0xec4(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@INT_MAX = global i32 0
@.str = [15 x i8] c"Always prints\0A\00"
define void @main() {
%1 = alloca i32
%2 = call i32 (...) @rand()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = load i32, i32* @INT_MAX
%5 = icmp sle i32 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
ret void
}

LLVM IR (-O2):
@INT_MAX = global i32 0
@str = [14 x i8] c"Always prints\00"
define void @main() {
%1 = tail call i32 (...) @rand()
%2 = load i32, i32* @INT_MAX
%3 = icmp sgt i32 %1, %2
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vx86_NBSB_Write8(int, unsigned char, unsigned char);
void sb1_Write8(unsigned char offset, unsigned char val) {
  vx86_NBSB_Write8(3, offset, val);
}


x86 assembly (clang, -O0):
<sb1_Write8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%al
mov    $0x3,%edi
movzbl %al,%esi
movzbl -0x2(%rbp),%edx
call   1030 <vx86_NBSB_Write8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sb1_Write8>:
mov    %esi,%edx
mov    %edi,%esi
mov    $0x3,%edi
jmp    1030 <vx86_NBSB_Write8@plt>

LLVM IR (-O0):
define void @sb1_Write8(i8 zeroext %0, i8 zeroext %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 i32 @vx86_NBSB_Write8(i32 3, i8 zeroext %5, i8 zeroext %6)
ret void
}

LLVM IR (-O2):
define void @sb1_Write8(i8 zeroext %0, i8 zeroext %1) {
%3 = tail call i32 @vx86_NBSB_Write8(i32 3, i8 zeroext %0, i8 zeroext %1)
ret void
}
/* Variables and functions */
float sqrtf(float);
float vec2_distance(float *a, float *b) {
  float x = b[0] - a[0], y = b[1] - a[1];
  return sqrtf(x * x + y * y);
}


x86 assembly (clang, -O0):
<vec2_distance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
subss  (%rax),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
subss  0x4(%rax),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
movss  -0x14(%rbp),%xmm2
movss  -0x18(%rbp),%xmm1
mulss  -0x18(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrtf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec2_distance>:
movss  (%rsi),%xmm0
movss  0x4(%rsi),%xmm1
subss  (%rdi),%xmm0
subss  0x4(%rdi),%xmm1
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     113b <vec2_distance+0x2b>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrtf@plt>

LLVM IR (-O0):
define float @vec2_distance(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca float
%6 = alloca float
store float* %0, float** %3
store float* %1, float** %4
%7 = load float*, float** %4
%8 = getelementptr inbounds float, float* %7, i64 0
%9 = load float, float* %8
%10 = load float*, float** %3
%11 = getelementptr inbounds float, float* %10, i64 0
%12 = load float, float* %11
%13 = fsub float %9, %12
store float %13, float* %5
%14 = load float*, float** %4
%15 = getelementptr inbounds float, float* %14, i64 1
%16 = load float, float* %15
%17 = load float*, float** %3
%18 = getelementptr inbounds float, float* %17, i64 1
%19 = load float, float* %18
%20 = fsub float %16, %19
store float %20, float* %6
%21 = load float, float* %5
%22 = load float, float* %5
%23 = load float, float* %6
%24 = load float, float* %6
%25 = fmul float %23, %24
%26 = call float @llvm.fmuladd.f32(float %21, float %22, float %25)
%27 = call float @sqrtf(float %26)
ret float %27
}

LLVM IR (-O2):
define float @vec2_distance(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = load float, float* %0
%5 = fsub float %3, %4
%6 = getelementptr inbounds float, float* %1, i64 1
%7 = load float, float* %6
%8 = getelementptr inbounds float, float* %0, i64 1
%9 = load float, float* %8
%10 = fsub float %7, %9
%11 = fmul float %10, %10
%12 = tail call float @llvm.fmuladd.f32(float %5, float %5, float %11)
%13 = tail call float @sqrtf(float %12)
ret float %13
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ by(int /*<<< orphan*/);
void xor_by(uint32_t x) {
  by(x);
  xor();
}


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

x86 assembly (clang, -O2):
<xor_by>:
push   %rax
call   1030 <by@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <xor@plt>

LLVM IR (-O0):
define void @xor_by(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @by(i32 %3)
%5 = call i32 (...) @xor()
ret void
}

LLVM IR (-O2):
define void @xor_by(i32 %0) {
%2 = tail call i32 @by(i32 %0)
%3 = tail call i32 (...) @xor()
ret void
}
char *strpbrk(const char *s, const char *accept) {
  const char *ss = s + __strxspn(s, accept, 1);
  return *ss ? (char *)ss : ((void *)0);
}


x86 assembly (clang, -O0):
<strpbrk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
mov    $0x0,%al
call   1030 <__strxspn@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1169 <strpbrk+0x59>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1174 <strpbrk+0x64>
xor    %eax,%eax
mov    %rax,-0x28(%rbp)
jmp    1174 <strpbrk+0x64>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strpbrk>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %r14d,%r14d
mov    $0x1,%edx
xor    %eax,%eax
call   1030 <__strxspn@plt>
cltq
lea    (%rbx,%rax,1),%rcx
cmpb   $0x0,(%rbx,%rax,1)
cmovne %rcx,%r14
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strpbrk(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @__strxspn to i32 (i8*, i8*, i32, ...)*)(i8* %7, i8* %8, i32 1)
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %6, i64 %10
store i8* %11, i8** %5
%12 = load i8*, i8** %5
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %2
%17 = load i8*, i8** %5
br label %19
18: ; preds = %2
br label %19
19: ; preds = %18, %16
%20 = phi i8* [ %17, %16 ], [ null, %18 ]
ret i8* %20
}

LLVM IR (-O2):
define i8* @strpbrk(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @__strxspn to i32 (i8*, i8*, i32, ...)*)(i8* %0, i8* %1, i32 1)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = select i1 %7, i8* null, i8* %5
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
ifdivert() {
  printf(".ds #d .d\n");
  printf(".if \\(ts\\n(.z\\(ts\\(ts .ds #d nl\n");
}


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

x86 assembly (clang, -O2):
<ifdivert>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee6(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [11 x i8] c".ds #d .d\0A\00"
@.str.1 = [33 x i8] c".if \\(ts\\n(.z\\(ts\\(ts .ds #d nl\0A\00"
define i32 @ifdivert() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@str = [10 x i8] c".ds #d .d\00"
@str.2 = [32 x i8] c".if \\(ts\\n(.z\\(ts\\(ts .ds #d nl\00"
define i32 @ifdivert() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.2, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ array_extra_comma();
int main(int argc, char **argv) {
  array_extra_comma();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @array_extra_comma()
ret i32 0
}
int rlGetSystemByteOrder() {
  const int one = 1;
  const char endian = *(char *)&one;
  return endian;
}


x86 assembly (clang, -O0):
<rlGetSystemByteOrder>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @rlGetSystemByteOrder() {
%1 = alloca i32
%2 = alloca i8
store i32 1, i32* %1
%3 = bitcast i32* %1 to i8*
%4 = load i8, i8* %3
store i8 %4, i8* %2
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @rlGetSystemByteOrder() {
ret i32 1
}
/* Variables and functions */
float log2f(float);
float smf2nv(float freq, float root) { return log2f(freq / root); }


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

x86 assembly (clang, -O2):
<smf2nv>:
divss  %xmm1,%xmm0
jmp    1030 <log2f@plt>

LLVM IR (-O0):
define float @smf2nv(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 = fdiv float %5, %6
%8 = call float @log2f(float %7)
ret float %8
}

LLVM IR (-O2):
define float @smf2nv(float %0, float %1) {
%3 = fdiv float %0, %1
%4 = tail call float @log2f(float %3)
ret float %4
}
void g_array_sort_with_data() {}


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

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

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

LLVM IR (-O2):
define void @g_array_sort_with_data() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
void fnReadArray(int iaArr[], int n) {
  int i;
  for (i = 0; i < n; i++)
    scanf("%d", &iaArr[i]);
}


x86 assembly (clang, -O0):
<fnReadArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115b <fnReadArray+0x4b>
mov    -0x8(%rbp),%rsi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xeb8(%rip),%rdi
call   1030 <scanf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <fnReadArray+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fnReadArray>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1145 <fnReadArray+0x35>
mov    %rdi,%rbx
mov    %esi,%r15d
lea    0xeda(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <scanf@plt>
add    $0x4,%rbx
add    $0xffffffffffffffff,%r15
jne    1130 <fnReadArray+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @fnReadArray(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %8)
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret void
}
/* Variables and functions */
double sin(double);
double my_dll_sin(double x) { return sin(x); }


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

x86 assembly (clang, -O2):
<my_dll_sin>:
jmp    1030 <sin@plt>

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

LLVM IR (-O2):
define double @my_dll_sin(double %0) {
%2 = tail call double @sin(double %0)
ret double %2
}
/* Variables and functions */
int rand();
int get_random(int min, int max) {
  if (max == 0)
    return 0;
  if (max - min == 0)
    return min;
  return (rand() % (max - min)) + min;
}


x86 assembly (clang, -O0):
<get_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1134 <get_random+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1164 <get_random+0x54>
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
cmp    $0x0,%eax
jne    114e <get_random+0x3e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1164 <get_random+0x54>
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0xc(%rbp),%ecx
sub    -0x8(%rbp),%ecx
cltd
idiv   %ecx
add    -0x8(%rbp),%edx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_random>:
push   %rbp
push   %rbx
push   %rax
test   %esi,%esi
je     112d <get_random+0x1d>
mov    %esi,%ebp
mov    %edi,%ebx
sub    %edi,%ebp
je     112f <get_random+0x1f>
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebp
add    %edx,%ebx
jmp    112f <get_random+0x1f>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @get_random(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = sub nsw i32 %1, %0
%6 = icmp eq i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = tail call i32 (...) @rand()
%9 = srem i32 %8, %5
%10 = add nsw i32 %9, %0
br label %11
11: ; preds = %4, %2, %7
%12 = phi i32 [ %10, %7 ], [ 0, %2 ], [ %0, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ SCOTCH_version(int *const, int *const, int *const);
void SCOTCHFVERSION(int *const versptr, int *const relaptr,
                    int *const patcptr) {
  SCOTCH_version(versptr, relaptr, patcptr);
}


x86 assembly (clang, -O0):
<SCOTCHFVERSION>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <SCOTCH_version@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SCOTCHFVERSION>:
jmp    1030 <SCOTCH_version@plt>

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

LLVM IR (-O2):
define void @SCOTCHFVERSION(i32* %0, i32* %1, i32* %2) {
%4 = tail call i32 @SCOTCH_version(i32* %0, i32* %1, i32* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ pclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *popen(char *, char *);
int run_chk(char cmd[255]) {
  char ret[255];
  FILE *f = popen(cmd, "r");
  fgets(ret, 255, f);
  pclose(f);
  int tmp = atoi(ret);
  tmp -= 3;
  return tmp;
}


x86 assembly (clang, -O0):
<run_chk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea6(%rip),%rsi
call   1050 <popen@plt>
mov    %rax,-0x118(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x118(%rbp),%rdx
mov    $0xff,%esi
call   1040 <fgets@plt>
mov    -0x118(%rbp),%rdi
call   1030 <pclose@plt>
lea    -0x110(%rbp),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x11c(%rbp)
mov    -0x11c(%rbp),%eax
sub    $0x3,%eax
mov    %eax,-0x11c(%rbp)
mov    -0x11c(%rbp),%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_chk>:
push   %r14
push   %rbx
sub    $0x108,%rsp
lea    0xeaf(%rip),%rsi
call   1050 <popen@plt>
mov    %rax,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0xff,%esi
mov    %rax,%rdx
call   1040 <fgets@plt>
mov    %rbx,%rdi
call   1030 <pclose@plt>
mov    %r14,%rdi
call   1060 <atoi@plt>
add    $0xfffffffd,%eax
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
define i32 @run_chk(i8* %0) {
%2 = alloca i8*
%3 = alloca [255 x i8]
%4 = alloca i32*
%5 = alloca i32
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = call i32* @popen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %7, i32** %4
%8 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%9 = load i32*, i32** %4
%10 = call i32 @fgets(i8* %8, i32 255, i32* %9)
%11 = load i32*, i32** %4
%12 = call i32 @pclose(i32* %11)
%13 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%14 = call i32 @atoi(i8* %13)
store i32 %14, i32* %5
%15 = load i32, i32* %5
%16 = sub nsw i32 %15, 3
store i32 %16, i32* %5
%17 = load i32, i32* %5
ret i32 %17
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @run_chk(i8* nocapture %0) {
%2 = alloca [255 x i8]
%3 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 0
%4 = tail call i32* @popen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @fgets(i8* %3, i32 255, i32* %4)
%6 = call i32 @pclose(i32* %4)
%7 = call i32 @atoi(i8* %3)
%8 = add nsw i32 %7, -3
ret i32 %8
}
int main() {
  int a, b;
  a = 1;
  b = 2;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int main() {
  int x$1;
  int y$1;
  (x$1++);
  (x$1 += 1);
  (y$1++);
  (y$1 += 1);
  (x$1 = (y$1 = 5));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x5,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ my_putchar(char);
void my_aff_params(int argc, char *argv[]) {
  int i;
  i = 0;
  while (i < argc) {
    my_putchar(argv[argc][i]);
    my_putchar('\n');
    i++;
  }
}


x86 assembly (clang, -O0):
<my_aff_params>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1163 <my_aff_params+0x53>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <my_putchar@plt>
mov    $0xa,%edi
call   1030 <my_putchar@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <my_aff_params+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_aff_params>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
jle    1150 <my_aff_params+0x40>
mov    %rsi,%r14
mov    %edi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%r15,8),%rax
movsbl (%rax,%rbx,1),%edi
call   1030 <my_putchar@plt>
mov    $0xa,%edi
call   1030 <my_putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <my_aff_params+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @my_aff_params(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %17
4: ; preds = %2
%5 = zext i32 %0 to i64
%6 = getelementptr inbounds i8*, i8** %1, i64 %5
%7 = zext i32 %0 to i64
br label %8
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %15, %8 ]
%10 = load i8*, i8** %6
%11 = getelementptr inbounds i8, i8* %10, i64 %9
%12 = load i8, i8* %11
%13 = tail call i32 @my_putchar(i8 signext %12)
%14 = tail call i32 @my_putchar(i8 signext 10)
%15 = add nuw nsw i64 %9, 1
%16 = icmp eq i64 %15, %7
br i1 %16, label %17, label %8
17: ; preds = %8, %2
ret void
}
int b_twist_u_on_edgeperm(eperm)
int eperm;
{
  int temp_arr[8];
  b_edgeperm_unpack(eperm, temp_arr);
  four_cycle(temp_arr, 1, 2, 3, 0);
  return b_edgeperm_pack(temp_arr);
}


x86 assembly (clang, -O0):
<b_twist_u_on_edgeperm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    $0x0,%al
call   1050 <b_edgeperm_unpack@plt>
lea    -0x30(%rbp),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
xor    %r8d,%r8d
mov    $0x0,%al
call   1040 <four_cycle@plt>
lea    -0x30(%rbp),%rdi
mov    $0x0,%al
call   1030 <b_edgeperm_pack@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_twist_u_on_edgeperm>:
push   %rbx
sub    $0x20,%rsp
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <b_edgeperm_unpack@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
xor    %r8d,%r8d
xor    %eax,%eax
call   1040 <four_cycle@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <b_edgeperm_pack@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @b_twist_u_on_edgeperm(i32 %0) {
%2 = alloca i32
%3 = alloca [8 x i32]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%6 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @b_edgeperm_unpack to i32 (i32, i32*, ...)*)(i32 %4, i32* %5)
%7 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%8 = call i32 (i32*, i32, i32, i32, i32, ...) bitcast (i32 (...)* @four_cycle to i32 (i32*, i32, i32, i32, i32, ...)*)(i32* %7, i32 1, i32 2, i32 3, i32 0)
%9 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%10 = call i32 (i32*, ...) bitcast (i32 (...)* @b_edgeperm_pack to i32 (i32*, ...)*)(i32* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @b_twist_u_on_edgeperm(i32 %0) {
%2 = alloca [8 x i32]
%3 = bitcast [8 x i32]* %2 to i8*
%4 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%5 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @b_edgeperm_unpack to i32 (i32, i32*, ...)*)(i32 %0, i32* %4)
%6 = call i32 (i32*, i32, i32, i32, i32, ...) bitcast (i32 (...)* @four_cycle to i32 (i32*, i32, i32, i32, i32, ...)*)(i32* %4, i32 1, i32 2, i32 3, i32 0)
%7 = call i32 (i32*, ...) bitcast (i32 (...)* @b_edgeperm_pack to i32 (i32*, ...)*)(i32* %4)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
__attribute__((no)) void test(int x) {
  printf("%d %d", x * x + 2 * x + 1, x * x + 2 * x - 1);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
imul   -0x4(%rbp),%esi
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    %eax,%esi
add    $0x1,%esi
mov    -0x4(%rbp),%edx
imul   -0x4(%rbp),%edx
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    %eax,%edx
sub    $0x1,%edx
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
lea    0x2(%rdi),%edx
imul   %edi,%edx
lea    0x1(%rdx),%esi
add    $0xffffffff,%edx
lea    0xedd(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
define void @test(i32 %0) {
%2 = add i32 %0, 2
%3 = mul i32 %2, %0
%4 = add nsw i32 %3, 1
%5 = add nsw i32 %3, -1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void exitfunc22(void) {
  printf("Executing exitfunc22.\n");
  exit(0);
}


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"Executing exitfunc22.\0A\00"
define void @exitfunc22() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [22 x i8] c"Executing exitfunc22.\00"
define void @exitfunc22() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
int ddsGetWidth(unsigned const char *buffer) {
  return (buffer[16] & 0xFF) | (buffer[17] & 0xFF) << 8 |
         (buffer[18] & 0xFF) << 16 | (buffer[19] & 0xFF) << 24;
}


x86 assembly (clang, -O0):
<ddsGetWidth>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x10(%rax),%eax
and    $0xff,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x11(%rcx),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x12(%rcx),%ecx
and    $0xff,%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x13(%rcx),%ecx
and    $0xff,%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ddsGetWidth(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 16
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = getelementptr inbounds i8, i8* %0, i64 17
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 8
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 18
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 16
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 19
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = shl nuw i32 %17, 24
%19 = or i32 %14, %18
ret i32 %19
}
void yy_1_Ticks(char *yytext, int yyleng) {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @yy_1_Ticks(i8* nocapture %0, i32 %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int vsnprintf(char *, size_t, char const *, int /*<<< orphan*/);
int vslprintf(char *dst, size_t size, const char *fmt, va_list ap) {
  int ret;
  ret = vsnprintf(dst, size, fmt, ap);
  dst[size - 1] = '\0';
  return ret;
}


x86 assembly (clang, -O0):
<vslprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <vsnprintf@plt>
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vslprintf>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <vsnprintf@plt>
movb   $0x0,-0x1(%r14,%rbx,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @vslprintf(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = load i8*, i8** %5
%11 = load i64, i64* %6
%12 = load i8*, i8** %7
%13 = load i32, i32* %8
%14 = call i32 @vsnprintf(i8* %10, i64 %11, i8* %12, i32 %13)
store i32 %14, i32* %9
%15 = load i8*, i8** %5
%16 = load i64, i64* %6
%17 = sub i64 %16, 1
%18 = getelementptr inbounds i8, i8* %15, i64 %17
store i8 0, i8* %18
%19 = load i32, i32* %9
ret i32 %19
}

LLVM IR (-O2):
define i32 @vslprintf(i8* nocapture %0, i64 %1, i8* nocapture %2, i32 %3) {
%5 = tail call i32 @vsnprintf(i8* %0, i64 %1, i8* %2, i32 %3)
%6 = add i64 %1, -1
%7 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 0, i8* %7
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(double *);
void freeVect(double *ret) { free(ret); }


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

x86 assembly (clang, -O2):
<freeVect>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @freeVect(double* nocapture %0) {
%2 = tail call i32 @free(double* %0)
ret void
}
char *strerror(int errnum) {}


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

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

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

LLVM IR (-O2):
define noalias i8* @strerror(i32 %0) {
ret i8* undef
}
void gtk_widget_get_parent() {}


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

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

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

LLVM IR (-O2):
define void @gtk_widget_get_parent() {
ret void
}
unsigned char swap_bits(unsigned char octet) {
  return ((octet >> 4 & 0x0F) | (0xF0 & octet << 4));
}


x86 assembly (clang, -O0):
<swap_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x4,%eax
and    $0xf,%eax
movzbl -0x1(%rbp),%ecx
shl    $0x4,%ecx
and    $0xf0,%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_bits>:
mov    %edi,%eax
rol    $0x4,%al
ret

LLVM IR (-O0):
define zeroext i8 @swap_bits(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = ashr i32 %4, 4
%6 = and i32 %5, 15
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = shl i32 %8, 4
%10 = and i32 240, %9
%11 = or i32 %6, %10
%12 = trunc i32 %11 to i8
ret i8 %12
}

LLVM IR (-O2):
define zeroext i8 @swap_bits(i8 zeroext %0) {
%2 = tail call i8 @llvm.fshl.i8(i8 %0, i8 %0, i8 4)
ret i8 %2
}
int test_0x123456() { return 0x123456; }


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

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

LLVM IR (-O0):
define i32 @test_0x123456() {
ret i32 1193046
}

LLVM IR (-O2):
define i32 @test_0x123456() {
ret i32 1193046
}