xunge/DecIR huggingface dataset:
int is_e_end(char c) {
  if ((c >= (-128 + 31)) && (c < (-128 + 34)))
    return (1);
  return (c == '\0') || (c == ':') || (c == ')') || (c == ',');
}


x86 assembly (clang, -O0):
<is_e_end>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0xffffff9f,%eax
jl     1130 <is_e_end+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0xffffffa2,%eax
jge    1130 <is_e_end+0x30>
movl   $0x1,-0x4(%rbp)
jmp    117e <is_e_end+0x7e>
movsbl -0x5(%rbp),%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x6(%rbp)
je     1173 <is_e_end+0x73>
movsbl -0x5(%rbp),%ecx
mov    $0x1,%al
cmp    $0x3a,%ecx
mov    %al,-0x6(%rbp)
je     1173 <is_e_end+0x73>
movsbl -0x5(%rbp),%ecx
mov    $0x1,%al
cmp    $0x29,%ecx
mov    %al,-0x6(%rbp)
je     1173 <is_e_end+0x73>
movsbl -0x5(%rbp),%eax
cmp    $0x2c,%eax
sete   %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_e_end>:
lea    0x61(%rdi),%ecx
mov    $0x1,%eax
cmp    $0x3,%cl
jb     1127 <is_e_end+0x27>
cmp    $0x3a,%dil
ja     1128 <is_e_end+0x28>
movzbl %dil,%ecx
movabs $0x400020000000001,%rdx
bt     %rcx,%rdx
jae    1128 <is_e_end+0x28>
ret
xor    %eax,%eax
cmp    $0x2c,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is_e_end(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 sge i32 %5, -97
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp slt i32 %9, -94
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %31
12: ; preds = %7, %1
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 0
br i1 %15, label %28, label %16
16: ; preds = %12
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 58
br i1 %19, label %28, label %20
20: ; preds = %16
%21 = load i8, i8* %3
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %22, 41
br i1 %23, label %28, label %24
24: ; preds = %20
%25 = load i8, i8* %3
%26 = sext i8 %25 to i32
%27 = icmp eq i32 %26, 44
br label %28
28: ; preds = %24, %20, %16, %12
%29 = phi i1 [ true, %20 ], [ true, %16 ], [ true, %12 ], [ %27, %24 ]
%30 = zext i1 %29 to i32
store i32 %30, i32* %2
br label %31
31: ; preds = %28, %11
%32 = load i32, i32* %2
ret i32 %32
}

LLVM IR (-O2):
define i32 @is_e_end(i8 signext %0) {
%2 = add i8 %0, 97
%3 = icmp ult i8 %2, 3
br i1 %3, label %8, label %4
4: ; preds = %1
switch i8 %0, label %5 [
i8 58, label %8
i8 41, label %8
i8 0, label %8
]
5: ; preds = %4
%6 = icmp eq i8 %0, 44
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %5, %4, %4, %4, %1
%9 = phi i32 [ 1, %1 ], [ 1, %4 ], [ %7, %5 ], [ 1, %4 ], [ 1, %4 ]
ret i32 %9
}
/* Variables and functions */
unsigned int bswap_32(unsigned int);
unsigned int normalize_fourcc(unsigned int fourcc) {
  if ((fourcc & 0xFFFFFF00) == ((('R' << 24) | ('G' << 16) | ('B' << 8)) | 0) ||
      (fourcc & 0xFFFFFF00) == ((('B' << 24) | ('G' << 16) | ('R' << 8)) | 0))
    return bswap_32(fourcc);
  else
    return fourcc;
}


