xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ dict_hash_cleanup();
void dict_cleanup(void) { dict_hash_cleanup(); }


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

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

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

LLVM IR (-O2):
define void @dict_cleanup() {
%1 = tail call i32 (...) @dict_hash_cleanup()
ret void
}
unsigned char f87(unsigned char x, int y) { return (x << (8 - y)) + (x >> y); }


x86 assembly (clang, -O0):
<f87>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
mov    $0x8,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%eax
movzbl -0x1(%rbp),%edx
mov    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f87>:
mov    $0x8,%cl
sub    %sil,%cl
mov    %edi,%eax
shl    %cl,%eax
mov    %esi,%ecx
shr    %cl,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @f87(i8 zeroext %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 = zext i8 %5 to i32
%7 = load i32, i32* %4
%8 = sub nsw i32 8, %7
%9 = shl i32 %6, %8
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = load i32, i32* %4
%13 = ashr i32 %11, %12
%14 = add nsw i32 %9, %13
%15 = trunc i32 %14 to i8
ret i8 %15
}

LLVM IR (-O2):
define zeroext i8 @f87(i8 zeroext %0, i32 %1) {
%3 = zext i8 %0 to i32
%4 = sub nsw i32 8, %1
%5 = shl i32 %3, %4
%6 = lshr i32 %3, %1
%7 = add nsw i32 %5, %6
%8 = trunc i32 %7 to i8
ret i8 %8
}
/* Variables and functions */
double floor(double);
int /*<<< orphan*/ printf(char *, double);
void handleTimeStep(double oldTime, double newTime) {
  if (floor(newTime) - floor(oldTime) >= 1.0)
    printf("handleTimeStep: %f frames/sec\n", 1.0 / (newTime - oldTime));
}


x86 assembly (clang, -O0):
<handleTimeStep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <floor@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <floor@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  0xea1(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     118b <handleTimeStep+0x6b>
movsd  -0x10(%rbp),%xmm1
subsd  -0x8(%rbp),%xmm1
movsd  0xe85(%rip),%xmm0
divsd  %xmm1,%xmm0
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handleTimeStep>:
sub    $0x18,%rsp
movsd  %xmm0,(%rsp)
movsd  %xmm1,0x8(%rsp)
movaps %xmm1,%xmm0
call   1040 <floor@plt>
movsd  %xmm0,0x10(%rsp)
movsd  (%rsp),%xmm0
call   1040 <floor@plt>
movsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
ucomisd 0xea7(%rip),%xmm1
jae    1160 <handleTimeStep+0x40>
add    $0x18,%rsp
ret
movsd  0x8(%rsp),%xmm1
subsd  (%rsp),%xmm1
movsd  0xe8d(%rip),%xmm0
divsd  %xmm1,%xmm0
lea    0xe8a(%rip),%rdi
add    $0x18,%rsp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"handleTimeStep: %f frames/sec\0A\00"
define void @handleTimeStep(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = call double @llvm.floor.f64(double %5)
%7 = load double, double* %3
%8 = call double @llvm.floor.f64(double %7)
%9 = fsub double %6, %8
%10 = fcmp oge double %9, 1.000000e+00
br i1 %10, label %11, label %17
11: ; preds = %2
%12 = load double, double* %4
%13 = load double, double* %3
%14 = fsub double %12, %13
%15 = fdiv double 1.000000e+00, %14
%16 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), double %15)
br label %17
17: ; preds = %11, %2
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"handleTimeStep: %f frames/sec\0A\00"
define void @handleTimeStep(double %0, double %1) {
%3 = tail call double @llvm.floor.f64(double %1)
%4 = tail call double @llvm.floor.f64(double %0)
%5 = fsub double %3, %4
%6 = fcmp ult double %5, 1.000000e+00
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = fsub double %1, %0
%9 = fdiv double 1.000000e+00, %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), double %9)
br label %11
11: ; preds = %7, %2
ret void
}
int *e2(void) { return 0; }


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

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

LLVM IR (-O0):
define i32* @e2() {
ret i32* null
}

LLVM IR (-O2):
define noalias i32* @e2() {
ret i32* null
}
/* Variables and functions */
unsigned long Rand3();
unsigned long lRand3(void) { return Rand3(); }


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

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

LLVM IR (-O0):
define i64 @lRand3() {
%1 = call i64 (...) @Rand3()
ret i64 %1
}

