xunge/DecIR huggingface dataset:
void _M2_EXCEPTIONS_init(__attribute__((unused)) int argc,
                         __attribute__((unused)) char *argv[]) {}


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

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

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

LLVM IR (-O2):
define void @_M2_EXCEPTIONS_init(i32 %0, i8** nocapture %1) {
ret void
}
int am33xx_bbu_emmc_register_handler(const char *name, char *devicefile) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @am33xx_bbu_emmc_register_handler(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int time_t;
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, void *);
time_t get_time_milli_seconds() {
  struct timeval tv;
  gettimeofday(&tv, (void *)0);
  time_t time_in_mill = (tv.tv_sec) * 1000 + (tv.tv_usec) / 1000;
  return time_in_mill;
}


x86 assembly (clang, -O0):
<get_time_milli_seconds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time_milli_seconds>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,(%rsp),%ecx
movslq 0x4(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @get_time_milli_seconds() {
%1 = alloca %struct.timeval
%2 = alloca i32
%3 = call i32 @gettimeofday(%struct.timeval* %1, i8* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = add nsw i32 %6, %9
store i32 %10, i32* %2
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @get_time_milli_seconds() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i8* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = add nsw i32 %9, %6
ret i32 %10
}
/* Variables and functions */
char **stb_tokens_raw(char *, char *, int *, int /*<<< orphan*/, int, char *,
                      char *);
char **stb_tokens_nested_empty(char *src, char *delimit, int *count,
                               char *nest_in, char *nest_out) {
  return stb_tokens_raw(src, delimit, count, 0, 1, nest_in, nest_out);
}


x86 assembly (clang, -O0):
<stb_tokens_nested_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%r9
mov    -0x28(%rbp),%rax
xor    %ecx,%ecx
mov    $0x1,%r8d
mov    %rax,(%rsp)
call   1030 <stb_tokens_raw@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stb_tokens_nested_empty>:
push   %rax
mov    %rcx,%r9
mov    %r8,(%rsp)
xor    %ecx,%ecx
mov    $0x1,%r8d
call   1030 <stb_tokens_raw@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i8** @stb_tokens_nested_empty(i8* %0, i8* %1, i32* %2, i8* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32*
%9 = alloca i8*
%10 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i32* %2, i32** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i32*, i32** %8
%14 = load i8*, i8** %9
%15 = load i8*, i8** %10
%16 = call i8** @stb_tokens_raw(i8* %11, i8* %12, i32* %13, i32 0, i32 1, i8* %14, i8* %15)
ret i8** %16
}

LLVM IR (-O2):
define i8** @stb_tokens_nested_empty(i8* %0, i8* %1, i32* %2, i8* %3, i8* %4) {
%6 = tail call i8** @stb_tokens_raw(i8* %0, i8* %1, i32* %2, i32 0, i32 1, i8* %3, i8* %4)
ret i8** %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int test(int result, int ligne) {
  if (!result) {
    printf("Echec du Test ligne %d.\n", ligne);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1143 <test+0x33>
mov    -0xc(%rbp),%esi
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    114a <test+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
xor    %eax,%eax
test   %edi,%edi
je     1117 <test+0x7>
ret
push   %rax
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
@.str = [25 x i8] c"Echec du Test ligne %d.\0A\00"
define i32 @test(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %1)
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ 1, %4 ], [ 0, %2 ]
ret i32 %7
}
int pad64(int items, int sz) { return items + (64 - items * sz % 64) / sz; }


x86 assembly (clang, -O0):
<pad64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    $0x40,%ecx
cltd
idiv   %ecx
mov    $0x40,%eax
sub    %edx,%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pad64>:
mov    %esi,%ecx
imul   %edi,%ecx
lea    0x3f(%rcx),%eax
test   %ecx,%ecx
cmovns %ecx,%eax
and    $0xffffffc0,%eax
sub    %ecx,%eax
add    $0x40,%eax
cltd
idiv   %esi
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @pad64(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = mul nsw i32 %6, %7
%9 = srem i32 %8, 64
%10 = sub nsw i32 64, %9
%11 = load i32, i32* %4
%12 = sdiv i32 %10, %11
%13 = add nsw i32 %5, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @pad64(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = srem i32 %3, 64
%5 = sub nsw i32 64, %4
%6 = sdiv i32 %5, %1
%7 = add nsw i32 %6, %0
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int fwrite(int *, int, int, int /*<<< orphan*/ *);
int fputc(int ic, FILE *file) {
  if (fwrite(&ic, 1, 1, file) == 1) {
    return ic;
  } else {
    return EOF;
  }
}


x86 assembly (clang, -O0):
<fputc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
lea    -0x8(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fwrite@plt>
cmp    $0x1,%eax
jne    1147 <fputc+0x37>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <fputc+0x43>
mov    0x2e9a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fputc>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rcx
mov    %edi,0xc(%rsp)
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
cmp    $0x1,%eax
je     113f <fputc+0x2f>
mov    0x2ea9(%rip),%rbx
mov    (%rbx),%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define i32 @fputc(i32 %0, i32* nocapture %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @fwrite(i32* %3, i32 1, i32 1, i32* %1)
%5 = icmp eq i32 %4, 1
%6 = load i32, i32* %3
%7 = load i32, i32* @EOF
%8 = select i1 %5, i32 %6, i32 %7
ret i32 %8
}
int bar(void) {
  static int s;
#pragma omp declare target to(s)
  return ++s;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1a(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f11(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
mov    0x2f1e(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f15(%rip)
ret

LLVM IR (-O0):
@bar.s = internal global i32 0
define i32 @bar() {
%1 = load i32, i32* @bar.s
%2 = add nsw i32 %1, 1
store i32 %2, i32* @bar.s
ret i32 %2
}

LLVM IR (-O2):
@bar.s = internal unnamed_addr global i32 0
define i32 @bar() {
%1 = load i32, i32* @bar.s
%2 = add nsw i32 %1, 1
store i32 %2, i32* @bar.s
ret i32 %2
}
/* Type definitions */
struct em8051 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *);
int disasm_inc_a(struct em8051 *aCPU, int aPosition, char *aBuffer) {
  sprintf(aBuffer, "INC   A");
  return 1;
}


x86 assembly (clang, -O0):
<disasm_inc_a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xed2(%rip),%rsi
call   1030 <sprintf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disasm_inc_a>:
movabs $0x41202020434e49,%rax
mov    %rax,(%rdx)
mov    $0x1,%eax
ret

LLVM IR (-O0):
%struct.em8051 = type { i32 }
@.str = [8 x i8] c"INC A\00"
define i32 @disasm_inc_a(%struct.em8051* %0, i32 %1, i8* %2) {
%4 = alloca %struct.em8051*
%5 = alloca i32
%6 = alloca i8*
store %struct.em8051* %0, %struct.em8051** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
%struct.em8051 = type { i32 }
define i32 @disasm_inc_a(%struct.em8051* nocapture readnone %0, i32 %1, i8* nocapture writeonly %2) {
%4 = bitcast i8* %2 to i64*
store i64 18331195838516809, i64* %4
ret i32 1
}
void ARGBToARGB1555Row_Any_SSE2() {}


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

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

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

LLVM IR (-O2):
define void @ARGBToARGB1555Row_Any_SSE2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
void freeIntVector(int *vector) { free(vector); }


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

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

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

LLVM IR (-O2):
define void @freeIntVector(i32* nocapture %0) {
%2 = tail call i32 @free(i32* %0)
ret void
}
main() {
a:
  __attribute((unused));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <main+0x9>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
br label %1
1: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int test_imm_1Duint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x1D << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_1Duint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 29
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int ksft_exit_fail(void) { exit(1); }


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

x86 assembly (clang, -O2):
<ksft_exit_fail>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @ksft_exit_fail() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define i32 @ksft_exit_fail() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
float exp(float);
float log(float);
float powf(float x, float y) { return exp(y * log(x)); }


x86 assembly (clang, -O0):
<powf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <log@plt>
movaps %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
mulss  %xmm1,%xmm0
call   1030 <exp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<powf>:
push   %rax
movss  %xmm1,0x4(%rsp)
call   1040 <log@plt>
mulss  0x4(%rsp),%xmm0
pop    %rax
jmp    1030 <exp@plt>

LLVM IR (-O0):
define float @powf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %4
%6 = load float, float* %3
%7 = call float @log(float %6)
%8 = fmul float %5, %7
%9 = call float @exp(float %8)
ret float %9
}

LLVM IR (-O2):
define float @powf(float %0, float %1) {
%3 = tail call float @log(float %0)
%4 = fmul float %3, %1
%5 = tail call float @exp(float %4)
ret float %5
}
/* Variables and functions */
void *domalloc(size_t);
void *malloc(size_t size) {
  void *m = domalloc(size);
  ;
  return m;
}


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

x86 assembly (clang, -O2):
<malloc>:
jmp    1030 <domalloc@plt>

LLVM IR (-O0):
define i8* @malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @domalloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define i8* @malloc(i64 %0) {
%2 = tail call i8* @domalloc(i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ charout(int /*<<< orphan*/);
int mywrite(char *ptr, int len) {
  int i = len;
  while (i--)
    charout(*ptr++);
  return len;
}


x86 assembly (clang, -O0):
<mywrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x10(%rbp)
cmp    $0x0,%eax
je     1155 <mywrite+0x45>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <charout@plt>
jmp    1125 <mywrite+0x15>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mywrite>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
test   %esi,%esi
je     1142 <mywrite+0x32>
mov    %rdi,%r15
mov    %r14d,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1030 <charout@plt>
add    $0x1,%rbx
cmp    %ebx,%ebp
jne    1130 <mywrite+0x20>
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @mywrite(i8* nocapture %0, i32 returned %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i8* [ %8, %4 ], [ %0, %2 ]
%7 = add nsw i32 %5, -1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %6
%10 = sext i8 %9 to i32
%11 = tail call i32 @charout(i32 %10)
%12 = icmp eq i32 %7, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %2
ret i32 %1
}
int test_imm_D2int8_mem(signed char *val) {
  return ((*val) & (0xD2 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_D2int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, 210
%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_D2int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -46
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ header();
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ txt_ctrd(char *);
void win_scr(int player) {
  header();
  char str[50];
  sprintf(str, "Congratulations Player %d, you win !\n", player + 1);
  txt_ctrd(str);
  txt_ctrd("Press a key to quit...\n");
  getchar();
}


x86 assembly (clang, -O0):
<win_scr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <header@plt>
lea    -0x40(%rbp),%rdi
mov    -0x4(%rbp),%edx
add    $0x1,%edx
lea    0xe9d(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x40(%rbp),%rdi
call   1050 <txt_ctrd@plt>
lea    0xeae(%rip),%rdi
call   1050 <txt_ctrd@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<win_scr>:
push   %r14
push   %rbx
sub    $0x38,%rsp
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <header@plt>
add    $0x1,%ebx
lea    0xea6(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
mov    %ebx,%edx
call   1060 <sprintf@plt>
mov    %r14,%rdi
call   1050 <txt_ctrd@plt>
lea    0xeb0(%rip),%rdi
call   1050 <txt_ctrd@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [38 x i8] c"Congratulations Player %d, you win !\0A\00"
@.str.1 = [24 x i8] c"Press a key to quit...\0A\00"
define void @win_scr(i32 %0) {
%2 = alloca i32
%3 = alloca [50 x i8]
store i32 %0, i32* %2
%4 = call i32 (...) @header()
%5 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 1
%8 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%10 = call i32 @txt_ctrd(i8* %9)
%11 = call i32 @txt_ctrd(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 (...) @getchar()
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"Congratulations Player %d, you win !\0A\00"
@.str.1 = [24 x i8] c"Press a key to quit...\0A\00"
define void @win_scr(i32 %0) {
%2 = alloca [50 x i8]
%3 = tail call i32 (...) @header()
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%5 = add nsw i32 %0, 1
%6 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @txt_ctrd(i8* %4)
%8 = call i32 @txt_ctrd(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 (...) @getchar()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ question_one();
int /*<<< orphan*/ question_two();
int main(int argc, char **argv) {
  question_one();
  question_two();
  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 <question_one@plt>
mov    $0x0,%al
call   1030 <question_two@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <question_one@plt>
xor    %eax,%eax
call   1030 <question_two@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
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 (...) @question_one()
%7 = call i32 (...) @question_two()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @question_one()
%4 = tail call i32 (...) @question_two()
ret i32 0
}
/* Variables and functions */
long __arch_fetch_and_add(long *, long);
long int sas_fetch_and_add(long *pointer, long int delta) {
  return __arch_fetch_and_add(pointer, delta);
}


x86 assembly (clang, -O0):
<sas_fetch_and_add>:
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 <__arch_fetch_and_add@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sas_fetch_and_add>:
jmp    1030 <__arch_fetch_and_add@plt>

LLVM IR (-O0):
define i64 @sas_fetch_and_add(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%5 = load i64*, i64** %3
%6 = load i64, i64* %4
%7 = call i64 @__arch_fetch_and_add(i64* %5, i64 %6)
ret i64 %7
}

LLVM IR (-O2):
define i64 @sas_fetch_and_add(i64* %0, i64 %1) {
%3 = tail call i64 @__arch_fetch_and_add(i64* %0, i64 %1)
ret i64 %3
}
void crypto_postfork(void) {}


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

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

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

LLVM IR (-O2):
define void @crypto_postfork() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fat32_wr_n(void *, unsigned int, int);
void fat32_wr32(void *p, unsigned v) { fat32_wr_n(p, v, 4); }


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

x86 assembly (clang, -O2):
<fat32_wr32>:
mov    $0x4,%edx
jmp    1030 <fat32_wr_n@plt>

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

LLVM IR (-O2):
define void @fat32_wr32(i8* %0, i32 %1) {
%3 = tail call i32 @fat32_wr_n(i8* %0, i32 %1, i32 4)
ret void
}
/* Variables and functions */
double fabs(double);
double ABS(double a) { return fabs(a); }


x86 assembly (clang, -O0):
<ABS>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movaps 0xeeb(%rip),%xmm1
pand   %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ABS>:
andps  0xef9(%rip),%xmm0
ret

LLVM IR (-O0):
define double @ABS(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.fabs.f64(double %3)
ret double %4
}

LLVM IR (-O2):
define double @ABS(double %0) {
%2 = tail call double @llvm.fabs.f64(double %0)
ret double %2
}
void av_assert0_fpu() {}


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

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

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

LLVM IR (-O2):
define void @av_assert0_fpu() {
ret void
}
struct bwb_line *bwb_DEFSNG(struct bwb_line *l) {
  bwx_DEBUG(__FUNCTION__);
  var_defx(l, 1);
  return bwb_zline(l);
}


x86 assembly (clang, -O0):
<bwb_DEFSNG>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1040 <bwx_DEBUG@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <var_defx@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1050 <bwb_zline@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bwb_DEFSNG>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1040 <bwx_DEBUG@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <var_defx@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <bwb_zline@plt>
cltq
pop    %rbx
ret

LLVM IR (-O0):
%struct.bwb_line = type opaque
@__FUNCTION__.bwb_DEFSNG = [11 x i8] c"bwb_DEFSNG\00"
define %struct.bwb_line* @bwb_DEFSNG(%struct.bwb_line* %0) {
%2 = alloca %struct.bwb_line*
store %struct.bwb_line* %0, %struct.bwb_line** %2
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @bwx_DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.bwb_DEFSNG, i64 0, i64 0))
%4 = load %struct.bwb_line*, %struct.bwb_line** %2
%5 = call i32 (%struct.bwb_line*, i32, ...) bitcast (i32 (...)* @var_defx to i32 (%struct.bwb_line*, i32, ...)*)(%struct.bwb_line* %4, i32 1)
%6 = load %struct.bwb_line*, %struct.bwb_line** %2
%7 = call i32 (%struct.bwb_line*, ...) bitcast (i32 (...)* @bwb_zline to i32 (%struct.bwb_line*, ...)*)(%struct.bwb_line* %6)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to %struct.bwb_line*
ret %struct.bwb_line* %9
}

LLVM IR (-O2):
%struct.bwb_line = type opaque
@__FUNCTION__.bwb_DEFSNG = [11 x i8] c"bwb_DEFSNG\00"
define %struct.bwb_line* @bwb_DEFSNG(%struct.bwb_line* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @bwx_DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.bwb_DEFSNG, i64 0, i64 0))
%3 = tail call i32 (%struct.bwb_line*, i32, ...) bitcast (i32 (...)* @var_defx to i32 (%struct.bwb_line*, i32, ...)*)(%struct.bwb_line* %0, i32 1)
%4 = tail call i32 (%struct.bwb_line*, ...) bitcast (i32 (...)* @bwb_zline to i32 (%struct.bwb_line*, ...)*)(%struct.bwb_line* %0)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to %struct.bwb_line*
ret %struct.bwb_line* %6
}
/* Variables and functions */
int /*<<< orphan*/ main();
void c_entry() { main(); }


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

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

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

LLVM IR (-O2):
define void @c_entry() {
%1 = tail call i32 (...) @main()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ *tmpfile();
int main() {
  FILE *fp;
  fp = tmpfile();
  printf("Temporary file created\n");
  fclose(fp);
  return (0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <tmpfile@plt>
mov    %rax,%rbx
lea    0xebe(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Temporary file created\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* (...) @tmpfile()
store i32* %3, i32** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%5 = load i32*, i32** %2
%6 = call i32 @fclose(i32* %5)
ret i32 0
}

LLVM IR (-O2):
@str = [23 x i8] c"Temporary file created\00"
define i32 @main() {
%1 = tail call i32* (...) @tmpfile()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @fclose(i32* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ns2svas(int);
void ns2svas_(int *mode) { ns2svas(*mode); }


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

x86 assembly (clang, -O2):
<ns2svas_>:
mov    (%rdi),%edi
jmp    1030 <ns2svas@plt>

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

LLVM IR (-O2):
define void @ns2svas_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @ns2svas(i32 %2)
ret void
}
void __attribute__((
    __warning__("curl_easy_setopt expects a curl_sockopt_callback argument for "
                "this option"))) __attribute__((__unused__))
__attribute__((__no__)) _curl_easy_setopt_err_sockopt_cb(void) {
  __asm__("");
}


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

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

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

LLVM IR (-O2):
define void @_curl_easy_setopt_err_sockopt_cb() {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
int test_imm_93int16_mem(short *val) {
  return ((*val) & (-0x93 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_93int16_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, -147
%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_93int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -147
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
long decrease_sleep_time(long wait) {
  if (wait == 300000)
    wait = 60000;
  wait -= 30000;
  if (wait <= 30000)
    wait = 30000;
  return wait;
}


x86 assembly (clang, -O0):
<decrease_sleep_time>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x493e0,-0x8(%rbp)
jne    111e <decrease_sleep_time+0x1e>
movq   $0xea60,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sub    $0x7530,%rax
mov    %rax,-0x8(%rbp)
cmpq   $0x7530,-0x8(%rbp)
jg     1142 <decrease_sleep_time+0x42>
movq   $0x7530,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decrease_sleep_time>:
lea    -0x7530(%rdi),%rax
cmp    $0x493e0,%rdi
mov    $0x7530,%ecx
cmove  %rcx,%rax
cmp    $0x7531,%rax
cmovl  %rcx,%rax
ret

LLVM IR (-O0):
define i64 @decrease_sleep_time(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 300000
br i1 %4, label %5, label %6
5: ; preds = %1
store i64 60000, i64* %2
br label %6
6: ; preds = %5, %1
%7 = load i64, i64* %2
%8 = sub nsw i64 %7, 30000
store i64 %8, i64* %2
%9 = load i64, i64* %2
%10 = icmp sle i64 %9, 30000
br i1 %10, label %11, label %12
11: ; preds = %6
store i64 30000, i64* %2
br label %12
12: ; preds = %11, %6
%13 = load i64, i64* %2
ret i64 %13
}

LLVM IR (-O2):
define i64 @decrease_sleep_time(i64 %0) {
%2 = icmp eq i64 %0, 300000
%3 = add nsw i64 %0, -30000
%4 = select i1 %2, i64 30000, i64 %3
%5 = icmp sgt i64 %4, 30000
%6 = select i1 %5, i64 %4, i64 30000
ret i64 %6
}
/* Variables and functions */
char *strdup(char *);
char *emit_syscall(int num) {
  return strdup(": mov "
                "r0"
                ", `.arg`\n: svc 0x8000\n");
}


x86 assembly (clang, -O0):
<emit_syscall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <strdup@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [31 x i8] c": mov r0, `.arg`\0A: svc 0x8000\0A\00"
define i8* @emit_syscall(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i8* @strdup(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}

LLVM IR (-O2):
@.str = [31 x i8] c": mov r0, `.arg`\0A: svc 0x8000\0A\00"
define noalias i8* @emit_syscall(i32 %0) {
%2 = tail call dereferenceable_or_null(31) i8* @strdup(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void fail(char *msg) {
  fprintf(stderr, "%s", msg);
  exit(1);
}


x86 assembly (clang, -O0):
<fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fail>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define void @fail(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 ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define void @fail(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int select_fd(int, double, int);
int sock_poll(int fd, double timeout, int wait_for) {
  return select_fd(fd, timeout, wait_for);
}


x86 assembly (clang, -O0):
<sock_poll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x4(%rbp),%edi
movsd  -0x10(%rbp),%xmm0
mov    -0x14(%rbp),%esi
call   1030 <select_fd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sock_poll>:
jmp    1030 <select_fd@plt>

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

LLVM IR (-O2):
define i32 @sock_poll(i32 %0, double %1, i32 %2) {
%4 = tail call i32 @select_fd(i32 %0, double %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *unity_malloc(size_t);
void *unity_calloc(size_t num, size_t size) {
  void *mem = unity_malloc(num * size);
  memset(mem, 0, num * size);
  return mem;
}


x86 assembly (clang, -O0):
<unity_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
imul   -0x10(%rbp),%rdi
call   1040 <unity_malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
imul   -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unity_calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
call   1040 <unity_malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @unity_calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = mul i64 %6, %7
%9 = call i8* @unity_malloc(i64 %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = load i64, i64* %3
%12 = load i64, i64* %4
%13 = mul i64 %11, %12
%14 = call i32 @memset(i8* %10, i32 0, i64 %13)
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
define i8* @unity_calloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @unity_malloc(i64 %3)
%5 = tail call i32 @memset(i8* %4, i32 0, i64 %3)
ret i8* %4
}
/* Type definitions */
struct __kfifo {
  int dummy;
};

/* Variables and functions */
unsigned int __kfifo_peek_n(struct __kfifo *, size_t);
unsigned int __kfifo_len_r(struct __kfifo *fifo, size_t recsize) {
  return __kfifo_peek_n(fifo, recsize);
}


x86 assembly (clang, -O0):
<__kfifo_len_r>:
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 <__kfifo_peek_n@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__kfifo_len_r>:
jmp    1030 <__kfifo_peek_n@plt>

LLVM IR (-O0):
%struct.__kfifo = type { i32 }
define i32 @__kfifo_len_r(%struct.__kfifo* %0, i64 %1) {
%3 = alloca %struct.__kfifo*
%4 = alloca i64
store %struct.__kfifo* %0, %struct.__kfifo** %3
store i64 %1, i64* %4
%5 = load %struct.__kfifo*, %struct.__kfifo** %3
%6 = load i64, i64* %4
%7 = call i32 @__kfifo_peek_n(%struct.__kfifo* %5, i64 %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.__kfifo = type { i32 }
define i32 @__kfifo_len_r(%struct.__kfifo* %0, i64 %1) {
%3 = tail call i32 @__kfifo_peek_n(%struct.__kfifo* %0, i64 %1)
ret i32 %3
}
void dgemm_transpose(double *a, double *b, double *c, int n) {}


x86 assembly (clang, -O0):
<dgemm_transpose>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @dgemm_transpose(double* %0, double* %1, double* %2, i32 %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca double*
%8 = alloca i32
store double* %0, double** %5
store double* %1, double** %6
store double* %2, double** %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
define void @dgemm_transpose(double* nocapture %0, double* nocapture %1, double* nocapture %2, i32 %3) {
ret void
}
void b_system_misc(unsigned long function, void *var1, void *var2) {
  asm volatile("call *0x00100078" : : "d"(function), "a"(var1), "c"(var2));
}


x86 assembly (clang, -O0):
<b_system_misc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
call   *0x100078
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_system_misc>:
mov    %rdx,%rcx
mov    %rsi,%rax
mov    %rdi,%rdx
call   *0x100078
ret

LLVM IR (-O0):
define void @b_system_misc(i64 %0, i8* %1, i8* %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i8*
store i64 %0, i64* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i64, i64* %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
ret void
}

LLVM IR (-O2):
define void @b_system_misc(i64 %0, i8* %1, i8* %2) {
tail call void asm sideeffect "call *0x00100078", "{dx},{ax},{cx},~{dirflag},~{fpsr},~{flags}"(i64 %0, i8* %1, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int, int /*<<< orphan*/, int /*<<< orphan*/);
void version() {
  printf("'ga_nuc_summit' in genome analysis tools version: %d.%d.%d\n", 1, 0,
         0);
  exit(0);
}


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

x86 assembly (clang, -O2):
<version>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x1,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [60 x i8] c"'ga_nuc_summit' in genome analysis tools version: %d.%d.%d\0A\00"
define void @version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i32 1, i32 0, i32 0)
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [60 x i8] c"'ga_nuc_summit' in genome analysis tools version: %d.%d.%d\0A\00"
define void @version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i32 1, i32 0, i32 0)
%2 = tail call i32 @exit(i32 0)
unreachable
}
int fn1(int a, int b, int m) { return (a & ~m) | (b & m); }


x86 assembly (clang, -O0):
<fn1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn1>:
mov    %esi,%eax
xor    %edi,%eax
and    %edx,%eax
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @fn1(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %6
%9 = xor i32 %8, -1
%10 = and i32 %7, %9
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = and i32 %11, %12
%14 = or i32 %10, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @fn1(i32 %0, i32 %1, i32 %2) {
%4 = xor i32 %2, -1
%5 = and i32 %4, %0
%6 = and i32 %2, %1
%7 = or i32 %5, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMR75_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMR75_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMR75_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void single_dim(int a[], int n) {
  printf("%d\n", a[n - 1]);
  printf("sizeof=%lu\n", sizeof(a));
}


x86 assembly (clang, -O0):
<single_dim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xec2(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<single_dim>:
push   %rax
movslq %esi,%rax
mov    -0x4(%rdi,%rax,4),%esi
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
mov    $0x8,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [12 x i8] c"sizeof=%lu\0A\00"
define void @single_dim(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %6, 1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %5, i64 %8
%10 = load i32, i32* %9
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 8)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [12 x i8] c"sizeof=%lu\0A\00"
define void @single_dim(i32* nocapture %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void g_error(char *message) { printf("%s: %s\n", "od", message); }


x86 assembly (clang, -O0):
<g_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xed9(%rip),%rdi
lea    0xeda(%rip),%rsi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_error>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xee7(%rip),%rsi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"%s: %s\0A\00"
@.str.1 = [3 x i8] c"od\00"
define void @g_error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}