xunge/DecIR huggingface dataset:
/* Variables and functions */
double RAND_MAX;
scalar_t__ rand();
double random_number(void) { return (double)rand() / RAND_MAX; }


x86 assembly (clang, -O0):
<random_number>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec1(%rip),%rax
divsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_number>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec4(%rip),%rax
divsd  (%rax),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define double @random_number() {
%1 = call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load double, double* @RAND_MAX
%4 = fdiv double %2, %3
ret double %4
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @random_number() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load double, double* @RAND_MAX
%4 = fdiv double %2, %3
ret double %4
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMR3F_get(void) { return U_WMRCORENONE_get("U_WMR3F"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR3F\00"
define i32 @U_WMR3F_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR3F\00"
define i32 @U_WMR3F_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Type definitions */
struct sembuf {
  int sem_op;
  int sem_flg;
  scalar_t__ sem_num;
};

/* Variables and functions */
int /*<<< orphan*/ semop(int, struct sembuf *, int);
void sem_wait1(int semid, int val) {
  struct sembuf semaphore;
  semaphore.sem_num = 0;
  semaphore.sem_op = (-1 * val);
  semaphore.sem_flg = 1;
  semop(semid, &semaphore, 1);
}


x86 assembly (clang, -O0):
<sem_wait1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
imul   $0xffffffff,-0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x18(%rbp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sem_wait1>:
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
neg    %esi
mov    %esi,0x8(%rsp)
movl   $0x1,0xc(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sembuf = type { i32, i32, i64 }
define void @sem_wait1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.sembuf
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %5, i32 0, i32 2
store i64 0, i64* %6
%7 = load i32, i32* %4
%8 = mul nsw i32 -1, %7
%9 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %5, i32 0, i32 0
store i32 %8, i32* %9
%10 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %5, i32 0, i32 1
store i32 1, i32* %10
%11 = load i32, i32* %3
%12 = call i32 @semop(i32 %11, %struct.sembuf* %5, i32 1)
ret void
}

LLVM IR (-O2):
%struct.sembuf = type { i32, i32, i64 }
define void @sem_wait1(i32 %0, i32 %1) {
%3 = alloca %struct.sembuf
%4 = bitcast %struct.sembuf* %3 to i8*
%5 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 2
store i64 0, i64* %5
%6 = sub nsw i32 0, %1
%7 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 0
store i32 %6, i32* %7
%8 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 1
store i32 1, i32* %8
%9 = call i32 @semop(i32 %0, %struct.sembuf* %3, i32 1)
ret void
}
/* Type definitions */
typedef unsigned int uint32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t rol32(uint32_t data, unsigned int rotation) {
  return ((data << rotation) | (data >> (32 - rotation)));
}


x86 assembly (clang, -O0):
<rol32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
shr    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rol32>:
mov    %esi,%ecx
mov    %edi,%eax
rol    %cl,%eax
ret

LLVM IR (-O0):
define i32 @rol32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub i32 32, %9
%11 = lshr i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rol32(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub i32 32, %1
%5 = lshr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void f1(void) { printf("f1\n"); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"f1\0A\00"
define void @f1() {
%1 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [3 x i8] c"f1\00"
define void @f1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret void
}
int hf1Int(const void *const e) {
  int *e_int = (int *)e;
  return (*e_int) % 31;
}


x86 assembly (clang, -O0):
<hf1Int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    $0x1f,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hf1Int>:
movslq (%rdi),%rcx
imul   $0xffffffff84210843,%rcx,%rax
shr    $0x20,%rax
add    %ecx,%eax
mov    %eax,%edx
shr    $0x1f,%edx
sar    $0x4,%eax
add    %edx,%eax
mov    %eax,%edx
shl    $0x5,%edx
sub    %edx,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @hf1Int(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = srem i32 %7, 31
ret i32 %8
}

LLVM IR (-O2):
define i32 @hf1Int(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = srem i32 %3, 31
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0xf0() {
  Assert_real((isodigit(240) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              1205, ("isodigit should be 0 for 0xf0"));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0xf0>:
push   %rax
mov    $0xf0,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x4b5,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xf0\00"
define void @t_isodigit_0xf0() {
%1 = call i64 @isodigit(i32 240)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1205, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xf0\00"
define void @t_isodigit_0xf0() {
%1 = tail call i64 @isodigit(i32 240)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1205, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int funsigned2(uint32_t a) {
  if (a < 1)
    return 1;
  return (-1 * 0x1ffffffffL) / a == 0;
}


x86 assembly (clang, -O0):
<funsigned2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    111d <funsigned2+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    113f <funsigned2+0x3f>
movslq -0x8(%rbp),%rcx
movabs $0xfffffffe00000001,%rax
ff ff ff
cqto
idiv   %rcx
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<funsigned2>:
xor    %eax,%eax
test   %edi,%edi
setle  %al
ret

LLVM IR (-O0):
define i32 @funsigned2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %13
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = sdiv i64 -8589934591, %9
%11 = icmp eq i64 %10, 0
%12 = zext i1 %11 to i32
store i32 %12, i32* %2
br label %13
13: ; preds = %7, %6
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @funsigned2(i32 %0) {
%2 = icmp slt i32 %0, 1
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
double RAND_MAX;
scalar_t__ rand();
double rand1() { return ((double)rand() / RAND_MAX); }


x86 assembly (clang, -O0):
<rand1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec1(%rip),%rax
divsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand1>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec4(%rip),%rax
divsd  (%rax),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define double @rand1() {
%1 = call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load double, double* @RAND_MAX
%4 = fdiv double %2, %3
ret double %4
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @rand1() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load double, double* @RAND_MAX
%4 = fdiv double %2, %3
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, float, int);
int fun(int a, float b, char c) {
  printf("char: %c - float: %f - int: %d\n", c, b, a);
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%edx
lea    0xec8(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [32 x i8] c"char: %c - float: %f - int: %d\0A\00"
define i32 @fun(i32 %0, float %1, i8 signext %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
%7 = alloca i8
store i32 %0, i32* %5
store float %1, float* %6
store i8 %2, i8* %7
%8 = load i8, i8* %7
%9 = load float, float* %6
%10 = load i32, i32* %5
%11 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8 signext %8, float %9, i32 %10)
%12 = load i32, i32* %4
ret i32 %12
}

LLVM IR (-O2):
@.str = [32 x i8] c"char: %c - float: %f - int: %d\0A\00"
define i32 @fun(i32 %0, float %1, i8 signext %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8 signext %2, float %1, i32 %0)
ret i32 undef
}
int ti_obv_start(double const *options) {
  (void)options;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @ti_obv_start(double* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ GL_COLOR_BUFFER_BIT;
int /*<<< orphan*/ glClear(int /*<<< orphan*/);
int /*<<< orphan*/ glFlush();
void unproject_display(void) {
  glClear(GL_COLOR_BUFFER_BIT);
  glFlush();
}


x86 assembly (clang, -O0):
<unproject_display>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1030 <glClear@plt>
mov    $0x0,%al
call   1040 <glFlush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<unproject_display>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
call   1030 <glClear@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <glFlush@plt>

LLVM IR (-O0):
@GL_COLOR_BUFFER_BIT = global i32 0
define void @unproject_display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = call i32 @glClear(i32 %1)
%3 = call i32 (...) @glFlush()
ret void
}

LLVM IR (-O2):
@GL_COLOR_BUFFER_BIT = global i32 0
define void @unproject_display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = tail call i32 @glClear(i32 %1)
%3 = tail call i32 (...) @glFlush()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int _FREE(int *a) { free(a); }


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

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

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

LLVM IR (-O2):
define i32 @_FREE(i32* nocapture %0) {
%2 = tail call i32 @free(i32* %0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ LOG_NOTICE;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, char *);
int hdd_restore(void) {
  {
    syslog((LOG_NOTICE), "%s", ("not implemented in the chunkserver"));
    fprintf(stderr, "%s\n", ("not implemented in the chunkserver"));
  };
  return 0;
}


x86 assembly (clang, -O0):
<hdd_restore>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
lea    0xec8(%rip),%rdx
call   1040 <syslog@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xed6(%rip),%rsi
lea    0xeac(%rip),%rdx
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hdd_restore>:
push   %rbx
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
lea    0xecb(%rip),%rbx
mov    %rbx,%rdx
call   1040 <syslog@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xed6(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@LOG_NOTICE = global i32 0
@.str = [3 x i8] c"%s\00"
@.str.1 = [35 x i8] c"not implemented in the chunkserver\00"
@stderr = global i32 0
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @hdd_restore() {
%1 = load i32, i32* @LOG_NOTICE
%2 = call i32 @syslog(i32 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@LOG_NOTICE = global i32 0
@.str = [3 x i8] c"%s\00"
@.str.1 = [35 x i8] c"not implemented in the chunkserver\00"
@stderr = global i32 0
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @hdd_restore() {
%1 = load i32, i32* @LOG_NOTICE
%2 = tail call i32 @syslog(i32 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ checkForOption(char *, int, char **);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ print_help();
void check_for_help(int argc, char *argv[]) {
  if (checkForOption("--help", argc, argv) ||
      checkForOption("-help", argc, argv)) {
    print_help();
    exit(1);
  }
}


x86 assembly (clang, -O0):
<check_for_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xeb3(%rip),%rdi
call   1030 <checkForOption@plt>
cmp    $0x0,%rax
jne    1179 <check_for_help+0x49>
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xe97(%rip),%rdi
call   1030 <checkForOption@plt>
cmp    $0x0,%rax
je     118a <check_for_help+0x5a>
mov    $0x0,%al
call   1040 <print_help@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_for_help>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xec1(%rip),%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
call   1030 <checkForOption@plt>
test   %rax,%rax
jne    116b <check_for_help+0x3b>
lea    0xeac(%rip),%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
call   1030 <checkForOption@plt>
test   %rax,%rax
jne    116b <check_for_help+0x3b>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
xor    %eax,%eax
call   1040 <print_help@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"--help\00"
@.str.1 = [6 x i8] c"-help\00"
define void @check_for_help(i32 %0, i8** %1) {
%3 = tail call i64 @checkForOption(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0, i8** %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i64 @checkForOption(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %0, i8** %1)
%7 = icmp eq i64 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %5, %2
%9 = tail call i32 (...) @print_help()
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %5
ret void
}
void IntSoftwareIntClear(unsigned int intrNum) {
  (*((volatile unsigned int *)((0x48200000) +
                               (0x94 + ((intrNum >> (0x05)) * 0x20))))) =
      (0x01 << (intrNum & (0x1F)));
}


x86 assembly (clang, -O0):
<IntSoftwareIntClear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x1f,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
shr    $0x5,%eax
shl    $0x5,%eax
add    $0x94,%eax
add    $0x48200000,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<IntSoftwareIntClear>:
mov    %edi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    $0xffffffe0,%ecx
add    $0x48200094,%ecx
mov    %eax,(%rcx)
ret

LLVM IR (-O0):
define void @IntSoftwareIntClear(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 31
%5 = shl i32 1, %4
%6 = load i32, i32* %2
%7 = lshr i32 %6, 5
%8 = mul i32 %7, 32
%9 = add i32 148, %8
%10 = add i32 1210056704, %9
%11 = zext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
store volatile i32 %5, i32* %12
ret void
}

LLVM IR (-O2):
define void @IntSoftwareIntClear(i32 %0) {
%2 = and i32 %0, 31
%3 = shl nuw i32 1, %2
%4 = and i32 %0, -32
%5 = add i32 %4, 1210056852
%6 = zext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
store volatile i32 %3, i32* %7
ret void
}
void RTUtf16CalcLatin1LenEx(void) {}


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

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

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

LLVM IR (-O2):
define void @RTUtf16CalcLatin1LenEx() {
ret void
}
void usb_ep2_token() {}


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

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

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

LLVM IR (-O2):
define void @usb_ep2_token() {
ret void
}
int row_byte_gbk2(int row) { return 0x81 + row; }


x86 assembly (clang, -O0):
<row_byte_gbk2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x81,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<row_byte_gbk2>:
lea    0x81(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @row_byte_gbk2(i32 %0) {
%2 = add nsw i32 %0, 129
ret i32 %2
}
/* Variables and functions */
char *strcpy(char *, char const *);
char *strcat(char *dest, const char *src) {
  while (*dest++)
    ;
  return strcpy(dest, src);
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     113d <strcat+0x2d>
jmp    1120 <strcat+0x10>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strcat>
jmp    1030 <strcpy@plt>

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

LLVM IR (-O2):
define i8* @strcat(i8* %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %5, %3 ]
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %4
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3
%9 = tail call i8* @strcpy(i8* %5, i8* dereferenceable(1) %1)
ret i8* %5
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};
struct sockaddr {
  int dummy;
};

/* Variables and functions */
int bind(int, struct sockaddr *, int);
int INET_bind(int socket, struct sockaddr_in *address, int address_len) {
  return bind(socket, (struct sockaddr *)address, address_len);
}


x86 assembly (clang, -O0):
<INET_bind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <bind@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<INET_bind>:
jmp    1030 <bind@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @INET_bind(i32 %0, %struct.sockaddr_in* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.sockaddr_in*
%6 = alloca i32
store i32 %0, i32* %4
store %struct.sockaddr_in* %1, %struct.sockaddr_in** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load %struct.sockaddr_in*, %struct.sockaddr_in** %5
%9 = bitcast %struct.sockaddr_in* %8 to %struct.sockaddr*
%10 = load i32, i32* %6
%11 = call i32 @bind(i32 %7, %struct.sockaddr* %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @INET_bind(i32 %0, %struct.sockaddr_in* %1, i32 %2) {
%4 = bitcast %struct.sockaddr_in* %1 to %struct.sockaddr*
%5 = tail call i32 @bind(i32 %0, %struct.sockaddr* %4, i32 %2)
ret i32 %5
}
void vtScrollUp(void *pointer) {
  struct virtualTerminal *vt = (struct virtualTerminal *)pointer;
}


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

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

LLVM IR (-O0):
%struct.virtualTerminal = type opaque
define void @vtScrollUp(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.virtualTerminal*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.virtualTerminal*
store %struct.virtualTerminal* %5, %struct.virtualTerminal** %3
ret void
}

LLVM IR (-O2):
define void @vtScrollUp(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int do_valid_stuff() {
  printf("The serial number is valid!\n");
  exit(0);
}


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

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

LLVM IR (-O0):
@.str = [29 x i8] c"The serial number is valid!\0A\00"
define i32 @do_valid_stuff() {
%1 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [28 x i8] c"The serial number is valid!\00"
define i32 @do_valid_stuff() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ f();
void *t_fun(void *arg) {
  f();
  return NULL;
}


x86 assembly (clang, -O0):
<t_fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <f@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @t_fun(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @f()
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @t_fun(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @f()
ret i8* null
}
int fun480() { return 480; }


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

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

LLVM IR (-O0):
define i32 @fun480() {
ret i32 480
}

LLVM IR (-O2):
define i32 @fun480() {
ret i32 480
}
float fahr_to_celsius(float f) { return (5.0 / 9.0) * (f - 32.0); }


x86 assembly (clang, -O0):
<fahr_to_celsius>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeee(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xeda(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fahr_to_celsius>:
cvtss2sd %xmm0,%xmm0
addsd  0xef4(%rip),%xmm0
mulsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @fahr_to_celsius(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fsub double %4, 3.200000e+01
%6 = fmul double 0x3FE1C71C71C71C72, %5
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @fahr_to_celsius(float %0) {
%2 = fpext float %0 to double
%3 = fadd double %2, -3.200000e+01
%4 = fmul double %3, 0x3FE1C71C71C71C72
%5 = fptrunc double %4 to float
ret float %5
}
int hashname(char *name) {
  int val = 0;
  int i = 1;
  while (*name != 0) {
    val += (*name) * i;
    i++;
    name++;
  }
  return val;
}


x86 assembly (clang, -O0):
<hashname>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1151 <hashname+0x51>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
imul   -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1116 <hashname+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashname>:
mov    (%rdi),%dl
xor    %eax,%eax
test   %dl,%dl
je     1124 <hashname+0x24>
mov    $0x1,%ecx
nopl   (%rax)
movsbl %dl,%edx
imul   %ecx,%edx
add    %edx,%eax
movzbl (%rdi,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <hashname+0x10>
ret

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

LLVM IR (-O2):
define i32 @hashname(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %14, %4 ], [ %2, %1 ]
%6 = phi i32 [ %12, %4 ], [ 1, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = phi i8* [ %13, %4 ], [ %0, %1 ]
%9 = sext i8 %5 to i32
%10 = mul nsw i32 %6, %9
%11 = add nsw i32 %10, %7
%12 = add nuw nsw i32 %6, 1
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %4, %1
%17 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ abc();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ xyz();
void func3(int x) {
  printf("Called func3\n");
  xyz();
  abc();
}


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

x86 assembly (clang, -O2):
<func3>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <xyz@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <abc@plt>

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

LLVM IR (-O2):
@str = [13 x i8] c"Called func3\00"
define void @func3(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @xyz()
%4 = tail call i32 (...) @abc()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello World!");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello World!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void setval_167(unsigned *p) { *p = 3281113481U; }


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

x86 assembly (clang, -O2):
<setval_167>:
movl   $0xc391d189,(%rdi)
ret

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

LLVM IR (-O2):
define void @setval_167(i32* nocapture writeonly %0) {
store i32 -1013853815, i32* %0
ret void
}
int mad_is_vendor_range1(int mgmt) { return mgmt >= 0x9 && mgmt <= 0xf; }


x86 assembly (clang, -O0):
<mad_is_vendor_range1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x9,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <mad_is_vendor_range1+0x20>
cmpl   $0xf,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mad_is_vendor_range1>:
add    $0xfffffff7,%edi
xor    %eax,%eax
cmp    $0x7,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @mad_is_vendor_range1(i32 %0) {
%2 = add i32 %0, -9
%3 = icmp ult i32 %2, 7
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int Theory(int, int, int);
void Solve() {
  int r;
  r = Theory(1, 2, 3);
  if (r == 0)
    return;
  r = Theory(3, 2, 1);
  if (r == 0)
    return;
  r = Theory(4, 4, 4);
  if (r == 0)
    return;
}


x86 assembly (clang, -O0):
<Solve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1030 <Theory@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    113e <Solve+0x2e>
jmp    1184 <Solve+0x74>
mov    $0x3,%edi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <Theory@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1164 <Solve+0x54>
jmp    1184 <Solve+0x74>
mov    $0x4,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1030 <Theory@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1184 <Solve+0x74>
jmp    1184 <Solve+0x74>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Solve>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1030 <Theory@plt>
test   %eax,%eax
je     1156 <Solve+0x46>
mov    $0x3,%edi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <Theory@plt>
test   %eax,%eax
je     1156 <Solve+0x46>
mov    $0x4,%edi
mov    $0x4,%esi
mov    $0x4,%edx
pop    %rax
jmp    1030 <Theory@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @Solve() {
%1 = tail call i32 @Theory(i32 1, i32 2, i32 3)
%2 = icmp eq i32 %1, 0
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = tail call i32 @Theory(i32 3, i32 2, i32 1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @Theory(i32 4, i32 4, i32 4)
br label %8
8: ; preds = %6, %3, %0
ret void
}
void nosprintf5() {}


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

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

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

LLVM IR (-O2):
define void @nosprintf5() {
ret void
}
float foo_impl(float x) { return x + 1; }


x86 assembly (clang, -O0):
<foo_impl>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
addss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo_impl>:
addss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @foo_impl(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fadd float %3, 1.000000e+00
ret float %4
}

LLVM IR (-O2):
define float @foo_impl(float %0) {
%2 = fadd float %0, 1.000000e+00
ret float %2
}
void gtk_image_new() {}


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

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

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

LLVM IR (-O2):
define void @gtk_image_new() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ free_array_and_exit(char **, int);
char **realloc(char **, int);
char **array_realloc(char **array, uint32_t size) {
  char **new_array = realloc(array, sizeof(char *) * size);
  if (new_array == NULL) {
    free_array_and_exit(new_array, size);
  }
  return new_array;
}


x86 assembly (clang, -O0):
<array_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%esi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115d <array_realloc+0x3d>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <free_array_and_exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_realloc>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
lea    0x0(,%r14,8),%esi
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1146 <array_realloc+0x26>
xor    %edi,%edi
mov    %r14d,%esi
call   1030 <free_array_and_exit@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8** @array_realloc(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
%5 = alloca i8**
store i8** %0, i8*** %3
store i32 %1, i32* %4
%6 = load i8**, i8*** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = mul i64 8, %8
%10 = trunc i64 %9 to i32
%11 = call i8** @realloc(i8** %6, i32 %10)
store i8** %11, i8*** %5
%12 = load i8**, i8*** %5
%13 = icmp eq i8** %12, null
br i1 %13, label %14, label %18
14: ; preds = %2
%15 = load i8**, i8*** %5
%16 = load i32, i32* %4
%17 = call i32 @free_array_and_exit(i8** %15, i32 %16)
br label %18
18: ; preds = %14, %2
%19 = load i8**, i8*** %5
ret i8** %19
}

LLVM IR (-O2):
define i8** @array_realloc(i8** %0, i32 %1) {
%3 = shl i32 %1, 3
%4 = tail call i8** @realloc(i8** %0, i32 %3)
%5 = icmp eq i8** %4, null
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @free_array_and_exit(i8** null, i32 %1)
br label %8
8: ; preds = %6, %2
ret i8** %4
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void os_closesocket(int sock) {
  if (sock > -1)
    close(sock);
}


x86 assembly (clang, -O0):
<os_closesocket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jle    112d <os_closesocket+0x1d>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_closesocket>:
test   %edi,%edi
js     1119 <os_closesocket+0x9>
jmp    1030 <close@plt>
ret

LLVM IR (-O0):
define void @os_closesocket(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, -1
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @close(i32 %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @os_closesocket(i32 %0) {
%2 = icmp sgt i32 %0, -1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @close(i32 %0)
br label %5
5: ; preds = %3, %1
ret void
}
unsigned char mouse_get_x(void) { return 0; }


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

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

LLVM IR (-O0):
define zeroext i8 @mouse_get_x() {
ret i8 0
}

LLVM IR (-O2):
define zeroext i8 @mouse_get_x() {
ret i8 0
}
int scnothing() { return (0); }


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

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

LLVM IR (-O0):
define i32 @scnothing() {
ret i32 0
}

LLVM IR (-O2):
define i32 @scnothing() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int8_t hcd_free(void *pAddress) {}


x86 assembly (clang, -O0):
<hcd_free>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @hcd_free(i8* nocapture readnone %0) {
ret i32 undef
}
unsigned long round_down(unsigned long val, unsigned long rounding) {
  return val & ~(rounding - 1);
}


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

x86 assembly (clang, -O2):
<round_down>:
mov    %rsi,%rax
neg    %rax
and    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @round_down(i64 %0, i64 %1) {
%3 = sub i64 0, %1
%4 = and i64 %3, %0
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ putchar(unsigned char);
void putstr(unsigned char *s) {
  int i;
  for (i = 0; s[i]; i++) {
    putchar(s[i]);
  }
}


x86 assembly (clang, -O0):
<putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1154 <putstr+0x44>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzbl (%rax,%rcx,1),%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <putstr+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putstr>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <putstr+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movzbl %al,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <putstr+0x10>
pop    %rbx
ret

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

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


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

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

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

LLVM IR (-O2):
define void @sys_close_midi() {
ret void
}
unsigned int sdbm(const char *s) {
  unsigned int h = 0;
  int c;
  while (c = *s++)
    h = c + (h << 6) + (h << 16) - h;
  return h;
}


x86 assembly (clang, -O0):
<sdbm>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
je     114b <sdbm+0x4b>
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x6,%ecx
add    %ecx,%eax
mov    -0xc(%rbp),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <sdbm+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @sdbm(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 i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = sext i8 %5 to i32
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = mul i32 %7, 65599
%11 = add i32 %10, %8
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %15
}
/* Variables and functions */
int csv_get_int(int /*<<< orphan*/);
int /*<<< orphan*/ field_start(char *, int);
int csvint(char *line, int f) { return csv_get_int(field_start(line, f)); }


x86 assembly (clang, -O0):
<csvint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <field_start@plt>
mov    %eax,%edi
call   1040 <csv_get_int@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @csvint(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @field_start(i8* %5, i32 %6)
%8 = call i32 @csv_get_int(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @csvint(i8* %0, i32 %1) {
%3 = tail call i32 @field_start(i8* %0, i32 %1)
%4 = tail call i32 @csv_get_int(i32 %3)
ret i32 %4
}