x86 assembly (clang, -O0):
<normalize_fourcc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xffffff00,%eax
cmp    $0x52474200,%eax
je     1141 <normalize_fourcc+0x31>
mov    -0x8(%rbp),%eax
and    $0xffffff00,%eax
cmp    $0x42475200,%eax
jne    1151 <normalize_fourcc+0x41>
mov    -0x8(%rbp),%edi
call   1030 <bswap_32@plt>
mov    %eax,-0x4(%rbp)
jmp    1157 <normalize_fourcc+0x47>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<normalize_fourcc>:
mov    %edi,%eax
and    $0xffffff00,%eax
cmp    $0x52474200,%eax
je     1125 <normalize_fourcc+0x15>
cmp    $0x42475200,%eax
jne    112a <normalize_fourcc+0x1a>
jmp    1030 <bswap_32@plt>
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @normalize_fourcc(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = and i32 %4, -256
%6 = icmp eq i32 %5, 1380401664
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i32, i32* %3
%9 = and i32 %8, -256
%10 = icmp eq i32 %9, 1111970304
br i1 %10, label %11, label %14
11: ; preds = %7, %1
%12 = load i32, i32* %3
%13 = call i32 @bswap_32(i32 %12)
store i32 %13, i32* %2
br label %16
14: ; preds = %7
%15 = load i32, i32* %3
store i32 %15, i32* %2
br label %16
16: ; preds = %14, %11
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @normalize_fourcc(i32 %0) {
%2 = and i32 %0, -256
switch i32 %2, label %5 [
i32 1380401664, label %3
i32 1111970304, label %3
]
3: ; preds = %1, %1
%4 = tail call i32 @bswap_32(i32 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ %0, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ test_glob_char();
int /*<<< orphan*/ test_glob_int();
int /*<<< orphan*/ test_local_char();
int /*<<< orphan*/ test_local_int();
int main() {
  test_local_int();
  test_local_char();
  test_glob_int();
  test_glob_char();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <test_local_int@plt>
mov    $0x0,%al
call   1040 <test_local_char@plt>
mov    $0x0,%al
call   1050 <test_glob_int@plt>
mov    $0x0,%al
call   1060 <test_glob_char@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_local_int@plt>
xor    %eax,%eax
call   1040 <test_local_char@plt>
xor    %eax,%eax
call   1050 <test_glob_int@plt>
xor    %eax,%eax
call   1060 <test_glob_char@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @test_local_int()
%2 = call i32 (...) @test_local_char()
%3 = call i32 (...) @test_glob_int()
%4 = call i32 (...) @test_glob_char()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_local_int()
%2 = tail call i32 (...) @test_local_char()
%3 = tail call i32 (...) @test_glob_int()
%4 = tail call i32 (...) @test_glob_char()
ret i32 0
}
void read_barrier(void) {}


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

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

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

LLVM IR (-O2):
define void @read_barrier() {
ret void
}
/* Variables and functions */
char *test8_helper_1() { return NULL; }


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

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

LLVM IR (-O0):
define i8* @test8_helper_1() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @test8_helper_1() {
ret i8* null
}
int est_8mem_for_6str(int len) { return 1 + (int)(4.0 / 3.0 * len); }


x86 assembly (clang, -O0):
<est_8mem_for_6str>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xeec(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<est_8mem_for_6str>:
cvtsi2sd %edi,%xmm0
mulsd  0xef4(%rip),%xmm0
cvttsd2si %xmm0,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @est_8mem_for_6str(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fmul double 0x3FF5555555555555, %4
%6 = fptosi double %5 to i32
%7 = add nsw i32 1, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @est_8mem_for_6str(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fmul double %2, 0x3FF5555555555555
%4 = fptosi double %3 to i32
%5 = add nsw i32 %4, 1
ret i32 %5
}
/* Variables and functions */
int check_arg_count(int, int);
char *fullname(char *, char *);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_status(char *);
void cmd_fullname(int nargs, char **args) {
  char string[256];
  if (check_arg_count(nargs, 1) == 1)
    return;
  report_count(2);
  report_status(fullname(args[0], string));
  report_status(string);
}


x86 assembly (clang, -O0):
<cmd_fullname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1040 <check_arg_count@plt>
cmp    $0x1,%eax
jne    116d <cmd_fullname+0x2d>
jmp    119e <cmd_fullname+0x5e>
mov    $0x2,%edi
call   1050 <report_count@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    -0x110(%rbp),%rsi
call   1060 <fullname@plt>
mov    %rax,%rdi
call   1030 <report_status@plt>
lea    -0x110(%rbp),%rdi
call   1030 <report_status@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_fullname>:
push   %rbx
sub    $0x100,%rsp
mov    %rsi,%rbx
mov    $0x1,%esi
call   1040 <check_arg_count@plt>
cmp    $0x1,%eax
je     1182 <cmd_fullname+0x42>
mov    $0x2,%edi
call   1050 <report_count@plt>
mov    (%rbx),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1060 <fullname@plt>
mov    %rax,%rdi
call   1030 <report_status@plt>
mov    %rbx,%rdi
call   1030 <report_status@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @cmd_fullname(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [256 x i8]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i32, i32* %3
%7 = call i32 @check_arg_count(i32 %6, i32 1)
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %10
9: ; preds = %2
br label %20
10: ; preds = %2
%11 = call i32 @report_count(i32 2)
%12 = load i8**, i8*** %4
%13 = getelementptr inbounds i8*, i8** %12, i64 0
%14 = load i8*, i8** %13
%15 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%16 = call i8* @fullname(i8* %14, i8* %15)
%17 = call i32 @report_status(i8* %16)
%18 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%19 = call i32 @report_status(i8* %18)
br label %20
20: ; preds = %10, %9
ret void
}

LLVM IR (-O2):
define void @cmd_fullname(i32 %0, i8** nocapture %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @check_arg_count(i32 %0, i32 1)
%6 = icmp eq i32 %5, 1
br i1 %6, label %13, label %7
7: ; preds = %2
%8 = tail call i32 @report_count(i32 2)
%9 = load i8*, i8** %1
%10 = call i8* @fullname(i8* %9, i8* %4)
%11 = call i32 @report_status(i8* %10)
%12 = call i32 @report_status(i8* %4)
br label %13
13: ; preds = %2, %7
ret void
}
void simple_report(const char *fmt, ...) { ; }


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

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

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

LLVM IR (-O2):
define void @simple_report(i8* nocapture %0, ...) {
ret void
}
void print(int pos, char *text, char color) {
  asm volatile("movl $0xA, %%eax; int $0x80"
               :
               : "b"(pos), "c"(text), "d"(color));
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %dl,%al
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %al,-0x19(%rbp)
mov    -0xc(%rbp),%ebx
mov    -0x18(%rbp),%rcx
mov    -0x19(%rbp),%dl
mov    $0xa,%eax
int    $0x80
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %rbx
mov    %rsi,%rcx
mov    %edi,%ebx
mov    $0xa,%eax
int    $0x80
pop    %rbx
ret

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

LLVM IR (-O2):
define void @print(i32 %0, i8* %1, i8 signext %2) {
tail call void asm sideeffect "movl $$0xA, %eax; int $$0x80", "{bx},{cx},{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0, i8* %1, i8 %2)
ret void
}
falInternAtom() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @falInternAtom() {
ret i32 0
}
/* Variables and functions */
int cubeByValue(int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int number = 5;
  printf("The original value of number is %d", number);
  number = cubeByValue(number);
  printf("The new value of number is %d", number);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
call   1040 <cubeByValue@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
mov    $0x5,%edi
call   1040 <cubeByValue@plt>
lea    0xee0(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"The original value of number is %d\00"
@.str.1 = [30 x i8] c"The new value of number is %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @cubeByValue(i32 %5)
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"The original value of number is %d\00"
@.str.1 = [30 x i8] c"The new value of number is %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 5)
%2 = tail call i32 @cubeByValue(i32 5)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_session_get_seat(const char *session, char **seat) {
  return -EINVAL;
}


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

x86 assembly (clang, -O2):
<sd_session_get_seat>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_session_get_seat(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_session_get_seat(i8* nocapture readnone %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
int isSign(char c) { return ((c == '-') || (c == '+')); }


x86 assembly (clang, -O0):
<isSign>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2d,%ecx
mov    %al,-0x2(%rbp)
je     1129 <isSign+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x2b,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSign>:
add    $0xd5,%dil
xor    %eax,%eax
test   $0xfd,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @isSign(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 45
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 43
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isSign(i8 signext %0) {
%2 = icmp eq i8 %0, 45
%3 = icmp eq i8 %0, 43
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
const char *yes_no(bool b) { return b ? "yes" : "no"; }


x86 assembly (clang, -O0):
<yes_no>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xef3(%rip),%rax
lea    0xee8(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<yes_no>:
test   %edi,%edi
lea    0xefb(%rip),%rcx
lea    0xef0(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"yes\00"
@.str.1 = [3 x i8] c"no\00"
define i8* @yes_no(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
ret i8* %6
}

LLVM IR (-O2):
@.str = [4 x i8] c"yes\00"
@.str.1 = [3 x i8] c"no\00"
define i8* @yes_no(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void error_msg(const char *msg) {
  fprintf(stderr, "%s: %s\n", msg, strerror(errno));
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<error_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    %rax,%rcx
lea    0xe91(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e55(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error_msg>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ea3(%rip),%rax
mov    (%rax),%ebp
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeac(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1030 <fprintf@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
define void @error_msg(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = load i32, i32* @errno
%6 = call i8* @strerror(i32 %5)
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %6)
%8 = load i32, i32* @EXIT_FAILURE
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
define void @error_msg(i8* %0) {
%2 = load i32, i32* @stderr
%3 = load i32, i32* @errno
%4 = tail call i8* @strerror(i32 %3)
%5 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
}
void hal_spi_init(void) {}


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

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

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

LLVM IR (-O2):
define void @hal_spi_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ brc2(int, int, char);
int /*<<< orphan*/ padding(int);
int cup(int pn1, int pn2) {
  brc2(pn1, pn2, 'H');
  padding(5);
  return 1;
}


x86 assembly (clang, -O0):
<cup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x48,%edx
call   1040 <brc2@plt>
mov    $0x5,%edi
call   1030 <padding@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cup>:
push   %rax
mov    $0x48,%edx
call   1040 <brc2@plt>
mov    $0x5,%edi
call   1030 <padding@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @cup(i32 %0, i32 %1) {
%3 = tail call i32 @brc2(i32 %0, i32 %1, i8 signext 72)
%4 = tail call i32 @padding(i32 5)
ret i32 1
}
/* Type definitions */
struct drm_device {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ r128_do_cleanup_cce(struct drm_device *);
void r128_driver_lastclose(struct drm_device *dev) { r128_do_cleanup_cce(dev); }


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

x86 assembly (clang, -O2):
<r128_driver_lastclose>:
jmp    1030 <r128_do_cleanup_cce@plt>

LLVM IR (-O0):
%struct.drm_device = type { i32 }
define void @r128_driver_lastclose(%struct.drm_device* %0) {
%2 = alloca %struct.drm_device*
store %struct.drm_device* %0, %struct.drm_device** %2
%3 = load %struct.drm_device*, %struct.drm_device** %2
%4 = call i32 @r128_do_cleanup_cce(%struct.drm_device* %3)
ret void
}

LLVM IR (-O2):
%struct.drm_device = type { i32 }
define void @r128_driver_lastclose(%struct.drm_device* %0) {
%2 = tail call i32 @r128_do_cleanup_cce(%struct.drm_device* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ eval();
int /*<<< orphan*/ init_threads();
int stop_simulation();
void start_simulation(void) {
  int kernel_st;
  int tmp;
  {
    {
      kernel_st = 0;
      init_threads();
    }
    {
      while (1) {
      while_3_continue:;
        {
          kernel_st = 1;
          eval();
          tmp = stop_simulation();
        }
        if (tmp) {
          goto while_3_break;
        } else {
        }
      }
    while_3_break:;
    }
    return;
  }
}


x86 assembly (clang, -O0):
<start_simulation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <init_threads@plt>
jmp    114b <start_simulation+0x1b>
movl   $0x1,-0x4(%rbp)
mov    $0x0,%al
call   1050 <eval@plt>
mov    $0x0,%al
call   1030 <stop_simulation@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1172 <start_simulation+0x42>
jmp    117c <start_simulation+0x4c>
jmp    1177 <start_simulation+0x47>
jmp    1146 <start_simulation+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<start_simulation>:
push   %rax
xor    %eax,%eax
call   1040 <init_threads@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <eval@plt>
xor    %eax,%eax
call   1030 <stop_simulation@plt>
test   %eax,%eax
je     1140 <start_simulation+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @start_simulation() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @init_threads()
br label %4
4: ; preds = %0, %12
br label %5
5: ; preds = %4
store i32 1, i32* %1
%6 = call i32 (...) @eval()
%7 = call i32 (...) @stop_simulation()
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %5
br label %13
11: ; preds = %5
br label %12
12: ; preds = %11
br label %4
13: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @start_simulation() {
%1 = tail call i32 (...) @init_threads()
br label %2
2: ; preds = %2, %0
%3 = tail call i32 (...) @eval()
%4 = tail call i32 (...) @stop_simulation()
%5 = icmp eq i32 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
ret void
}
/* Variables and functions */
char gfx_wait();
void window_wait() {
  char c;
  while (1) {
    c = gfx_wait();
    if (c == 'q')
      break;
  }
}


x86 assembly (clang, -O0):
<window_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <gfx_wait@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x71,%eax
jne    1134 <window_wait+0x24>
jmp    1139 <window_wait+0x29>
jmp    1118 <window_wait+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<window_wait>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <gfx_wait@plt>
cmp    $0x71,%al
jne    1120 <window_wait+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @window_wait() {
%1 = alloca i8
br label %2
2: ; preds = %0, %8
%3 = call signext i8 (...) @gfx_wait()
store i8 %3, i8* %1
%4 = load i8, i8* %1
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 113
br i1 %6, label %7, label %8
7: ; preds = %2
br label %9
8: ; preds = %2
br label %2
9: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @window_wait() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @gfx_wait()
%3 = icmp eq i8 %2, 113
br i1 %3, label %4, label %1
4: ; preds = %1
ret void
}
const char *deviceDataDispatcherDebugGetName(void) { return "dataDispatcher"; }


x86 assembly (clang, -O0):
<deviceDataDispatcherDebugGetName>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"dataDispatcher\00"
define i8* @deviceDataDispatcherDebugGetName() {
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [15 x i8] c"dataDispatcher\00"
define i8* @deviceDataDispatcherDebugGetName() {
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int SerialAPI_request(unsigned char *, int);
int ZW_GetProtocolStatus() {
  unsigned char buf[255];
  buf[0] = 0x00;
  buf[1] = 0xBF;
  return SerialAPI_request(buf, 2);
}


x86 assembly (clang, -O0):
<ZW_GetProtocolStatus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
movb   $0x0,-0x100(%rbp)
movb   $0xbf,-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_GetProtocolStatus>:
sub    $0x108,%rsp
movw   $0xbf00,(%rsp)
mov    %rsp,%rdi
mov    $0x2,%esi
call   1030 <SerialAPI_request@plt>
add    $0x108,%rsp
ret

LLVM IR (-O0):
define i32 @ZW_GetProtocolStatus() {
%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 -65, 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_GetProtocolStatus() {
%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 -65, i8* %3
%4 = call i32 @SerialAPI_request(i8* %2, i32 2)
ret i32 %4
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *mallocz(size_t size) {
  void *ptr;
  ptr = malloc(size);
  memset(ptr, 0, size);
  return ptr;
}


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

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

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

LLVM IR (-O2):
define i8* @mallocz(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
ret i8* %2
}
int addvec3(int count, ...) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @addvec3(i32 %0, ...) {
ret i32 0
}
void multiply(int *number, int multiplier) {
  int mul = (*number) * multiplier;
  *number = mul;
}


x86 assembly (clang, -O0):
<multiply>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiply>:
imul   (%rdi),%esi
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @multiply(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = mul nsw i32 %3, %1
store i32 %4, i32* %0
ret void
}
/* Variables and functions */
float __infer_nondet_float();
float cosf(float x) { return __infer_nondet_float(); }


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

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

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

LLVM IR (-O2):
define float @cosf(float %0) {
%2 = tail call float (...) @__infer_nondet_float()
ret float %2
}
int test_imm_63uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x63 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_63uint64_highword_reg>:
movabs $0x6300000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_63uint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 99
%6 = icmp ne i64 %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_63uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 425201762304
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int div(int, int);
int /*<<< orphan*/ interrupt(int, int, char *, int, int);
int mod(int, int);
void readSector(char *buffer, int sector) {
  interrupt(0x13, 0x0201, buffer,
            ((div(sector, 36) << 8) | mod(sector, 18)) + 1,
            (div(sector, 18) & 1) << 8);
}


x86 assembly (clang, -O0):
<readSector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
mov    $0x24,%esi
call   1050 <div@plt>
shl    $0x8,%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%edi
mov    $0x12,%esi
call   1030 <mod@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
or     %ecx,%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    $0x12,%esi
call   1050 <div@plt>
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%ecx
mov    %eax,%r8d
and    $0x1,%r8d
shl    $0x8,%r8d
mov    $0x13,%edi
mov    $0x201,%esi
call   1040 <interrupt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readSector>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%edi
mov    $0x24,%esi
call   1050 <div@plt>
mov    %eax,%ebx
shl    $0x8,%ebx
mov    %ebp,%edi
mov    $0x12,%esi
call   1030 <mod@plt>
or     %eax,%ebx
add    $0x1,%ebx
mov    %ebp,%edi
mov    $0x12,%esi
call   1050 <div@plt>
and    $0x1,%eax
shl    $0x8,%eax
mov    $0x13,%edi
mov    $0x201,%esi
mov    %r14,%rdx
mov    %ebx,%ecx
mov    %eax,%r8d
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <interrupt@plt>

LLVM IR (-O0):
define void @readSector(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 @div(i32 %6, i32 36)
%8 = shl i32 %7, 8
%9 = load i32, i32* %4
%10 = call i32 @mod(i32 %9, i32 18)
%11 = or i32 %8, %10
%12 = add nsw i32 %11, 1
%13 = load i32, i32* %4
%14 = call i32 @div(i32 %13, i32 18)
%15 = and i32 %14, 1
%16 = shl i32 %15, 8
%17 = call i32 @interrupt(i32 19, i32 513, i8* %5, i32 %12, i32 %16)
ret void
}

LLVM IR (-O2):
define void @readSector(i8* %0, i32 %1) {
%3 = tail call i32 @div(i32 %1, i32 36)
%4 = shl i32 %3, 8
%5 = tail call i32 @mod(i32 %1, i32 18)
%6 = or i32 %4, %5
%7 = add nsw i32 %6, 1
%8 = tail call i32 @div(i32 %1, i32 18)
%9 = shl i32 %8, 8
%10 = and i32 %9, 256
%11 = tail call i32 @interrupt(i32 19, i32 513, i8* %0, i32 %7, i32 %10)
ret void
}
int main(void) {
#pragma acc parallel
  {
    int j = 0;
#pragma acc loop private(j)
    for (int i = 0; i < 10; i++)
      j++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    113a <main+0x3a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1119 <main+0x19>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void _Z37_Jv_FindClassFromSignatureNoExceptionPcPN4java4lang11ClassLoaderEPS_(
    void) {}


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

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

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

LLVM IR (-O2):
define void @_Z37_Jv_FindClassFromSignatureNoExceptionPcPN4java4lang11ClassLoaderEPS_() {
ret void
}
int clickplc_int16_enc(unsigned short number, unsigned char *stream2bytes) {
  int retval = 2;
  stream2bytes[0] = (unsigned char)(number >> 8);
  stream2bytes[1] = (unsigned char)(number & 0x00ff);
  return (retval);
}


x86 assembly (clang, -O0):
<clickplc_int16_enc>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
movzwl -0x2(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clickplc_int16_enc>:
rol    $0x8,%di
mov    %di,(%rsi)
mov    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @clickplc_int16_enc(i16 zeroext %0, i8* %1) {
%3 = alloca i16
%4 = alloca i8*
%5 = alloca i32
store i16 %0, i16* %3
store i8* %1, i8** %4
store i32 2, i32* %5
%6 = load i16, i16* %3
%7 = zext i16 %6 to i32
%8 = ashr i32 %7, 8
%9 = trunc i32 %8 to i8
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i64 0
store i8 %9, i8* %11
%12 = load i16, i16* %3
%13 = zext i16 %12 to i32
%14 = and i32 %13, 255
%15 = trunc i32 %14 to i8
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i64 1
store i8 %15, i8* %17
%18 = load i32, i32* %5
ret i32 %18
}

LLVM IR (-O2):
define i32 @clickplc_int16_enc(i16 zeroext %0, i8* nocapture writeonly %1) {
%3 = lshr i16 %0, 8
%4 = trunc i16 %3 to i8
store i8 %4, i8* %1
%5 = trunc i16 %0 to i8
%6 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %5, i8* %6
ret i32 2
}
/* Variables and functions */
char *make_scalar(char *, char *);
char *count(char *field) { return make_scalar("COUNT", field); }


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

x86 assembly (clang, -O2):
<count>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <make_scalar@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"COUNT\00"
define i8* @count(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @make_scalar(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i8* %4
}

LLVM IR (-O2):
@.str = [6 x i8] c"COUNT\00"
define i8* @count(i8* %0) {
%2 = tail call i8* @make_scalar(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int sm_reply_who(void *data, int len) {
  printf("online friend: %s\n", (char *)data);
  return 0;
}


x86 assembly (clang, -O0):
<sm_reply_who>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sm_reply_who>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"online friend: %s\0A\00"
define i32 @sm_reply_who(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 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"online friend: %s\0A\00"
define i32 @sm_reply_who(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
int ev_is_default_loop(struct ev_loop *loop) {
  extern struct ev_loop *ev_default_loop_ptr;
  return !!(loop == ev_default_loop_ptr);
}


x86 assembly (clang, -O0):
<ev_is_default_loop>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2ecd(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ev_is_default_loop>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
cmp    %rdi,(%rcx)
sete   %al
ret

LLVM IR (-O0):
%struct.ev_loop = type opaque
@ev_default_loop_ptr = external global %struct.ev_loop*
define i32 @ev_is_default_loop(%struct.ev_loop* %0) {
%2 = alloca %struct.ev_loop*
store %struct.ev_loop* %0, %struct.ev_loop** %2
%3 = load %struct.ev_loop*, %struct.ev_loop** %2
%4 = load %struct.ev_loop*, %struct.ev_loop** @ev_default_loop_ptr
%5 = icmp eq %struct.ev_loop* %3, %4
%6 = xor i1 %5, true
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
%struct.ev_loop = type opaque
@ev_default_loop_ptr = external global %struct.ev_loop*
define i32 @ev_is_default_loop(%struct.ev_loop* nocapture readnone %0) {
%2 = load %struct.ev_loop*, %struct.ev_loop** @ev_default_loop_ptr
%3 = icmp eq %struct.ev_loop* %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
unsigned char diffsw(unsigned char inputSW) {
  unsigned char prevSW, outputSW;
  outputSW = inputSW ^ prevSW;
  prevSW = inputSW;
  return outputSW;
}


x86 assembly (clang, -O0):
<diffsw>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0x3(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x2(%rbp)
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @diffsw(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %2
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = load i8, i8* %3
%8 = zext i8 %7 to i32
%9 = xor i32 %6, %8
%10 = trunc i32 %9 to i8
store i8 %10, i8* %4
%11 = load i8, i8* %2
store i8 %11, i8* %3
%12 = load i8, i8* %4
ret i8 %12
}

LLVM IR (-O2):
define zeroext i8 @diffsw(i8 zeroext %0) {
ret i8 0
}
void gtk_text_mark_get_visible() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_mark_get_visible() {
ret void
}
const char *str_leaf(const char *path) {
  const char *p;
  const char *leaf;
  char c;
  p = leaf = path;
  do {
    c = *p++;
    if (c == ':' || c == '.')
      leaf = p;
  } while (c >= ' ');
  return leaf;
}


x86 assembly (clang, -O0):
<str_leaf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x19(%rbp)
movsbl -0x19(%rbp),%eax
cmp    $0x3a,%eax
je     1142 <str_leaf+0x42>
movsbl -0x19(%rbp),%eax
cmp    $0x2e,%eax
jne    114a <str_leaf+0x4a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    114f <str_leaf+0x4f>
movsbl -0x19(%rbp),%eax
cmp    $0x20,%eax
jge    1114 <str_leaf+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_leaf>:
mov    %rdi,%rax
lea    0x1(%rdi),%rcx
jmp    111c <str_leaf+0x1c>
nopl   0x0(%rax)
mov    %rcx,%rax
add    $0x1,%rcx
cmp    $0x1f,%dl
jle    112c <str_leaf+0x2c>
movzbl -0x1(%rcx),%edx
cmp    $0x3a,%dl
je     1110 <str_leaf+0x10>
cmp    $0x2e,%dl
je     1110 <str_leaf+0x10>
jmp    1113 <str_leaf+0x13>
ret

LLVM IR (-O0):
define i8* @str_leaf(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
store i8* %0, i8** %2
%6 = load i8*, i8** %2
store i8* %6, i8** %4
store i8* %6, i8** %3
br label %7
7: ; preds = %21, %1
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %3
%10 = load i8, i8* %8
store i8 %10, i8* %5
%11 = load i8, i8* %5
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 58
br i1 %13, label %18, label %14
14: ; preds = %7
%15 = load i8, i8* %5
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 46
br i1 %17, label %18, label %20
18: ; preds = %14, %7
%19 = load i8*, i8** %3
store i8* %19, i8** %4
br label %20
20: ; preds = %18, %14
br label %21
21: ; preds = %20
%22 = load i8, i8* %5
%23 = sext i8 %22 to i32
%24 = icmp sge i32 %23, 32
br i1 %24, label %7, label %25
25: ; preds = %21
%26 = load i8*, i8** %4
ret i8* %26
}

LLVM IR (-O2):
define i8* @str_leaf(i8* %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %9, %8 ]
%4 = phi i8* [ %0, %1 ], [ %5, %8 ]
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %4
switch i8 %6, label %8 [
i8 58, label %7
i8 46, label %7
]
7: ; preds = %2, %2
br label %8
8: ; preds = %2, %7
%9 = phi i8* [ %5, %7 ], [ %3, %2 ]
%10 = icmp sgt i8 %6, 31
br i1 %10, label %2, label %11
11: ; preds = %8
ret i8* %9
}
/* Variables and functions */
double nn_kin();
int nn_num_particles();
double nn_pot();
double nn_energy() {
  const int n = nn_num_particles();
  const double pot = nn_pot();
  const double kin = nn_kin();
  return (kin - pot) / n;
}


x86 assembly (clang, -O0):
<nn_energy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1040 <nn_num_particles@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <nn_pot@plt>
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1050 <nn_kin@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nn_energy>:
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1040 <nn_num_particles@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <nn_pot@plt>
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1050 <nn_kin@plt>
subsd  0x8(%rsp),%xmm0
cvtsi2sd %ebx,%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @nn_energy() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = call i32 (...) @nn_num_particles()
store i32 %4, i32* %1
%5 = call double (...) @nn_pot()
store double %5, double* %2
%6 = call double (...) @nn_kin()
store double %6, double* %3
%7 = load double, double* %3
%8 = load double, double* %2
%9 = fsub double %7, %8
%10 = load i32, i32* %1
%11 = sitofp i32 %10 to double
%12 = fdiv double %9, %11
ret double %12
}

LLVM IR (-O2):
define double @nn_energy() {
%1 = tail call i32 (...) @nn_num_particles()
%2 = tail call double (...) @nn_pot()
%3 = tail call double (...) @nn_kin()
%4 = fsub double %3, %2
%5 = sitofp i32 %1 to double
%6 = fdiv double %4, %5
ret double %6
}
void dummy_free(void *ptr) { return; }


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

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

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

LLVM IR (-O2):
define void @dummy_free(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ send_command(int);
void SetColumn(unsigned int x) {
  send_command(0x10 | ((x >> 4) & 0x0F));
  send_command(0x00 | ((x >> 0) & 0x0F));
}


x86 assembly (clang, -O0):
<SetColumn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
shr    $0x4,%edi
and    $0xf,%edi
or     $0x10,%edi
call   1030 <send_command@plt>
mov    -0x4(%rbp),%edi
shr    $0x0,%edi
and    $0xf,%edi
or     $0x0,%edi
call   1030 <send_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetColumn>:
push   %rbx
mov    %edi,%ebx
shr    $0x4,%edi
and    $0xf,%edi
or     $0x10,%edi
call   1030 <send_command@plt>
and    $0xf,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <send_command@plt>

LLVM IR (-O0):
define void @SetColumn(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 4
%5 = and i32 %4, 15
%6 = or i32 16, %5
%7 = call i32 @send_command(i32 %6)
%8 = load i32, i32* %2
%9 = lshr i32 %8, 0
%10 = and i32 %9, 15
%11 = or i32 0, %10
%12 = call i32 @send_command(i32 %11)
ret void
}

LLVM IR (-O2):
define void @SetColumn(i32 %0) {
%2 = lshr i32 %0, 4
%3 = and i32 %2, 15
%4 = or i32 %3, 16
%5 = tail call i32 @send_command(i32 %4)
%6 = and i32 %0, 15
%7 = tail call i32 @send_command(i32 %6)
ret void
}
int test_imm_23int8_reg(signed char val) {
  return ((val) & (0x23 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_23int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x23,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_23int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 35
%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_23int8_reg(i8 signext %0) {
%2 = and i8 %0, 35
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}