xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void childhandler(int signo __attribute__((unused))) {
  printf("Caught signal from child!\n");
  exit(0);
}


x86 assembly (clang, -O0):
<childhandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [27 x i8] c"Caught signal from child!\0A\00"
define void @childhandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [26 x i8] c"Caught signal from child!\00"
define void @childhandler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
double aphelion(double sma, double e) {
  double r;
  r = sma * (1.0 + e);
  return r;
}


x86 assembly (clang, -O0):
<aphelion>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xee5(%rip),%xmm1
addsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<aphelion>:
addsd  0xef8(%rip),%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @aphelion(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %4
%8 = fadd double 1.000000e+00, %7
%9 = fmul double %6, %8
store double %9, double* %5
%10 = load double, double* %5
ret double %10
}

LLVM IR (-O2):
define double @aphelion(double %0, double %1) {
%3 = fadd double %1, 1.000000e+00
%4 = fmul double %3, %0
ret double %4
}
void test_create_rays() {}


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

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

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

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

/* Variables and functions */
uint32_t EEPROMBlockCountGet(void) {
  return (((((*((volatile uint32_t *)(0x400AF000)))) & 0x07FF0000) >> 16));
}


x86 assembly (clang, -O0):
<EEPROMBlockCountGet>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400af000,%eax
mov    (%rax),%eax
and    $0x7ff0000,%eax
sar    $0x10,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<EEPROMBlockCountGet>:
mov    0x400af000,%eax
shr    $0x10,%eax
and    $0x7ff,%eax
ret

LLVM IR (-O0):
define i32 @EEPROMBlockCountGet() {
%1 = load volatile i32, i32* inttoptr (i64 1074458624 to i32*)
%2 = and i32 %1, 134152192
%3 = ashr i32 %2, 16
ret i32 %3
}

LLVM IR (-O2):
define i32 @EEPROMBlockCountGet() {
%1 = load volatile i32, i32* inttoptr (i64 1074458624 to i32*)
%2 = lshr i32 %1, 16
%3 = and i32 %2, 2047
ret i32 %3
}
/* Variables and functions */
unsigned int rgb_to_pixel32(unsigned int, unsigned int, unsigned int);
unsigned int rgb_to_pixel32_dup(unsigned int r, unsigned int g,
                                unsigned int b) {
  unsigned int col;
  col = rgb_to_pixel32(r, g, b);
  return col;
}


x86 assembly (clang, -O0):
<rgb_to_pixel32_dup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <rgb_to_pixel32@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgb_to_pixel32_dup>:
jmp    1030 <rgb_to_pixel32@plt>

