xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ msg(char *, int /*<<< orphan*/, char const *);
void show_pid(const char *opt) {
  msg("pid: %d (%s)", getpid(), opt ? opt : "");
}


x86 assembly (clang, -O0):
<show_pid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114e <show_pid+0x2e>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    115e <show_pid+0x3e>
lea    0xeb7(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    115e <show_pid+0x3e>
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
lea    0xe94(%rip),%rdi
call   1040 <msg@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_pid>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <getpid@plt>
test   %rbx,%rbx
lea    0xed7(%rip),%rdx
cmovne %rbx,%rdx
lea    0xec0(%rip),%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <msg@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c"pid: %d (%s)\00"
@.str.1 = [1 x i8] zeroinitializer
define void @show_pid(i8* %0) {
%2 = tail call i32 (...) @getpid()
%3 = icmp eq i8* %0, null
%4 = select i1 %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* %0
%5 = tail call i32 @msg(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %2, i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
void largeAdjustmentLT(unsigned a) {
  if (a + 2 < 1)
    clang_analyzer_eval(a == (~0U) - 1);
  else
    clang_analyzer_eval(a != (~0U) - 1);
}


x86 assembly (clang, -O0):
<largeAdjustmentLT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
cmp    $0x1,%eax
jae    1140 <largeAdjustmentLT+0x30>
cmpl   $0xfffffffe,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
jmp    1151 <largeAdjustmentLT+0x41>
cmpl   $0xfffffffe,-0x4(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<largeAdjustmentLT>:
mov    $0x1,%edi
jmp    1030 <clang_analyzer_eval@plt>

LLVM IR (-O0):
define void @largeAdjustmentLT(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 2
%5 = icmp ult i32 %4, 1
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, -2
%9 = zext i1 %8 to i32
%10 = call i32 @clang_analyzer_eval(i32 %9)
br label %16
11: ; preds = %1
%12 = load i32, i32* %2
%13 = icmp ne i32 %12, -2
%14 = zext i1 %13 to i32
%15 = call i32 @clang_analyzer_eval(i32 %14)
br label %16
16: ; preds = %11, %6
ret void
}

LLVM IR (-O2):
define void @largeAdjustmentLT(i32 %0) {
%2 = tail call i32 @clang_analyzer_eval(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ kfree(void *);
void rbio_pool_free(void *rbio, void *data) { kfree(rbio); }


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

x86 assembly (clang, -O2):
<rbio_pool_free>:
jmp    1030 <kfree@plt>

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

LLVM IR (-O2):
define void @rbio_pool_free(i8* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @kfree(i8* %0)
ret void
}
int gcd(int a, int b) {
  int c;
  for (; a != 0;) {
    c = a;
    a = b % a;
    b = c;
  }
  return b;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112f <gcd+0x2f>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0x4(%rbp)
mov    %edx,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    110a <gcd+0xa>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %esi,%eax
test   %edi,%edi
je     111d <gcd+0x1d>
mov    %edi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %0, %2 ]
%6 = phi i32 [ %5, %4 ], [ %1, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %1, %2 ], [ %5, %4 ]
ret i32 %10
}
extern void _kill(int pid, int sig) { return; }


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

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

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

LLVM IR (-O2):
define void @_kill(i32 %0, i32 %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ __setCHRBank1Low(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ m22_SetChrROMBank1();
void m22_setParamsBXX2(uint16_t addr, uint8_t val) {
  __setCHRBank1Low(addr, val);
  m22_SetChrROMBank1();
}


x86 assembly (clang, -O0):
<m22_setParamsBXX2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <__setCHRBank1Low@plt>
mov    $0x0,%al
call   1040 <m22_SetChrROMBank1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m22_setParamsBXX2>:
push   %rax
call   1030 <__setCHRBank1Low@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <m22_SetChrROMBank1@plt>

LLVM IR (-O0):
define void @m22_setParamsBXX2(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 = call i32 @__setCHRBank1Low(i32 %5, i32 %6)
%8 = call i32 (...) @m22_SetChrROMBank1()
ret void
}

LLVM IR (-O2):
define void @m22_setParamsBXX2(i32 %0, i32 %1) {
%3 = tail call i32 @__setCHRBank1Low(i32 %0, i32 %1)
%4 = tail call i32 (...) @m22_SetChrROMBank1()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ c_hecmw2fstr_connect_conv(int, int *, int *, int *);
void hecmw2fstr_connect_conv__(int *n_elem, int elem_type[],
                               int elem_node_index[], int elem_node_item[]) {
  c_hecmw2fstr_connect_conv(*n_elem, elem_type, elem_node_index,
                            elem_node_item);
}


x86 assembly (clang, -O0):
<hecmw2fstr_connect_conv__>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <c_hecmw2fstr_connect_conv@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @hecmw2fstr_connect_conv__(i32* nocapture %0, i32* %1, i32* %2, i32* %3) {
%5 = load i32, i32* %0
%6 = tail call i32 @c_hecmw2fstr_connect_conv(i32 %5, i32* %1, i32* %2, i32* %3)
ret void
}
int test_imm_00int16_mem(short *val) {
  return ((*val) & (-0x00 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
mov    $0xffffffd8,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_00int16_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, 0
%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_00int16_mem(i16* nocapture readnone %0) {
ret i32 -40
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ override_redirect;
};
typedef TYPE_1__ XReparentEvent;

/* Variables and functions */
int get_XReparentEvent_override_redirect(void *_p) {
  return (int)((XReparentEvent *)_p)->override_redirect;
}


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

x86 assembly (clang, -O2):
<get_XReparentEvent_override_redirect>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XReparentEvent_override_redirect(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XReparentEvent_override_redirect(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
void timerinit(void) {}


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

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

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

LLVM IR (-O2):
define void @timerinit() {
ret void
}
/* Variables and functions */
int test_main();
int main() { return test_main(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_main()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0xe4() {
  Assert_real((isgraph(228) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isgraph.c",
              1145, ("isgraph should be 0 for 0xe4"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xe4\00"
define void @t_isgraph_0xe4() {
%1 = tail call i64 @isgraph(i32 228)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1145, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void saveTextFile() {
  FILE *fp;
  fp = fopen("test.txt", "w");
  fprintf(fp, "Testing...\n");
}


x86 assembly (clang, -O0):
<saveTextFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    0xed3(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec1(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<saveTextFile>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xeda(%rip),%rsi
call   1030 <fopen@plt>
lea    0xed0(%rip),%rdi
mov    $0xb,%esi
mov    $0x1,%edx
mov    %rax,%rcx
pop    %rax
jmp    1040 <fwrite@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"test.txt\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [12 x i8] c"Testing...\0A\00"
define void @saveTextFile() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"test.txt\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [12 x i8] c"Testing...\0A\00"
define void @saveTextFile() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i64 11, i64 1, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ frand();
float log(int /*<<< orphan*/);
float rand_exp(float k) { return -log(frand()) / k; }


x86 assembly (clang, -O0):
<rand_exp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <frand@plt>
mov    %eax,%edi
call   1040 <log@plt>
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
divss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_exp>:
push   %rax
movss  %xmm0,0x4(%rsp)
xor    %eax,%eax
call   1030 <frand@plt>
mov    %eax,%edi
call   1040 <log@plt>
xorps  0xec4(%rip),%xmm0
divss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @rand_exp(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = call i32 (...) @frand()
%4 = call float @log(i32 %3)
%5 = fneg float %4
%6 = load float, float* %2
%7 = fdiv float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @rand_exp(float %0) {
%2 = tail call i32 (...) @frand()
%3 = tail call float @log(i32 %2)
%4 = fneg float %3
%5 = fdiv float %4, %0
ret float %5
}
void AUTO() { auto x; }


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

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

LLVM IR (-O0):
define void @AUTO() {
%1 = alloca i32
ret void
}

LLVM IR (-O2):
define void @AUTO() {
ret void
}
int __attribute__((no)) foo(int i) {
  int *p = __builtin_malloc(4 * sizeof(int));
  *p = 0;
  p[i] = 1;
  return *p;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x10,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
movl   $0x1,(%rax,%rcx,4)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
mov    %edi,%ebx
mov    $0x10,%edi
call   1030 <malloc@plt>
movl   $0x0,(%rax)
movslq %ebx,%rcx
movl   $0x1,(%rax,%rcx,4)
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = call i8* @malloc(i64 16)
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
store i32 0, i32* %6
%7 = load i32*, i32** %3
%8 = load i32, i32* %2
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %7, i64 %9
store i32 1, i32* %10
%11 = load i32*, i32** %3
%12 = load i32, i32* %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = tail call dereferenceable_or_null(16) i8* @malloc(i64 16)
%3 = bitcast i8* %2 to i32*
store i32 0, i32* %3
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds i32, i32* %3, i64 %4
store i32 1, i32* %5
%6 = load i32, i32* %3
ret i32 %6
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t ht_hash_string(const void *key) {
  const unsigned char *str;
  uint32_t hash;
  hash = 5381;
  for (str = key; *str; str++)
    hash = ((hash << 5) + hash) ^ *str;
  return hash;
}


x86 assembly (clang, -O0):
<ht_hash_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1505,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114a <ht_hash_string+0x4a>
mov    -0x14(%rbp),%eax
shl    $0x5,%eax
add    -0x14(%rbp),%eax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
xor    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1117 <ht_hash_string+0x17>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ht_hash_string>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <ht_hash_string+0x28>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %eax,%edx
shl    $0x5,%edx
add    %eax,%edx
movzbl %cl,%eax
xor    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <ht_hash_string+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i32 @ht_hash_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 5381, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = mul i32 %6, 33
%9 = zext i8 %5 to i32
%10 = xor i32 %8, %9
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 5381, %1 ], [ %10, %4 ]
ret i32 %15
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t get_index(const uint8_t **pp) {
  uint8_t c;
  c = *(*pp)++;
  if (c & 0x80) {
    return ((c & 0x7f) << 8) + *(*pp)++;
  } else {
    return c;
  }
}


x86 assembly (clang, -O0):
<get_index>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,(%rcx)
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1153 <get_index+0x53>
mov    -0x14(%rbp),%eax
and    $0x7f,%eax
shl    $0x8,%eax
mov    -0x10(%rbp),%rdx
mov    (%rdx),%rcx
mov    %rcx,%rsi
add    $0x4,%rsi
mov    %rsi,(%rdx)
add    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    1159 <get_index+0x59>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_index>:
mov    (%rdi),%rcx
lea    0x4(%rcx),%rax
mov    %rax,(%rdi)
mov    (%rcx),%eax
test   $0x80,%al
je     1120 <get_index+0x20>
and    $0x7f,%eax
shl    $0x8,%eax
lea    0x8(%rcx),%rdx
mov    %rdx,(%rdi)
add    0x4(%rcx),%eax
ret

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

LLVM IR (-O2):
define i32 @get_index(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = getelementptr inbounds i32, i32* %2, i64 1
store i32* %3, i32** %0
%4 = load i32, i32* %2
%5 = and i32 %4, 128
%6 = icmp eq i32 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1
%8 = shl i32 %4, 8
%9 = and i32 %8, 32512
%10 = getelementptr inbounds i32, i32* %2, i64 2
store i32* %10, i32** %0
%11 = load i32, i32* %3
%12 = add nsw i32 %11, %9
br label %13
13: ; preds = %1, %7
%14 = phi i32 [ %12, %7 ], [ %4, %1 ]
ret i32 %14
}
void imap_main_set_timeout(int sec) {}


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

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

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

LLVM IR (-O2):
define void @imap_main_set_timeout(i32 %0) {
ret void
}
int ui_init_bcm91125ecmds(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @ui_init_bcm91125ecmds() {
ret i32 0
}

LLVM IR (-O2):
define i32 @ui_init_bcm91125ecmds() {
ret i32 0
}
void f3(unsigned char x) {}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f3(i8 zeroext %0) {
ret void
}
char *strcpy(char *to, const char *from) {
  char *save = to;
  for (; (*to = *from) != '\0'; ++from, ++to)
    ;
  return save;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     114e <strcpy+0x4e>
jmp    1131 <strcpy+0x31>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <strcpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
mov    %cl,(%rdi)
test   %cl,%cl
je     111f <strcpy+0x1f>
mov    $0x1,%ecx
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
store i8 %3, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %9, %5 ], [ %0, %2 ]
%7 = phi i8* [ %8, %5 ], [ %1, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = load i8, i8* %8
store i8 %10, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %2
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ import_does_not_exit();
void __attribute__((constructor)) my_init(void) { import_does_not_exit(); }


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

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

LLVM IR (-O0):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @my_init, i8* null }]
define void @my_init() {
%1 = call i32 (...) @import_does_not_exit()
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @my_init, i8* null }]
define void @my_init() {
%1 = tail call i32 (...) @import_does_not_exit()
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t vhd_calc_checksum(const void *data, size_t size) {
  uint32_t sum = 0;
  for (unsigned i = 0; i < size; i++)
    sum += ((uint8_t *)data)[i];
  return ~sum;
}


x86 assembly (clang, -O0):
<vhd_calc_checksum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x10(%rbp),%rax
jae    114a <vhd_calc_checksum+0x4a>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%ecx
mov    (%rax,%rcx,8),%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    111a <vhd_calc_checksum+0x1a>
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vhd_calc_checksum>:
test   %rsi,%rsi
je     111e <vhd_calc_checksum+0x1e>
xor    %ecx,%ecx
xor    %eax,%eax
nopl   0x0(%rax)
add    (%rdi,%rcx,8),%eax
add    $0x1,%ecx
cmp    %rsi,%rcx
jb     1110 <vhd_calc_checksum+0x10>
not    %eax
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @vhd_calc_checksum(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = bitcast i8* %0 to i64*
br label %10
6: ; preds = %10
%7 = xor i32 %16, -1
br label %8
8: ; preds = %6, %2
%9 = phi i32 [ -1, %2 ], [ %7, %6 ]
ret i32 %9
10: ; preds = %4, %10
%11 = phi i64 [ 0, %4 ], [ %18, %10 ]
%12 = phi i32 [ 0, %4 ], [ %16, %10 ]
%13 = getelementptr inbounds i64, i64* %5, i64 %11
%14 = load i64, i64* %13
%15 = trunc i64 %14 to i32
%16 = add i32 %12, %15
%17 = add nuw nsw i64 %11, 1
%18 = and i64 %17, 4294967295
%19 = icmp ult i64 %18, %1
br i1 %19, label %10, label %6
}
/* Variables and functions */
int /*<<< orphan*/ PTRACE_TRACEME;
int /*<<< orphan*/ execl(char const *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ ptrace(int /*<<< orphan*/, int /*<<< orphan*/,
                          int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void setup_inferior(const char *path, char argv[]) {
  ptrace(PTRACE_TRACEME, 0, NULL, NULL);
  execl(path, argv, 0);
}


x86 assembly (clang, -O0):
<setup_inferior>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rdx
call   1030 <ptrace@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1040 <execl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup_inferior>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <ptrace@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %edx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <execl@plt>

LLVM IR (-O0):
@PTRACE_TRACEME = global i32 0
define void @setup_inferior(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @PTRACE_TRACEME
%6 = call i32 @ptrace(i32 %5, i32 0, i32* null, i32* null)
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @execl(i8* %7, i8* %8, i32 0)
ret void
}

LLVM IR (-O2):
@PTRACE_TRACEME = global i32 0
define void @setup_inferior(i8* %0, i8* %1) {
%3 = load i32, i32* @PTRACE_TRACEME
%4 = tail call i32 @ptrace(i32 %3, i32 0, i32* null, i32* null)
%5 = tail call i32 @execl(i8* %0, i8* %1, i32 0)
ret void
}
char *strchr(s, c)
char *s;
char c;
{
  char *index();
  return index(s, c);
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <index@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
jmp    1030 <index@plt>

LLVM IR (-O0):
define i8* @strchr(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8*, i8** %3
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
%8 = call i8* @index(i8* %5, i32 %7)
ret i8* %8
}

LLVM IR (-O2):
define i8* @strchr(i8* %0, i8 signext %1) {
%3 = sext i8 %1 to i32
%4 = tail call i8* @index(i8* %0, i32 %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void wife_say(void) { printf("My darling,are you call me ?/n"); }


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"My darling,are you call me ?/n\00"
define void @wife_say() {
%1 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"My darling,are you call me ?/n\00"
define void @wife_say() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "usage: nice [-n increment] utility [argument ...]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [51 x i8] c"usage: nice [-n increment] utility [argument ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [51 x i8] c"usage: nice [-n increment] utility [argument ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void McASPAMUTEINActivate(unsigned int baseAddr, unsigned int polarity) {
  (*((volatile unsigned int *)(baseAddr + (0x48)))) &= ~(0x00000004u);
  (*((volatile unsigned int *)(baseAddr + (0x48)))) |=
      ((0x00000010u) | (0x00000008u) | (polarity & (0x00000004u)));
}


x86 assembly (clang, -O0):
<McASPAMUTEINActivate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x48,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xfffffffb,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%edx
and    $0x4,%edx
or     $0x18,%edx
mov    -0x4(%rbp),%eax
add    $0x48,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<McASPAMUTEINActivate>:
add    $0x48,%edi
andl   $0xfffffffb,(%rdi)
and    $0x4,%esi
or     (%rdi),%esi
or     $0x18,%esi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @McASPAMUTEINActivate(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 = add i32 %5, 72
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, -5
store volatile i32 %10, i32* %8
%11 = load i32, i32* %4
%12 = and i32 %11, 4
%13 = or i32 24, %12
%14 = load i32, i32* %3
%15 = add i32 %14, 72
%16 = zext i32 %15 to i64
%17 = inttoptr i64 %16 to i32*
%18 = load volatile i32, i32* %17
%19 = or i32 %18, %13
store volatile i32 %19, i32* %17
ret void
}

LLVM IR (-O2):
define void @McASPAMUTEINActivate(i32 %0, i32 %1) {
%3 = add i32 %0, 72
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, -5
store volatile i32 %7, i32* %5
%8 = and i32 %1, 4
%9 = load volatile i32, i32* %5
%10 = or i32 %8, %9
%11 = or i32 %10, 24
store volatile i32 %11, i32* %5
ret void
}
/* Type definitions */
struct t_gui_buffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gui_buffer_dump_hexa(struct t_gui_buffer *);
int debug_buffer_cb(void *data, const char *signal, const char *type_data,
                    void *signal_data) {
  (void)data;
  (void)signal;
  (void)type_data;
  gui_buffer_dump_hexa((struct t_gui_buffer *)signal_data);
  return 0;
}


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

x86 assembly (clang, -O2):
<debug_buffer_cb>:
push   %rax
mov    %rcx,%rdi
call   1030 <gui_buffer_dump_hexa@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.t_gui_buffer = type { i32 }
define i32 @debug_buffer_cb(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = bitcast i8* %12 to %struct.t_gui_buffer*
%14 = call i32 @gui_buffer_dump_hexa(%struct.t_gui_buffer* %13)
ret i32 0
}

LLVM IR (-O2):
%struct.t_gui_buffer = type { i32 }
define i32 @debug_buffer_cb(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* %3) {
%5 = bitcast i8* %3 to %struct.t_gui_buffer*
%6 = tail call i32 @gui_buffer_dump_hexa(%struct.t_gui_buffer* %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ handleC(char);
void handleS(const char *s) {
  char c;
  while (c = *s++) {
    handleC(c);
  }
}


x86 assembly (clang, -O0):
<handleS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x9(%rbp)
cmp    $0x0,%al
je     1146 <handleS+0x36>
movsbl -0x9(%rbp),%edi
call   1030 <handleC@plt>
jmp    111c <handleS+0xc>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @handleS(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = tail call i32 @handleC(i8 signext %5)
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int S_ISLNK(unsigned int);
int s_iflnk(unsigned int m) { return S_ISLNK(m); }


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

x86 assembly (clang, -O2):
<s_iflnk>:
jmp    1030 <S_ISLNK@plt>

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

LLVM IR (-O2):
define i32 @s_iflnk(i32 %0) {
%2 = tail call i32 @S_ISLNK(i32 %0)
ret i32 %2
}
int shrs(int x, int y, int z) {
  int s = y & 63;
  if (s >= 32)
    return x >> 31;
  else
    return x >> s;
}


x86 assembly (clang, -O0):
<shrs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    $0x3f,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x20,-0x14(%rbp)
jl     112e <shrs+0x2e>
mov    -0x8(%rbp),%eax
sar    $0x1f,%eax
mov    %eax,-0x4(%rbp)
jmp    1139 <shrs+0x39>
mov    -0x8(%rbp),%eax
mov    -0x14(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<shrs>:
and    $0x3f,%esi
cmp    $0x1f,%esi
mov    $0x1f,%ecx
cmovb  %esi,%ecx
mov    %edi,%eax
sar    %cl,%eax
ret

LLVM IR (-O0):
define i32 @shrs(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%9 = load i32, i32* %6
%10 = and i32 %9, 63
store i32 %10, i32* %8
%11 = load i32, i32* %8
%12 = icmp sge i32 %11, 32
br i1 %12, label %13, label %16
13: ; preds = %3
%14 = load i32, i32* %5
%15 = ashr i32 %14, 31
store i32 %15, i32* %4
br label %20
16: ; preds = %3
%17 = load i32, i32* %5
%18 = load i32, i32* %8
%19 = ashr i32 %17, %18
store i32 %19, i32* %4
br label %20
20: ; preds = %16, %13
%21 = load i32, i32* %4
ret i32 %21
}

LLVM IR (-O2):
define i32 @shrs(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %1, 63
%5 = icmp ult i32 %4, 31
%6 = select i1 %5, i32 %4, i32 31
%7 = ashr i32 %0, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void version(void) {
  printf("iyelld version %s\n", "0.7.0");
  exit(0);
}


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"iyelld version %s\0A\00"
@.str.1 = [6 x i8] c"0.7.0\00"
define void @version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [19 x i8] c"iyelld version %s\0A\00"
@.str.1 = [6 x i8] c"0.7.0\00"
define void @version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int support_vsprintf(char *, char const *, int /*<<< orphan*/);
int vsprintf(char *s, const char *format, va_list arg) {
  return support_vsprintf(s, format, arg);
}


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

x86 assembly (clang, -O2):
<vsprintf>:
jmp    1030 <support_vsprintf@plt>

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

LLVM IR (-O2):
define i32 @vsprintf(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @support_vsprintf(i8* %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int f81(int *);
int f82(int *p) { return f81(p); }


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

x86 assembly (clang, -O2):
<f82>:
jmp    1030 <f81@plt>

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

LLVM IR (-O2):
define i32 @f82(i32* %0) {
%2 = tail call i32 @f81(i32* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ posix_spawnattr_t;
typedef int /*<<< orphan*/ posix_spawn_file_actions_t;
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int do_posix_spawn(int /*<<< orphan*/ *, char const *,
                   int /*<<< orphan*/ const *, int /*<<< orphan*/ const *,
                   char *const *, char *const *, int /*<<< orphan*/);
int posix_spawn(pid_t *pid, const char *path,
                const posix_spawn_file_actions_t *fa,
                const posix_spawnattr_t *sa, char *const argv[],
                char *const envp[]) {
  return do_posix_spawn(pid, path, fa, sa, argv, envp, 0);
}


x86 assembly (clang, -O0):
<posix_spawn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
xor    %eax,%eax
movl   $0x0,(%rsp)
call   1030 <do_posix_spawn@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<posix_spawn>:
push   %rax
movl   $0x0,(%rsp)
call   1030 <do_posix_spawn@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @posix_spawn(i32* %0, i8* %1, i32* %2, i32* %3, i8** %4, i8** %5) {
%7 = tail call i32 @do_posix_spawn(i32* %0, i8* %1, i32* %2, i32* %3, i8** %4, i8** %5, i32 0)
ret i32 %7
}
/* Variables and functions */
int system(char *);
int main() { return system("test"); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"test\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void alt_b(void) { printf("Hey, you pressed ALT b! \n"); }


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"Hey, you pressed ALT b! \0A\00"
define void @alt_b() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [25 x i8] c"Hey, you pressed ALT b! \00"
define void @alt_b() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret void
}