xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int enterChoice(void) {
  int menuChoice;
  printf("\nEnter your choice\n"
         "1 - store a formatted text file of accounts called\n"
         "	\"accounts.txt\" for printing\n"
         "2 - update an account\n"
         "3 - add a new account\n"
         "4 - delete an account\n"
         "5 - end program\n? ");
  scanf("%d", &menuChoice);
  return menuChoice;
}


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

x86 assembly (clang, -O2):
<enterChoice>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xf84(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [184 x i8] c"\0AEnter your choice\0A1 - store a formatted text file of accounts called\0A\09\22accounts.txt\22 for printing\0A2 - update an account\0A3 - add a new account\0A4 - delete an account\0A5 - end program\0A? \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @enterChoice() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([184 x i8], [184 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [184 x i8] c"\0AEnter your choice\0A1 - store a formatted text file of accounts called\0A\09\22accounts.txt\22 for printing\0A2 - update an account\0A3 - add a new account\0A4 - delete an account\0A5 - end program\0A? \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @enterChoice() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([184 x i8], [184 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_vvector(void **v, long nl, long nh) { free((char *)(v + nl - 0)); }


x86 assembly (clang, -O0):
<free_vvector>:
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),%rax
shl    $0x3,%rax
add    %rax,%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_vvector>:
lea    (%rdi,%rsi,8),%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_vvector(i8** %0, i64 %1, i64 %2) {
%4 = alloca i8**
%5 = alloca i64
%6 = alloca i64
store i8** %0, i8*** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i8**, i8*** %4
%8 = load i64, i64* %5
%9 = getelementptr inbounds i8*, i8** %7, i64 %8
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = bitcast i8** %10 to i8*
%12 = call i32 @free(i8* %11)
ret void
}

LLVM IR (-O2):
define void @free_vvector(i8** nocapture %0, i64 %1, i64 %2) {
%4 = getelementptr inbounds i8*, i8** %0, i64 %1
%5 = bitcast i8** %4 to i8*
%6 = tail call i32 @free(i8* %5)
ret void
}
char *langRomTypeNormalRam() { return "Normal RAM"; }


x86 assembly (clang, -O0):
<langRomTypeNormalRam>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<langRomTypeNormalRam>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [11 x i8] c"Normal RAM\00"
define i8* @langRomTypeNormalRam() {
ret i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [11 x i8] c"Normal RAM\00"
define i8* @langRomTypeNormalRam() {
ret i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0)
}
void bar(void) {
  int i, j;
#pragma omp for collapse(2)
  for (i = 0; i < 10; ++i)
    for (j = 0; j < i; ++j)
      ;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    114e <bar+0x4e>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    113b <bar+0x3b>
jmp    112d <bar+0x2d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    111c <bar+0x1c>
jmp    1140 <bar+0x40>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <bar+0xb>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @bar() {
ret void
}
/* Variables and functions */
long gcd(long, long);
long lcm(long a, long b) { return (a * b) / gcd(a, b); }


x86 assembly (clang, -O0):
<lcm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <gcd@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cqto
idiv   %rcx
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcm>:
push   %rbx
mov    %rsi,%rbx
imul   %rdi,%rbx
call   1030 <gcd@plt>
mov    %rax,%rcx
or     %rbx,%rax
shr    $0x20,%rax
je     1133 <lcm+0x23>
mov    %rbx,%rax
cqto
idiv   %rcx
pop    %rbx
ret
mov    %ebx,%eax
xor    %edx,%edx
div    %ecx
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @lcm(i64 %0, i64 %1) {
%3 = mul nsw i64 %1, %0
%4 = tail call i64 @gcd(i64 %0, i64 %1)
%5 = sdiv i64 %3, %4
ret i64 %5
}
/* Variables and functions */
double PIDcontroller(double, double, double *, double *, double, double,
                     double);
double PitchControl(double TarPhi, double NowPhi, double *PitchPE,
                    double *PitchDS) {
  static double result = 0.0;
  result = PIDcontroller(TarPhi, NowPhi, PitchPE, PitchDS, 19.31, 0.0, 8.0);
  return result;
}


x86 assembly (clang, -O0):
<PitchControl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
movsd  0xebc(%rip),%xmm2
xorps  %xmm3,%xmm3
movsd  0xeb9(%rip),%xmm4
call   1030 <PIDcontroller@plt>
movsd  %xmm0,0x2ed4(%rip)
movsd  0x2ecc(%rip),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PitchControl>:
movsd  0xee8(%rip),%xmm2
movsd  0xee8(%rip),%xmm4
xorps  %xmm3,%xmm3
jmp    1030 <PIDcontroller@plt>

LLVM IR (-O0):
@PitchControl.result = internal global double 0.000000e+00
define double @PitchControl(double %0, double %1, double* %2, double* %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double*
%8 = alloca double*
store double %0, double* %5
store double %1, double* %6
store double* %2, double** %7
store double* %3, double** %8
%9 = load double, double* %5
%10 = load double, double* %6
%11 = load double*, double** %7
%12 = load double*, double** %8
%13 = call double @PIDcontroller(double %9, double %10, double* %11, double* %12, double 1.931000e+01, double 0.000000e+00, double 8.000000e+00)
store double %13, double* @PitchControl.result
%14 = load double, double* @PitchControl.result
ret double %14
}

LLVM IR (-O2):
define double @PitchControl(double %0, double %1, double* %2, double* %3) {
%5 = tail call double @PIDcontroller(double %0, double %1, double* %2, double* %3, double 1.931000e+01, double 0.000000e+00, double 8.000000e+00)
ret double %5
}
/* Type definitions */
typedef int /*<<< orphan*/ len;

/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned char *, int *, int);
int blist_encode_list(int *P, int len, int tot_items, unsigned char *res) {
  int r;
  memcpy(res, &len, r = sizeof(len));
  memcpy(res + sizeof(len), P, r += sizeof(*P) * len);
  return r;
}


x86 assembly (clang, -O0):
<blist_encode_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
movl   $0x4,-0x1c(%rbp)
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rdi
add    $0x4,%rdi
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rcx
shl    $0x2,%rcx
movslq -0x1c(%rbp),%rax
add    %rcx,%rax
mov    %eax,%edx
mov    %edx,-0x1c(%rbp)
call   1030 <memcpy@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blist_encode_list>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rcx,%rbx
mov    %rdi,%r14
mov    %esi,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %rcx,%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x4,%rbx
mov    0xc(%rsp),%eax
lea    0x4(,%rax,4),%ebp
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1030 <memcpy@plt>
mov    %ebp,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @blist_encode_list(i32* %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%10 = load i8*, i8** %8
store i32 4, i32* %9
%11 = call i32 @memcpy(i8* %10, i32* %6, i32 4)
%12 = load i8*, i8** %8
%13 = getelementptr inbounds i8, i8* %12, i64 4
%14 = load i32*, i32** %5
%15 = load i32, i32* %6
%16 = sext i32 %15 to i64
%17 = mul i64 4, %16
%18 = load i32, i32* %9
%19 = sext i32 %18 to i64
%20 = add i64 %19, %17
%21 = trunc i64 %20 to i32
store i32 %21, i32* %9
%22 = call i32 @memcpy(i8* %13, i32* %14, i32 %21)
%23 = load i32, i32* %9
ret i32 %23
}

LLVM IR (-O2):
define i32 @blist_encode_list(i32* %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i32
store i32 %1, i32* %5
%6 = call i32 @memcpy(i8* %3, i32* %5, i32 4)
%7 = getelementptr inbounds i8, i8* %3, i64 4
%8 = load i32, i32* %5
%9 = shl i32 %8, 2
%10 = add i32 %9, 4
%11 = call i32 @memcpy(i8* %7, i32* %0, i32 %10)
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ read_varid();
int /*<<< orphan*/ write_src(char *, int /*<<< orphan*/);
void mkconst_handler(void) {
  write_src("mkconst("
            "%d"
            ");\n",
            read_varid());
}


x86 assembly (clang, -O0):
<mkconst_handler>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <read_varid@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1030 <write_src@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkconst_handler>:
push   %rax
xor    %eax,%eax
call   1040 <read_varid@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <write_src@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"mkconst(%d);\0A\00"
define void @mkconst_handler() {
%1 = call i32 (...) @read_varid()
%2 = call i32 @write_src(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"mkconst(%d);\0A\00"
define void @mkconst_handler() {
%1 = tail call i32 (...) @read_varid()
%2 = tail call i32 @write_src(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  float arr[5] = {12.5, 10.0, 13.5, 90.5, 0.5};
  float *ptr1 = &arr[0];
  float *ptr2 = ptr1 + 3;
  printf("%f ", *ptr2);
  printf("%d", ptr2 - ptr1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xece(%rip),%eax
mov    %eax,-0x20(%rbp)
lea    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
add    $0xc,%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
cvttss2si (%rax),%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
mov    %eax,%esi
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.arr = [5 x float] [float 1.250000e+01, float 1.000000e+01, float 1.350000e+01, float 9.050000e+01, float 5.000000e-01]
@.str = [4 x i8] c"%f \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [5 x float]
%7 = alloca float*
%8 = alloca float*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = bitcast [5 x float]* %6 to i8*
%10 = getelementptr inbounds [5 x float], [5 x float]* %6, i64 0, i64 0
store float* %10, float** %7
%11 = load float*, float** %7
%12 = getelementptr inbounds float, float* %11, i64 3
store float* %12, float** %8
%13 = load float*, float** %8
%14 = load float, float* %13
%15 = fptosi float %14 to i32
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = load float*, float** %8
%18 = load float*, float** %7
%19 = ptrtoint float* %17 to i64
%20 = ptrtoint float* %18 to i64
%21 = sub i64 %19, %20
%22 = sdiv exact i64 %21, 4
%23 = trunc i64 %22 to i32
%24 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %23)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 90)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 3)
ret i32 0
}
int do_814() { return 814; }


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

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

LLVM IR (-O0):
define i32 @do_814() {
ret i32 814
}

LLVM IR (-O2):
define i32 @do_814() {
ret i32 814
}
int devtmpfs_delete_node(struct device *dev) { return 0; }


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

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

LLVM IR (-O0):
%struct.device = type opaque
define i32 @devtmpfs_delete_node(%struct.device* %0) {
%2 = alloca %struct.device*
store %struct.device* %0, %struct.device** %2
ret i32 0
}

LLVM IR (-O2):
%struct.device = type opaque
define i32 @devtmpfs_delete_node(%struct.device* nocapture readnone %0) {
ret i32 0
}
int nrandom(n)
int n;
{ return ((int)random() % n); }


x86 assembly (clang, -O0):
<nrandom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrandom>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <random@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @nrandom(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @random()
%4 = load i32, i32* %2
%5 = srem i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @nrandom(i32 %0) {
%2 = tail call i32 (...) @random()
%3 = srem i32 %2, %0
ret i32 %3
}
int fun1113() { return 1113; }


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

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

LLVM IR (-O0):
define i32 @fun1113() {
ret i32 1113
}

LLVM IR (-O2):
define i32 @fun1113() {
ret i32 1113
}
/* Variables and functions */
int /*<<< orphan*/ fileno(int /*<<< orphan*/);
int /*<<< orphan*/ func(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ getenv(char *);
int /*<<< orphan*/ stdout;
int main(void) { func(fileno(stdout), getenv("QUERY_STRING")); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
call   1040 <fileno@plt>
mov    %eax,-0x4(%rbp)
lea    0xeb0(%rip),%rdi
call   1030 <getenv@plt>
mov    -0x4(%rbp),%edi
mov    %eax,%esi
call   1050 <func@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1040 <fileno@plt>
mov    %eax,%ebx
lea    0xeb8(%rip),%rdi
call   1030 <getenv@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1050 <func@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [13 x i8] c"QUERY_STRING\00"
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = call i32 @fileno(i32 %1)
%3 = call i32 @getenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @func(i32 %2, i32 %3)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [13 x i8] c"QUERY_STRING\00"
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fileno(i32 %1)
%3 = tail call i32 @getenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @func(i32 %2, i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ eoutput(int, char *, char const *);
void iml_fatal(const char *message) { eoutput(1, "Fatal", message); }


x86 assembly (clang, -O0):
<iml_fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0x1,%edi
lea    0xed4(%rip),%rsi
call   1030 <eoutput@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iml_fatal>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rsi
mov    $0x1,%edi
jmp    1030 <eoutput@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"Fatal\00"
define void @iml_fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @eoutput(i32 1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"Fatal\00"
define void @iml_fatal(i8* %0) {
%2 = tail call i32 @eoutput(i32 1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void RandomFunc(unsigned int input[1], unsigned int output[1]) {
  unsigned int state[1];
  unsigned int local1;
  {
    state[0UL] = (input[0UL] & 914778474UL) << 7U;
    local1 = 0UL;
    while (local1 < 0U) {
      state[0UL] &= state[local1];
      local1++;
    }
    output[0UL] = state[0UL] & 773635072U;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0x3686696a,%rax
shl    $0x7,%rax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jae    114b <RandomFunc+0x4b>
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp,%rax,4),%eax
and    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1126 <RandomFunc+0x26>
mov    -0x14(%rbp),%ecx
and    $0x2e1cbc00,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    (%rdi),%eax
shl    $0x7,%eax
and    $0x214b400,%eax
mov    %eax,(%rsi)
ret

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

LLVM IR (-O2):
define void @RandomFunc(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = shl i32 %3, 7
%5 = and i32 %4, 34911232
store i32 %5, i32* %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int kill(int /*<<< orphan*/, int);
int killpg(pid_t pgrp, int signal) { return kill(-pgrp, signal); }


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

x86 assembly (clang, -O2):
<killpg>:
neg    %edi
jmp    1030 <kill@plt>

LLVM IR (-O0):
define i32 @killpg(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 = sub nsw i32 0, %5
%7 = load i32, i32* %4
%8 = call i32 @kill(i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @killpg(i32 %0, i32 %1) {
%3 = sub nsw i32 0, %0
%4 = tail call i32 @kill(i32 %3, i32 %1)
ret i32 %4
}
int test_imm_86uint8_reg(unsigned char val) {
  return ((val) & (-0x86 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_86uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff7a,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_86uint8_reg>:
test   $0x7a,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_86uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 122
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void badusage(void) {
  fprintf(stderr, "Usage: \n");
  fprintf(stderr, "gpgenmult2 [-ip d/s[dr]] [-op d/s] [-silent] [-v] [-l/-h] "
                  "[-f] groupname.\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [9 x i8] c"Usage: \0A\00"
@.str.1 = [75 x i8] c"gpgenmult2 [-ip d/s[dr]] [-op d/s] [-silent] [-v] [-l/-h] [-f] groupname.\0A\00"
define void @badusage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [9 x i8] c"Usage: \0A\00"
@.str.1 = [75 x i8] c"gpgenmult2 [-ip d/s[dr]] [-op d/s] [-silent] [-v] [-l/-h] [-f] groupname.\0A\00"
define void @badusage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
int fun491() { return 491; }


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

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

LLVM IR (-O0):
define i32 @fun491() {
ret i32 491
}

LLVM IR (-O2):
define i32 @fun491() {
ret i32 491
}
/* Variables and functions */
char *ketama_error();
char *hashring_error() { return ketama_error(); }


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

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

LLVM IR (-O0):
define i8* @hashring_error() {
%1 = call i8* (...) @ketama_error()
ret i8* %1
}

LLVM IR (-O2):
define i8* @hashring_error() {
%1 = tail call i8* (...) @ketama_error()
ret i8* %1
}
/* Variables and functions */
unsigned char inb(int);
int /*<<< orphan*/ outb(int, int);
unsigned char getval(int what) {
  outb(what, 0x70);
  return (inb(0x71));
}


x86 assembly (clang, -O0):
<getval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x70,%esi
call   1030 <outb@plt>
mov    $0x71,%edi
call   1040 <inb@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getval>:
push   %rax
mov    $0x70,%esi
call   1030 <outb@plt>
mov    $0x71,%edi
pop    %rax
jmp    1040 <inb@plt>

LLVM IR (-O0):
define zeroext i8 @getval(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @outb(i32 %3, i32 112)
%5 = call zeroext i8 @inb(i32 113)
ret i8 %5
}

LLVM IR (-O2):
define zeroext i8 @getval(i32 %0) {
%2 = tail call i32 @outb(i32 %0, i32 112)
%3 = tail call zeroext i8 @inb(i32 113)
ret i8 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ err(int /*<<< orphan*/, char *);
int vasprintf(char **, char const *, int /*<<< orphan*/);
int xvasprintf(char **ret, const char *fmt, va_list ap) {
  int i;
  i = vasprintf(ret, fmt, ap);
  if (i < 0 || *ret == NULL) {
    err(EXIT_FAILURE, "xvasprintf failed");
  }
  return (i);
}


x86 assembly (clang, -O0):
<xvasprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <vasprintf@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jl     115e <xvasprintf+0x3e>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1173 <xvasprintf+0x53>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
lea    0xe92(%rip),%rsi
call   1040 <err@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xvasprintf>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <vasprintf@plt>
mov    %eax,%ebp
test   %eax,%eax
js     1137 <xvasprintf+0x17>
cmpq   $0x0,(%rbx)
jne    114c <xvasprintf+0x2c>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xeb9(%rip),%rsi
call   1040 <err@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@.str = [18 x i8] c"xvasprintf failed\00"
define i32 @xvasprintf(i8** %0, i8* %1, i32 %2) {
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8** %0, i8*** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8**, i8*** %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @vasprintf(i8** %8, i8* %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp slt i32 %12, 0
br i1 %13, label %18, label %14
14: ; preds = %3
%15 = load i8**, i8*** %4
%16 = load i8*, i8** %15
%17 = icmp eq i8* %16, null
br i1 %17, label %18, label %21
18: ; preds = %14, %3
%19 = load i32, i32* @EXIT_FAILURE
%20 = call i32 @err(i32 %19, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %21
21: ; preds = %18, %14
%22 = load i32, i32* %7
ret i32 %22
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@.str = [18 x i8] c"xvasprintf failed\00"
define i32 @xvasprintf(i8** %0, i8* %1, i32 %2) {
%4 = tail call i32 @vasprintf(i8** %0, i8* %1, i32 %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = load i8*, i8** %0
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %6, %3
%10 = load i32, i32* @EXIT_FAILURE
%11 = tail call i32 @err(i32 %10, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %9, %6
ret i32 %4
}
/* Variables and functions */
bool isValidBounds(const long input, const short lowerBound,
                   const long upperBound) {
  if ((input < lowerBound) || (input > upperBound))
    return false;
  return true;
}


x86 assembly (clang, -O0):
<isValidBounds>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movswq -0x12(%rbp),%rcx
cmp    %rcx,%rax
jl     1133 <isValidBounds+0x33>
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jle    113f <isValidBounds+0x3f>
movl   $0x0,-0x4(%rbp)
jmp    1146 <isValidBounds+0x46>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isValidBounds>:
movslq %esi,%rax
cmp    %rdi,%rax
setle  %al
cmp    %rdx,%rdi
setle  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isValidBounds(i64 %0, i16 signext %1, i64 %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i16
%7 = alloca i64
store i64 %0, i64* %5
store i16 %1, i16* %6
store i64 %2, i64* %7
%8 = load i64, i64* %5
%9 = load i16, i16* %6
%10 = sext i16 %9 to i64
%11 = icmp slt i64 %8, %10
br i1 %11, label %16, label %12
12: ; preds = %3
%13 = load i64, i64* %5
%14 = load i64, i64* %7
%15 = icmp sgt i64 %13, %14
br i1 %15, label %16, label %17
16: ; preds = %12, %3
store i32 0, i32* %4
br label %18
17: ; preds = %12
store i32 1, i32* %4
br label %18
18: ; preds = %17, %16
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
define i32 @isValidBounds(i64 %0, i16 signext %1, i64 %2) {
%4 = sext i16 %1 to i64
%5 = icmp sle i64 %4, %0
%6 = icmp sle i64 %0, %2
%7 = and i1 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ LOG_INFO;
scalar_t__ chdir(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *);
void change_dir() {
  if ((chdir("/")) < 0) {
    syslog(LOG_INFO, "Can't change directory");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<change_dir>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1030 <chdir@plt>
cmp    $0x0,%rax
jge    116d <change_dir+0x3d>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
lea    0xea8(%rip),%rsi
call   1040 <syslog@plt>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<change_dir>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <chdir@plt>
test   %rax,%rax
js     1144 <change_dir+0x14>
pop    %rax
ret
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
lea    0xeae(%rip),%rsi
call   1040 <syslog@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"/\00"
@LOG_INFO = global i32 0
@.str.1 = [23 x i8] c"Can't change directory\00"
@EXIT_FAILURE = global i32 0
define void @change_dir() {
%1 = call i64 @chdir(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = icmp slt i64 %1, 0
br i1 %2, label %3, label %8
3: ; preds = %0
%4 = load i32, i32* @LOG_INFO
%5 = call i32 @syslog(i32 %4, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
8: ; preds = %0
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
@LOG_INFO = global i32 0
@.str.1 = [23 x i8] c"Can't change directory\00"
@EXIT_FAILURE = global i32 0
define void @change_dir() {
%1 = tail call i64 @chdir(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = icmp slt i64 %1, 0
br i1 %2, label %3, label %8
3: ; preds = %0
%4 = load i32, i32* @LOG_INFO
%5 = tail call i32 @syslog(i32 %4, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %0
ret void
}
int hash_string(void *p) {
  char *s = (char *)p;
  int total = 0;
  int i = 0;
  while (s[i] != 0) {
    total += s[i];
    i++;
  }
  return total;
}


x86 assembly (clang, -O0):
<hash_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1153 <hash_string+0x53>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    111e <hash_string+0x1e>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_string>:
mov    (%rdi),%cl
test   %cl,%cl
je     1121 <hash_string+0x21>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_string+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %10, %4 ], [ 0, %1 ]
%6 = phi i8 [ %12, %4 ], [ %2, %1 ]
%7 = phi i32 [ %9, %4 ], [ 0, %1 ]
%8 = sext i8 %6 to i32
%9 = add nsw i32 %7, %8
%10 = add nuw nsw i64 %5, 1
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %9, %4 ]
ret i32 %15
}
void wolfs_error(const char *function, const char *fmt, ...) {}


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

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

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

LLVM IR (-O2):
define void @wolfs_error(i8* nocapture %0, i8* nocapture %1, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ equality(int *, int);
int /*<<< orphan*/ read_into_array(int *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int length;
  scanf("%d", &length);
  int s[length];
  read_into_array(s, length);
  equality(s, length);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
lea    0xf(,%rax,4),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x20(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%esi
call   1030 <read_into_array@plt>
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1040 <equality@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xebe(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
mov    %rsp,%r14
mov    -0x14(%rbp),%eax
mov    %rsp,%rbx
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    -0x14(%rbp),%esi
mov    %rbx,%rdi
call   1030 <read_into_array@plt>
mov    -0x14(%rbp),%esi
mov    %rbx,%rdi
call   1040 <equality@plt>
mov    %r14,%rsp
xor    %eax,%eax
lea    -0x10(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = zext i32 %6 to i64
%8 = call i8* @llvm.stacksave()
store i8* %8, i8** %3
%9 = alloca i32, i64 %7
store i64 %7, i64* %4
%10 = load i32, i32* %2
%11 = call i32 @read_into_array(i32* %9, i32 %10)
%12 = load i32, i32* %2
%13 = call i32 @equality(i32* %9, i32 %12)
store i32 0, i32* %1
%14 = load i8*, i8** %3
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = zext i32 %4 to i64
%6 = call i8* @llvm.stacksave()
%7 = alloca i32, i64 %5
%8 = load i32, i32* %1
%9 = call i32 @read_into_array(i32* %7, i32 %8)
%10 = load i32, i32* %1
%11 = call i32 @equality(i32* %7, i32 %10)
ret i32 0
}
/* Variables and functions */
int res_init();
int my_res_init() { return res_init(); }


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

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

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

LLVM IR (-O2):
define i32 @my_res_init() {
%1 = tail call i32 (...) @res_init()
ret i32 %1
}
/* Variables and functions */
int genrand_int32();
long genrand_int31(void) { return (long)(genrand_int32() >> 1); }


x86 assembly (clang, -O0):
<genrand_int31>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <genrand_int32@plt>
sar    $0x1,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<genrand_int31>:
push   %rax
xor    %eax,%eax
call   1030 <genrand_int32@plt>
sar    %eax
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @genrand_int31() {
%1 = call i32 (...) @genrand_int32()
%2 = ashr i32 %1, 1
%3 = sext i32 %2 to i64
ret i64 %3
}

LLVM IR (-O2):
define i64 @genrand_int31() {
%1 = tail call i32 (...) @genrand_int32()
%2 = ashr i32 %1, 1
%3 = sext i32 %2 to i64
ret i64 %3
}
/* Type definitions */
struct buffer {
  int dummy;
};
typedef int /*<<< orphan*/ data;

/* Variables and functions */
int /*<<< orphan*/ buffer_write(struct buffer *, int *, int);
void buffer_write_int(struct buffer *__restrict buf, int data) {
  buffer_write(buf, &data, sizeof(data));
}


x86 assembly (clang, -O0):
<buffer_write_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
call   1030 <buffer_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buffer_write_int>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <buffer_write@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.buffer = type { i32 }
define void @buffer_write_int(%struct.buffer* noalias %0, i32 %1) {
%3 = alloca %struct.buffer*
%4 = alloca i32
store %struct.buffer* %0, %struct.buffer** %3
store i32 %1, i32* %4
%5 = load %struct.buffer*, %struct.buffer** %3
%6 = call i32 @buffer_write(%struct.buffer* %5, i32* %4, i32 4)
ret void
}

LLVM IR (-O2):
%struct.buffer = type { i32 }
define void @buffer_write_int(%struct.buffer* noalias %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @buffer_write(%struct.buffer* %0, i32* %3, i32 4)
ret void
}
void gencache(void) {}


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

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

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

LLVM IR (-O2):
define void @gencache() {
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int mapcon_write_maps(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(431, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<mapcon_write_maps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1af,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mapcon_write_maps>:
mov    $0x1af,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @mapcon_write_maps() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 431, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @mapcon_write_maps() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 431, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
void gtk_tree_path_next() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_path_next() {
ret void
}
void gtk_menu_tool_button_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_menu_tool_button_get_type() {
ret void
}
/* Variables and functions */
int set_sigchld(int);
int bg_jobs_freeze(void) { return set_sigchld(1); }


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

x86 assembly (clang, -O2):
<bg_jobs_freeze>:
mov    $0x1,%edi
jmp    1030 <set_sigchld@plt>

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

LLVM IR (-O2):
define i32 @bg_jobs_freeze() {
%1 = tail call i32 @set_sigchld(i32 1)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ emitln(char *);
int /*<<< orphan*/ expression();
int /*<<< orphan*/ match(char);
void less() {
  match('<');
  expression();
  emitln("pop\t%%ebx");
  emitln("cmp\t%%eax,%%ebx");
  emitln("setl\t%%al");
  emitln("movsx\t%%al,%%eax\t#extend al to eax");
}


x86 assembly (clang, -O0):
<less>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3c,%edi
call   1050 <match@plt>
mov    $0x0,%al
call   1040 <expression@plt>
lea    0xeb4(%rip),%rdi
call   1030 <emitln@plt>
lea    0xeb2(%rip),%rdi
call   1030 <emitln@plt>
lea    0xeb6(%rip),%rdi
call   1030 <emitln@plt>
lea    0xeb4(%rip),%rdi
call   1030 <emitln@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<less>:
push   %rax
mov    $0x3c,%edi
call   1050 <match@plt>
xor    %eax,%eax
call   1040 <expression@plt>
lea    0xeb7(%rip),%rdi
call   1030 <emitln@plt>
lea    0xeb5(%rip),%rdi
call   1030 <emitln@plt>
lea    0xeb9(%rip),%rdi
call   1030 <emitln@plt>
lea    0xeb7(%rip),%rdi
pop    %rax
jmp    1030 <emitln@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"pop\09%%ebx\00"
@.str.1 = [16 x i8] c"cmp\09%%eax,%%ebx\00"
@.str.2 = [10 x i8] c"setl\09%%al\00"
@.str.3 = [35 x i8] c"movsx\09%%al,%%eax\09#extend al to eax\00"
define void @less() {
%1 = call i32 @match(i8 signext 60)
%2 = call i32 (...) @expression()
%3 = call i32 @emitln(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @emitln(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @emitln(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @emitln(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"pop\09%%ebx\00"
@.str.1 = [16 x i8] c"cmp\09%%eax,%%ebx\00"
@.str.2 = [10 x i8] c"setl\09%%al\00"
@.str.3 = [35 x i8] c"movsx\09%%al,%%eax\09#extend al to eax\00"
define void @less() {
%1 = tail call i32 @match(i8 signext 60)
%2 = tail call i32 (...) @expression()
%3 = tail call i32 @emitln(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @emitln(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @emitln(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @emitln(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0))
ret void
}