LLVM IR (-O0):
define i32 @rgb_to_pixel32_dup(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @rgb_to_pixel32(i32 %8, i32 %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
ret i32 %12
}

LLVM IR (-O2):
define i32 @rgb_to_pixel32_dup(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @rgb_to_pixel32(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ adc8(int /*<<< orphan*/);
int /*<<< orphan*/ indirectl();
int /*<<< orphan*/ readmem65816(int /*<<< orphan*/);
void adcIndirectLong8(void) { adc8(readmem65816(indirectl())); }


x86 assembly (clang, -O0):
<adcIndirectLong8>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <indirectl@plt>
mov    %eax,%edi
call   1050 <readmem65816@plt>
mov    %eax,%edi
call   1030 <adc8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<adcIndirectLong8>:
push   %rax
xor    %eax,%eax
call   1040 <indirectl@plt>
mov    %eax,%edi
call   1050 <readmem65816@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <adc8@plt>

LLVM IR (-O0):
define void @adcIndirectLong8() {
%1 = call i32 (...) @indirectl()
%2 = call i32 @readmem65816(i32 %1)
%3 = call i32 @adc8(i32 %2)
ret void
}

LLVM IR (-O2):
define void @adcIndirectLong8() {
%1 = tail call i32 (...) @indirectl()
%2 = tail call i32 @readmem65816(i32 %1)
%3 = tail call i32 @adc8(i32 %2)
ret void
}
int find_nonzero(int *dat, int nr) {
  int idx;
  for (idx = 0; idx < nr; ++idx) {
    if (dat[idx])
      return idx;
  }
  return -1;
}


x86 assembly (clang, -O0):
<find_nonzero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    114e <find_nonzero+0x4e>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     113b <find_nonzero+0x3b>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1155 <find_nonzero+0x55>
jmp    1140 <find_nonzero+0x40>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <find_nonzero+0x12>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_nonzero>:
mov    $0xffffffff,%eax
test   %esi,%esi
jle    111f <find_nonzero+0x1f>
mov    %esi,%edx
xor    %ecx,%ecx
nopl   (%rax)
cmpl   $0x0,(%rdi,%rcx,4)
jne    1120 <find_nonzero+0x20>
add    $0x1,%rcx
cmp    %rcx,%rdx
jne    1110 <find_nonzero+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @find_nonzero(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %16
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %11
%7 = phi i64 [ 0, %4 ], [ %12, %11 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %6
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %16, label %6
14: ; preds = %6
%15 = trunc i64 %7 to i32
br label %16
16: ; preds = %11, %14, %2
%17 = phi i32 [ -1, %2 ], [ %15, %14 ], [ -1, %11 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0xdf() {
  Assert_real((isgraph(223) == 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_isgraph.c",
              1120, ("isgraph should be 0 for 0xdf"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xdf\00"
define void @t_isgraph_0xdf() {
%1 = tail call i64 @isgraph(i32 223)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1120, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
float fdividef(float x, float y) { return x / y; }


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

x86 assembly (clang, -O2):
<fdividef>:
divss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @fdividef(float %0, float %1) {
%3 = fdiv float %0, %1
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int fact, i, n, m;
  fact = 1;
  for (n = 10; n > 0; n--) {
    fact = fact * n;
  }
  printf("!10 = %d\n", fact);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0xa,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    114f <main+0x3f>
mov    -0x8(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <main+0x1d>
mov    -0x8(%rbp),%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"!10 = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 3628800)
ret i32 0
}
void integrate_physics_engine(struct physics_engine *physics_engine) {}


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

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

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

LLVM IR (-O2):
%struct.physics_engine = type opaque
define void @integrate_physics_engine(%struct.physics_engine* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("PyCharlockHolmes\n");
  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 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [17 x i8] c"PyCharlockHolmes\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ check_info();
char const *qt_internal_envstr(char const *, char const *);
int strlen(char const *);
const char __attribute__((visibility("hidden"))) *
    qt_internal_get_env_str(const char *envariable, const char *dflt) {
  assert(strlen(envariable) < 90);
  check_info();
  return qt_internal_envstr(envariable, dflt);
}


x86 assembly (clang, -O0):
<qt_internal_get_env_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x5a,%eax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x0,%al
call   1060 <check_info@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <qt_internal_envstr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qt_internal_get_env_str>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
xor    %edi,%edi
cmp    $0x5a,%eax
setl   %dil
call   1040 <assert@plt>
xor    %eax,%eax
call   1060 <check_info@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <qt_internal_envstr@plt>

LLVM IR (-O0):
define hidden i8* @qt_internal_get_env_str(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i32 @strlen(i8* %5)
%7 = icmp slt i32 %6, 90
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = call i32 (...) @check_info()
%11 = load i8*, i8** %3
%12 = load i8*, i8** %4
%13 = call i8* @qt_internal_envstr(i8* %11, i8* %12)
ret i8* %13
}

LLVM IR (-O2):
define hidden i8* @qt_internal_get_env_str(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = icmp slt i32 %3, 90
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i32 (...) @check_info()
%8 = tail call i8* @qt_internal_envstr(i8* %0, i8* %1)
ret i8* %8
}
volatile int read_INPUT(int port, int pin) {
  unsigned volatile int buf;
  if (port == 0x00) {
    buf = *(unsigned int volatile *)(0x41004400 + 0x20);
  } else if (port == 0x80) {
    buf = *(unsigned int volatile *)(0x41004400 + 0xA0);
  }
  if (buf & (1 << pin)) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<read_INPUT>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1123 <read_INPUT+0x23>
mov    $0x41004420,%eax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
jmp    113f <read_INPUT+0x3f>
cmpl   $0x80,-0x8(%rbp)
jne    113a <read_INPUT+0x3a>
mov    $0x410044a0,%eax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
jmp    113f <read_INPUT+0x3f>
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1165 <read_INPUT+0x65>
movl   $0x1,-0x4(%rbp)
jmp    116c <read_INPUT+0x6c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_INPUT>:
mov    %esi,%ecx
cmp    $0x80,%edi
je     1117 <read_INPUT+0x17>
test   %edi,%edi
jne    1122 <read_INPUT+0x22>
mov    0x41004420,%eax
jmp    111e <read_INPUT+0x1e>
mov    0x410044a0,%eax
mov    %eax,-0x4(%rsp)
mov    -0x4(%rsp),%eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @read_INPUT(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load volatile i32, i32* inttoptr (i64 1090536480 to i32*)
store volatile i32 %10, i32* %6
br label %17
11: ; preds = %2
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, 128
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = load volatile i32, i32* inttoptr (i64 1090536608 to i32*)
store volatile i32 %15, i32* %6
br label %16
16: ; preds = %14, %11
br label %17
17: ; preds = %16, %9
%18 = load volatile i32, i32* %6
%19 = load i32, i32* %5
%20 = shl i32 1, %19
%21 = and i32 %18, %20
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %24
23: ; preds = %17
store i32 1, i32* %3
br label %25
24: ; preds = %17
store i32 0, i32* %3
br label %25
25: ; preds = %24, %23
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @read_INPUT(i32 %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
switch i32 %0, label %9 [
i32 0, label %5
i32 128, label %7
]
5: ; preds = %2
%6 = load volatile i32, i32* inttoptr (i64 1090536480 to i32*)
store volatile i32 %6, i32* %3
br label %9
7: ; preds = %2
%8 = load volatile i32, i32* inttoptr (i64 1090536608 to i32*)
store volatile i32 %8, i32* %3
br label %9
9: ; preds = %2, %7, %5
%10 = load volatile i32, i32* %3
%11 = lshr i32 %10, %1
%12 = and i32 %11, 1
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ ushort;

/* Variables and functions */
int cannawcstrlen(int /*<<< orphan*/ *);
scalar_t__ malloc(int);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
ushort *cannawcstrdup(ushort *ws) {
  ushort *p;
  int len;
  len = cannawcstrlen(ws) * 2 + 2;
  p = (ushort *)malloc(len);
  memcpy(p, ws, len);
  return (ushort *)p;
}


x86 assembly (clang, -O0):
<cannawcstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <cannawcstrlen@plt>
shl    $0x1,%eax
add    $0x2,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cannawcstrdup>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <cannawcstrlen@plt>
lea    (%rax,%rax,1),%ebp
add    $0x2,%ebp
mov    %ebp,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32* @cannawcstrdup(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call i32 @cannawcstrlen(i32* %5)
%7 = mul nsw i32 %6, 2
%8 = add nsw i32 %7, 2
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = call i64 @malloc(i32 %9)
%11 = inttoptr i64 %10 to i32*
store i32* %11, i32** %3
%12 = load i32*, i32** %3
%13 = load i32*, i32** %2
%14 = load i32, i32* %4
%15 = call i32 @memcpy(i32* %12, i32* %13, i32 %14)
%16 = load i32*, i32** %3
ret i32* %16
}

LLVM IR (-O2):
define i32* @cannawcstrdup(i32* %0) {
%2 = tail call i32 @cannawcstrlen(i32* %0)
%3 = shl nsw i32 %2, 1
%4 = add nsw i32 %3, 2
%5 = tail call i64 @malloc(i32 %4)
%6 = inttoptr i64 %5 to i32*
%7 = tail call i32 @memcpy(i32* %6, i32* %0, i32 %4)
ret i32* %6
}
long long g4(long long j, unsigned short *b, long long i) { return j + b[i]; }


x86 assembly (clang, -O0):
<g4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rdx
movzwl (%rcx,%rdx,2),%ecx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g4>:
movzwl (%rsi,%rdx,2),%eax
add    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @g4(i64 %0, i16* %1, i64 %2) {
%4 = alloca i64
%5 = alloca i16*
%6 = alloca i64
store i64 %0, i64* %4
store i16* %1, i16** %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = load i16*, i16** %5
%9 = load i64, i64* %6
%10 = getelementptr inbounds i16, i16* %8, i64 %9
%11 = load i16, i16* %10
%12 = zext i16 %11 to i64
%13 = add nsw i64 %7, %12
ret i64 %13
}

LLVM IR (-O2):
define i64 @g4(i64 %0, i16* nocapture %1, i64 %2) {
%4 = getelementptr inbounds i16, i16* %1, i64 %2
%5 = load i16, i16* %4
%6 = zext i16 %5 to i64
%7 = add nsw i64 %6, %0
ret i64 %7
}
int fun278() { return 278; }


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

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

LLVM IR (-O0):
define i32 @fun278() {
ret i32 278
}

LLVM IR (-O2):
define i32 @fun278() {
ret i32 278
}
/* Type definitions */
typedef scalar_t__ time_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
scalar_t__ time(int /*<<< orphan*/);
int main() {
  int i;
  time_t t;
  printf("%ld\n", (long)time(0));
  for (i = 0; i < 10000000; ++i)
    t = time(0);
  printf("%ld\n", (long)time(0));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1040 <time@plt>
mov    %rax,%rsi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x989680,-0x8(%rbp)
jge    1172 <main+0x52>
xor    %edi,%edi
call   1040 <time@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    114c <main+0x2c>
xor    %edi,%edi
call   1040 <time@plt>
mov    %rax,%rsi
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %edi,%edi
call   1040 <time@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    $0x989680,%ebx
nopl   0x0(%rax)
xor    %edi,%edi
call   1040 <time@plt>
add    $0xffffffff,%ebx
jne    1140 <main+0x20>
xor    %edi,%edi
call   1040 <time@plt>
lea    0xea6(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = tail call i64 @time(i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %1)
br label %3
3: ; preds = %0, %3
%4 = phi i32 [ 0, %0 ], [ %6, %3 ]
%5 = tail call i64 @time(i32 0)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, 10000000
br i1 %7, label %8, label %3
8: ; preds = %3
%9 = tail call i64 @time(i32 0)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ OPER_AY_DI_16();
int /*<<< orphan*/ m68ki_set_ccr(int /*<<< orphan*/);
void m68k_op_move_16_toc_di(void) { m68ki_set_ccr(OPER_AY_DI_16()); }


x86 assembly (clang, -O0):
<m68k_op_move_16_toc_di>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <OPER_AY_DI_16@plt>
mov    %eax,%edi
call   1040 <m68ki_set_ccr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_move_16_toc_di>:
push   %rax
xor    %eax,%eax
call   1030 <OPER_AY_DI_16@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <m68ki_set_ccr@plt>

LLVM IR (-O0):
define void @m68k_op_move_16_toc_di() {
%1 = call i32 (...) @OPER_AY_DI_16()
%2 = call i32 @m68ki_set_ccr(i32 %1)
ret void
}

LLVM IR (-O2):
define void @m68k_op_move_16_toc_di() {
%1 = tail call i32 (...) @OPER_AY_DI_16()
%2 = tail call i32 @m68ki_set_ccr(i32 %1)
ret void
}
void __attribute__((annotate("!realtime"))) baz(void) {}


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"!realtime\00", section "llvm.metadata"
@.str.1 = [62 x i8] c"/home/jiang/dataset/exebench/tmp/tmpmb6hs93y/formatted_code.c\00", section "llvm.metadata"
@llvm.global.annotations = appending global [1 x { i8*, i8*, i8*, i32, i8* }] [{ i8*, i8*, i8*, i32, i8* } { i8* bitcast (void ()* @baz to i8*), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i32 0, i32 0), i32 1, i8* null }], section "llvm.metadata"
define void @baz() {
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"!realtime\00", section "llvm.metadata"
@.str.1 = [62 x i8] c"/home/jiang/dataset/exebench/tmp/tmpmb6hs93y/formatted_code.c\00", section "llvm.metadata"
@llvm.global.annotations = appending global [1 x { i8*, i8*, i8*, i32, i8* }] [{ i8*, i8*, i8*, i32, i8* } { i8* bitcast (void ()* @baz to i8*), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i32 0, i32 0), i32 1, i8* null }], section "llvm.metadata"
define void @baz() {
ret void
}
/* Variables and functions */
bool global_event_triggered(bool *pEvent) {
  if (*pEvent > 0) {
    (*pEvent)--;
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<global_event_triggered>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
jle    112c <global_event_triggered+0x2c>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0xffffffff,%ecx
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1133 <global_event_triggered+0x33>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<global_event_triggered>:
mov    (%rdi),%eax
test   %eax,%eax
jle    1111 <global_event_triggered+0x11>
add    $0xffffffff,%eax
mov    %eax,(%rdi)
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @global_event_triggered(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = add nsw i32 %2, -1
store i32 %5, i32* %0
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ SSL_METHOD;
typedef int /*<<< orphan*/ SSL_CTX;

/* Variables and functions */
int /*<<< orphan*/ ERR_print_errors_fp(int /*<<< orphan*/);
int /*<<< orphan*/ OpenSSL_add_all_algorithms();
int /*<<< orphan*/ *SSL_CTX_new(int /*<<< orphan*/ *);
int /*<<< orphan*/ SSL_load_error_strings();
int /*<<< orphan*/ *SSLv2_client_method();
int /*<<< orphan*/ abort();
int /*<<< orphan*/ stderr;
SSL_CTX *InitCTX(void) {
  SSL_METHOD *method;
  SSL_CTX *ctx;
  OpenSSL_add_all_algorithms();
  SSL_load_error_strings();
  method = SSLv2_client_method();
  ctx = SSL_CTX_new(method);
  if (ctx == NULL) {
    ERR_print_errors_fp(stderr);
    abort();
  }
  return ctx;
}


x86 assembly (clang, -O0):
<InitCTX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <OpenSSL_add_all_algorithms@plt>
mov    $0x0,%al
call   1070 <SSL_load_error_strings@plt>
mov    $0x0,%al
call   1040 <SSLv2_client_method@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <SSL_CTX_new@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    11ae <InitCTX+0x4e>
mov    0x2e40(%rip),%rax
mov    (%rax),%edi
call   1080 <ERR_print_errors_fp@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<InitCTX>:
push   %rax
xor    %eax,%eax
call   1050 <OpenSSL_add_all_algorithms@plt>
xor    %eax,%eax
call   1070 <SSL_load_error_strings@plt>
xor    %eax,%eax
call   1040 <SSLv2_client_method@plt>
mov    %rax,%rdi
call   1060 <SSL_CTX_new@plt>
test   %rax,%rax
je     1185 <InitCTX+0x25>
pop    %rcx
ret
mov    0x2e54(%rip),%rax
mov    (%rax),%edi
call   1080 <ERR_print_errors_fp@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
define i32* @InitCTX() {
%1 = alloca i32*
%2 = alloca i32*
%3 = call i32 (...) @OpenSSL_add_all_algorithms()
%4 = call i32 (...) @SSL_load_error_strings()
%5 = call i32* (...) @SSLv2_client_method()
store i32* %5, i32** %1
%6 = load i32*, i32** %1
%7 = call i32* @SSL_CTX_new(i32* %6)
store i32* %7, i32** %2
%8 = load i32*, i32** %2
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %14
10: ; preds = %0
%11 = load i32, i32* @stderr
%12 = call i32 @ERR_print_errors_fp(i32 %11)
%13 = call i32 (...) @abort()
unreachable
14: ; preds = %0
%15 = load i32*, i32** %2
ret i32* %15
}

LLVM IR (-O2):
@stderr = global i32 0
define i32* @InitCTX() {
%1 = tail call i32 (...) @OpenSSL_add_all_algorithms()
%2 = tail call i32 (...) @SSL_load_error_strings()
%3 = tail call i32* (...) @SSLv2_client_method()
%4 = tail call i32* @SSL_CTX_new(i32* %3)
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = load i32, i32* @stderr
%8 = tail call i32 @ERR_print_errors_fp(i32 %7)
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %0
ret i32* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ cmgr_read(int, void *, size_t);
ssize_t read(int fd, void *buf, size_t count) {
  ssize_t ret;
  ret = cmgr_read(fd, buf, count);
  ;
  return ret;
}


x86 assembly (clang, -O0):
<read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <cmgr_read@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read>:
jmp    1030 <cmgr_read@plt>

LLVM IR (-O0):
define i32 @read(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i32 @cmgr_read(i32 %8, i8* %9, i64 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
ret i32 %12
}

LLVM IR (-O2):
define i32 @read(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @cmgr_read(i32 %0, i8* %1, i64 %2)
ret i32 %4
}
/* Type definitions */
struct timespec {
  int tv_sec;
};
typedef int /*<<< orphan*/ max_wait;

/* Variables and functions */
int /*<<< orphan*/ do_or_timeout(struct timespec *);
int /*<<< orphan*/ memset(struct timespec *, int /*<<< orphan*/, int);
int main() {
  struct timespec max_wait;
  memset(&max_wait, 0, sizeof(max_wait));
  max_wait.tv_sec = 2;
  do_or_timeout(&max_wait);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
movl   $0x2,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <do_or_timeout@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
movl   $0x2,0x8(%rsp)
mov    %rbx,%rdi
call   1040 <do_or_timeout@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.timespec
store i32 0, i32* %1
%3 = call i32 @memset(%struct.timespec* %2, i32 0, i32 4)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
store i32 2, i32* %4
%5 = call i32 @do_or_timeout(%struct.timespec* %2)
ret i32 0
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
define i32 @main() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = call i32 @memset(%struct.timespec* %1, i32 0, i32 4)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
store i32 2, i32* %4
%5 = call i32 @do_or_timeout(%struct.timespec* %1)
ret i32 0
}
/* Type definitions */
struct workqueue_struct {
  int dummy;
};
struct delayed_work {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
bool queue_delayed_work(struct workqueue_struct *wq, struct delayed_work *dwork,
                        unsigned long delay) {
  assert(0);
  return true;
}


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

x86 assembly (clang, -O2):
<queue_delayed_work>:
push   %rax
xor    %edi,%edi
call   1030 <assert@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.workqueue_struct = type { i32 }
%struct.delayed_work = type { i32 }
define i32 @queue_delayed_work(%struct.workqueue_struct* %0, %struct.delayed_work* %1, i64 %2) {
%4 = alloca %struct.workqueue_struct*
%5 = alloca %struct.delayed_work*
%6 = alloca i64
store %struct.workqueue_struct* %0, %struct.workqueue_struct** %4
store %struct.delayed_work* %1, %struct.delayed_work** %5
store i64 %2, i64* %6
%7 = call i32 @assert(i32 0)
ret i32 1
}

LLVM IR (-O2):
%struct.workqueue_struct = type { i32 }
%struct.delayed_work = type { i32 }
define i32 @queue_delayed_work(%struct.workqueue_struct* nocapture readnone %0, %struct.delayed_work* nocapture readnone %1, i64 %2) {
%4 = tail call i32 @assert(i32 0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ HeartRateMonitor_HR_registerListener();
void Tracking_HR_registerListener() { HeartRateMonitor_HR_registerListener(); }


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

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

LLVM IR (-O0):
define void @Tracking_HR_registerListener() {
%1 = call i32 (...) @HeartRateMonitor_HR_registerListener()
ret void
}

LLVM IR (-O2):
define void @Tracking_HR_registerListener() {
%1 = tail call i32 (...) @HeartRateMonitor_HR_registerListener()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int syscall(int);
int main() {
  printf("Process ID: %d\n", syscall(285));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x11d,%edi
call   1040 <syscall@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Process ID: %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @syscall(i32 285)
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"Process ID: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @syscall(i32 285)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int __builtin_mips_cabs_ole_d(double, double);
int test6(double a, double b) { return __builtin_mips_cabs_ole_d(a, b); }


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

x86 assembly (clang, -O2):
<test6>:
jmp    1030 <__builtin_mips_cabs_ole_d@plt>

LLVM IR (-O0):
define i32 @test6(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call i32 @__builtin_mips_cabs_ole_d(double %5, double %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test6(double %0, double %1) {
%3 = tail call i32 @__builtin_mips_cabs_ole_d(double %0, double %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ MIPS_SET_BIT(int, int);
void xburst_cgm_gate_otg1() { MIPS_SET_BIT((0xB0000000 + 0x28), 8); }


x86 assembly (clang, -O0):
<xburst_cgm_gate_otg1>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb0000028,%edi
mov    $0x8,%esi
call   1030 <MIPS_SET_BIT@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<xburst_cgm_gate_otg1>:
mov    $0xb0000028,%edi
mov    $0x8,%esi
jmp    1030 <MIPS_SET_BIT@plt>

LLVM IR (-O0):
define void @xburst_cgm_gate_otg1() {
%1 = call i32 @MIPS_SET_BIT(i32 -1342177240, i32 8)
ret void
}

LLVM IR (-O2):
define void @xburst_cgm_gate_otg1() {
%1 = tail call i32 @MIPS_SET_BIT(i32 -1342177240, i32 8)
ret void
}
void RTVfsChainOpenIoStream(void) {}


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

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

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

LLVM IR (-O2):
define void @RTVfsChainOpenIoStream() {
ret void
}
void uDMAChannel16_23SelectDefault(unsigned long ulDefPeriphs) {
  (*((volatile unsigned long *)(0x400FF518))) &= ~ulDefPeriphs;
}


x86 assembly (clang, -O0):
<uDMAChannel16_23SelectDefault>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xor    $0xffffffffffffffff,%rax
mov    $0x400ff518,%ecx
mov    (%rcx),%rcx
and    %rax,%rcx
mov    $0x400ff518,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uDMAChannel16_23SelectDefault>:
not    %rdi
and    %rdi,0x400ff518
40
ret

LLVM IR (-O0):
define void @uDMAChannel16_23SelectDefault(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = xor i64 %3, -1
%5 = load volatile i64, i64* inttoptr (i64 1074787608 to i64*)
%6 = and i64 %5, %4
store volatile i64 %6, i64* inttoptr (i64 1074787608 to i64*)
ret void
}

LLVM IR (-O2):
define void @uDMAChannel16_23SelectDefault(i64 %0) {
%2 = xor i64 %0, -1
%3 = load volatile i64, i64* inttoptr (i64 1074787608 to i64*)
%4 = and i64 %3, %2
store volatile i64 %4, i64* inttoptr (i64 1074787608 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
void setpgid_error() { perror("setpgid error"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"setpgid error\00"
define void @setpgid_error() {
%1 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"setpgid error\00"
define void @setpgid_error() {
%1 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
float thinBurn(float radius, float *params) {
  if (radius >= params[0])
    return params[1];
  else
    return 1.0;
}


x86 assembly (clang, -O0):
<thinBurn>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rax
ucomiss (%rax),%xmm0
jb     1132 <thinBurn+0x32>
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    113f <thinBurn+0x3f>
movss  0xec6(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<thinBurn>:
ucomiss (%rdi),%xmm0
jae    110e <thinBurn+0xe>
movss  0xef3(%rip),%xmm0
ret
movss  0x4(%rdi),%xmm0
ret

LLVM IR (-O0):
define float @thinBurn(float %0, float* %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float*
store float %0, float* %4
store float* %1, float** %5
%6 = load float, float* %4
%7 = load float*, float** %5
%8 = getelementptr inbounds float, float* %7, i64 0
%9 = load float, float* %8
%10 = fcmp oge float %6, %9
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load float*, float** %5
%13 = getelementptr inbounds float, float* %12, i64 1
%14 = load float, float* %13
store float %14, float* %3
br label %16
15: ; preds = %2
store float 1.000000e+00, float* %3
br label %16
16: ; preds = %15, %11
%17 = load float, float* %3
ret float %17
}

LLVM IR (-O2):
define float @thinBurn(float %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = fcmp ugt float %3, %0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = getelementptr inbounds float, float* %1, i64 1
%7 = load float, float* %6
br label %8
8: ; preds = %2, %5
%9 = phi float [ %7, %5 ], [ 1.000000e+00, %2 ]
ret float %9
}
int test_imm_2Bint8_mem(signed char *val) {
  return ((*val) & (0x2B << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_2Bint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 43
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ japi_setcolor(int, int, int, int);
void j_setcolor(int arg0, int arg1, int arg2, int arg3) {
  japi_setcolor(arg0, arg1, arg2, arg3);
}


x86 assembly (clang, -O0):
<j_setcolor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1030 <japi_setcolor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<j_setcolor>:
jmp    1030 <japi_setcolor@plt>

LLVM IR (-O0):
define void @j_setcolor(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @japi_setcolor(i32 %9, i32 %10, i32 %11, i32 %12)
ret void
}

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

/* Variables and functions */
int /*<<< orphan*/ fread(unsigned char *, int, int, int /*<<< orphan*/ *);
int ReadWord32(FILE *f) {
  unsigned char buf[4];
  fread(buf, 4, 1, f);
  return (((unsigned int)buf[0]) << 24) + (((unsigned int)buf[1]) << 16) +
         (((unsigned int)buf[2]) << 8) + (unsigned int)buf[3];
}


x86 assembly (clang, -O0):
<ReadWord32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
movzbl -0xc(%rbp),%eax
shl    $0x18,%eax
movzbl -0xb(%rbp),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
movzbl -0xa(%rbp),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
movzbl -0x9(%rbp),%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadWord32>:
push   %rax
mov    %rdi,%rcx
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    0x4(%rsp),%eax
bswap  %eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ReadWord32(i32* %0) {
%2 = alloca i32*
%3 = alloca [4 x i8]
store i32* %0, i32** %2
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%5 = load i32*, i32** %2
%6 = call i32 @fread(i8* %4, i32 4, i32 1, i32* %5)
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = shl i32 %9, 24
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = shl i32 %13, 16
%15 = add i32 %10, %14
%16 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 2
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = add i32 %15, %19
%21 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 3
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = add i32 %20, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @ReadWord32(i32* nocapture %0) {
%2 = alloca [4 x i8]
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%4 = call i32 @fread(i8* %3, i32 4, i32 1, i32* %0)
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = shl nuw i32 %6, 24
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 1
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = shl nuw nsw i32 %10, 16
%12 = or i32 %11, %7
%13 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 2
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = shl nuw nsw i32 %15, 8
%17 = or i32 %12, %16
%18 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 3
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = or i32 %17, %20
ret i32 %21
}