xunge/DecIR huggingface dataset:
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *sstrdup(char *str) {
  char *ret = malloc(strlen(str) + 1);
  strcpy(ret, str);
  return ret;
}


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

x86 assembly (clang, -O2):
<sstrdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @sstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @sstrdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *progname) {
  fprintf(stderr, "usage: %s [-d device] [-z size] [page code]\n", progname);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [45 x i8] c"usage: %s [-d device] [-z size] [page code]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [45 x i8] c"usage: %s [-d device] [-z size] [page code]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
f(struct A { int i; } * p) {
  struct A a = {1};
  *p = a;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    0xef2(%rip),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.A = type { i32 }
@__const.f.a = %struct.A { i32 1 }
define i32 @f(%struct.A* %0) {
%2 = alloca i32
%3 = alloca %struct.A*
%4 = alloca %struct.A
store %struct.A* %0, %struct.A** %3
%5 = bitcast %struct.A* %4 to i8*
%6 = load %struct.A*, %struct.A** %3
%7 = bitcast %struct.A* %6 to i8*
%8 = bitcast %struct.A* %4 to i8*
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
%struct.A = type { i32 }
define i32 @f(%struct.A* nocapture writeonly %0) {
%2 = getelementptr inbounds %struct.A, %struct.A* %0, i64 0, i32 0
store i32 1, i32* %2
ret i32 undef
}
void RTStrmGetLine(void) {}


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

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

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

LLVM IR (-O2):
define void @RTStrmGetLine() {
ret void
}
unsigned int setBit(unsigned int ch, int i) {
  unsigned int mask = 1U << i;
  return mask | ch;
}


x86 assembly (clang, -O0):
<setBit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
or     -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setBit>:
mov    %edi,%eax
bts    %esi,%eax
ret

LLVM IR (-O0):
define i32 @setBit(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* %4
%7 = shl i32 1, %6
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load i32, i32* %3
%10 = or i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @setBit(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = or i32 %3, %0
ret i32 %4
}
int fun1273() { return 1273; }


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

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

LLVM IR (-O0):
define i32 @fun1273() {
ret i32 1273
}

LLVM IR (-O2):
define i32 @fun1273() {
ret i32 1273
}
/* Variables and functions */
int /*<<< orphan*/ Com_Printf(char *);
int /*<<< orphan*/ S_StartBackgroundTrack(int /*<<< orphan*/,
                                          int /*<<< orphan*/);
int trap_Cmd_Argc();
int /*<<< orphan*/ trap_Cmd_Argv(int);
void S_Music(void) {
  if (trap_Cmd_Argc() < 2) {
    Com_Printf("music: <introfile|playlist> [loopfile|shuffle]\n");
    return;
  }
  S_StartBackgroundTrack(trap_Cmd_Argv(1), trap_Cmd_Argv(2));
}


x86 assembly (clang, -O0):
<S_Music>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <trap_Cmd_Argc@plt>
cmp    $0x2,%eax
jge    1169 <S_Music+0x29>
lea    0xea1(%rip),%rdi
call   1050 <Com_Printf@plt>
jmp    118a <S_Music+0x4a>
mov    $0x1,%edi
call   1060 <trap_Cmd_Argv@plt>
mov    %eax,-0x4(%rbp)
mov    $0x2,%edi
call   1060 <trap_Cmd_Argv@plt>
mov    -0x4(%rbp),%edi
mov    %eax,%esi
call   1030 <S_StartBackgroundTrack@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<S_Music>:
push   %rbx
xor    %eax,%eax
call   1040 <trap_Cmd_Argc@plt>
cmp    $0x1,%eax
jg     115a <S_Music+0x1a>
lea    0xeac(%rip),%rdi
pop    %rbx
jmp    1050 <Com_Printf@plt>
mov    $0x1,%edi
call   1060 <trap_Cmd_Argv@plt>
mov    %eax,%ebx
mov    $0x2,%edi
call   1060 <trap_Cmd_Argv@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <S_StartBackgroundTrack@plt>

LLVM IR (-O0):
@.str = [48 x i8] c"music: <introfile|playlist> [loopfile|shuffle]\0A\00"
define void @S_Music() {
%1 = call i32 (...) @trap_Cmd_Argc()
%2 = icmp slt i32 %1, 2
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @Com_Printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
br label %9
5: ; preds = %0
%6 = call i32 @trap_Cmd_Argv(i32 1)
%7 = call i32 @trap_Cmd_Argv(i32 2)
%8 = call i32 @S_StartBackgroundTrack(i32 %6, i32 %7)
br label %9
9: ; preds = %5, %3
ret void
}

LLVM IR (-O2):
@.str = [48 x i8] c"music: <introfile|playlist> [loopfile|shuffle]\0A\00"
define void @S_Music() {
%1 = tail call i32 (...) @trap_Cmd_Argc()
%2 = icmp slt i32 %1, 2
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @Com_Printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
br label %9
5: ; preds = %0
%6 = tail call i32 @trap_Cmd_Argv(i32 1)
%7 = tail call i32 @trap_Cmd_Argv(i32 2)
%8 = tail call i32 @S_StartBackgroundTrack(i32 %6, i32 %7)
br label %9
9: ; preds = %5, %3
ret void
}
/* Variables and functions */
int getuid();
int /*<<< orphan*/ printf(char *, int);
void *thread_sub(void *param) {
  printf("child uid=%d\n", getuid());
  return 0;
}


x86 assembly (clang, -O0):
<thread_sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %eax,%esi
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_sub>:
push   %rax
xor    %eax,%eax
call   1030 <getuid@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"child uid=%d\0A\00"
define i8* @thread_sub(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @getuid()
%4 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* null
}

LLVM IR (-O2):
@.str = [14 x i8] c"child uid=%d\0A\00"
define noalias i8* @thread_sub(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @getuid()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i8* null
}
unsigned int _hweight32(unsigned int w) {
  w -= (w >> 1) & 0x55555555;
  w = (w & 0x33333333) + ((w >> 2) & 0x33333333);
  w = (w + (w >> 4)) & 0x0f0f0f0f;
  return (w * 0x01010101) >> 24;
}


x86 assembly (clang, -O0):
<_hweight32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
shr    $0x1,%ecx
and    $0x55555555,%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x33333333,%eax
mov    -0x4(%rbp),%ecx
shr    $0x2,%ecx
and    $0x33333333,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x4,%ecx
add    %ecx,%eax
and    $0xf0f0f0f,%eax
mov    %eax,-0x4(%rbp)
imul   $0x1010101,-0x4(%rbp),%eax
shr    $0x18,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_hweight32>:
mov    %edi,%eax
shr    %eax
and    $0x55555555,%eax
sub    %eax,%edi
mov    %edi,%eax
and    $0x33333333,%eax
shr    $0x2,%edi
and    $0x33333333,%edi
add    %eax,%edi
mov    %edi,%eax
shr    $0x4,%eax
add    %edi,%eax
and    $0xf0f0f0f,%eax
imul   $0x1010101,%eax,%eax
shr    $0x18,%eax
ret

LLVM IR (-O0):
define i32 @_hweight32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 1
%5 = and i32 %4, 1431655765
%6 = load i32, i32* %2
%7 = sub i32 %6, %5
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = and i32 %8, 858993459
%10 = load i32, i32* %2
%11 = lshr i32 %10, 2
%12 = and i32 %11, 858993459
%13 = add i32 %9, %12
store i32 %13, i32* %2
%14 = load i32, i32* %2
%15 = load i32, i32* %2
%16 = lshr i32 %15, 4
%17 = add i32 %14, %16
%18 = and i32 %17, 252645135
store i32 %18, i32* %2
%19 = load i32, i32* %2
%20 = mul i32 %19, 16843009
%21 = lshr i32 %20, 24
ret i32 %21
}

LLVM IR (-O2):
define i32 @_hweight32(i32 %0) {
%2 = lshr i32 %0, 1
%3 = and i32 %2, 1431655765
%4 = sub i32 %0, %3
%5 = and i32 %4, 858993459
%6 = lshr i32 %4, 2
%7 = and i32 %6, 858993459
%8 = add nuw nsw i32 %7, %5
%9 = lshr i32 %8, 4
%10 = add nuw nsw i32 %9, %8
%11 = and i32 %10, 252645135
%12 = mul i32 %11, 16843009
%13 = lshr i32 %12, 24
ret i32 %13
}
int drv_HD_LCM162_keypad_handler(const int num) { return num; }


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

x86 assembly (clang, -O2):
<drv_HD_LCM162_keypad_handler>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @drv_HD_LCM162_keypad_handler(i32 returned %0) {
ret i32 %0
}
int do_841() { return 841; }


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

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

LLVM IR (-O0):
define i32 @do_841() {
ret i32 841
}

LLVM IR (-O2):
define i32 @do_841() {
ret i32 841
}
/* Variables and functions */
int atoi(char *);
char *strchr(char const *, char);
int repval(const char *str) {
  char *p = strchr(str, '=') + 1;
  return atoi(p);
}


x86 assembly (clang, -O0):
<repval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3d,%esi
call   1030 <strchr@plt>
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <atoi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<repval>:
push   %rax
mov    $0x3d,%esi
call   1030 <strchr@plt>
lea    0x1(%rax),%rdi
pop    %rax
jmp    1040 <atoi@plt>

LLVM IR (-O0):
define i32 @repval(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strchr(i8* %4, i8 signext 61)
%6 = getelementptr inbounds i8, i8* %5, i64 1
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @atoi(i8* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @repval(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 61)
%3 = getelementptr inbounds i8, i8* %2, i64 1
%4 = tail call i32 @atoi(i8* %3)
ret i32 %4
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ random();
float random_between(float lo, float hi) {
  float rand01;
  rand01 = (float)(random()) / (float)(RAND_MAX);
  return lo + (rand01 * (hi - lo));
}


x86 assembly (clang, -O0):
<random_between>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
cvtsi2ss %rax,%xmm0
mov    0x2eb3(%rip),%rax
cvtsi2ssq (%rax),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
movss  -0x8(%rbp),%xmm2
subss  -0x4(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_between>:
push   %rax
movss  %xmm1,0x4(%rsp)
movss  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <random@plt>
cvtsi2ss %rax,%xmm2
mov    0x2eb9(%rip),%rax
xorps  %xmm1,%xmm1
cvtsi2ssq (%rax),%xmm1
divss  %xmm1,%xmm2
movss  0x4(%rsp),%xmm0
movss  (%rsp),%xmm1
subss  %xmm1,%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define float @random_between(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = call i64 (...) @random()
%7 = sitofp i64 %6 to float
%8 = load i64, i64* @RAND_MAX
%9 = sitofp i64 %8 to float
%10 = fdiv float %7, %9
store float %10, float* %5
%11 = load float, float* %3
%12 = load float, float* %5
%13 = load float, float* %4
%14 = load float, float* %3
%15 = fsub float %13, %14
%16 = call float @llvm.fmuladd.f32(float %12, float %15, float %11)
ret float %16
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define float @random_between(float %0, float %1) {
%3 = tail call i64 (...) @random()
%4 = sitofp i64 %3 to float
%5 = load i64, i64* @RAND_MAX
%6 = sitofp i64 %5 to float
%7 = fdiv float %4, %6
%8 = fsub float %1, %0
%9 = tail call float @llvm.fmuladd.f32(float %7, float %8, float %0)
ret float %9
}
void _Z24_Jv_isPrimitiveOrDerivedPK13_Jv_Utf8Const(void) {}


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

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

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

LLVM IR (-O2):
define void @_Z24_Jv_isPrimitiveOrDerivedPK13_Jv_Utf8Const() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _hmt_register_covercase(char *, char *);
void _hmt_covercase_HMM_AddVec4_init(void) {
  _hmt_register_covercase("HMM_AddVec4", "1");
}


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

x86 assembly (clang, -O2):
<_hmt_covercase_HMM_AddVec4_init>:
lea    0xee9(%rip),%rdi
lea    0xeee(%rip),%rsi
jmp    1030 <_hmt_register_covercase@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"HMM_AddVec4\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_AddVec4_init() {
%1 = call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"HMM_AddVec4\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_AddVec4_init() {
%1 = tail call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcasecmp(char const *, char *);
int /*<<< orphan*/ strncasecmp(char const *, char *, int);
int uri_is_null(const char *uri) {
  return 0 || !strncasecmp(uri, "null:", 5) || !strcasecmp(uri, "/dev/null");
}


x86 assembly (clang, -O0):
<uri_is_null>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
mov    $0x5,%edx
call   1040 <strncasecmp@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     116c <uri_is_null+0x4c>
mov    -0x8(%rbp),%rdi
lea    0xeaa(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uri_is_null>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
mov    $0x5,%edx
call   1040 <strncasecmp@plt>
test   %eax,%eax
je     1153 <uri_is_null+0x33>
lea    0xec6(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"null:\00"
@.str.1 = [10 x i8] c"/dev/null\00"
define i32 @uri_is_null(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strncasecmp(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @strcasecmp(i8* %7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
br label %11
11: ; preds = %6, %1
%12 = phi i1 [ true, %1 ], [ %10, %6 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@.str = [6 x i8] c"null:\00"
@.str.1 = [10 x i8] c"/dev/null\00"
define i32 @uri_is_null(i8* nocapture %0) {
%2 = tail call i32 @strncasecmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ multitable_crc32c(int /*<<< orphan*/, unsigned char const *,
                                     unsigned int);
int /*<<< orphan*/ singletable_crc32c(int /*<<< orphan*/, unsigned char const *,
                                      unsigned int);
uint32_t calculate_crc32c(uint32_t crc32c, const unsigned char *buffer,
                          unsigned int length) {
  if (length < 4) {
    return (singletable_crc32c(crc32c, buffer, length));
  } else {
    return (multitable_crc32c(crc32c, buffer, length));
  }
}


x86 assembly (clang, -O0):
<calculate_crc32c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jae    1153 <calculate_crc32c+0x33>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <singletable_crc32c@plt>
mov    %eax,-0x4(%rbp)
jmp    1165 <calculate_crc32c+0x45>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <multitable_crc32c@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculate_crc32c>:
cmp    $0x3,%edx
ja     112a <calculate_crc32c+0xa>
jmp    1030 <singletable_crc32c@plt>
jmp    1040 <multitable_crc32c@plt>

LLVM IR (-O0):
define i32 @calculate_crc32c(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%8 = load i32, i32* %7
%9 = icmp ult i32 %8, 4
br i1 %9, label %10, label %15
10: ; preds = %3
%11 = load i32, i32* %5
%12 = load i8*, i8** %6
%13 = load i32, i32* %7
%14 = call i32 @singletable_crc32c(i32 %11, i8* %12, i32 %13)
store i32 %14, i32* %4
br label %20
15: ; preds = %3
%16 = load i32, i32* %5
%17 = load i8*, i8** %6
%18 = load i32, i32* %7
%19 = call i32 @multitable_crc32c(i32 %16, i8* %17, i32 %18)
store i32 %19, i32* %4
br label %20
20: ; preds = %15, %10
%21 = load i32, i32* %4
ret i32 %21
}

LLVM IR (-O2):
define i32 @calculate_crc32c(i32 %0, i8* %1, i32 %2) {
%4 = icmp ult i32 %2, 4
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @singletable_crc32c(i32 %0, i8* %1, i32 %2)
br label %9
7: ; preds = %3
%8 = tail call i32 @multitable_crc32c(i32 %0, i8* %1, i32 %2)
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void bold(char on) { printf("%c[%dm", 0x1B, on != 0 ? 1 : 21); }


x86 assembly (clang, -O0):
<bold>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x15,%edx
mov    $0x1,%eax
cmp    $0x0,%ecx
cmovne %eax,%edx
lea    0xec7(%rip),%rdi
mov    $0x1b,%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bold>:
test   %dil,%dil
mov    $0x15,%eax
mov    $0x1,%edx
cmove  %eax,%edx
lea    0xed9(%rip),%rdi
mov    $0x1b,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%c[%dm\00"
define void @bold(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 1, i32 21
%8 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 27, i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%c[%dm\00"
define void @bold(i8 signext %0) {
%2 = icmp eq i8 %0, 0
%3 = select i1 %2, i32 21, i32 1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 27, i32 %3)
ret void
}
char userLoop(void) { return 0; }


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

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

LLVM IR (-O0):
define signext i8 @userLoop() {
ret i8 0
}

LLVM IR (-O2):
define signext i8 @userLoop() {
ret i8 0
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
long long getCurrentTime(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return (long long)tv.tv_sec * 1000000 + (long long)tv.tv_usec;
}


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

x86 assembly (clang, -O2):
<getCurrentTime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x10(%rsp),%rax
add    0x8(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @getCurrentTime() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = mul nsw i64 %4, 1000000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i64, i64* %6
%8 = add nsw i64 %5, %7
ret i64 %8
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @getCurrentTime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = mul nsw i64 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = add nsw i64 %6, %8
ret i64 %9
}
/* Variables and functions */
int toupper(int);
int invalidFunctionArgBool_toupper(bool b, int c) {
  (void)toupper(b);
  return toupper(c != 0);
}


x86 assembly (clang, -O0):
<invalidFunctionArgBool_toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <toupper@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<invalidFunctionArgBool_toupper>:
xor    %edi,%edi
test   %esi,%esi
setne  %dil
jmp    1030 <toupper@plt>

LLVM IR (-O0):
define i32 @invalidFunctionArgBool_toupper(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i32 @toupper(i32 %5)
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @toupper(i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @invalidFunctionArgBool_toupper(i32 %0, i32 %1) {
%3 = icmp ne i32 %1, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @toupper(i32 %4)
ret i32 %5
}
/* Variables and functions */
size_t strlen(const char *string) {
  size_t result = 0;
  while (string[result])
    result++;
  return result;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1133 <strlen+0x33>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
/* Variables and functions */
long long random();
long long internal_rand_l(long long value) { return random(); }


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

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

LLVM IR (-O0):
define i64 @internal_rand_l(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i64 (...) @random()
ret i64 %3
}

LLVM IR (-O2):
define i64 @internal_rand_l(i64 %0) {
%2 = tail call i64 (...) @random()
ret i64 %2
}
/* Variables and functions */
int getchar();
int getch() { return getchar(); }


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

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

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

LLVM IR (-O2):
define i32 @getch() {
%1 = tail call i32 (...) @getchar()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void printMessage(char msg[]) {
  if (msg != NULL) {
    printf("%s", msg);
  }
}


x86 assembly (clang, -O0):
<printMessage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1137 <printMessage+0x27>
mov    -0x8(%rbp),%rsi
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printMessage>:
test   %rdi,%rdi
je     1124 <printMessage+0x14>
mov    %rdi,%rsi
lea    0xee1(%rip),%rdi
jmp    1030 <printf@plt>
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @printMessage(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void display_usage(void) {
  puts("Options:\n"
       "--help, -h\tshow this help\n"
       "--version, -v\tprint version\n"
       "--genhash, -g\tgenerate random ed2k hash");
}


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

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

LLVM IR (-O0):
@.str = [103 x i8] c"Options:\0A--help, -h\09show this help\0A--version, -v\09print version\0A--genhash, -g\09generate random ed2k hash\00"
define void @display_usage() {
%1 = call i32 @puts(i8* getelementptr inbounds ([103 x i8], [103 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [103 x i8] c"Options:\0A--help, -h\09show this help\0A--version, -v\09print version\0A--genhash, -g\09generate random ed2k hash\00"
define void @display_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([103 x i8], [103 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int ENOENT;
char Platform_NoSuchDirectory(int e) {
  char _o_result;
  _o_result = e == ENOENT;
  return _o_result;
}


x86 assembly (clang, -O0):
<Platform_NoSuchDirectory>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ec7(%rip),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Platform_NoSuchDirectory>:
mov    0x2ed1(%rip),%rax
cmp    %edi,(%rax)
sete   %al
ret

LLVM IR (-O0):
@ENOENT = global i32 0
define signext i8 @Platform_NoSuchDirectory(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @ENOENT
%6 = icmp eq i32 %4, %5
%7 = zext i1 %6 to i32
%8 = trunc i32 %7 to i8
store i8 %8, i8* %3
%9 = load i8, i8* %3
ret i8 %9
}

LLVM IR (-O2):
@ENOENT = global i32 0
define signext i8 @Platform_NoSuchDirectory(i32 %0) {
%2 = load i32, i32* @ENOENT
%3 = icmp eq i32 %2, %0
%4 = zext i1 %3 to i8
ret i8 %4
}
/* Variables and functions */
scalar_t__ chdir(char const *);
int errno;
int dss_chdir(const char *path) {
  if (chdir(path) >= 0)
    return 1;
  return -((errno) | (1 << 30));
}


x86 assembly (clang, -O0):
<dss_chdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <chdir@plt>
cmp    $0x0,%rax
jl     113b <dss_chdir+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    1151 <dss_chdir+0x41>
mov    0x2e9e(%rip),%rax
mov    (%rax),%ecx
or     $0x40000000,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dss_chdir>:
push   %rax
call   1030 <chdir@plt>
mov    0x2ec3(%rip),%rcx
mov    $0x40000000,%edx
or     (%rcx),%edx
neg    %edx
test   %rax,%rax
mov    $0x1,%eax
cmovs  %edx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @dss_chdir(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @chdir(i8* %4)
%6 = icmp sge i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %12
8: ; preds = %1
%9 = load i32, i32* @errno
%10 = or i32 %9, 1073741824
%11 = sub nsw i32 0, %10
store i32 %11, i32* %2
br label %12
12: ; preds = %8, %7
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @dss_chdir(i8* %0) {
%2 = tail call i64 @chdir(i8* %0)
%3 = icmp sgt i64 %2, -1
%4 = load i32, i32* @errno
%5 = or i32 %4, 1073741824
%6 = sub nsw i32 0, %5
%7 = select i1 %3, i32 1, i32 %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ _main(long, char **);
int open(char *, int /*<<< orphan*/, int /*<<< orphan*/);
void __attribute__((section(".init"))) _start() {
  long argc = 0;
  char *argv[1] = {0};
  int stdin = open("/obj/console", 0, 0);
  _main(argc, argv);
  int count = 0;
  for (;;) {
    count++;
  }
}


x86 assembly (clang, -O0):
<_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x0,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1090 <memset@plt>
lea    0xfb9(%rip),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   10a0 <open@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   10b0 <_main@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    %eax,-0x18(%rbp)
jmp    1067 <_start+0x47>
add    $0x8,%rsp
ret

x86 assembly (clang, -O2):
<_start>:
push   %rax
movq   $0x0,(%rsp)
lea    0xfd0(%rip),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1070 <open@plt>
mov    %rsp,%rsi
xor    %edi,%edi
call   1080 <_main@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
jmp    1050 <_start+0x30>
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"/obj/console\00"
define void @_start() section ".init" {
%1 = alloca i64
%2 = alloca [1 x i8*]
%3 = alloca i32
%4 = alloca i32
store i64 0, i64* %1
%5 = bitcast [1 x i8*]* %2 to i8*
%6 = call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 0, i32 0)
store i32 %6, i32* %3
%7 = load i64, i64* %1
%8 = getelementptr inbounds [1 x i8*], [1 x i8*]* %2, i64 0, i64 0
%9 = call i32 @_main(i64 %7, i8** %8)
store i32 0, i32* %4
br label %10
10: ; preds = %10, %0
%11 = load i32, i32* %4
%12 = add nsw i32 %11, 1
store i32 %12, i32* %4
br label %10
}

LLVM IR (-O2):
@.str = [13 x i8] c"/obj/console\00"
define void @_start() section ".init" {
%1 = alloca [1 x i8*]
%2 = bitcast [1 x i8*]* %1 to i8*
%3 = bitcast [1 x i8*]* %1 to i64*
store i64 0, i64* %3
%4 = tail call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 0, i32 0)
%5 = getelementptr inbounds [1 x i8*], [1 x i8*]* %1, i64 0, i64 0
%6 = call i32 @_main(i64 0, i8** %5)
br label %7
7: ; preds = %7, %0
br label %7
}
/* Variables and functions */
char tolower(char);
void str_tolower(char *str) {
  while (*str) {
    *str = tolower(*str);
    str++;
  }
}


x86 assembly (clang, -O0):
<str_tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <str_tolower+0x3e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <str_tolower+0xc>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @str_tolower(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @tolower(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void CAN1_TX_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @CAN1_TX_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @CAN1_TX_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
/* Variables and functions */
int i(int);
int j(int);
int k(int);
int h(int a) {
  int x;
  if (a == 1)
    x = i(37);
  else
    x = j(42);
  return x + a + k(x);
}


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1157 <h+0x27>
mov    $0x25,%edi
call   1040 <i@plt>
mov    %eax,-0x8(%rbp)
jmp    1164 <h+0x34>
mov    $0x2a,%edi
call   1030 <j@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <k@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h>:
push   %rbx
mov    %edi,%ebx
cmp    $0x1,%edi
jne    1144 <h+0x14>
mov    $0x25,%edi
call   1040 <i@plt>
jmp    114e <h+0x1e>
mov    $0x2a,%edi
call   1030 <j@plt>
add    %eax,%ebx
mov    %eax,%edi
call   1050 <k@plt>
add    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @h(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @i(i32 37)
br label %7
5: ; preds = %1
%6 = tail call i32 @j(i32 42)
br label %7
7: ; preds = %5, %3
%8 = phi i32 [ %4, %3 ], [ %6, %5 ]
%9 = add nsw i32 %8, %0
%10 = tail call i32 @k(i32 %8)
%11 = add nsw i32 %9, %10
ret i32 %11
}
int atomicFetch(volatile int *i) {
  return __sync_bool_compare_and_swap(i, 123897213, 123897213);
}


x86 assembly (clang, -O0):
<atomicFetch>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x762857d,%edx
mov    %edx,%eax
lock cmpxchg %edx,(%rcx)
mov    %eax,%ecx
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomicFetch>:
mov    $0x762857d,%edx
xor    %ecx,%ecx
mov    $0x762857d,%eax
lock cmpxchg %edx,(%rdi)
sete   %cl
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @atomicFetch(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = cmpxchg i32* %3, i32 123897213, i32 123897213 seq_cst seq_cst
%5 = extractvalue { i32, i1 } %4, 1
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @atomicFetch(i32* nocapture %0) {
%2 = cmpxchg i32* %0, i32 123897213, i32 123897213 seq_cst seq_cst
%3 = extractvalue { i32, i1 } %2, 1
%4 = zext i1 %3 to i32
ret i32 %4
}
char *langRomTypeKonamiGeneric() { return "Konami Generic"; }


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

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

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

LLVM IR (-O2):
@.str = [15 x i8] c"Konami Generic\00"
define i8* @langRomTypeKonamiGeneric() {
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
size_t my_strlen(const char *s) {
  size_t n = 0;
  while (*s++ != '\0')
    ++n;
  return n;
}


x86 assembly (clang, -O0):
<my_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     113c <my_strlen+0x3c>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <my_strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strlen>:
cmpb   $0x0,(%rdi)
je     111f <my_strlen+0x1f>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
mov    %rax,%rcx
jne    1110 <my_strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @my_strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add i64 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i64 [ 0, %1 ], [ %8, %4 ]
ret i64 %12
}
int test_imm_83int64_midword_reg(long long val) {
  return ((val >> 16) & (0x83 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_83int64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0x83,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_83int64_midword_reg>:
test   $0x830000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_83int64_midword_reg(i64 %0) {
%2 = and i64 %0, 8585216
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
void __attribute__((__always___, __nodebug__))
_mm_store_pd(double *dp, __m128d a) {
  *(__m128d *)dp = a;
}


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

x86 assembly (clang, -O2):
<_mm_store_pd>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @_mm_store_pd(double* nocapture writeonly %0, i32 %1) {
%3 = bitcast double* %0 to i32*
store i32 %1, i32* %3
ret void
}
long double fmaxl(long double _x, long double _y) {
  return (__builtin_isgreaterequal(_x, _y) || __builtin_isnan(_y)) ? _x : _y;
}


x86 assembly (clang, -O0):
<fmaxl>:
push   %rbp
mov    %rsp,%rbp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jae    1137 <fmaxl+0x37>
jmp    1127 <fmaxl+0x27>
fldt   -0x20(%rbp)
fucomip %st(0),%st
jnp    1142 <fmaxl+0x42>
jmp    1137 <fmaxl+0x37>
fldt   -0x10(%rbp)
fstpt  -0x2c(%rbp)
jmp    1148 <fmaxl+0x48>
fldt   -0x20(%rbp)
fstpt  -0x2c(%rbp)
fldt   -0x2c(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmaxl>:
fldt   0x8(%rsp)
fldt   0x18(%rsp)
fucomi %st(0),%st
fld    %st(0)
fcmovu %st(2),%st
fxch   %st(2)
fucomi %st(1),%st
fstp   %st(1)
fxch   %st(1)
fcmovnb %st(1),%st
fstp   %st(1)
ret

LLVM IR (-O0):
define x86_fp80 @fmaxl(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %4
%7 = fcmp oge x86_fp80 %5, %6
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load x86_fp80, x86_fp80* %4
%10 = fcmp uno x86_fp80 %9, %9
br i1 %10, label %11, label %13
11: ; preds = %8, %2
%12 = load x86_fp80, x86_fp80* %3
br label %15
13: ; preds = %8
%14 = load x86_fp80, x86_fp80* %4
br label %15
15: ; preds = %13, %11
%16 = phi x86_fp80 [ %12, %11 ], [ %14, %13 ]
ret x86_fp80 %16
}

LLVM IR (-O2):
define x86_fp80 @fmaxl(x86_fp80 %0, x86_fp80 %1) {
%3 = fcmp oge x86_fp80 %0, %1
%4 = fcmp uno x86_fp80 %1, 0xK00000000000000000000
%5 = or i1 %3, %4
%6 = select i1 %5, x86_fp80 %0, x86_fp80 %1
ret x86_fp80 %6
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ ptimeval(struct timeval *);
mptimeval(char *s, struct timeval *tv) {
  printf("%s\t ", s);
  ptimeval(tv);
}


x86 assembly (clang, -O0):
<mptimeval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1040 <ptimeval@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mptimeval>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <ptimeval@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
@.str = [5 x i8] c"%s\09 \00"
define i32 @mptimeval(i8* %0, %struct.timeval* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca %struct.timeval*
store i8* %0, i8** %4
store %struct.timeval* %1, %struct.timeval** %5
%6 = load i8*, i8** %4
%7 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load %struct.timeval*, %struct.timeval** %5
%9 = call i32 @ptimeval(%struct.timeval* %8)
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
@.str = [5 x i8] c"%s\09 \00"
define i32 @mptimeval(i8* %0, %struct.timeval* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @ptimeval(%struct.timeval* %1)
ret i32 undef
}