xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
int randomInt();
int testSymbolicInvalidation(int index) {
  int vals[10];
  vals[0] = 42;
  clang_analyzer_eval(vals[0] == 42);
  vals[index] = randomInt();
  clang_analyzer_eval(vals[0] == 42);
  return vals[index];
}


x86 assembly (clang, -O0):
<testSymbolicInvalidation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x2a,-0x30(%rbp)
cmpl   $0x2a,-0x30(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
mov    $0x0,%al
call   1030 <randomInt@plt>
mov    %eax,%ecx
movslq -0x4(%rbp),%rax
mov    %ecx,-0x30(%rbp,%rax,4)
cmpl   $0x2a,-0x30(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
movslq -0x4(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testSymbolicInvalidation>:
push   %rbp
push   %rbx
sub    $0x28,%rsp
mov    %edi,%ebx
movl   $0x2a,(%rsp)
mov    $0x1,%edi
call   1040 <clang_analyzer_eval@plt>
xor    %eax,%eax
call   1030 <randomInt@plt>
mov    %eax,%ebp
movslq %ebx,%rax
mov    %ebp,(%rsp,%rax,4)
xor    %edi,%edi
cmpl   $0x2a,(%rsp)
sete   %dil
call   1040 <clang_analyzer_eval@plt>
mov    %ebp,%eax
add    $0x28,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @testSymbolicInvalidation(i32 %0) {
%2 = alloca i32
%3 = alloca [10 x i32]
store i32 %0, i32* %2
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
store i32 42, i32* %4
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 42
%8 = zext i1 %7 to i32
%9 = call i32 @clang_analyzer_eval(i32 %8)
%10 = call i32 (...) @randomInt()
%11 = load i32, i32* %2
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %12
store i32 %10, i32* %13
%14 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%15 = load i32, i32* %14
%16 = icmp eq i32 %15, 42
%17 = zext i1 %16 to i32
%18 = call i32 @clang_analyzer_eval(i32 %17)
%19 = load i32, i32* %2
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %20
%22 = load i32, i32* %21
ret i32 %22
}

LLVM IR (-O2):
define i32 @testSymbolicInvalidation(i32 %0) {
%2 = alloca [10 x i32]
%3 = bitcast [10 x i32]* %2 to i8*
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
store i32 42, i32* %4
%5 = tail call i32 @clang_analyzer_eval(i32 1)
%6 = tail call i32 (...) @randomInt()
%7 = sext i32 %0 to i64
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %7
store i32 %6, i32* %8
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, 42
%11 = zext i1 %10 to i32
%12 = tail call i32 @clang_analyzer_eval(i32 %11)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ my_put_nbr(int);
int /*<<< orphan*/ my_putstr(char *);
void my_list_prime(int n, int k) {
  if (k > 0) {
    if ((n % k) == 0) {
      my_put_nbr(n / k);
      my_putstr("\n");
    }
    return my_list_prime(n, k - 1);
  }
}


x86 assembly (clang, -O0):
<my_list_prime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1180 <my_list_prime+0x50>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
jne    1172 <my_list_prime+0x42>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%edi
call   1030 <my_put_nbr@plt>
lea    0xe93(%rip),%rdi
call   1050 <my_putstr@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
call   1040 <my_list_prime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_list_prime>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    1164 <my_list_prime+0x44>
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xecd(%rip),%r14
jmp    114a <my_list_prime+0x2a>
cs nopw 0x0(%rax,%rax,1)
nop
lea    -0x1(%rbx),%eax
cmp    $0x1,%ebx
mov    %eax,%ebx
jle    1164 <my_list_prime+0x44>
mov    %ebp,%eax
cltd
idiv   %ebx
test   %edx,%edx
jne    1140 <my_list_prime+0x20>
mov    %eax,%edi
call   1030 <my_put_nbr@plt>
mov    %r14,%rdi
call   1040 <my_putstr@plt>
jmp    1140 <my_list_prime+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @my_list_prime(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %22
7: ; preds = %2
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = srem i32 %8, %9
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %7
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = sdiv i32 %13, %14
%16 = call i32 @my_put_nbr(i32 %15)
%17 = call i32 @my_putstr(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %12, %7
%19 = load i32, i32* %3
%20 = load i32, i32* %4
%21 = sub nsw i32 %20, 1
br label %22
22: ; preds = %18, %2
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @my_list_prime(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %15
4: ; preds = %2, %12
%5 = phi i32 [ %13, %12 ], [ %1, %2 ]
%6 = srem i32 %0, %5
%7 = sdiv i32 %0, %5
%8 = icmp eq i32 %6, 0
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = tail call i32 @my_put_nbr(i32 %7)
%11 = tail call i32 @my_putstr(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %9, %4
%13 = add nsw i32 %5, -1
%14 = icmp sgt i32 %5, 1
br i1 %14, label %4, label %15
15: ; preds = %12, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  if (argc >= 2) {
    printf("Hello %s!\n", argv[1]);
  } else {
    printf("Hello World\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)
jl     114b <main+0x3b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1159 <main+0x49>
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jl     113a <main+0x1a>
mov    0x8(%rsi),%rsi
lea    0xecf(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1146 <main+0x26>
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"Hello %s!\0A\00"
@.str.1 = [13 x i8] c"Hello World\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 sge 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 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %15
13: ; preds = %2
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %13, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"Hello %s!\0A\00"
@str = [12 x i8] c"Hello World\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
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 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %10
8: ; preds = %2
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
br label %10
10: ; preds = %8, %4
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint16_t;
struct pkt_buff {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ tprintf(char *);
void dissect_mobility_options(struct pkt_buff *pkt,
                              uint16_t *message_data_len) {
  if (*message_data_len)
    tprintf("MH Option(s) recognized ");
}


x86 assembly (clang, -O0):
<dissect_mobility_options>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     113a <dissect_mobility_options+0x2a>
lea    0xecb(%rip),%rdi
call   1030 <tprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dissect_mobility_options>:
cmpq   $0x0,(%rsi)
je     1122 <dissect_mobility_options+0x12>
lea    0xee3(%rip),%rdi
jmp    1030 <tprintf@plt>
ret

LLVM IR (-O0):
%struct.pkt_buff = type { i32 }
@.str = [25 x i8] c"MH Option(s) recognized \00"
define void @dissect_mobility_options(%struct.pkt_buff* %0, i64* %1) {
%3 = alloca %struct.pkt_buff*
%4 = alloca i64*
store %struct.pkt_buff* %0, %struct.pkt_buff** %3
store i64* %1, i64** %4
%5 = load i64*, i64** %4
%6 = load i64, i64* %5
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @tprintf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
%struct.pkt_buff = type { i32 }
@.str = [25 x i8] c"MH Option(s) recognized \00"
define void @dissect_mobility_options(%struct.pkt_buff* nocapture readnone %0, i64* nocapture %1) {
%3 = load i64, i64* %1
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @tprintf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ xlfail(char *);
badfop(void) { xlfail("bad floating point operation"); }


x86 assembly (clang, -O0):
<badfop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <xlfail@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [29 x i8] c"bad floating point operation\00"
define i32 @badfop() {
%1 = alloca i32
%2 = call i32 @xlfail(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [29 x i8] c"bad floating point operation\00"
define i32 @badfop() {
%1 = tail call i32 @xlfail(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
void gtk_about_dialog_get_logo_icon_name() {}


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

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

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

LLVM IR (-O2):
define void @gtk_about_dialog_get_logo_icon_name() {
ret void
}
int user_state_uid(const struct user_state *s) { return -1; }


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

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

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

LLVM IR (-O2):
%struct.user_state = type opaque
define i32 @user_state_uid(%struct.user_state* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int initialize_multprec_solution(int k) {
  int fail, *b;
  double *c;
  fail = _ada_use_c2phc(513, &k, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<initialize_multprec_solution>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x201,%edi
lea    -0x4(%rbp),%rsi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialize_multprec_solution>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x201,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @initialize_multprec_solution(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
%5 = alloca double*
store i32 %0, i32* %2
%6 = load i32*, i32** %4
%7 = load double*, double** %5
%8 = call i32 @_ada_use_c2phc(i32 513, i32* %2, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @initialize_multprec_solution(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc(i32 513, i32* %2, i32* undef, double* undef)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ res_hl(int);
void opcb_8e() { res_hl(1); }


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

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

LLVM IR (-O0):
define void @opcb_8e() {
%1 = call i32 @res_hl(i32 1)
ret void
}

LLVM IR (-O2):
define void @opcb_8e() {
%1 = tail call i32 @res_hl(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ erasePowerstacker(int, int);
void eraseCenteredPowerstacker() { erasePowerstacker(20, 4); }


x86 assembly (clang, -O0):
<eraseCenteredPowerstacker>:
push   %rbp
mov    %rsp,%rbp
mov    $0x14,%edi
mov    $0x4,%esi
call   1030 <erasePowerstacker@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<eraseCenteredPowerstacker>:
mov    $0x14,%edi
mov    $0x4,%esi
jmp    1030 <erasePowerstacker@plt>

LLVM IR (-O0):
define void @eraseCenteredPowerstacker() {
%1 = call i32 @erasePowerstacker(i32 20, i32 4)
ret void
}

LLVM IR (-O2):
define void @eraseCenteredPowerstacker() {
%1 = tail call i32 @erasePowerstacker(i32 20, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sentinel();
int incr(int i) {
  sentinel();
  return i + 1;
}


x86 assembly (clang, -O0):
<incr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <sentinel@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<incr>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <sentinel@plt>
add    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @incr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @sentinel()
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @incr(i32 %0) {
%2 = tail call i32 (...) @sentinel()
%3 = add nsw i32 %0, 1
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
char *unicode_write_string_utf16_imp(int /*<<< orphan*/ *, size_t, size_t *,
                                     int, int);
char *unicode_write_string_utf16(uint32_t *code_points,
                                 size_t code_points_length,
                                 size_t *string_length_ptr) {
  return unicode_write_string_utf16_imp(code_points, code_points_length,
                                        string_length_ptr, false, true);
}


x86 assembly (clang, -O0):
<unicode_write_string_utf16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
mov    $0x1,%r8d
call   1030 <unicode_write_string_utf16_imp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unicode_write_string_utf16>:
xor    %ecx,%ecx
mov    $0x1,%r8d
jmp    1030 <unicode_write_string_utf16_imp@plt>

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

LLVM IR (-O2):
define i8* @unicode_write_string_utf16(i32* %0, i64 %1, i64* %2) {
%4 = tail call i8* @unicode_write_string_utf16_imp(i32* %0, i64 %1, i64* %2, i32 0, i32 1)
ret i8* %4
}
void omap_fbdev_free(struct drm_device *dev) {}


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

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

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

LLVM IR (-O2):
%struct.drm_device = type opaque
define void @omap_fbdev_free(%struct.drm_device* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void console_attrib(int attrib) { printf("%c[%dm", 0x1B, attrib); }


x86 assembly (clang, -O0):
<console_attrib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xedb(%rip),%rdi
mov    $0x1b,%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<console_attrib>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
mov    $0x1b,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"%c[%dm\00"
define void @console_attrib(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 27, i32 %0)
ret void
}
void test(int l, int *p) {
  l++;
  (*p)++;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
addl   $0x1,(%rsi)
ret

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

LLVM IR (-O2):
define void @test(i32 %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = add nsw i32 %3, 1
store i32 %4, i32* %1
ret void
}
int test_imm_9Aint16_mem(short *val) {
  return ((*val) & (0x9A << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_9Aint16_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, 154
%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_9Aint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 154
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int sum(int *a, int *b) { return *a + *b; }


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

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

LLVM IR (-O0):
define i32 @sum(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* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @sum(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = add nsw i32 %4, %3
ret i32 %5
}
int foo(int a, int b, int c, int d) { return b + c - a - d + 100; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
sub    -0x4(%rbp),%eax
sub    -0x10(%rbp),%eax
add    $0x64,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
sub    %edi,%esi
lea    (%rsi,%rdx,1),%eax
sub    %ecx,%eax
add    $0x64,%eax
ret

LLVM IR (-O0):
define i32 @foo(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* %6
%10 = load i32, i32* %7
%11 = add nsw i32 %9, %10
%12 = load i32, i32* %5
%13 = sub nsw i32 %11, %12
%14 = load i32, i32* %8
%15 = sub nsw i32 %13, %14
%16 = add nsw i32 %15, 100
ret i32 %16
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = sub i32 100, %0
%6 = add i32 %5, %1
%7 = add i32 %6, %2
%8 = sub i32 %7, %3
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_cmpeq_epi32(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_shuffle_epi32(int /*<<< orphan*/, int);
extern __attribute__((__gnu___, __always___, __artificial__)) __m128i
_MM_CMPEQ_EPI64(__m128i a, __m128i b) {
  __m128i res;
  res = _mm_cmpeq_epi32(a, b);
  return _mm_shuffle_epi32(res, 1 | (1 << 2) | (3 << 4) | (3 << 6));
}


x86 assembly (clang, -O0):
<_MM_CMPEQ_EPI64>:
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   1040 <_mm_cmpeq_epi32@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    $0xf5,%esi
call   1030 <_mm_shuffle_epi32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_MM_CMPEQ_EPI64>:
push   %rax
call   1040 <_mm_cmpeq_epi32@plt>
mov    %eax,%edi
mov    $0xf5,%esi
pop    %rax
jmp    1030 <_mm_shuffle_epi32@plt>

LLVM IR (-O0):
define i32 @_MM_CMPEQ_EPI64(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @_mm_cmpeq_epi32(i32 %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = call i32 @_mm_shuffle_epi32(i32 %9, i32 245)
ret i32 %10
}

LLVM IR (-O2):
define i32 @_MM_CMPEQ_EPI64(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmpeq_epi32(i32 %0, i32 %1)
%4 = tail call i32 @_mm_shuffle_epi32(i32 %3, i32 245)
ret i32 %4
}
/* Variables and functions */
scalar_t__ compvar(char *, char *, int);
char *locate(char **itab, char *s) {
  for (; *itab; itab++) {
    if (compvar(*itab, s, 1) == 0)
      break;
  }
  return *itab;
}


x86 assembly (clang, -O0):
<locate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1168 <locate+0x58>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <compvar@plt>
cmp    $0x0,%rax
jne    1152 <locate+0x42>
jmp    1168 <locate+0x58>
jmp    1157 <locate+0x47>
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
jmp    1120 <locate+0x10>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<locate>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1150 <locate+0x40>
mov    %rsi,%r15
add    $0x8,%rbx
xor    %r14d,%r14d
nopw   0x0(%rax,%rax,1)
mov    %r15,%rsi
mov    $0x1,%edx
call   1030 <compvar@plt>
test   %rax,%rax
je     1155 <locate+0x45>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <locate+0x20>
jmp    1159 <locate+0x49>
xor    %r14d,%r14d
jmp    1159 <locate+0x49>
mov    -0x8(%rbx),%r14
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @locate(i8** nocapture %0, i8* %1) {
%3 = load i8*, i8** %0
%4 = icmp eq i8* %3, null
br i1 %4, label %16, label %5
5: ; preds = %2, %12
%6 = phi i8* [ %14, %12 ], [ %3, %2 ]
%7 = phi i8** [ %13, %12 ], [ %0, %2 ]
%8 = tail call i64 @compvar(i8* %6, i8* %1, i32 1)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %5
%11 = load i8*, i8** %7
br label %16
12: ; preds = %5
%13 = getelementptr inbounds i8*, i8** %7, i64 1
%14 = load i8*, i8** %13
%15 = icmp eq i8* %14, null
br i1 %15, label %16, label %5
16: ; preds = %12, %10, %2
%17 = phi i8* [ null, %2 ], [ %11, %10 ], [ null, %12 ]
ret i8* %17
}
/* Variables and functions */
int /*<<< orphan*/ doCalcSpringFixed(double, double, double, double,
                                     unsigned int, unsigned int, unsigned int);
void calcSpringFixed(double k, double d, double l0, double l1, unsigned int spr,
                     unsigned int fixed, unsigned int moving) {
  if (l1 > l0) {
    doCalcSpringFixed(k, d, l0, l1, spr, fixed, moving);
  }
}


x86 assembly (clang, -O0):
<calcSpringFixed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
mov    %edi,-0x24(%rbp)
mov    %esi,-0x28(%rbp)
mov    %edx,-0x2c(%rbp)
movsd  -0x20(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1167 <calcSpringFixed+0x57>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
mov    -0x24(%rbp),%edi
mov    -0x28(%rbp),%esi
mov    -0x2c(%rbp),%edx
call   1030 <doCalcSpringFixed@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcSpringFixed>:
ucomisd %xmm2,%xmm3
jbe    111b <calcSpringFixed+0xb>
jmp    1030 <doCalcSpringFixed@plt>
ret

LLVM IR (-O0):
define void @calcSpringFixed(double %0, double %1, double %2, double %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store double %0, double* %8
store double %1, double* %9
store double %2, double* %10
store double %3, double* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%15 = load double, double* %11
%16 = load double, double* %10
%17 = fcmp ogt double %15, %16
br i1 %17, label %18, label %27
18: ; preds = %7
%19 = load double, double* %8
%20 = load double, double* %9
%21 = load double, double* %10
%22 = load double, double* %11
%23 = load i32, i32* %12
%24 = load i32, i32* %13
%25 = load i32, i32* %14
%26 = call i32 @doCalcSpringFixed(double %19, double %20, double %21, double %22, i32 %23, i32 %24, i32 %25)
br label %27
27: ; preds = %18, %7
ret void
}

LLVM IR (-O2):
define void @calcSpringFixed(double %0, double %1, double %2, double %3, i32 %4, i32 %5, i32 %6) {
%8 = fcmp ogt double %3, %2
br i1 %8, label %9, label %11
9: ; preds = %7
%10 = tail call i32 @doCalcSpringFixed(double %0, double %1, double %2, double %3, i32 %4, i32 %5, i32 %6)
br label %11
11: ; preds = %9, %7
ret void
}
void g_io_channel_get_buffer_size() {}


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

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

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

LLVM IR (-O2):
define void @g_io_channel_get_buffer_size() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sndbuf;

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_SNDBUF;
int /*<<< orphan*/ setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/,
                              char *, int);
void set_send_window(int sockfd, int sndbuf) {
  setsockopt(sockfd, SOL_SOCKET, SO_SNDBUF, (char *)&sndbuf, sizeof(sndbuf));
}


x86 assembly (clang, -O0):
<set_send_window>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
mov    0x2eaf(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_send_window>:
push   %rax
mov    %esi,0x4(%rsp)
mov    0x2ecc(%rip),%rax
mov    (%rax),%esi
mov    0x2ebb(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
pop    %rax
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_SNDBUF = global i32 0
define void @set_send_window(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* @SOL_SOCKET
%7 = load i32, i32* @SO_SNDBUF
%8 = bitcast i32* %4 to i8*
%9 = call i32 @setsockopt(i32 %5, i32 %6, i32 %7, i8* %8, i32 4)
ret void
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_SNDBUF = global i32 0
define void @set_send_window(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = load i32, i32* @SOL_SOCKET
%5 = load i32, i32* @SO_SNDBUF
%6 = bitcast i32* %3 to i8*
%7 = call i32 @setsockopt(i32 %0, i32 %4, i32 %5, i8* %6, i32 4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_slli_epi16(int /*<<< orphan*/, int);
__m128i test_mm_slli_epi16(__m128i A) { return _mm_slli_epi16(A, 1); }


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

x86 assembly (clang, -O2):
<test_mm_slli_epi16>:
mov    $0x1,%esi
jmp    1030 <_mm_slli_epi16@plt>

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

LLVM IR (-O2):
define i32 @test_mm_slli_epi16(i32 %0) {
%2 = tail call i32 @_mm_slli_epi16(i32 %0, i32 1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sleep(int);
void handler(int s) {
  printf("recv a sig=%d\n", s);
  sleep(20);
  printf("after sleep!\n");
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x14,%edi
call   1040 <sleep@plt>
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
push   %rax
mov    %edi,%esi
lea    0xec6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x14,%edi
call   1050 <sleep@plt>
lea    0xebd(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"recv a sig=%d\0A\00"
@.str.1 = [14 x i8] c"after sleep!\0A\00"
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @sleep(i32 20)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"recv a sig=%d\0A\00"
@str = [13 x i8] c"after sleep!\00"
define void @handler(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @sleep(i32 20)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
char *zfcdat(name)
char *name;
{ return (""); }


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

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @zfcdat(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @zfcdat(i8* nocapture readnone %0) {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}
int do_710() { return 710; }


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

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

LLVM IR (-O0):
define i32 @do_710() {
ret i32 710
}

LLVM IR (-O2):
define i32 @do_710() {
ret i32 710
}
OP(ed, f7) {}


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
}
void bootretry_dont_retry(void) {}


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

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

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

LLVM IR (-O2):
define void @bootretry_dont_retry() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _HibernateWriteComplete();
void HibernateRequest(void) {
  (*((volatile unsigned long *)(0x400FC010))) |= 0x00000002;
  _HibernateWriteComplete();
}


x86 assembly (clang, -O0):
<HibernateRequest>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fc010,%eax
mov    (%rax),%rcx
or     $0x2,%rcx
mov    $0x400fc010,%eax
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <_HibernateWriteComplete@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateRequest>:
orq    $0x2,0x400fc010
40 02
xor    %eax,%eax
jmp    1030 <_HibernateWriteComplete@plt>

LLVM IR (-O0):
define void @HibernateRequest() {
%1 = load volatile i64, i64* inttoptr (i64 1074774032 to i64*)
%2 = or i64 %1, 2
store volatile i64 %2, i64* inttoptr (i64 1074774032 to i64*)
%3 = call i32 (...) @_HibernateWriteComplete()
ret void
}

LLVM IR (-O2):
define void @HibernateRequest() {
%1 = load volatile i64, i64* inttoptr (i64 1074774032 to i64*)
%2 = or i64 %1, 2
store volatile i64 %2, i64* inttoptr (i64 1074774032 to i64*)
%3 = tail call i32 (...) @_HibernateWriteComplete()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ add_url_encoded_char(char, char **, char *);
void url_encode_char(char ch, char buffer[4]) {
  char *buffer_end = buffer + sizeof(char[4]) - sizeof(char);
  add_url_encoded_char(ch, &buffer, buffer_end);
  *buffer = '\0';
}


x86 assembly (clang, -O0):
<url_encode_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
mov    -0x1(%rbp),%al
mov    -0x18(%rbp),%rdx
lea    -0x10(%rbp),%rsi
movsbl %al,%edi
call   1030 <add_url_encoded_char@plt>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<url_encode_char>:
push   %rax
mov    %rsi,(%rsp)
lea    0x3(%rsi),%rdx
mov    %rsp,%rsi
call   1030 <add_url_encoded_char@plt>
mov    (%rsp),%rax
movb   $0x0,(%rax)
pop    %rax
ret

LLVM IR (-O0):
define void @url_encode_char(i8 signext %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** %4
%7 = getelementptr inbounds i8, i8* %6, i64 4
%8 = getelementptr inbounds i8, i8* %7, i64 -1
store i8* %8, i8** %5
%9 = load i8, i8* %3
%10 = load i8*, i8** %5
%11 = call i32 @add_url_encoded_char(i8 signext %9, i8** %4, i8* %10)
%12 = load i8*, i8** %4
store i8 0, i8* %12
ret void
}

LLVM IR (-O2):
define void @url_encode_char(i8 signext %0, i8* %1) {
%3 = alloca i8*
store i8* %1, i8** %3
%4 = getelementptr inbounds i8, i8* %1, i64 3
%5 = call i32 @add_url_encoded_char(i8 signext %0, i8** %3, i8* %4)
%6 = load i8*, i8** %3
store i8 0, i8* %6
ret void
}
/* Variables and functions */
int SerialAPI_request(unsigned char *, int);
int ZW_GetInitData() {
  unsigned char buf[255];
  buf[0] = 0x00;
  buf[1] = 0x2;
  return SerialAPI_request(buf, 2);
}


x86 assembly (clang, -O0):
<ZW_GetInitData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
movb   $0x0,-0x100(%rbp)
movb   $0x2,-0xff(%rbp)
lea    -0x100(%rbp),%rdi
mov    $0x2,%esi
call   1030 <SerialAPI_request@plt>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ZW_GetInitData>:
sub    $0x108,%rsp
movw   $0x200,(%rsp)
mov    %rsp,%rdi
mov    $0x2,%esi
call   1030 <SerialAPI_request@plt>
add    $0x108,%rsp
ret

LLVM IR (-O0):
define i32 @ZW_GetInitData() {
%1 = alloca [255 x i8]
%2 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
store i8 0, i8* %2
%3 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 1
store i8 2, i8* %3
%4 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%5 = call i32 @SerialAPI_request(i8* %4, i32 2)
ret i32 %5
}

LLVM IR (-O2):
define i32 @ZW_GetInitData() {
%1 = alloca [255 x i8]
%2 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
store i8 0, i8* %2
%3 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 1
store i8 2, i8* %3
%4 = call i32 @SerialAPI_request(i8* %2, i32 2)
ret i32 %4
}
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ INIT_LIST_HEAD(struct list_head *);
int /*<<< orphan*/ list_replace(struct list_head *, struct list_head *);
void list_replace_init(struct list_head *oldp, struct list_head *newp) {
  list_replace(oldp, newp);
  INIT_LIST_HEAD(oldp);
}


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

x86 assembly (clang, -O2):
<list_replace_init>:
push   %rbx
mov    %rdi,%rbx
call   1040 <list_replace@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <INIT_LIST_HEAD@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define void @list_replace_init(%struct.list_head* %0, %struct.list_head* %1) {
%3 = alloca %struct.list_head*
%4 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %3
store %struct.list_head* %1, %struct.list_head** %4
%5 = load %struct.list_head*, %struct.list_head** %3
%6 = load %struct.list_head*, %struct.list_head** %4
%7 = call i32 @list_replace(%struct.list_head* %5, %struct.list_head* %6)
%8 = load %struct.list_head*, %struct.list_head** %3
%9 = call i32 @INIT_LIST_HEAD(%struct.list_head* %8)
ret void
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @list_replace_init(%struct.list_head* %0, %struct.list_head* %1) {
%3 = tail call i32 @list_replace(%struct.list_head* %0, %struct.list_head* %1)
%4 = tail call i32 @INIT_LIST_HEAD(%struct.list_head* %0)
ret void
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ rand();
int do_rand(int a) {
  int i1;
  double d1;
  d1 = (double)rand() / ((double)RAND_MAX + 1);
  d1 = d1 * a;
  i1 = (int)d1;
  return i1;
}


x86 assembly (clang, -O0):
<do_rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2eba(%rip),%rax
cvtsi2sdq (%rax),%xmm1
movsd  0xec5(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
cvttsd2si -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_rand>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec2(%rip),%rax
cvtsi2sdq (%rax),%xmm1
addsd  0xecd(%rip),%xmm1
cvtsi2sd %ebx,%xmm2
divsd  %xmm1,%xmm0
mulsd  %xmm0,%xmm2
cvttsd2si %xmm2,%eax
pop    %rbx
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define i32 @do_rand(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %2
%5 = call i64 (...) @rand()
%6 = sitofp i64 %5 to double
%7 = load i64, i64* @RAND_MAX
%8 = sitofp i64 %7 to double
%9 = fadd double %8, 1.000000e+00
%10 = fdiv double %6, %9
store double %10, double* %4
%11 = load double, double* %4
%12 = load i32, i32* %2
%13 = sitofp i32 %12 to double
%14 = fmul double %11, %13
store double %14, double* %4
%15 = load double, double* %4
%16 = fptosi double %15 to i32
store i32 %16, i32* %3
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define i32 @do_rand(i32 %0) {
%2 = tail call i64 (...) @rand()
%3 = sitofp i64 %2 to double
%4 = load i64, i64* @RAND_MAX
%5 = sitofp i64 %4 to double
%6 = fadd double %5, 1.000000e+00
%7 = fdiv double %3, %6
%8 = sitofp i32 %0 to double
%9 = fmul double %7, %8
%10 = fptosi double %9 to i32
ret i32 %10
}
int fun752() { return 752; }


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

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

LLVM IR (-O0):
define i32 @fun752() {
ret i32 752
}

LLVM IR (-O2):
define i32 @fun752() {
ret i32 752
}
int test_imm_17int32_mem(int *val) {
  return ((*val) & (0x17 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_17int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 23
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int fun(int);
int /*<<< orphan*/ printf(char *, int, int);
void main() {
  int i;
  for (i = 1; i <= 5; i++)
    printf("fun(%d)=%d\n", i, fun(i));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jg     1166 <main+0x46>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <fun@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <main+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%edi
call   1030 <fun@plt>
lea    0xece(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %eax,%edx
call   1040 <printf@plt>
mov    $0x2,%edi
call   1030 <fun@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    %eax,%edx
call   1040 <printf@plt>
mov    $0x3,%edi
call   1030 <fun@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    %eax,%edx
call   1040 <printf@plt>
mov    $0x4,%edi
call   1030 <fun@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    %eax,%edx
call   1040 <printf@plt>
mov    $0x5,%edi
call   1030 <fun@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
mov    %eax,%edx
pop    %rbx
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"fun(%d)=%d\0A\00"
define void @main() {
%1 = tail call i32 @fun(i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 1, i32 %1)
%3 = tail call i32 @fun(i32 2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 2, i32 %3)
%5 = tail call i32 @fun(i32 3)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 3, i32 %5)
%7 = tail call i32 @fun(i32 4)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 4, i32 %7)
%9 = tail call i32 @fun(i32 5)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 5, i32 %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ db(int);
void fabs() {
  db(0xD9);
  db(0xE1);
}


x86 assembly (clang, -O0):
<fabs>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd9,%edi
call   1030 <db@plt>
mov    $0xe1,%edi
call   1030 <db@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabs>:
push   %rax
mov    $0xd9,%edi
call   1030 <db@plt>
mov    $0xe1,%edi
pop    %rax
jmp    1030 <db@plt>

LLVM IR (-O0):
define void @fabs() {
%1 = call i32 @db(i32 217)
%2 = call i32 @db(i32 225)
ret void
}

LLVM IR (-O2):
define void @fabs() {
%1 = tail call i32 @db(i32 217)
%2 = tail call i32 @db(i32 225)
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned long message_type;
};
struct TYPE_4__ {
  TYPE_1__ xclient;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xclient_message_type(void *_p, unsigned long _v) {
  ((XEvent *)_p)->xclient.message_type = (unsigned long)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xclient_message_type>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define void @set_XEvent_xclient_message_type(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i64 %5, i64* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xclient_message_type(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
void errInspectionPrintSummary() {}


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

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

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

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