xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Log0(char *);
int /*<<< orphan*/ Log1(char *, int);
int /*<<< orphan*/ Log2(char *, int, int);
int /*<<< orphan*/ Log3(char *, int, int, int);
int main(void) {
  Log0("Log 0");
  Log1("Log 1", 1);
  Log2("Log 2", 1, 2);
  Log3("Log 3", 1, 2, 3);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
call   1030 <Log0@plt>
lea    0xeaf(%rip),%rdi
mov    $0x1,%esi
call   1050 <Log1@plt>
lea    0xea4(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1040 <Log2@plt>
lea    0xe94(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
call   1060 <Log3@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <Log0@plt>
lea    0xeb2(%rip),%rdi
mov    $0x1,%esi
call   1050 <Log1@plt>
lea    0xea7(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1040 <Log2@plt>
lea    0xe97(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
call   1060 <Log3@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"Log 0\00"
@.str.1 = [6 x i8] c"Log 1\00"
@.str.2 = [6 x i8] c"Log 2\00"
@.str.3 = [6 x i8] c"Log 3\00"
define i32 @main() {
%1 = call i32 @Log0(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @Log1(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 1)
%3 = call i32 @Log2(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 1, i32 2)
%4 = call i32 @Log3(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 1, i32 2, i32 3)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"Log 0\00"
@.str.1 = [6 x i8] c"Log 1\00"
@.str.2 = [6 x i8] c"Log 2\00"
@.str.3 = [6 x i8] c"Log 3\00"
define i32 @main() {
%1 = tail call i32 @Log0(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @Log1(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 1)
%3 = tail call i32 @Log2(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 1, i32 2)
%4 = tail call i32 @Log3(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 1, i32 2, i32 3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void Sys_Sleep(int msec) { usleep(msec); }


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

x86 assembly (clang, -O2):
<Sys_Sleep>:
jmp    1030 <usleep@plt>

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

LLVM IR (-O2):
define void @Sys_Sleep(i32 %0) {
%2 = tail call i32 @usleep(i32 %0)
ret void
}
void gtk_widget_list_mnemonic_labels() {}


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

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

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

LLVM IR (-O2):
define void @gtk_widget_list_mnemonic_labels() {
ret void
}
char char_to_digit(char chr) {
  return (chr - '0') < 10 ? (chr - '0') : (chr - 'A' + 10);
}


x86 assembly (clang, -O0):
<char_to_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
cmp    $0xa,%eax
jge    1129 <char_to_digit+0x29>
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <char_to_digit+0x36>
movsbl -0x1(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_to_digit>:
cmp    $0x3a,%dil
mov    $0xd0,%ecx
mov    $0xc9,%eax
cmovl  %ecx,%eax
add    %dil,%al
ret

LLVM IR (-O0):
define signext i8 @char_to_digit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 48
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = sub nsw i32 %9, 48
br label %16
11: ; preds = %1
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 65
%15 = add nsw i32 %14, 10
br label %16
16: ; preds = %11, %7
%17 = phi i32 [ %10, %7 ], [ %15, %11 ]
%18 = trunc i32 %17 to i8
ret i8 %18
}

LLVM IR (-O2):
define signext i8 @char_to_digit(i8 signext %0) {
%2 = icmp slt i8 %0, 58
%3 = select i1 %2, i8 -48, i8 -55
%4 = add i8 %3, %0
ret i8 %4
}
int is_Pythagorean_triplet(int a, int b, int c) {
  if ((a * a + b * b) == c * c)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_Pythagorean_triplet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   -0xc(%rbp),%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%ecx
imul   -0x10(%rbp),%ecx
cmp    %ecx,%eax
jne    1138 <is_Pythagorean_triplet+0x38>
movl   $0x1,-0x4(%rbp)
jmp    113f <is_Pythagorean_triplet+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_Pythagorean_triplet>:
imul   %edi,%edi
imul   %esi,%esi
add    %edi,%esi
imul   %edx,%edx
xor    %eax,%eax
cmp    %edx,%esi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_Pythagorean_triplet(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %0, %0
%5 = mul nsw i32 %1, %1
%6 = add nuw nsw i32 %5, %4
%7 = mul nsw i32 %2, %2
%8 = icmp eq i32 %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}
void __attribute__((visibility("default"))) liba_func() {}


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

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

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

LLVM IR (-O2):
define void @liba_func() {
ret void
}
float test_cosf(float x) { return __builtin_cosf(x); }


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

x86 assembly (clang, -O2):
<test_cosf>:
jmp    1030 <cosf@plt>

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

LLVM IR (-O2):
define float @test_cosf(float %0) {
%2 = tail call float @cosf(float %0)
ret float %2
}
/* Type definitions */
struct forf_env {
  int dummy;
};

/* Variables and functions */
long forf_pop_num(struct forf_env *);
int /*<<< orphan*/ forf_push_num(struct forf_env *, int);
void forf_proc_le(struct forf_env *env) {
  long a = forf_pop_num(env);
  long b = forf_pop_num(env);
  forf_push_num(env, b <= a);
}


x86 assembly (clang, -O0):
<forf_proc_le>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <forf_pop_num@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <forf_pop_num@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
setle  %al
and    $0x1,%al
movzbl %al,%esi
call   1040 <forf_push_num@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<forf_proc_le>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <forf_pop_num@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <forf_pop_num@plt>
xor    %esi,%esi
cmp    %r14,%rax
setle  %sil
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <forf_push_num@plt>

LLVM IR (-O0):
%struct.forf_env = type { i32 }
define void @forf_proc_le(%struct.forf_env* %0) {
%2 = alloca %struct.forf_env*
%3 = alloca i64
%4 = alloca i64
store %struct.forf_env* %0, %struct.forf_env** %2
%5 = load %struct.forf_env*, %struct.forf_env** %2
%6 = call i64 @forf_pop_num(%struct.forf_env* %5)
store i64 %6, i64* %3
%7 = load %struct.forf_env*, %struct.forf_env** %2
%8 = call i64 @forf_pop_num(%struct.forf_env* %7)
store i64 %8, i64* %4
%9 = load %struct.forf_env*, %struct.forf_env** %2
%10 = load i64, i64* %4
%11 = load i64, i64* %3
%12 = icmp sle i64 %10, %11
%13 = zext i1 %12 to i32
%14 = call i32 @forf_push_num(%struct.forf_env* %9, i32 %13)
ret void
}

LLVM IR (-O2):
%struct.forf_env = type { i32 }
define void @forf_proc_le(%struct.forf_env* %0) {
%2 = tail call i64 @forf_pop_num(%struct.forf_env* %0)
%3 = tail call i64 @forf_pop_num(%struct.forf_env* %0)
%4 = icmp sle i64 %3, %2
%5 = zext i1 %4 to i32
%6 = tail call i32 @forf_push_num(%struct.forf_env* %0, i32 %5)
ret void
}
/* Variables and functions */
scalar_t__ COND_PL();
int /*<<< orphan*/ EA_A7_PD_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_spl_8_pd7(void) {
  m68ki_write_8(EA_A7_PD_8(), COND_PL() ? 0xff : 0);
}


x86 assembly (clang, -O0):
<m68k_op_spl_8_pd7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <EA_A7_PD_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <COND_PL@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_spl_8_pd7>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <EA_A7_PD_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <COND_PL@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_spl_8_pd7() {
%1 = call i32 (...) @EA_A7_PD_8()
%2 = call i64 (...) @COND_PL()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_spl_8_pd7() {
%1 = tail call i32 (...) @EA_A7_PD_8()
%2 = tail call i64 (...) @COND_PL()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
void RandomFunc(unsigned short input[1], unsigned short output[1]) {
  unsigned short state[1];
  {
    state[0UL] = input[0UL] + (unsigned short)2885;
    if ((state[0UL] >> (unsigned short)4) & (unsigned short)1) {
      state[0UL] += state[0UL];
    }
    output[0UL] = state[0UL] - 188124796UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%eax
add    $0xb45,%eax
mov    %ax,-0x12(%rbp)
movzwl -0x12(%rbp),%eax
sar    $0x4,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     113d <RandomFunc+0x3d>
movzwl -0x12(%rbp),%ecx
movzwl -0x12(%rbp),%eax
add    %ecx,%eax
mov    %ax,-0x12(%rbp)
movzwl -0x12(%rbp),%eax
sub    $0xb368e7c,%rax
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
movzwl (%rdi),%eax
add    $0xb45,%eax
mov    %eax,%ecx
shr    $0x4,%cl
and    $0x1,%cl
shl    %cl,%eax
add    $0x7184,%eax
mov    %ax,(%rsi)
ret

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

LLVM IR (-O2):
define void @RandomFunc(i16* nocapture %0, i16* nocapture writeonly %1) {
%3 = load i16, i16* %0
%4 = add i16 %3, 2885
%5 = lshr i16 %4, 4
%6 = and i16 %5, 1
%7 = shl i16 %4, %6
%8 = add i16 %7, 29060
store i16 %8, i16* %1
ret void
}
OP(ed, ce) {}


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
ret i32 undef
}
__attribute__((always_)) unsigned long end_name_hash(unsigned long hash) {
  return (unsigned int)hash;
}


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

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

LLVM IR (-O0):
define i64 @end_name_hash(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = zext i32 %4 to i64
ret i64 %5
}

LLVM IR (-O2):
define i64 @end_name_hash(i64 %0) {
%2 = and i64 %0, 4294967295
ret i64 %2
}
/* Variables and functions */
int testCaseNDot(void) { return 20; }


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

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

LLVM IR (-O0):
define i32 @testCaseNDot() {
ret i32 20
}

LLVM IR (-O2):
define i32 @testCaseNDot() {
ret i32 20
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void reassert_nmi(void) {
  outb(0x09, 0x50);
  outb(0x09, 0x52);
}


x86 assembly (clang, -O0):
<reassert_nmi>:
push   %rbp
mov    %rsp,%rbp
mov    $0x9,%edi
mov    $0x50,%esi
call   1030 <outb@plt>
mov    $0x9,%edi
mov    $0x52,%esi
call   1030 <outb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reassert_nmi>:
push   %rax
mov    $0x9,%edi
mov    $0x50,%esi
call   1030 <outb@plt>
mov    $0x9,%edi
mov    $0x52,%esi
pop    %rax
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @reassert_nmi() {
%1 = call i32 @outb(i32 9, i32 80)
%2 = call i32 @outb(i32 9, i32 82)
ret void
}

LLVM IR (-O2):
define void @reassert_nmi() {
%1 = tail call i32 @outb(i32 9, i32 80)
%2 = tail call i32 @outb(i32 9, i32 82)
ret void
}
int ubi_debugging_init_dev(struct ubi_device *ubi) { return 0; }


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

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

LLVM IR (-O0):
%struct.ubi_device = type opaque
define i32 @ubi_debugging_init_dev(%struct.ubi_device* %0) {
%2 = alloca %struct.ubi_device*
store %struct.ubi_device* %0, %struct.ubi_device** %2
ret i32 0
}

LLVM IR (-O2):
%struct.ubi_device = type opaque
define i32 @ubi_debugging_init_dev(%struct.ubi_device* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
void sprint_inc_direct(char *str, uint8_t direct) {
  sprintf(str,
          "INC   "
          "0x%02X"
          "                      ",
          direct);
}


x86 assembly (clang, -O0):
<sprint_inc_direct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sprint_inc_direct>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"INC 0x%02X \00"
define void @sprint_inc_direct(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"INC 0x%02X \00"
define void @sprint_inc_direct(i8* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ stdout;
void report(const char *s) {
  printf("%s\r", s);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<report>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<report>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0D\00"
@stdout = global i32 0
define void @report(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @stdout
%6 = call i32 @fflush(i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0D\00"
@stdout = global i32 0
define void @report(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
ret void
}
int crossMultiplication(int oldMaxValue, int newMaxValue, int value) {
  int ret = newMaxValue * value / oldMaxValue;
  return ret;
}


x86 assembly (clang, -O0):
<crossMultiplication>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
cltd
idivl  -0x4(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<crossMultiplication>:
mov    %esi,%eax
imul   %edx,%eax
cltd
idiv   %edi
ret

LLVM IR (-O0):
define i32 @crossMultiplication(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 = mul nsw i32 %8, %9
%11 = load i32, i32* %4
%12 = sdiv i32 %10, %11
store i32 %12, i32* %7
%13 = load i32, i32* %7
ret i32 %13
}

LLVM IR (-O2):
define i32 @crossMultiplication(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %2, %1
%5 = sdiv i32 %4, %0
ret i32 %5
}
int IsANumber(char c) {
  if (c == '0' || c == '1' || c == '2' || c == '3' || c == '4' || c == '5' ||
      c == '6' || c == '7' || c == '8' || c == '9')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<IsANumber>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
je     118c <IsANumber+0x8c>
movsbl -0x5(%rbp),%eax
cmp    $0x31,%eax
je     118c <IsANumber+0x8c>
movsbl -0x5(%rbp),%eax
cmp    $0x32,%eax
je     118c <IsANumber+0x8c>
movsbl -0x5(%rbp),%eax
cmp    $0x33,%eax
je     118c <IsANumber+0x8c>
movsbl -0x5(%rbp),%eax
cmp    $0x34,%eax
je     118c <IsANumber+0x8c>
movsbl -0x5(%rbp),%eax
cmp    $0x35,%eax
je     118c <IsANumber+0x8c>
movsbl -0x5(%rbp),%eax
cmp    $0x36,%eax
je     118c <IsANumber+0x8c>
movsbl -0x5(%rbp),%eax
cmp    $0x37,%eax
je     118c <IsANumber+0x8c>
movsbl -0x5(%rbp),%eax
cmp    $0x38,%eax
je     118c <IsANumber+0x8c>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jne    1198 <IsANumber+0x98>
movl   $0x1,-0x4(%rbp)
jmp    119f <IsANumber+0x9f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsANumber>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @IsANumber(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 48
br i1 %6, label %43, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 49
br i1 %10, label %43, label %11
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 50
br i1 %14, label %43, label %15
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 51
br i1 %18, label %43, label %19
19: ; preds = %15
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 52
br i1 %22, label %43, label %23
23: ; preds = %19
%24 = load i8, i8* %3
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 53
br i1 %26, label %43, label %27
27: ; preds = %23
%28 = load i8, i8* %3
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 54
br i1 %30, label %43, label %31
31: ; preds = %27
%32 = load i8, i8* %3
%33 = sext i8 %32 to i32
%34 = icmp eq i32 %33, 55
br i1 %34, label %43, label %35
35: ; preds = %31
%36 = load i8, i8* %3
%37 = sext i8 %36 to i32
%38 = icmp eq i32 %37, 56
br i1 %38, label %43, label %39
39: ; preds = %35
%40 = load i8, i8* %3
%41 = sext i8 %40 to i32
%42 = icmp eq i32 %41, 57
br i1 %42, label %43, label %44
43: ; preds = %39, %35, %31, %27, %23, %19, %15, %11, %7, %1
store i32 1, i32* %2
br label %45
44: ; preds = %39
store i32 0, i32* %2
br label %45
45: ; preds = %44, %43
%46 = load i32, i32* %2
ret i32 %46
}

LLVM IR (-O2):
define i32 @IsANumber(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int user_main(int, char **);
int main(int argc, char **argv) { return user_main(argc, argv); }


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <user_main@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @user_main(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ mkdir(char const *, int);
char *strrchr(char const *, char);
int mar_ensure_parent_dir(const char *path) {
  char *slash = strrchr(path, '/');
  if (slash) {
    *slash = '\0';
    mar_ensure_parent_dir(path);
    mkdir(path, 0755);
    *slash = '/';
  }
  return 0;
}


x86 assembly (clang, -O0):
<mar_ensure_parent_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     117e <mar_ensure_parent_dir+0x4e>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
call   1050 <mar_ensure_parent_dir@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1ed,%esi
call   1030 <mkdir@plt>
mov    -0x10(%rbp),%rax
movb   $0x2f,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mar_ensure_parent_dir>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x2f,%esi
call   1040 <strrchr@plt>
test   %rax,%rax
je     1164 <mar_ensure_parent_dir+0x34>
mov    %rax,%rbx
movb   $0x0,(%rax)
mov    %r14,%rdi
call   1050 <mar_ensure_parent_dir@plt>
mov    %r14,%rdi
mov    $0x1ed,%esi
call   1030 <mkdir@plt>
movb   $0x2f,(%rbx)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @mar_ensure_parent_dir(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %15
8: ; preds = %1
%9 = load i8*, i8** %3
store i8 0, i8* %9
%10 = load i8*, i8** %2
%11 = call i32 @mar_ensure_parent_dir(i8* %10)
%12 = load i8*, i8** %2
%13 = call i32 @mkdir(i8* %12, i32 493)
%14 = load i8*, i8** %3
store i8 47, i8* %14
br label %15
15: ; preds = %8, %1
ret i32 0
}

LLVM IR (-O2):
define i32 @mar_ensure_parent_dir(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %5
4: ; preds = %1, %5
ret i32 0
5: ; preds = %1
store i8 0, i8* %2
%6 = tail call i32 @mar_ensure_parent_dir(i8* %0)
%7 = tail call i32 @mkdir(i8* %0, i32 493)
store i8 47, i8* %2
br label %4
}
/* Variables and functions */
int /*<<< orphan*/ EX_NOPERM;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void pfpanic_non_root(void) {
  fprintf(stderr, "You have to be root in order to use this tool!\n");
  exit(EX_NOPERM);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [48 x i8] c"You have to be root in order to use this tool!\0A\00"
@EX_NOPERM = global i32 0
define void @pfpanic_non_root() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EX_NOPERM
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [48 x i8] c"You have to be root in order to use this tool!\0A\00"
@EX_NOPERM = global i32 0
define void @pfpanic_non_root() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EX_NOPERM
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void builtin_destroy(void *ptr) { free(ptr); }


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

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

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

LLVM IR (-O2):
define void @builtin_destroy(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int light_isdigit(int c) { return (c >= '0' && c <= '9'); }


x86 assembly (clang, -O0):
<light_isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <light_isdigit+0x20>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<light_isdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @light_isdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 48
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @light_isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ h265nal_init(int /*<<< orphan*/ *);
int /*<<< orphan*/ h265nal_set_type(int /*<<< orphan*/ *, int);
void h265pps_init(uint8_t *p_h265pps) {
  h265nal_init(p_h265pps);
  h265nal_set_type(p_h265pps, 34);
}


x86 assembly (clang, -O0):
<h265pps_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <h265nal_init@plt>
mov    -0x8(%rbp),%rdi
mov    $0x22,%esi
call   1030 <h265nal_set_type@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h265pps_init>:
push   %rbx
mov    %rdi,%rbx
call   1040 <h265nal_init@plt>
mov    %rbx,%rdi
mov    $0x22,%esi
pop    %rbx
jmp    1030 <h265nal_set_type@plt>

LLVM IR (-O0):
define void @h265pps_init(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @h265nal_init(i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @h265nal_set_type(i32* %5, i32 34)
ret void
}

LLVM IR (-O2):
define void @h265pps_init(i32* %0) {
%2 = tail call i32 @h265nal_init(i32* %0)
%3 = tail call i32 @h265nal_set_type(i32* %0, i32 34)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
void test_vmvn_s32x2(int32_t *__restrict__ dest, int32_t *a) {
  int i;
  for (i = 0; i < 2; i++) {
    dest[i] = ~a[i];
  }
}


x86 assembly (clang, -O0):
<test_vmvn_s32x2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x2,-0x14(%rbp)
jge    1144 <test_vmvn_s32x2+0x44>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
xor    $0xffffffff,%edx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <test_vmvn_s32x2+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_vmvn_s32x2>:
mov    (%rsi),%eax
not    %eax
mov    %eax,(%rdi)
mov    0x4(%rsi),%eax
not    %eax
mov    %eax,0x4(%rdi)
ret

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

LLVM IR (-O2):
define void @test_vmvn_s32x2(i32* noalias nocapture writeonly %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = xor i32 %3, -1
store i32 %4, i32* %0
%5 = getelementptr inbounds i32, i32* %1, i64 1
%6 = load i32, i32* %5
%7 = xor i32 %6, -1
%8 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %7, i32* %8
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint;

/* Variables and functions */
void string_insert(char **str, const char *value, uint pos) {}


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

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

LLVM IR (-O0):
define void @string_insert(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
ret void
}

LLVM IR (-O2):
define void @string_insert(i8** nocapture %0, i8* nocapture %1, i32 %2) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ box(int /*<<< orphan*/ *, int /*<<< orphan*/,
                       int /*<<< orphan*/);
int /*<<< orphan*/ *newwin(int, int, int, int);
int /*<<< orphan*/ wrefresh(int /*<<< orphan*/ *);
WINDOW *_new_win(int lines, int cols, int y, int x) {
  WINDOW *w;
  w = newwin(lines, cols, y, x);
  box(w, 0, 0);
  wrefresh(w);
  return w;
}


x86 assembly (clang, -O0):
<_new_win>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1040 <newwin@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1050 <box@plt>
mov    -0x18(%rbp),%rdi
call   1030 <wrefresh@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_new_win>:
push   %rbx
call   1040 <newwin@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1050 <box@plt>
mov    %rbx,%rdi
call   1030 <wrefresh@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32* @_new_win(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32* @newwin(i32 %0, i32 %1, i32 %2, i32 %3)
%6 = tail call i32 @box(i32* %5, i32 0, i32 0)
%7 = tail call i32 @wrefresh(i32* %5)
ret i32* %5
}
int test_imm_B0int16_mem(short *val) {
  return ((*val) & (-0xB0 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_B0int16_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, -176
%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_B0int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -176
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int guild_skill_get_max(int id) { return (id == 10004) ? 10 : 1; }


x86 assembly (clang, -O0):
<guild_skill_get_max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x1,%eax
mov    $0xa,%ecx
cmp    $0x2714,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<guild_skill_get_max>:
xor    %eax,%eax
cmp    $0x2714,%edi
sete   %al
lea    (%rax,%rax,8),%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @guild_skill_get_max(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 10004
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 10, i32 1
ret i32 %6
}

LLVM IR (-O2):
define i32 @guild_skill_get_max(i32 %0) {
%2 = icmp eq i32 %0, 10004
%3 = select i1 %2, i32 10, i32 1
ret i32 %3
}
/* Variables and functions */
scalar_t__ SD_GetStatus();
int /*<<< orphan*/ SD_Init();
char STORAGE_IsReady(void) {
  static char last_status = 0;
  if (last_status < 0) {
    SD_Init();
    last_status = 0;
  }
  if (SD_GetStatus() != 0) {
    last_status = -1;
    return (-1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<STORAGE_IsReady>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsbl 0x2f02(%rip),%eax
cmp    $0x0,%eax
jge    1146 <STORAGE_IsReady+0x26>
mov    $0x0,%al
call   1030 <SD_Init@plt>
movb   $0x0,0x2eeb(%rip)
mov    $0x0,%al
call   1040 <SD_GetStatus@plt>
cmp    $0x0,%rax
je     1167 <STORAGE_IsReady+0x47>
movb   $0xff,0x2ed3(%rip)
movb   $0xff,-0x1(%rbp)
jmp    116b <STORAGE_IsReady+0x4b>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<STORAGE_IsReady>:
push   %rbx
cmpb   $0x1,0x2f09(%rip)
jne    1138 <STORAGE_IsReady+0x18>
xor    %eax,%eax
call   1030 <SD_Init@plt>
movb   $0x0,0x2ef9(%rip)
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <SD_GetStatus@plt>
test   %rax,%rax
je     114f <STORAGE_IsReady+0x2f>
movb   $0x1,0x2ee4(%rip)
mov    $0xff,%bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@STORAGE_IsReady.last_status = internal global i8 0
define signext i8 @STORAGE_IsReady() {
%1 = alloca i8
%2 = load i8, i8* @STORAGE_IsReady.last_status
%3 = sext i8 %2 to i32
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (...) @SD_Init()
store i8 0, i8* @STORAGE_IsReady.last_status
br label %7
7: ; preds = %5, %0
%8 = call i64 (...) @SD_GetStatus()
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %7
store i8 -1, i8* @STORAGE_IsReady.last_status
store i8 -1, i8* %1
br label %12
11: ; preds = %7
store i8 0, i8* %1
br label %12
12: ; preds = %11, %10
%13 = load i8, i8* %1
ret i8 %13
}

LLVM IR (-O2):
@STORAGE_IsReady.last_status = internal unnamed_addr global i1 false
define signext i8 @STORAGE_IsReady() {
%1 = load i1, i1* @STORAGE_IsReady.last_status
br i1 %1, label %2, label %4
2: ; preds = %0
%3 = tail call i32 (...) @SD_Init()
store i1 false, i1* @STORAGE_IsReady.last_status
br label %4
4: ; preds = %2, %0
%5 = tail call i64 (...) @SD_GetStatus()
%6 = icmp eq i64 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %4
store i1 true, i1* @STORAGE_IsReady.last_status
br label %8
8: ; preds = %4, %7
%9 = phi i8 [ -1, %7 ], [ 0, %4 ]
ret i8 %9
}
int test_imm_1Euint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x1E << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_1Euint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 30
%7 = icmp ne i64 %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_1Euint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 1966080
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ FastGrep(char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  if (argc == 2)
    FastGrep(argv[1]);
  else
    printf("Usage: fgrep chaine\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    1152 <main+0x32>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <FastGrep@plt>
jmp    115e <main+0x3e>
lea    0xea7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1131 <main+0x11>
mov    0x8(%rsi),%rdi
call   1030 <FastGrep@plt>
jmp    113d <main+0x1d>
lea    0xec8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [20 x i8] c"Usage: fgrep chaine\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @FastGrep(i8* %6)
br label %10
8: ; preds = %2
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
br label %10
10: ; preds = %8, %4
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ starexit(int);
void internalerror(void) {
  printf("  Please report this bug to jrs@cs.berkeley.edu\n");
  printf("  Include the message above, your input data set, and the exact\n");
  printf("  command line you used to run Star.\n");
  starexit(1);
}


x86 assembly (clang, -O0):
<internalerror>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xefa(%rip),%rdi
call   1030 <printf@plt>
lea    0xf2f(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <starexit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<internalerror>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xefc(%rip),%rdi
call   1030 <puts@plt>
lea    0xf30(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <starexit@plt>

LLVM IR (-O0):
@.str = [49 x i8] c" Please report this bug to jrs@cs.berkeley.edu\0A\00"
@.str.1 = [65 x i8] c" Include the message above, your input data set, and the exact\0A\00"
@.str.2 = [38 x i8] c" command line you used to run Star.\0A\00"
define void @internalerror() {
%1 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @starexit(i32 1)
ret void
}

LLVM IR (-O2):
@str = [48 x i8] c" Please report this bug to jrs@cs.berkeley.edu\00"
@str.3 = [64 x i8] c" Include the message above, your input data set, and the exact\00"
@str.4 = [37 x i8] c" command line you used to run Star.\00"
define void @internalerror() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.4, i64 0, i64 0))
%4 = tail call i32 @starexit(i32 1)
ret void
}
/* Variables and functions */
char tolower(char);
void str_lower(char *s) {
  for (; *s; ++s)
    *s = tolower(*s);
}


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

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

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

LLVM IR (-O2):
define void @str_lower(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @tolower(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug_printf(char *, ...);
int /*<<< orphan*/ send(int, char *, int, int /*<<< orphan*/);
void strnsend(int fd, char *string, int len) {
  debug_printf(">strnsend(%d,%s,%d)\n", fd, string, len);
  send(fd, string, len, 0);
  debug_printf("strnsend>\n");
}


x86 assembly (clang, -O0):
<strnsend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug_printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1040 <send@plt>
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <debug_printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnsend>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xecd(%rip),%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
mov    %r14d,%ecx
xor    %eax,%eax
call   1030 <debug_printf@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
lea    0xebd(%rip),%rdi
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <debug_printf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c">strnsend(%d,%s,%d)\0A\00"
@.str.1 = [11 x i8] c"strnsend>\0A\00"
define void @strnsend(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 (i8*, ...) @debug_printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %8, i32 %9)
%11 = load i32, i32* %4
%12 = load i8*, i8** %5
%13 = load i32, i32* %6
%14 = call i32 @send(i32 %11, i8* %12, i32 %13, i32 0)
%15 = call i32 (i8*, ...) @debug_printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c">strnsend(%d,%s,%d)\0A\00"
@.str.1 = [11 x i8] c"strnsend>\0A\00"
define void @strnsend(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 (i8*, ...) @debug_printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1, i32 %2)
%5 = tail call i32 @send(i32 %0, i8* %1, i32 %2, i32 0)
%6 = tail call i32 (i8*, ...) @debug_printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sbrk(int /*<<< orphan*/);
int main() { sbrk(0); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <sbrk@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @sbrk(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @sbrk(i32 0)
ret i32 0
}