LLVM IR (-O2):
define i64 @lRand3() {
%1 = tail call i64 (...) @Rand3()
ret i64 %1
}
int cairo_code_draw_casOutputLabel_get_height() { return 12; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_casOutputLabel_get_height() {
ret i32 12
}

LLVM IR (-O2):
define i32 @cairo_code_draw_casOutputLabel_get_height() {
ret i32 12
}
__attribute__((no, noclone)) unsigned __int128 t100_3add(signed char y) {
  unsigned __int128 r;
  if (__builtin_add_overflow((signed char)(-1), y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %dil,%al
mov    %al,-0x11(%rbp)
movsbq -0x11(%rbp),%rdx
mov    %rdx,%r9
sar    $0x3f,%r9
add    $0xffffffffffffffff,%rdx
mov    %r9,%rcx
adc    $0xffffffffffffffff,%rcx
mov    %r9,%r8
adc    $0xffffffffffffffff,%r8
adc    $0xffffffffffffffff,%r9
mov    %r8d,%eax
and    $0x1,%eax
mov    %eax,%esi
mov    %rsi,%rax
neg    %rax
mov    %rax,%rdi
xor    %r9,%rdi
xor    %r8,%rax
or     %rdi,%rax
or     %rsi,%rax
setne  %al
mov    %rdx,-0x30(%rbp)
mov    %rcx,-0x28(%rbp)
test   $0x1,%al
jne    1175 <t100_3add+0x65>
jmp    117c <t100_3add+0x6c>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x30(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %r14
push   %rbx
push   %rax
movslq %edi,%r14
mov    %r14,%rbx
sar    $0x3f,%rbx
add    $0xffffffffffffffff,%r14
adc    $0xffffffffffffffff,%rbx
test   %dil,%dil
jg     1132 <t100_3add+0x22>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %r14,%rax
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t100_3add(i8 signext %0) {
%2 = alloca i128
%3 = alloca i8
%4 = alloca i128
store i8 %0, i8* %3
%5 = load i8, i8* %3
%6 = sext i8 %5 to i129
%7 = call { i129, i1 } @llvm.sadd.with.overflow.i129(i129 -1, i129 %6)
%8 = extractvalue { i129, i1 } %7, 1
%9 = extractvalue { i129, i1 } %7, 0
%10 = trunc i129 %9 to i128
%11 = zext i128 %10 to i129
%12 = icmp ne i129 %9, %11
%13 = or i1 %8, %12
store i128 %10, i128* %4
br i1 %13, label %14, label %16
14: ; preds = %1
%15 = call i32 (...) @bar()
br label %16
16: ; preds = %14, %1
%17 = load i128, i128* %4
store i128 %17, i128* %2
%18 = bitcast i128* %2 to { i64, i64 }*
%19 = load { i64, i64 }, { i64, i64 }* %18
ret { i64, i64 } %19
}

LLVM IR (-O2):
define { i64, i64 } @t100_3add(i8 signext %0) {
%2 = sext i8 %0 to i129
%3 = add nsw i129 %2, -1
%4 = icmp slt i8 %0, 1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (...) @bar()
br label %7
7: ; preds = %5, %1
%8 = trunc i129 %3 to i64
%9 = lshr i129 %3, 64
%10 = trunc i129 %9 to i64
%11 = insertvalue { i64, i64 } poison, i64 %8, 0
%12 = insertvalue { i64, i64 } %11, i64 %10, 1
ret { i64, i64 } %12
}
/* Variables and functions */
int bar();
int foo();
int main() {
  int i = foo();
  int k = bar();
  i = i * k;
  return i;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <foo@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <bar@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <foo@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <bar@plt>
imul   %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @foo()
store i32 %4, i32* %2
%5 = call i32 (...) @bar()
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = mul nsw i32 %6, %7
store i32 %8, i32* %2
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 (...) @bar()
%3 = mul nsw i32 %2, %1
ret i32 %3
}
void L4_KDB_PrintChar(char arg) {
  __asm__ __volatile__("/* L4_KDB_"
                       "PrintChar"
                       "() */		\n"
                       "	int	$3		\n"
                       "	cmpb	%1, %%al	\n"
                       :
                       : "a"(arg), "i"(0x00));
}


x86 assembly (clang, -O0):
<L4_KDB_PrintChar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
int3
cmp    $0x0,%al
pop    %rbp
ret

x86 assembly (clang, -O2):
<L4_KDB_PrintChar>:
mov    %edi,%eax
int3
cmp    $0x0,%al
ret

LLVM IR (-O0):
define void @L4_KDB_PrintChar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
ret void
}

LLVM IR (-O2):
define void @L4_KDB_PrintChar(i8 signext %0) {
tail call void asm sideeffect "/* L4_KDB_PrintChar() */\09\09\0A\09int\09$$3\09\09\0A\09cmpb\09$1, %al\09\0A", "{ax},i,~{dirflag},~{fpsr},~{flags}"(i8 %0, i32 0)
ret void
}
int blank_reset(void *state) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @blank_reset(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void foo() {
  while (1)
    sleep(1);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <foo+0x9>
mov    $0x1,%edi
call   1030 <sleep@plt>
jmp    1119 <foo+0x9>

x86 assembly (clang, -O2):
<foo>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1030 <sleep@plt>
jmp    1120 <foo+0x10>

LLVM IR (-O0):
define void @foo() {
br label %1
1: ; preds = %0, %1
%2 = call i32 @sleep(i32 1)
br label %1
}

LLVM IR (-O2):
define void @foo() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @sleep(i32 1)
br label %1
}
void gameOptions() {}


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

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

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

LLVM IR (-O2):
define void @gameOptions() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mdea_error(char **, char *);
int mdea_number_node_get_string(void *p, const char **string, char **error) {
  mdea_error(error, "Expected string, got number");
  return -1;
}


x86 assembly (clang, -O0):
<mdea_number_node_get_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xed1(%rip),%rsi
call   1030 <mdea_error@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mdea_number_node_get_string>:
push   %rax
mov    %rdx,%rdi
lea    0xee5(%rip),%rsi
call   1030 <mdea_error@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Expected string, got number\00"
define i32 @mdea_number_node_get_string(i8* %0, i8** %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
%7 = load i8**, i8*** %6
%8 = call i32 @mdea_error(i8** %7, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [28 x i8] c"Expected string, got number\00"
define i32 @mdea_number_node_get_string(i8* nocapture readnone %0, i8** nocapture readnone %1, i8** %2) {
%4 = tail call i32 @mdea_error(i8** %2, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ u_char;
typedef int /*<<< orphan*/ RSA;

/* Variables and functions */
int /*<<< orphan*/ *d2i_RSAPrivateKey(int /*<<< orphan*/ *,
                                      int /*<<< orphan*/ const **, long);
RSA *get_rsa_priv(const u_char **priv_key, long length) {
  return d2i_RSAPrivateKey(NULL, priv_key, length);
}


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

x86 assembly (clang, -O2):
<get_rsa_priv>:
mov    %rsi,%rdx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <d2i_RSAPrivateKey@plt>

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

LLVM IR (-O2):
define i32* @get_rsa_priv(i32** %0, i64 %1) {
%3 = tail call i32* @d2i_RSAPrivateKey(i32* null, i32** %0, i64 %1)
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: snd2nes [--note-delta=DELTA] [--hertz-delta=DELTA]"
         "               [--output=FILE]\n [--verbose]\n"
         "               [--help] [--usage] [--version]\n"
         "               FILE\n");
  exit(0);
}


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

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

LLVM IR (-O0):
@.str = [168 x i8] c"Usage: snd2nes [--note-delta=DELTA] [--hertz-delta=DELTA] [--output=FILE]\0A [--verbose]\0A [--help] [--usage] [--version]\0A FILE\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [167 x i8] c"Usage: snd2nes [--note-delta=DELTA] [--hertz-delta=DELTA] [--output=FILE]\0A [--verbose]\0A [--help] [--usage] [--version]\0A FILE\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([167 x i8], [167 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int PARTITION(int *, int, int);
void QUICKSORT(int A[], int p, int q) {
  if (p < q) {
    int m = PARTITION(A, p, q);
    QUICKSORT(A, p, m - 1);
    QUICKSORT(A, m + 1, q);
  }
}


x86 assembly (clang, -O0):
<QUICKSORT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <QUICKSORT+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <PARTITION@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1030 <QUICKSORT@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1030 <QUICKSORT@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @QUICKSORT(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %24
11: ; preds = %3
%12 = load i32*, i32** %4
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = call i32 @PARTITION(i32* %12, i32 %13, i32 %14)
store i32 %15, i32* %7
%16 = load i32*, i32** %4
%17 = load i32, i32* %5
%18 = load i32, i32* %7
%19 = sub nsw i32 %18, 1
%20 = load i32*, i32** %4
%21 = load i32, i32* %7
%22 = add nsw i32 %21, 1
%23 = load i32, i32* %6
br label %24
24: ; preds = %11, %3
ret void
}

LLVM IR (-O2):
define void @QUICKSORT(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @PARTITION(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @QUICKSORT(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
void ft_striteri(char *s, void (*f)(unsigned int, char *)) {
  int i;
  i = 0;
  if (s && f) {
    while (s[i]) {
      f(i, &s[i]);
      i++;
    }
  }
}


x86 assembly (clang, -O0):
<ft_striteri>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     116b <ft_striteri+0x6b>
cmpq   $0x0,-0x10(%rbp)
je     116b <ft_striteri+0x6b>
jmp    1132 <ft_striteri+0x32>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1166 <ft_striteri+0x66>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%rsi
movslq -0x14(%rbp),%rcx
add    %rcx,%rsi
call   *%rax
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1132 <ft_striteri+0x32>
jmp    116b <ft_striteri+0x6b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_striteri>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     1135 <ft_striteri+0x35>
mov    %rsi,%r14
test   %rsi,%rsi
je     1135 <ft_striteri+0x35>
mov    %rdi,%r15
cmpb   $0x0,(%rdi)
je     1135 <ft_striteri+0x35>
xor    %ebx,%ebx
nopl   0x0(%rax)
lea    (%r15,%rbx,1),%rsi
mov    %ebx,%edi
call   *%r14
cmpb   $0x0,0x1(%r15,%rbx,1)
lea    0x1(%rbx),%rbx
jne    1120 <ft_striteri+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @ft_striteri(i8* %0, void (i32, i8*)* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne void (i32, i8*)* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %17
6: ; preds = %2
%7 = load i8, i8* %0
%8 = icmp eq i8 %7, 0
br i1 %8, label %17, label %9
9: ; preds = %6, %9
%10 = phi i64 [ %13, %9 ], [ 0, %6 ]
%11 = phi i8* [ %14, %9 ], [ %0, %6 ]
%12 = trunc i64 %10 to i32
tail call void %1(i32 %12, i8* %11)
%13 = add nuw i64 %10, 1
%14 = getelementptr inbounds i8, i8* %0, i64 %13
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %9
17: ; preds = %9, %6, %2
ret void
}
int f0(__attribute__((vector_size(16))) int t) { return ((int *)&t)[0]; }


x86 assembly (clang, -O0):
<f0>:
push   %rbp
mov    %rsp,%rbp
movdqa %xmm0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f0>:
movd   %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @f0(<4 x i32> %0) {
%2 = alloca <4 x i32>
store <4 x i32> %0, <4 x i32>* %2
%3 = bitcast <4 x i32>* %2 to i32*
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @f0(<4 x i32> %0) {
%2 = extractelement <4 x i32> %0, i64 0
ret i32 %2
}
int LZ5_sizeofState() { return (((1 << (20 - 3)) + 4) * sizeof(long long)); }


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

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

LLVM IR (-O0):
define i32 @LZ5_sizeofState() {
ret i32 1048608
}

LLVM IR (-O2):
define i32 @LZ5_sizeofState() {
ret i32 1048608
}
void test2() {
  if (0) {
    if (1) {
    }
  } else {
  }
  do {
  } while (0);
  while (0)
    while (0)
      do
        ;
      while (0);
  for ((void)0; 0; (void)0)
    for (;;)
      for ((void)9; 0; (void)2)
        ;
  for (int X = 0; 0; (void)0)
    ;
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <test2+0x9>
jmp    110e <test2+0xe>
xor    %eax,%eax
test   $0x1,%al
jne    111d <test2+0x1d>
jmp    1145 <test2+0x45>
jmp    1122 <test2+0x22>
xor    %eax,%eax
test   $0x1,%al
jne    1131 <test2+0x31>
jmp    1140 <test2+0x40>
jmp    1136 <test2+0x36>
jmp    113b <test2+0x3b>
jmp    1122 <test2+0x22>
jmp    110e <test2+0xe>
jmp    114a <test2+0x4a>
xor    %eax,%eax
test   $0x1,%al
jne    1159 <test2+0x59>
jmp    1181 <test2+0x81>
jmp    115e <test2+0x5e>
jmp    1163 <test2+0x63>
xor    %eax,%eax
test   $0x1,%al
jne    1172 <test2+0x72>
jmp    117c <test2+0x7c>
jmp    1177 <test2+0x77>
jmp    1163 <test2+0x63>
jmp    115e <test2+0x5e>
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
test   $0x1,%al
jne    1197 <test2+0x97>
jmp    11a1 <test2+0xa1>
jmp    119c <test2+0x9c>
jmp    1188 <test2+0x88>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test2() {
%1 = alloca i32
br label %2
2: ; preds = %0
br label %3
3: ; preds = %2
br label %4
4: ; preds = %10, %3
br i1 false, label %5, label %11
5: ; preds = %4
br label %6
6: ; preds = %9, %5
br i1 false, label %7, label %10
7: ; preds = %6
br label %8
8: ; preds = %7
br label %9
9: ; preds = %8
br label %6
10: ; preds = %6
br label %4
11: ; preds = %4
br label %12
12: ; preds = %19, %11
br i1 false, label %13, label %20
13: ; preds = %12
br label %14
14: ; preds = %18, %13
br label %15
15: ; preds = %17, %14
br i1 false, label %16, label %18
16: ; preds = %15
br label %17
17: ; preds = %16
br label %15
18: ; preds = %15
br label %14
19: ; No predecessors!
br label %12
20: ; preds = %12
store i32 0, i32* %1
br label %21
21: ; preds = %23, %20
br i1 false, label %22, label %24
22: ; preds = %21
br label %23
23: ; preds = %22
br label %21
24: ; preds = %21
ret void
}

LLVM IR (-O2):
define void @test2() {
ret void
}
/* Variables and functions */
scalar_t__ memcmp(char const *, char *, int);
int key_value_isset(const char *reply, size_t reply_len) {
  return reply_len > 0 && (reply_len < 4 || memcmp(reply, "FAIL", 4) != 0);
}


x86 assembly (clang, -O0):
<key_value_isset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
jbe    1165 <key_value_isset+0x55>
mov    $0x1,%al
cmpq   $0x4,-0x10(%rbp)
mov    %al,-0x12(%rbp)
jb     115f <key_value_isset+0x4f>
mov    -0x8(%rbp),%rdi
lea    0xeb5(%rip),%rsi
mov    $0x4,%edx
call   1030 <memcmp@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<key_value_isset>:
test   %rsi,%rsi
je     1142 <key_value_isset+0x32>
mov    $0x1,%eax
cmp    $0x4,%rsi
jb     1141 <key_value_isset+0x31>
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x4,%edx
call   1030 <memcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"FAIL\00"
define i32 @key_value_isset(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = icmp ugt i64 %5, 0
br i1 %6, label %7, label %16
7: ; preds = %2
%8 = load i64, i64* %4
%9 = icmp ult i64 %8, 4
br i1 %9, label %14, label %10
10: ; preds = %7
%11 = load i8*, i8** %3
%12 = call i64 @memcmp(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%13 = icmp ne i64 %12, 0
br label %14
14: ; preds = %10, %7
%15 = phi i1 [ true, %7 ], [ %13, %10 ]
br label %16
16: ; preds = %14, %2
%17 = phi i1 [ false, %2 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
@.str = [5 x i8] c"FAIL\00"
define i32 @key_value_isset(i8* %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = icmp ult i64 %1, 4
br i1 %5, label %10, label %6
6: ; preds = %4
%7 = tail call i64 @memcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %4, %6, %2
%11 = phi i32 [ 0, %2 ], [ 1, %4 ], [ %9, %6 ]
ret i32 %11
}
void pnv_npu2_destroy_context(struct npu_context *context,
                              struct pci_dev *gpdev) {}


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

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

LLVM IR (-O0):
%struct.npu_context = type opaque
%struct.pci_dev = type opaque
define void @pnv_npu2_destroy_context(%struct.npu_context* %0, %struct.pci_dev* %1) {
%3 = alloca %struct.npu_context*
%4 = alloca %struct.pci_dev*
store %struct.npu_context* %0, %struct.npu_context** %3
store %struct.pci_dev* %1, %struct.pci_dev** %4
ret void
}

LLVM IR (-O2):
%struct.npu_context = type opaque
%struct.pci_dev = type opaque
define void @pnv_npu2_destroy_context(%struct.npu_context* nocapture %0, %struct.pci_dev* nocapture %1) {
ret void
}
void XPolygonRegion() {}


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

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

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

LLVM IR (-O2):
define void @XPolygonRegion() {
ret void
}
int bmk_cpu_init(void) {
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<bmk_cpu_init>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <bmk_cpu_init+0x9>
jmp    1109 <bmk_cpu_init+0x9>

x86 assembly (clang, -O2):
<bmk_cpu_init>:
jmp    1100 <bmk_cpu_init>

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

LLVM IR (-O2):
define i32 @bmk_cpu_init() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
char *blocksig();
int /*<<< orphan*/ free(char *);
int import_data(char const *, char *, unsigned char **, unsigned int *);
int embed_get_data(const char *argv0, unsigned char **ret_data,
                   unsigned int *ret_size) {
  char *sig;
  int ret;
  sig = blocksig();
  ret = import_data(argv0, sig, ret_data, ret_size);
  free(sig);
  return ret;
}


x86 assembly (clang, -O0):
<embed_get_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1050 <blocksig@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1040 <import_data@plt>
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<embed_get_data>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
xor    %eax,%eax
call   1050 <blocksig@plt>
mov    %rax,%rbx
mov    %r12,%rdi
mov    %rax,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1040 <import_data@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @embed_get_data(i8* %0, i8** %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i32* %2, i32** %6
%9 = call i8* (...) @blocksig()
store i8* %9, i8** %7
%10 = load i8*, i8** %4
%11 = load i8*, i8** %7
%12 = load i8**, i8*** %5
%13 = load i32*, i32** %6
%14 = call i32 @import_data(i8* %10, i8* %11, i8** %12, i32* %13)
store i32 %14, i32* %8
%15 = load i8*, i8** %7
%16 = call i32 @free(i8* %15)
%17 = load i32, i32* %8
ret i32 %17
}

LLVM IR (-O2):
define i32 @embed_get_data(i8* %0, i8** %1, i32* %2) {
%4 = tail call i8* (...) @blocksig()
%5 = tail call i32 @import_data(i8* %0, i8* %4, i8** %1, i32* %2)
%6 = tail call i32 @free(i8* %4)
ret i32 %5
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ TIMER_ABSTIME;
int clock_nanosleep(int /*<<< orphan*/, int /*<<< orphan*/,
                    struct timespec const *, struct timespec *);
int clock_nanosleep_abstime(const struct timespec *req, struct timespec *rem) {
  return clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, req, rem);
}


x86 assembly (clang, -O0):
<clock_nanosleep_abstime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
call   1030 <clock_nanosleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clock_nanosleep_abstime>:
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
mov    0x2ec2(%rip),%rax
mov    (%rax),%esi
jmp    1030 <clock_nanosleep@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
@TIMER_ABSTIME = global i32 0
define i32 @clock_nanosleep_abstime(%struct.timespec* %0, %struct.timespec* %1) {
%3 = alloca %struct.timespec*
%4 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load i32, i32* @CLOCK_MONOTONIC
%6 = load i32, i32* @TIMER_ABSTIME
%7 = load %struct.timespec*, %struct.timespec** %3
%8 = load %struct.timespec*, %struct.timespec** %4
%9 = call i32 @clock_nanosleep(i32 %5, i32 %6, %struct.timespec* %7, %struct.timespec* %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
@TIMER_ABSTIME = global i32 0
define i32 @clock_nanosleep_abstime(%struct.timespec* %0, %struct.timespec* %1) {
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = load i32, i32* @TIMER_ABSTIME
%5 = tail call i32 @clock_nanosleep(i32 %3, i32 %4, %struct.timespec* %0, %struct.timespec* %1)
ret i32 %5
}
/* Type definitions */
struct timespec {
  int dummy;
};
typedef int /*<<< orphan*/ clockid_t;

/* Variables and functions */
int clock_gettime(int /*<<< orphan*/, struct timespec *);
__attribute__((__weak__, __always___)) int
softboundmpx_clock_gettime(clockid_t clk_id, struct timespec *tp) {
  return clock_gettime(clk_id, tp);
}


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

x86 assembly (clang, -O2):
<softboundmpx_clock_gettime>:
jmp    1030 <clock_gettime@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
define weak i32 @softboundmpx_clock_gettime(i32 %0, %struct.timespec* %1) {
%3 = alloca i32
%4 = alloca %struct.timespec*
store i32 %0, i32* %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load i32, i32* %3
%6 = load %struct.timespec*, %struct.timespec** %4
%7 = call i32 @clock_gettime(i32 %5, %struct.timespec* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
define weak i32 @softboundmpx_clock_gettime(i32 %0, %struct.timespec* %1) {
%3 = tail call i32 @clock_gettime(i32 %0, %struct.timespec* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ EFAULT;
int /*<<< orphan*/ errno;
int daemon(int nochdir, int noclose) {
  (void)nochdir;
  (void)noclose;
  errno = EFAULT;
  return -1;
}


x86 assembly (clang, -O0):
<daemon>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ee7(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebe(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<daemon>:
mov    0x2ef1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EFAULT = global i32 0
@errno = global i32 0
define i32 @daemon(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 = load i32, i32* @EFAULT
store i32 %7, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EFAULT = global i32 0
@errno = global i32 0
define i32 @daemon(i32 %0, i32 %1) {
%3 = load i32, i32* @EFAULT
store i32 %3, i32* @errno
ret i32 -1
}
/* Variables and functions */
scalar_t__ getline(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverse(char *);
int main(void) {
  char line[10000] = "";
  while (getline(line, 10000) > 0) {
    reverse(line);
    printf("%s\n", line);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2720,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x2720(%rbp),%rdi
xor    %esi,%esi
mov    $0x2710,%edx
call   1050 <memset@plt>
lea    -0x2720(%rbp),%rdi
mov    $0x2710,%esi
call   1060 <getline@plt>
cmp    $0x0,%rax
jle    11a4 <main+0x64>
lea    -0x2720(%rbp),%rdi
call   1030 <reverse@plt>
lea    -0x2720(%rbp),%rsi
lea    0xe66(%rip),%rdi
call   1040 <printf@plt>
jmp    1165 <main+0x25>
xor    %eax,%eax
add    $0x2720,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x2718,%rsp
mov    %rsp,%rbx
mov    $0x2710,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <memset@plt>
mov    %rbx,%rdi
mov    $0x2710,%esi
call   1060 <getline@plt>
test   %rax,%rax
jle    11a5 <main+0x65>
mov    %rsp,%rbx
lea    0xe88(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <reverse@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x2710,%esi
call   1060 <getline@plt>
test   %rax,%rax
jg     1180 <main+0x40>
xor    %eax,%eax
add    $0x2718,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [10000 x i8]
%2 = getelementptr inbounds [10000 x i8], [10000 x i8]* %1, i64 0, i64 0
%3 = call i64 @getline(i8* %2, i32 10000)
%4 = icmp sgt i64 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %0, %5
%6 = call i32 @reverse(i8* %2)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%8 = call i64 @getline(i8* %2, i32 10000)
%9 = icmp sgt i64 %8, 0
br i1 %9, label %5, label %10
10: ; preds = %5, %0
ret i32 0
}
double DSConvertZUnitsToCM(int z, int zUnits) { return z * zUnits / 10000.0; }


x86 assembly (clang, -O0):
<DSConvertZUnitsToCM>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xee3(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<DSConvertZUnitsToCM>:
imul   %esi,%edi
cvtsi2sd %edi,%xmm0
divsd  0xef1(%rip),%xmm0
ret

LLVM IR (-O0):
define double @DSConvertZUnitsToCM(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 = mul nsw i32 %5, %6
%8 = sitofp i32 %7 to double
%9 = fdiv double %8, 1.000000e+04
ret double %9
}

LLVM IR (-O2):
define double @DSConvertZUnitsToCM(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = sitofp i32 %3 to double
%5 = fdiv double %4, 1.000000e+04
ret double %5
}
/* Variables and functions */
int japi_graphicbutton(int, char *);
int j_graphicbutton(int arg0, char *arg1) {
  return (japi_graphicbutton(arg0, arg1));
}


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

x86 assembly (clang, -O2):
<j_graphicbutton>:
jmp    1030 <japi_graphicbutton@plt>

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

LLVM IR (-O2):
define i32 @j_graphicbutton(i32 %0, i8* %1) {
%3 = tail call i32 @japi_graphicbutton(i32 %0, i8* %1)
ret i32 %3
}
int f() { return 1 / 0; }


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

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

LLVM IR (-O0):
define i32 @f() {
ret i32 poison
}

LLVM IR (-O2):
define i32 @f() {
ret i32 poison
}
/* Variables and functions */
int syscall(int, void *, size_t);
int __munmap(void *start, size_t len) { return syscall(91, start, len); }


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

x86 assembly (clang, -O2):
<__munmap>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x5b,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @__munmap(i8* %0, i64 %1) {
%3 = tail call i32 @syscall(i32 91, i8* %0, i64 %1)
ret i32 %3
}
/* Type definitions */
struct timeval {
  int tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
double ftime_to_double(struct timeval t) {
  return (double)t.tv_sec + t.tv_usec * 1e-6;
}


x86 assembly (clang, -O0):
<ftime_to_double>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm1
cvtsi2sdl -0x10(%rbp),%xmm0
movsd  0xee2(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftime_to_double>:
cvtsi2sd %rsi,%xmm1
cvtsi2sd %edi,%xmm0
mulsd  0xeef(%rip),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define double @ftime_to_double(i32 %0, i64 %1) {
%3 = alloca %struct.timeval
%4 = bitcast %struct.timeval* %3 to { i32, i64 }*
%5 = getelementptr inbounds { i32, i64 }, { i32, i64 }* %4, i32 0, i32 0
store i32 %0, i32* %5
%6 = getelementptr inbounds { i32, i64 }, { i32, i64 }* %4, i32 0, i32 1
store i64 %1, i64* %6
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%11 = load i32, i32* %10
%12 = sitofp i32 %11 to double
%13 = call double @llvm.fmuladd.f64(double %12, double 0x3EB0C6F7A0B5ED8D, double %9)
ret double %13
}

LLVM IR (-O2):
define double @ftime_to_double(i32 %0, i64 %1) {
%3 = sitofp i64 %1 to double
%4 = sitofp i32 %0 to double
%5 = tail call double @llvm.fmuladd.f64(double %4, double 0x3EB0C6F7A0B5ED8D, double %3)
ret double %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int getc(int /*<<< orphan*/ *const);
int /*<<< orphan*/ stderr;
unsigned char pbm_getrawbyte(FILE *const file) {
  int iby;
  iby = getc(file);
  if (iby == EOF) {
    fprintf(stderr, "EOF / read error reading a one-byte sample\n");
    exit(-1);
  }
  return (unsigned char)iby;
}


x86 assembly (clang, -O0):
<pbm_getrawbyte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <getc@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2e96(%rip),%rcx
cmp    (%rcx),%eax
jne    1179 <pbm_getrawbyte+0x49>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
lea    0xe96(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
mov    -0xc(%rbp),%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pbm_getrawbyte>:
push   %rax
call   1050 <getc@plt>
mov    0x2eab(%rip),%rcx
cmp    (%rcx),%eax
je     1143 <pbm_getrawbyte+0x13>
pop    %rcx
ret
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
lea    0xead(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EOF = global i32 0
@stderr = global i32 0
@.str = [44 x i8] c"EOF / read error reading a one-byte sample\0A\00"
define zeroext i8 @pbm_getrawbyte(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @getc(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = load i32, i32* @EOF
%8 = icmp eq i32 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @exit(i32 -1)
unreachable
13: ; preds = %1
%14 = load i32, i32* %3
%15 = trunc i32 %14 to i8
ret i8 %15
}

LLVM IR (-O2):
@EOF = global i32 0
@stderr = global i32 0
@.str = [44 x i8] c"EOF / read error reading a one-byte sample\0A\00"
define zeroext i8 @pbm_getrawbyte(i32* nocapture %0) {
%2 = tail call i32 @getc(i32* %0)
%3 = load i32, i32* @EOF
%4 = icmp eq i32 %2, %3
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 -1)
unreachable
9: ; preds = %1
%10 = trunc i32 %2 to i8
ret i8 %10
}
int main() { return 2 >= 3; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void do_nothing_halide() {
  int x = 5 + 6;
  printf("hello\n");
}


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"hello\00"
define void @do_nothing_halide() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
long long current_time() {
  struct timeval t_start;
  gettimeofday(&t_start, 0);
  long long t =
      ((long long)t_start.tv_sec) * 1000 + (long long)t_start.tv_usec / 1000;
  return t;
}


x86 assembly (clang, -O0):
<current_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<current_time>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,0x10(%rsp),%rcx
movabs $0x20c49ba5e353f7cf,%rax
9b c4 20
imulq  0x8(%rsp)
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x7,%rdx
add    %rdx,%rax
add    %rcx,%rax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @current_time() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = mul nsw i64 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = sdiv i64 %8, 1000
%10 = add nsw i64 %9, %6
ret i64 %10
}
int test_imm_6Buint32_mem(unsigned int *val) {
  return ((*val) & (0x6B << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_6Buint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 107
%6 = icmp ne i32 %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_6Buint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 107
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void ExttTableAuxTable(void) {}


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

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

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

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