xunge/DecIR huggingface dataset:
__attribute__((visibility("hidden"))) void
create_wait_event(struct wait_event *wait_event) {}


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

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

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

LLVM IR (-O2):
%struct.wait_event = type opaque
define hidden void @create_wait_event(%struct.wait_event* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pushNumber(int /*<<< orphan*/);
int /*<<< orphan*/ stopmusic();
void basStopMusic() { pushNumber(stopmusic()); }


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

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

LLVM IR (-O0):
define void @basStopMusic() {
%1 = call i32 (...) @stopmusic()
%2 = call i32 @pushNumber(i32 %1)
ret void
}

LLVM IR (-O2):
define void @basStopMusic() {
%1 = tail call i32 (...) @stopmusic()
%2 = tail call i32 @pushNumber(i32 %1)
ret void
}
/* Variables and functions */
int addemup(int *);
int *calloc(int, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int sum;
  int *a = calloc(10, sizeof(int));
  sum = addemup(a);
  printf("sum is %d\n", sum);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
mov    $0x4,%esi
call   1050 <calloc@plt>
mov    %rax,%rdi
call   1030 <addemup@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"sum is %d\0A\00"
define i32 @main() {
%1 = tail call i32* @calloc(i32 10, i32 4)
%2 = tail call i32 @addemup(i32* %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Variables and functions */
int colpt(void *, int /*<<< orphan*/);
int cuncollapse(void *v) { return colpt(v, 0); }


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

x86 assembly (clang, -O2):
<cuncollapse>:
xor    %esi,%esi
jmp    1030 <colpt@plt>

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

LLVM IR (-O2):
define i32 @cuncollapse(i8* %0) {
%2 = tail call i32 @colpt(i8* %0, i32 0)
ret i32 %2
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  char word;
  int count = 0;
  printf("enter the word: ");
  while ((word = getchar()) != '\n') {
    count += 1;
  }
  printf("word count is %d\n", count);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%eax
cmp    $0xa,%eax
je     1168 <main+0x48>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1144 <main+0x24>
mov    -0xc(%rbp),%esi
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0xffffffff,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1040 <getchar@plt>
add    $0x1,%ebx
cmp    $0xa,%al
jne    1140 <main+0x20>
lea    0xebc(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"enter the word: \00"
@.str.1 = [18 x i8] c"word count is %d\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
%3 = phi i32 [ 0, %0 ], [ %6, %2 ]
%4 = tail call signext i8 (...) @getchar()
%5 = icmp eq i8 %4, 10
%6 = add nuw nsw i32 %3, 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
double atan(double);
double dmnsn_radians(double degrees) { return degrees * (atan(1.0) / 45.0); }


x86 assembly (clang, -O0):
<dmnsn_radians>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xed9(%rip),%xmm0
call   1030 <atan@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  0xebc(%rip),%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dmnsn_radians>:
push   %rax
movsd  %xmm0,(%rsp)
movsd  0xee2(%rip),%xmm0
call   1030 <atan@plt>
movsd  (%rsp),%xmm0
mulsd  0xed8(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @dmnsn_radians(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @atan(double 1.000000e+00)
%5 = fdiv double %4, 4.500000e+01
%6 = fmul double %3, %5
ret double %6
}

LLVM IR (-O2):
define double @dmnsn_radians(double %0) {
%2 = tail call double @atan(double 1.000000e+00)
%3 = fmul double %0, 0x3F91DF46A2529D39
ret double %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void test_vorr_u32x4(uint32_t *__restrict__ dest, uint32_t *a, uint32_t *b) {
  int i;
  for (i = 0; i < 4; i++) {
    dest[i] = a[i] | b[i];
  }
}


x86 assembly (clang, -O0):
<test_vorr_u32x4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x4,-0x1c(%rbp)
jge    1150 <test_vorr_u32x4+0x50>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
or     (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1117 <test_vorr_u32x4+0x17>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_vorr_u32x4>:
movups (%rsi),%xmm0
movups (%rdx),%xmm1
orps   %xmm0,%xmm1
movups %xmm1,(%rdi)
ret

LLVM IR (-O0):
define void @test_vorr_u32x4(i32* noalias %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
store i32 0, i32* %7
br label %8
8: ; preds = %27, %3
%9 = load i32, i32* %7
%10 = icmp slt i32 %9, 4
br i1 %10, label %11, label %30
11: ; preds = %8
%12 = load i32*, i32** %5
%13 = load i32, i32* %7
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = load i32, i32* %15
%17 = load i32*, i32** %6
%18 = load i32, i32* %7
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %17, i64 %19
%21 = load i32, i32* %20
%22 = or i32 %16, %21
%23 = load i32*, i32** %4
%24 = load i32, i32* %7
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
br label %27
27: ; preds = %11
%28 = load i32, i32* %7
%29 = add nsw i32 %28, 1
store i32 %29, i32* %7
br label %8
30: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @test_vorr_u32x4(i32* noalias nocapture writeonly %0, i32* nocapture %1, i32* nocapture %2) {
%4 = bitcast i32* %1 to <4 x i32>*
%5 = load <4 x i32>, <4 x i32>* %4
%6 = bitcast i32* %2 to <4 x i32>*
%7 = load <4 x i32>, <4 x i32>* %6
%8 = or <4 x i32> %7, %5
%9 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> %8, <4 x i32>* %9
ret void
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
long gettimeofday(struct timeval *, int);
long TimerStart(struct timeval *start_time) {
  return gettimeofday(start_time, 0x0);
}


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

x86 assembly (clang, -O2):
<TimerStart>:
xor    %esi,%esi
jmp    1030 <gettimeofday@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i64 @TimerStart(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load %struct.timeval*, %struct.timeval** %2
%4 = call i64 @gettimeofday(%struct.timeval* %3, i32 0)
ret i64 %4
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i64 @TimerStart(%struct.timeval* %0) {
%2 = tail call i64 @gettimeofday(%struct.timeval* %0, i32 0)
ret i64 %2
}
/* Variables and functions */
int BGBBTJ_AVI_GetMonoSamplesRate(void *, short *, int, int);
int avi_getsamples(short *samples, int cnt, void *data) {
  return (BGBBTJ_AVI_GetMonoSamplesRate(data, samples, cnt, 44100));
}


x86 assembly (clang, -O0):
<avi_getsamples>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    $0xac44,%ecx
call   1030 <BGBBTJ_AVI_GetMonoSamplesRate@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<avi_getsamples>:
mov    %rdx,%rax
mov    %esi,%edx
mov    %rdi,%rsi
mov    %rax,%rdi
mov    $0xac44,%ecx
jmp    1030 <BGBBTJ_AVI_GetMonoSamplesRate@plt>

LLVM IR (-O0):
define i32 @avi_getsamples(i16* %0, i32 %1, i8* %2) {
%4 = alloca i16*
%5 = alloca i32
%6 = alloca i8*
store i16* %0, i16** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = load i16*, i16** %4
%9 = load i32, i32* %5
%10 = call i32 @BGBBTJ_AVI_GetMonoSamplesRate(i8* %7, i16* %8, i32 %9, i32 44100)
ret i32 %10
}

LLVM IR (-O2):
define i32 @avi_getsamples(i16* %0, i32 %1, i8* %2) {
%4 = tail call i32 @BGBBTJ_AVI_GetMonoSamplesRate(i8* %2, i16* %0, i32 %1, i32 44100)
ret i32 %4
}
void RTPathChangeToUnixSlashes(void) {}


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

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

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

LLVM IR (-O2):
define void @RTPathChangeToUnixSlashes() {
ret void
}
__attribute__((__no__)) void
do_nothing_big_hole_none(struct test_big_hole *ptr) {
  if ((unsigned long)ptr > 0x2)
    return;
  else
    return;
}


x86 assembly (clang, -O0):
<do_nothing_big_hole_none>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmp    $0x2,%rax
jbe    111b <do_nothing_big_hole_none+0x1b>
jmp    1120 <do_nothing_big_hole_none+0x20>
jmp    1120 <do_nothing_big_hole_none+0x20>
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.test_big_hole = type opaque
define void @do_nothing_big_hole_none(%struct.test_big_hole* %0) {
%2 = alloca %struct.test_big_hole*
store %struct.test_big_hole* %0, %struct.test_big_hole** %2
%3 = load %struct.test_big_hole*, %struct.test_big_hole** %2
%4 = ptrtoint %struct.test_big_hole* %3 to i64
%5 = icmp ugt i64 %4, 2
br i1 %5, label %6, label %7
6: ; preds = %1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
%struct.test_big_hole = type opaque
define void @do_nothing_big_hole_none(%struct.test_big_hole* nocapture %0) {
ret void
}
int test_imm_F2int16_mem(short *val) {
  return ((*val) & (-0xF2 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_F2int16_mem>:
movzwl (%rdi),%eax
test   $0xff0e,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_F2int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -242
%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_F2int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -242
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t s291_parity(uint8_t i_val) {
  uint8_t i_parity =
      (((i_val * 0x0101010101010101ULL) & 0x8040201008040201ULL) % 0x1FF) & 1;
  return (uint16_t)i_parity << 8 | ((uint16_t)(i_parity ^ 1) << 9);
}


x86 assembly (clang, -O0):
<s291_parity>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
movabs $0x101010101010101,%rcx
01 01 01
imul   %rcx,%rax
movabs $0x8040201008040201,%rcx
20 40 80
and    %rcx,%rax
mov    $0x1ff,%ecx
xor    %edx,%edx
div    %rcx
and    $0x1,%rdx
mov    %edx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%ecx
xor    $0x1,%ecx
shl    $0x9,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<s291_parity>:
movslq %edi,%rax
movabs $0x101010101010101,%rsi
01 01 01
imul   %rax,%rsi
movabs $0x8040201008040201,%rcx
20 40 80
and    %rsi,%rcx
movabs $0x80402010080403,%rdx
mov    %rcx,%rax
mul    %rdx
sub    %edx,%ecx
shr    %ecx
add    %edx,%ecx
shr    $0x8,%ecx
add    %ecx,%esi
and    $0x1,%esi
shl    $0x8,%esi
lea    (%rsi,%rsi,2),%eax
xor    $0x200,%eax
ret

LLVM IR (-O0):
define i32 @s291_parity(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = mul i64 %5, 72340172838076673
%7 = and i64 %6, -9205322385119247871
%8 = urem i64 %7, 511
%9 = and i64 %8, 1
%10 = trunc i64 %9 to i32
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = shl i32 %11, 8
%13 = load i32, i32* %3
%14 = xor i32 %13, 1
%15 = shl i32 %14, 9
%16 = or i32 %12, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @s291_parity(i32 %0) {
%2 = sext i32 %0 to i64
%3 = mul i64 %2, 72340172838076673
%4 = and i64 %3, -9205322385119247871
%5 = urem i64 %4, 511
%6 = trunc i64 %5 to i32
%7 = and i32 %6, 1
%8 = mul nuw nsw i32 %7, 768
%9 = xor i32 %8, 512
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("only time will\n");
  printf("fit as a\n");
  printf("the quick brown\n");
  printf("hello world\n");
  printf("the early bird\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>
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
lea    0xee2(%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>
lea    0xeeb(%rip),%rdi
call   1030 <puts@plt>
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeec(%rip),%rdi
call   1030 <puts@plt>
lea    0xeec(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"only time will\0A\00"
@.str.1 = [10 x i8] c"fit as a\0A\00"
@.str.2 = [17 x i8] c"the quick brown\0A\00"
@.str.3 = [13 x i8] c"hello world\0A\00"
@.str.4 = [16 x i8] c"the early bird\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [15 x i8] c"only time will\00"
@str.5 = [9 x i8] c"fit as a\00"
@str.6 = [16 x i8] c"the quick brown\00"
@str.7 = [12 x i8] c"hello world\00"
@str.8 = [15 x i8] c"the early bird\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.7, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.8, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int const wchar_t;

/* Variables and functions */
wchar_t *wcschr(const wchar_t *s, wchar_t c) {
  while (*s != c && *s != L'\0')
    s++;
  if (*s == c)
    return ((wchar_t *)s);
  return (NULL);
}


x86 assembly (clang, -O0):
<wcschr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
xor    %eax,%eax
cmp    -0x14(%rbp),%ecx
mov    %al,-0x15(%rbp)
je     112c <wcschr+0x2c>
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    113c <wcschr+0x3c>
jmp    114d <wcschr+0x4d>
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
jmp    110b <wcschr+0xb>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    1169 <wcschr+0x69>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1171 <wcschr+0x71>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcschr>:
add    $0xfffffffffffffffc,%rdi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0x4(%rdi),%ecx
add    $0x4,%rdi
cmp    %esi,%ecx
je     111f <wcschr+0x1f>
test   %ecx,%ecx
jne    1110 <wcschr+0x10>
xor    %eax,%eax
cmp    %esi,%ecx
cmove  %rdi,%rax
ret

LLVM IR (-O0):
define i32* @wcschr(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = load i32, i32* %5
%10 = icmp ne i32 %8, %9
br i1 %10, label %11, label %15
11: ; preds = %6
%12 = load i32*, i32** %4
%13 = load i32, i32* %12
%14 = icmp ne i32 %13, 0
br label %15
15: ; preds = %11, %6
%16 = phi i1 [ false, %6 ], [ %14, %11 ]
br i1 %16, label %17, label %20
17: ; preds = %15
%18 = load i32*, i32** %4
%19 = getelementptr inbounds i32, i32* %18, i32 1
store i32* %19, i32** %4
br label %6
20: ; preds = %15
%21 = load i32*, i32** %4
%22 = load i32, i32* %21
%23 = load i32, i32* %5
%24 = icmp eq i32 %22, %23
br i1 %24, label %25, label %27
25: ; preds = %20
%26 = load i32*, i32** %4
store i32* %26, i32** %3
br label %28
27: ; preds = %20
store i32* null, i32** %3
br label %28
28: ; preds = %27, %25
%29 = load i32*, i32** %3
ret i32* %29
}

LLVM IR (-O2):
define i32* @wcschr(i32* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32* [ %0, %2 ], [ %9, %3 ]
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, %1
%7 = icmp eq i32 %5, 0
%8 = or i1 %6, %7
%9 = getelementptr inbounds i32, i32* %4, i64 1
br i1 %8, label %10, label %3
10: ; preds = %3
%11 = select i1 %6, i32* %4, i32* null
ret i32* %11
}
void psci_set_putc(void (*putcf)(void *ctx, int c), void *ctx) {}


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

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

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

LLVM IR (-O2):
define void @psci_set_putc(void (i8*, i32)* nocapture %0, i8* nocapture %1) {
ret void
}
int accidental_ctoi(char c) {
  switch (c) {
  case 'b':
    return -1;
  case ' ':
    return 0;
  case '#':
    return 1;
  default:
    return -2;
  }
}


x86 assembly (clang, -O0):
<accidental_ctoi>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x20,%eax
je     114d <accidental_ctoi+0x4d>
jmp    111f <accidental_ctoi+0x1f>
mov    -0xc(%rbp),%eax
sub    $0x23,%eax
je     1159 <accidental_ctoi+0x59>
jmp    1130 <accidental_ctoi+0x30>
mov    -0xc(%rbp),%eax
sub    $0x62,%eax
jne    1165 <accidental_ctoi+0x65>
jmp    1141 <accidental_ctoi+0x41>
movl   $0xffffffff,-0x4(%rbp)
jmp    116c <accidental_ctoi+0x6c>
movl   $0x0,-0x4(%rbp)
jmp    116c <accidental_ctoi+0x6c>
movl   $0x1,-0x4(%rbp)
jmp    116c <accidental_ctoi+0x6c>
movl   $0xfffffffe,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<accidental_ctoi>:
cmp    $0x62,%edi
je     1112 <accidental_ctoi+0x12>
cmp    $0x23,%edi
je     1118 <accidental_ctoi+0x18>
cmp    $0x20,%edi
jne    111e <accidental_ctoi+0x1e>
xor    %eax,%eax
ret
mov    $0xffffffff,%eax
ret
mov    $0x1,%eax
ret
mov    $0xfffffffe,%eax
ret

LLVM IR (-O0):
define i32 @accidental_ctoi(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %9 [
i32 98, label %6
i32 32, label %7
i32 35, label %8
]
6: ; preds = %1
store i32 -1, i32* %2
br label %10
7: ; preds = %1
store i32 0, i32* %2
br label %10
8: ; preds = %1
store i32 1, i32* %2
br label %10
9: ; preds = %1
store i32 -2, i32* %2
br label %10
10: ; preds = %9, %8, %7, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @accidental_ctoi(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %5 [
i32 98, label %6
i32 32, label %3
i32 35, label %4
]
3: ; preds = %1
br label %6
4: ; preds = %1
br label %6
5: ; preds = %1
br label %6
6: ; preds = %1, %5, %4, %3
%7 = phi i32 [ -2, %5 ], [ 1, %4 ], [ 0, %3 ], [ -1, %1 ]
ret i32 %7
}
_Bool __VERIFIER_nondet_bool() { return 0; }


x86 assembly (clang, -O0):
<__VERIFIER_nondet_bool>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i1 @__VERIFIER_nondet_bool() {
ret i1 false
}

LLVM IR (-O2):
define zeroext i1 @__VERIFIER_nondet_bool() {
ret i1 false
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int SIGCHLD;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int wait(int /*<<< orphan*/ *);
void handle(int s) {
  if (s == SIGCHLD) {
    pid_t pid = wait(NULL);
    printf("%d exit..\n", pid);
  } else {
    printf("client child process exit......\n");
    exit(0);
  }
}


x86 assembly (clang, -O0):
<handle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ea3(%rip),%rcx
cmp    (%rcx),%eax
jne    116f <handle+0x3f>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <wait@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1184 <handle+0x54>
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle>:
push   %rax
mov    0x2ea0(%rip),%rax
cmp    %edi,(%rax)
jne    1164 <handle+0x24>
xor    %edi,%edi
call   1060 <wait@plt>
lea    0xea6(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
pop    %rcx
jmp    1040 <printf@plt>
lea    0xea0(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@SIGCHLD = global i32 0
@.str = [11 x i8] c"%d exit..\0A\00"
@.str.1 = [33 x i8] c"client child process exit......\0A\00"
define void @handle(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @SIGCHLD
%6 = icmp eq i32 %4, %5
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = call i32 @wait(i32* null)
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %14
11: ; preds = %1
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 @exit(i32 0)
unreachable
14: ; preds = %7
ret void
}

LLVM IR (-O2):
@SIGCHLD = global i32 0
@.str = [11 x i8] c"%d exit..\0A\00"
@str = [32 x i8] c"client child process exit......\00"
define void @handle(i32 %0) {
%2 = load i32, i32* @SIGCHLD
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @wait(i32* null)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
7: ; preds = %1
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%9 = tail call i32 @exit(i32 0)
unreachable
}
const char *STM_getExt() { return "stmcompr"; }


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

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"stmcompr\00"
define i8* @STM_getExt() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}
int ppm_save(const char *filename, struct DisplaySurface *ds) { return 0; }


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

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

LLVM IR (-O0):
%struct.DisplaySurface = type opaque
define i32 @ppm_save(i8* %0, %struct.DisplaySurface* %1) {
%3 = alloca i8*
%4 = alloca %struct.DisplaySurface*
store i8* %0, i8** %3
store %struct.DisplaySurface* %1, %struct.DisplaySurface** %4
ret i32 0
}

LLVM IR (-O2):
%struct.DisplaySurface = type opaque
define i32 @ppm_save(i8* nocapture readnone %0, %struct.DisplaySurface* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_socket();
int main(int argc, char **argv) {
  if (!test_socket())
    return 1;
  printf("OK\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <test_socket@plt>
cmp    $0x0,%eax
jne    1152 <main+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1165 <main+0x45>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <test_socket@plt>
test   %eax,%eax
je     113c <main+0x1c>
lea    0xecb(%rip),%rdi
call   1030 <puts@plt>
jmp    1141 <main+0x21>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@str = [3 x i8] c"OK\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_socket()
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ 0, %5 ], [ 1, %2 ]
ret i32 %8
}
/* Variables and functions */
int EXIT_FAILURE;
int bar() { return EXIT_FAILURE; }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define i32 @bar() {
%1 = load i32, i32* @EXIT_FAILURE
ret i32 %1
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define i32 @bar() {
%1 = load i32, i32* @EXIT_FAILURE
ret i32 %1
}
int A(int x, double dx) { return (float)x == (float)dx; }


x86 assembly (clang, -O0):
<A>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
cvtsd2ss %xmm1,%xmm1
ucomiss %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<A>:
cvtsi2ss %edi,%xmm1
cvtsd2ss %xmm0,%xmm0
cmpeqss %xmm1,%xmm0
movd   %xmm0,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @A(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
%5 = load i32, i32* %3
%6 = sitofp i32 %5 to float
%7 = load double, double* %4
%8 = fptrunc double %7 to float
%9 = fcmp oeq float %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @A(i32 %0, double %1) {
%3 = sitofp i32 %0 to float
%4 = fptrunc double %1 to float
%5 = fcmp oeq float %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
void gendiv() {}


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

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

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

LLVM IR (-O2):
define void @gendiv() {
ret void
}
/* Variables and functions */
int rename(char const *, char const *);
int outside_rename(const char *oldpath, const char *newpath) {
  return rename(oldpath, newpath);
}


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

x86 assembly (clang, -O2):
<outside_rename>:
jmp    1030 <rename@plt>

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

LLVM IR (-O2):
define i32 @outside_rename(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @rename(i8* %0, i8* %1)
ret i32 %3
}
void delay() {
  unsigned i;
  for (i = 0; i < 1000000; i++)
    asm volatile("");
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0xf4240,-0x4(%rbp)
jae    1126 <delay+0x26>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <delay+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
mov    $0xf4240,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0xffffffff,%eax
jne    1110 <delay+0x10>
ret

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

LLVM IR (-O2):
define void @delay() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %3, %1 ]
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
%3 = add nuw nsw i32 %2, 1
%4 = icmp eq i32 %3, 1000000
br i1 %4, label %5, label %1
5: ; preds = %1
ret void
}
/* Type definitions */
struct eb_root {
  int dummy;
};
struct eb64_node {
  int dummy;
};

/* Variables and functions */
struct eb64_node *__eb64_insert(struct eb_root *, struct eb64_node *);
struct eb64_node *eb64_insert(struct eb_root *root, struct eb64_node *new) {
  return __eb64_insert(root, new);
}


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

x86 assembly (clang, -O2):
<eb64_insert>:
jmp    1030 <__eb64_insert@plt>

LLVM IR (-O0):
%struct.eb_root = type { i32 }
%struct.eb64_node = type { i32 }
define %struct.eb64_node* @eb64_insert(%struct.eb_root* %0, %struct.eb64_node* %1) {
%3 = alloca %struct.eb_root*
%4 = alloca %struct.eb64_node*
store %struct.eb_root* %0, %struct.eb_root** %3
store %struct.eb64_node* %1, %struct.eb64_node** %4
%5 = load %struct.eb_root*, %struct.eb_root** %3
%6 = load %struct.eb64_node*, %struct.eb64_node** %4
%7 = call %struct.eb64_node* @__eb64_insert(%struct.eb_root* %5, %struct.eb64_node* %6)
ret %struct.eb64_node* %7
}

LLVM IR (-O2):
%struct.eb_root = type { i32 }
%struct.eb64_node = type { i32 }
define %struct.eb64_node* @eb64_insert(%struct.eb_root* %0, %struct.eb64_node* %1) {
%3 = tail call %struct.eb64_node* @__eb64_insert(%struct.eb_root* %0, %struct.eb64_node* %1)
ret %struct.eb64_node* %3
}
/* Variables and functions */
int partition(int *, int, int);
void quick_sort(int *array, int start, int end) {
  if (end - start < 1)
    return;
  int splitIdx = partition(array, start, end);
  quick_sort(array, start, splitIdx - 1);
  quick_sort(array, splitIdx + 1, end);
}


x86 assembly (clang, -O0):
<quick_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
cmp    $0x1,%eax
jge    1146 <quick_sort+0x26>
jmp    117c <quick_sort+0x5c>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quick_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quick_sort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick_sort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %esi,%edx
jle    1166 <quick_sort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quick_sort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quick_sort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @quick_sort(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* %6
%9 = load i32, i32* %5
%10 = sub nsw i32 %8, %9
%11 = icmp slt i32 %10, 1
br i1 %11, label %12, label %13
12: ; preds = %3
br label %26
13: ; preds = %3
%14 = load i32*, i32** %4
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = call i32 @partition(i32* %14, i32 %15, i32 %16)
store i32 %17, i32* %7
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = load i32, i32* %7
%21 = sub nsw i32 %20, 1
%22 = load i32*, i32** %4
%23 = load i32, i32* %7
%24 = add nsw i32 %23, 1
%25 = load i32, i32* %6
br label %26
26: ; preds = %13, %12
ret void
}

LLVM IR (-O2):
define void @quick_sort(i32* %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, %1
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quick_sort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cpc_key_press(int);
int /*<<< orphan*/ cpc_key_unpress(int);
void Joy_Opqa_Fire3(int value) {
  if (value) {
    cpc_key_press(0x11);
  } else {
    cpc_key_unpress(0x11);
  };
}


x86 assembly (clang, -O0):
<Joy_Opqa_Fire3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1144 <Joy_Opqa_Fire3+0x24>
mov    $0x11,%edi
call   1030 <cpc_key_press@plt>
jmp    114e <Joy_Opqa_Fire3+0x2e>
mov    $0x11,%edi
call   1040 <cpc_key_unpress@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Joy_Opqa_Fire3>:
test   %edi,%edi
je     112e <Joy_Opqa_Fire3+0xe>
mov    $0x11,%edi
jmp    1030 <cpc_key_press@plt>
mov    $0x11,%edi
jmp    1040 <cpc_key_unpress@plt>

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

LLVM IR (-O2):
define void @Joy_Opqa_Fire3(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @cpc_key_press(i32 17)
br label %7
5: ; preds = %1
%6 = tail call i32 @cpc_key_unpress(i32 17)
br label %7
7: ; preds = %5, %3
ret void
}
int ithread_initialize_library(void) {
  int ret = 0;
  return ret;
}


x86 assembly (clang, -O0):
<ithread_initialize_library>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ithread_initialize_library() {
ret i32 0
}
void RandomFunc(unsigned int input[1], unsigned int output[1]) {
  unsigned int state[1];
  unsigned int local2;
  unsigned int local1;
  {
    state[0UL] = input[0UL] + 4284877637U;
    local1 = 0UL;
    while (local1 < input[1UL]) {
      local2 = 0UL;
      while (local2 < input[1UL]) {
        local2 += 2UL;
      }
      local1 += 2UL;
    }
    output[0UL] = state[0UL] - 3662329353U;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0xff660b45,%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    0x4(%rcx),%eax
jae    1166 <RandomFunc+0x66>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    0x4(%rcx),%eax
jae    1157 <RandomFunc+0x57>
mov    -0x18(%rbp),%eax
add    $0x2,%rax
mov    %eax,-0x18(%rbp)
jmp    1138 <RandomFunc+0x38>
mov    -0x1c(%rbp),%eax
add    $0x2,%rax
mov    %eax,-0x1c(%rbp)
jmp    1121 <RandomFunc+0x21>
mov    -0x14(%rbp),%ecx
sub    $0xda4ab609,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    $0x251b553c,%eax
add    (%rdi),%eax
mov    %eax,(%rsi)
ret

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

LLVM IR (-O2):
define void @RandomFunc(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = add i32 %3, 622548284
store i32 %4, i32* %1
ret void
}
void ADCTimerReset(unsigned long ulBase) {
  (*((volatile unsigned long *)(ulBase + 0x00000068))) |= (1 << 24);
}


x86 assembly (clang, -O0):
<ADCTimerReset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x68(%rax),%rcx
or     $0x1000000,%rcx
mov    %rcx,0x68(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCTimerReset>:
orq    $0x1000000,0x68(%rdi)
01
ret

LLVM IR (-O0):
define void @ADCTimerReset(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 104
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = or i64 %6, 16777216
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @ADCTimerReset(i64 %0) {
%2 = add i64 %0, 104
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = or i64 %4, 16777216
store volatile i64 %5, i64* %3
ret void
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
int strlen(char const *);
char *marker_string_alloc(const char *str) {
  size_t len = strlen(str) + 1;
  char *new_str = (char *)malloc(len);
  memcpy(new_str, str, len);
  return new_str;
}


x86 assembly (clang, -O0):
<marker_string_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<marker_string_alloc>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @marker_string_alloc(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
%7 = tail call i32 @memcpy(i8* %6, i8* %0, i64 %4)
ret i8* %6
}
/* Variables and functions */
scalar_t__ fprintf(int /*<<< orphan*/, char *, int, ...);
int /*<<< orphan*/ stderr;
int ModuloSub(int f, int k) {
  int tmp;
  tmp = f - k;
  0 && fprintf(stderr, "MDBG f-k = t  %d - %d = %d, ", f, k, tmp);
  if (tmp < 0)
    tmp += 27;
  0 && fprintf(stderr, " mod= %d\n", tmp);
  return (tmp);
}


x86 assembly (clang, -O0):
<ModuloSub>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1126 <ModuloSub+0x26>
mov    -0xc(%rbp),%eax
add    $0x1b,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ModuloSub>:
sub    %esi,%edi
lea    0x1b(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
ret

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

LLVM IR (-O2):
@stderr = global i32 0
define i32 @ModuloSub(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
%4 = icmp slt i32 %3, 0
%5 = add nsw i32 %3, 27
%6 = select i1 %4, i32 %5, i32 %3
ret i32 %6
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int celcon_number_of_original_cells(int *length) {
  int fail;
  int *b;
  double *c;
  fail = _ada_use_c2phc4c(880, length, b, c, 0);
  return fail;
}


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

x86 assembly (clang, -O2):
<celcon_number_of_original_cells>:
mov    %rdi,%rsi
mov    $0x370,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

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

LLVM IR (-O2):
define i32 @celcon_number_of_original_cells(i32* %0) {
%2 = tail call i32 @_ada_use_c2phc4c(i32 880, i32* %0, i32* undef, double* undef, i32 0)
ret i32 %2
}