xunge/DecIR huggingface dataset:
double longtodouble(l)
long l;
{
  if (l > 0)
    return ((double)l);
  else if (l < 0)
    return ((double)(l & 0x7fffffff) + 2147483648.0);
  else
    return (4294967296.0);
}


x86 assembly (clang, -O0):
<longtodouble>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jle    1123 <longtodouble+0x23>
cvtsi2sdq -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1160 <longtodouble+0x60>
cmpq   $0x0,-0x10(%rbp)
jge    1153 <longtodouble+0x53>
mov    -0x10(%rbp),%rax
and    $0x7fffffff,%rax
cvtsi2sd %rax,%xmm0
movsd  0xec3(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1160 <longtodouble+0x60>
movsd  0xea5(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<longtodouble>:
test   %rdi,%rdi
jle    110b <longtodouble+0xb>
cvtsi2sd %rdi,%xmm0
ret
js     1116 <longtodouble+0x16>
movsd  0xeeb(%rip),%xmm0
ret
and    $0x7fffffff,%edi
cvtsi2sd %edi,%xmm0
addsd  0xee0(%rip),%xmm0
ret

LLVM IR (-O0):
define double @longtodouble(i64 %0) {
%2 = alloca double
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp sgt i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i64, i64* %3
%8 = sitofp i64 %7 to double
store double %8, double* %2
br label %18
9: ; preds = %1
%10 = load i64, i64* %3
%11 = icmp slt i64 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %9
%13 = load i64, i64* %3
%14 = and i64 %13, 2147483647
%15 = sitofp i64 %14 to double
%16 = fadd double %15, 0x41E0000000000000
store double %16, double* %2
br label %18
17: ; preds = %9
store double 0x41F0000000000000, double* %2
br label %18
18: ; preds = %17, %12, %6
%19 = load double, double* %2
ret double %19
}

LLVM IR (-O2):
define double @longtodouble(i64 %0) {
%2 = icmp sgt i64 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = sitofp i64 %0 to double
br label %11
5: ; preds = %1
%6 = icmp slt i64 %0, 0
br i1 %6, label %7, label %11
7: ; preds = %5
%8 = and i64 %0, 2147483647
%9 = sitofp i64 %8 to double
%10 = fadd double %9, 0x41E0000000000000
br label %11
11: ; preds = %5, %7, %3
%12 = phi double [ %4, %3 ], [ %10, %7 ], [ 0x41F0000000000000, %5 ]
ret double %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int div_two(int n) {
  printf("%d\n", n / 2);
  return 0;
}


x86 assembly (clang, -O0):
<div_two>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<div_two>:
push   %rax
mov    %edi,%esi
shr    $0x1f,%esi
add    %edi,%esi
sar    %esi
lea    0xedf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @div_two(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 2
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @div_two(i32 %0) {
%2 = sdiv i32 %0, 2
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Variables and functions */
int BinomialCoefficient(int, int);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", BinomialCoefficient(13, 9));
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd,%edi
mov    $0x9,%esi
call   1050 <BinomialCoefficient@plt>
mov    %eax,%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xd,%edi
mov    $0x9,%esi
call   1050 <BinomialCoefficient@plt>
lea    0xeb9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = call i32 @BinomialCoefficient(i32 13, i32 9)
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @BinomialCoefficient(i32 13, i32 9)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int snprintf(char *, size_t, char *, unsigned char, unsigned char);
int print_url_encoded_char(char *out, size_t n, unsigned char c) {
  return snprintf(out, n, "%%%1X%1X", (c >> 4), (c & 0xF));
}


x86 assembly (clang, -O0):
<print_url_encoded_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movzbl -0x11(%rbp),%eax
sar    $0x4,%eax
mov    %al,%cl
movzbl -0x11(%rbp),%eax
and    $0xf,%eax
lea    0xebc(%rip),%rdx
movzbl %cl,%ecx
movzbl %al,%r8d
call   1030 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_url_encoded_char>:
mov    %edx,%r8d
mov    %r8d,%eax
shr    $0x4,%al
and    $0xf,%r8d
movzbl %al,%ecx
lea    0xed9(%rip),%rdx
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"%%%1X%1X\00"
define i32 @print_url_encoded_char(i8* %0, i64 %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8 %2, i8* %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = load i8, i8* %6
%10 = zext i8 %9 to i32
%11 = ashr i32 %10, 4
%12 = trunc i32 %11 to i8
%13 = load i8, i8* %6
%14 = zext i8 %13 to i32
%15 = and i32 %14, 15
%16 = trunc i32 %15 to i8
%17 = call i32 @snprintf(i8* %7, i64 %8, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8 zeroext %12, i8 zeroext %16)
ret i32 %17
}

LLVM IR (-O2):
@.str = [9 x i8] c"%%%1X%1X\00"
define i32 @print_url_encoded_char(i8* %0, i64 %1, i8 zeroext %2) {
%4 = lshr i8 %2, 4
%5 = and i8 %2, 15
%6 = tail call i32 @snprintf(i8* %0, i64 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8 zeroext %4, i8 zeroext %5)
ret i32 %6
}
int snd_hdac_get_display_clk(struct hdac_bus *bus) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.hdac_bus = type opaque
define i32 @snd_hdac_get_display_clk(%struct.hdac_bus* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMRE9_set(void) { return U_WMRCORENONE_set("U_WMRE9"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRE9\00"
define i8* @U_WMRE9_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRE9\00"
define i8* @U_WMRE9_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
char *longestCommonPrefix(char **, int);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char const *argv[]) {
  char *s[] = {"", ""};
  printf("%s\n", longestCommonPrefix(s, 1));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2cd3(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2cd0(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x1,%esi
call   1030 <longestCommonPrefix@plt>
mov    %rax,%rsi
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0x2ce5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x1,%esi
call   1030 <longestCommonPrefix@plt>
lea    0xebd(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@__const.main.s = [2 x i8*] [i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i32 0, i32 0)]
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [2 x i8*]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [2 x i8*]* %6 to i8*
%8 = getelementptr inbounds [2 x i8*], [2 x i8*]* %6, i64 0, i64 0
%9 = call i8* @longestCommonPrefix(i8** %8, i32 1)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@__const.main.s = [2 x i8*] [i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i32 0, i32 0)]
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [2 x i8*]
%4 = bitcast [2 x i8*]* %3 to i8*
%5 = getelementptr inbounds [2 x i8*], [2 x i8*]* %3, i64 0, i64 0
%6 = call i8* @longestCommonPrefix(i8** %5, i32 1)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret i32 0
}
/* Type definitions */
struct idle_task {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ idle_body(struct idle_task *);
void *idle_function(void *it) {
  idle_body((struct idle_task *)it);
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.idle_task = type { i32 }
define i8* @idle_function(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.idle_task*
%5 = call i32 @idle_body(%struct.idle_task* %4)
ret i8* null
}

LLVM IR (-O2):
%struct.idle_task = type { i32 }
define noalias i8* @idle_function(i8* %0) {
%2 = bitcast i8* %0 to %struct.idle_task*
%3 = tail call i32 @idle_body(%struct.idle_task* %2)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ net_send(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *, char *, char *);
void irc_ban(char *channel, char *mask) {
  char msg[(512 - 3)];
  snprintf(msg, (512 - 3), "%s %s +b %s", "MODE", channel, mask);
  net_send(msg);
}


x86 assembly (clang, -O0):
<irc_ban>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x8(%rbp),%r8
mov    -0x10(%rbp),%r9
mov    $0x1fd,%esi
lea    0xeb2(%rip),%rdx
lea    0xeb7(%rip),%rcx
call   1030 <snprintf@plt>
lea    -0x210(%rbp),%rdi
call   1040 <net_send@plt>
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_ban>:
push   %rbx
sub    $0x200,%rsp
mov    %rsi,%r9
mov    %rdi,%r8
lea    0xecb(%rip),%rdx
lea    0xed0(%rip),%rcx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1fd,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <net_send@plt>
add    $0x200,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"%s %s +b %s\00"
@.str.1 = [5 x i8] c"MODE\00"
define void @irc_ban(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [509 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [509 x i8], [509 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @snprintf(i8* %6, i32 509, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %7, i8* %8)
%10 = getelementptr inbounds [509 x i8], [509 x i8]* %5, i64 0, i64 0
%11 = call i32 @net_send(i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"%s %s +b %s\00"
@.str.1 = [5 x i8] c"MODE\00"
define void @irc_ban(i8* %0, i8* %1) {
%3 = alloca [509 x i8]
%4 = getelementptr inbounds [509 x i8], [509 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 509, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %1)
%6 = call i32 @net_send(i8* %4)
ret void
}
void pointers_basics() {
  printf("POINTERS BASICS \n");
  int foo = 5;
  int *foo_ptr = &foo;
  printf("%d = %d\n", foo, *foo_ptr);
  printf("%d\n", foo_ptr);
  printf("--------\n\n\n");
}


x86 assembly (clang, -O0):
<pointers_basics>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x5,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pointers_basics>:
push   %rax
lea    0xee1(%rip),%rdi
call   1030 <puts@plt>
movl   $0x5,0x4(%rsp)
lea    0xec4(%rip),%rdi
mov    $0x5,%esi
mov    $0x5,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb1(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb3(%rip),%rdi
call   1030 <puts@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [18 x i8] c"POINTERS BASICS \0A\00"
@.str.1 = [9 x i8] c"%d = %d\0A\00"
@.str.2 = [4 x i8] c"%d\0A\00"
@.str.3 = [12 x i8] c"--------\0A\0A\0A\00"
define void @pointers_basics() {
%1 = alloca i32
%2 = alloca i32*
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
store i32 5, i32* %1
store i32* %1, i32** %2
%4 = load i32, i32* %1
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %4, i32 %6)
%8 = load i32*, i32** %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32* %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [9 x i8] c"%d = %d\0A\00"
@.str.2 = [4 x i8] c"%d\0A\00"
@str = [17 x i8] c"POINTERS BASICS \00"
@str.4 = [11 x i8] c"--------\0A\0A\00"
define void @pointers_basics() {
%1 = alloca i32
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%3 = bitcast i32* %1 to i8*
store i32 5, i32* %1
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 5, i32 5)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.4, i64 0, i64 0))
ret void
}
int internal(void) { return 77; }


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

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

LLVM IR (-O0):
define i32 @internal() {
ret i32 77
}

LLVM IR (-O2):
define i32 @internal() {
ret i32 77
}
/* Variables and functions */
int bbm_data(void *, unsigned short, unsigned char *, unsigned int);
int bbm_com_data(void *handle, unsigned short addr, unsigned char *data,
                 unsigned int size) {
  int res;
  res = bbm_data(handle, addr, data, size);
  return res;
}


x86 assembly (clang, -O0):
<bbm_com_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xa(%rbp),%ax
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
movzwl %ax,%esi
call   1030 <bbm_data@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bbm_com_data>:
jmp    1030 <bbm_data@plt>

LLVM IR (-O0):
define i32 @bbm_com_data(i8* %0, i16 zeroext %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i16
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
store i8* %0, i8** %5
store i16 %1, i16* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = load i8*, i8** %5
%11 = load i16, i16* %6
%12 = load i8*, i8** %7
%13 = load i32, i32* %8
%14 = call i32 @bbm_data(i8* %10, i16 zeroext %11, i8* %12, i32 %13)
store i32 %14, i32* %9
%15 = load i32, i32* %9
ret i32 %15
}

LLVM IR (-O2):
define i32 @bbm_com_data(i8* %0, i16 zeroext %1, i8* %2, i32 %3) {
%5 = tail call i32 @bbm_data(i8* %0, i16 zeroext %1, i8* %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
int __data20_read_short(unsigned long);
int /*<<< orphan*/ __disable_interrupt();
int /*<<< orphan*/ __enable_interrupt();
int flash_rb(unsigned long address) {
  int ret;
  __disable_interrupt();
  ret = __data20_read_short(address);
  __enable_interrupt();
  return ret;
}


x86 assembly (clang, -O0):
<flash_rb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__disable_interrupt@plt>
mov    -0x8(%rbp),%rdi
call   1050 <__data20_read_short@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1040 <__enable_interrupt@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flash_rb>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <__disable_interrupt@plt>
mov    %rbx,%rdi
call   1050 <__data20_read_short@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <__enable_interrupt@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @flash_rb(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
%4 = call i32 (...) @__disable_interrupt()
%5 = load i64, i64* %2
%6 = call i32 @__data20_read_short(i64 %5)
store i32 %6, i32* %3
%7 = call i32 (...) @__enable_interrupt()
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @flash_rb(i64 %0) {
%2 = tail call i32 (...) @__disable_interrupt()
%3 = tail call i32 @__data20_read_short(i64 %0)
%4 = tail call i32 (...) @__enable_interrupt()
ret i32 %3
}
/* Variables and functions */
int EINVAL;
int pushpull_width(int pp) {
  pp &= 0xf;
  if (pp == 0)
    return -EINVAL;
  return 2 << pp;
}


x86 assembly (clang, -O0):
<pushpull_width>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xf,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    112d <pushpull_width+0x2d>
xor    %eax,%eax
mov    0x2ebd(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    113a <pushpull_width+0x3a>
mov    -0x8(%rbp),%ecx
mov    $0x2,%eax
shl    %cl,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pushpull_width>:
mov    %edi,%ecx
and    $0xf,%ecx
mov    0x2ed4(%rip),%rax
xor    %edx,%edx
sub    (%rax),%edx
mov    $0x2,%eax
shl    %cl,%eax
test   %ecx,%ecx
cmove  %edx,%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @pushpull_width(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = and i32 %4, 15
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32, i32* @EINVAL
%10 = sub nsw i32 0, %9
store i32 %10, i32* %2
br label %14
11: ; preds = %1
%12 = load i32, i32* %3
%13 = shl i32 2, %12
store i32 %13, i32* %2
br label %14
14: ; preds = %11, %8
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @pushpull_width(i32 %0) {
%2 = and i32 %0, 15
%3 = icmp eq i32 %2, 0
%4 = load i32, i32* @EINVAL
%5 = sub nsw i32 0, %4
%6 = shl nuw nsw i32 2, %2
%7 = select i1 %3, i32 %5, i32 %6
ret i32 %7
}
void foo311() {}


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

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

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

LLVM IR (-O2):
define void @foo311() {
ret void
}
int getdword(char *p) { return (((*p & 0xFF) | (*(p + 1) << 8)) & 0xFFFF); }


x86 assembly (clang, -O0):
<getdword>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
and    $0xff,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
and    $0xffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getdword>:
movzbl (%rdi),%ecx
movzbl 0x1(%rdi),%eax
shl    $0x8,%eax
movzwl %ax,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @getdword(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, 255
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = or i32 %6, %11
%13 = and i32 %12, 65535
ret i32 %13
}

LLVM IR (-O2):
define i32 @getdword(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = shl nsw i32 %6, 8
%8 = and i32 %7, 65280
%9 = or i32 %8, %3
ret i32 %9
}
double B01(double t) {
  double tmp = 1.0 - t;
  return tmp * tmp * (tmp + 3 * t);
}


x86 assembly (clang, -O0):
<B01>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
movsd  0xec9(%rip),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<B01>:
movsd  0xef8(%rip),%xmm1
subsd  %xmm0,%xmm1
mulsd  0xef4(%rip),%xmm0
addsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @B01(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fsub double 1.000000e+00, %4
store double %5, double* %3
%6 = load double, double* %3
%7 = load double, double* %3
%8 = fmul double %6, %7
%9 = load double, double* %3
%10 = load double, double* %2
%11 = call double @llvm.fmuladd.f64(double 3.000000e+00, double %10, double %9)
%12 = fmul double %8, %11
ret double %12
}

LLVM IR (-O2):
define double @B01(double %0) {
%2 = fsub double 1.000000e+00, %0
%3 = fmul double %2, %2
%4 = tail call double @llvm.fmuladd.f64(double %0, double 3.000000e+00, double %2)
%5 = fmul double %3, %4
ret double %5
}
/* Variables and functions */
int chaz_HeadCheck_check_header(char const *);
int chaz_Headers_check(const char *header_name) {
  return chaz_HeadCheck_check_header(header_name);
}


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

x86 assembly (clang, -O2):
<chaz_Headers_check>:
jmp    1030 <chaz_HeadCheck_check_header@plt>

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

LLVM IR (-O2):
define i32 @chaz_Headers_check(i8* %0) {
%2 = tail call i32 @chaz_HeadCheck_check_header(i8* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fputs(char *, int /*<<< orphan*/ *);
int fputws(const wchar_t *s, FILE *stream) { return fputs((char *)s, stream); }


x86 assembly (clang, -O0):
<fputws>:
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   1030 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fputws>:
jmp    1030 <fputs@plt>

LLVM IR (-O0):
define i32 @fputws(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 = bitcast i32* %5 to i8*
%7 = load i32*, i32** %4
%8 = call i32 @fputs(i8* %6, i32* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @fputws(i32* nocapture %0, i32* nocapture %1) {
%3 = bitcast i32* %0 to i8*
%4 = tail call i32 @fputs(i8* %3, i32* %1)
ret i32 %4
}
unsigned __rthal_do_div(unsigned long long *a, unsigned d) {
  unsigned r = *a % d;
  *a /= d;
  return r;
}


x86 assembly (clang, -O0):
<__rthal_do_div>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0xc(%rbp),%ecx
xor    %edx,%edx
div    %rcx
mov    %edx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    (%rax),%rax
xor    %edx,%edx
div    %rcx
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__rthal_do_div>:
mov    (%rdi),%rax
mov    %esi,%ecx
mov    %rax,%rdx
shr    $0x20,%rdx
je     1115 <__rthal_do_div+0x15>
xor    %edx,%edx
div    %rcx
jmp    1119 <__rthal_do_div+0x19>
xor    %edx,%edx
div    %ecx
mov    %rax,(%rdi)
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @__rthal_do_div(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
%5 = alloca i32
store i64* %0, i64** %3
store i32 %1, i32* %4
%6 = load i64*, i64** %3
%7 = load i64, i64* %6
%8 = load i32, i32* %4
%9 = zext i32 %8 to i64
%10 = urem i64 %7, %9
%11 = trunc i64 %10 to i32
store i32 %11, i32* %5
%12 = load i32, i32* %4
%13 = zext i32 %12 to i64
%14 = load i64*, i64** %3
%15 = load i64, i64* %14
%16 = udiv i64 %15, %13
store i64 %16, i64* %14
%17 = load i32, i32* %5
ret i32 %17
}

LLVM IR (-O2):
define i32 @__rthal_do_div(i64* nocapture %0, i32 %1) {
%3 = load i64, i64* %0
%4 = zext i32 %1 to i64
%5 = urem i64 %3, %4
%6 = trunc i64 %5 to i32
%7 = udiv i64 %3, %4
store i64 %7, i64* %0
ret i32 %6
}
/* Variables and functions */
double incomgam(double, double);
double errorfun(double x) {
  return (x >= 0.0) ? incomgam(0.5, x * x) : -incomgam(0.5, x * x);
}


x86 assembly (clang, -O0):
<errorfun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1150 <errorfun+0x40>
movsd  -0x8(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  0xebf(%rip),%xmm0
call   1030 <incomgam@plt>
movsd  %xmm0,-0x10(%rbp)
jmp    1183 <errorfun+0x73>
movsd  -0x8(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  0xe9e(%rip),%xmm0
call   1030 <incomgam@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<errorfun>:
push   %rax
movsd  %xmm0,(%rsp)
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  0xeda(%rip),%xmm0
call   1030 <incomgam@plt>
movapd 0xedd(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm1,%xmm1
cmpnlesd (%rsp),%xmm1
movapd %xmm1,%xmm3
andnpd %xmm0,%xmm3
andpd  %xmm2,%xmm1
orpd   %xmm3,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @errorfun(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oge double %3, 0.000000e+00
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load double, double* %2
%7 = load double, double* %2
%8 = fmul double %6, %7
%9 = call double @incomgam(double 5.000000e-01, double %8)
br label %16
10: ; preds = %1
%11 = load double, double* %2
%12 = load double, double* %2
%13 = fmul double %11, %12
%14 = call double @incomgam(double 5.000000e-01, double %13)
%15 = fneg double %14
br label %16
16: ; preds = %10, %5
%17 = phi double [ %9, %5 ], [ %15, %10 ]
ret double %17
}

LLVM IR (-O2):
define double @errorfun(double %0) {
%2 = fcmp ult double %0, 0.000000e+00
%3 = fmul double %0, %0
%4 = tail call double @incomgam(double 5.000000e-01, double %3)
%5 = fneg double %4
%6 = select i1 %2, double %5, double %4
ret double %6
}
neg_lhs(int i) { return i << 1; }


x86 assembly (clang, -O0):
<neg_lhs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<neg_lhs>:
lea    (%rdi,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @neg_lhs(i32 %0) {
%2 = shl i32 %0, 1
ret i32 %2
}
void SNDDMA_Activate(void) {}


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

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

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

LLVM IR (-O2):
define void @SNDDMA_Activate() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void mov_reg64_preg64preg64(int reg1, int reg2, int reg3) {
  put8(0x48);
  put8(0x8B);
  put8((reg1 << 3) | 0x04);
  put8(reg2 | (reg3 << 3));
}


x86 assembly (clang, -O0):
<mov_reg64_preg64preg64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x48,%edi
call   1030 <put8@plt>
mov    $0x8b,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
or     $0x4,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%eax
shl    $0x3,%eax
or     %eax,%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mov_reg64_preg64preg64>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%r14d
mov    %edi,%ebp
mov    $0x48,%edi
call   1030 <put8@plt>
mov    $0x8b,%edi
call   1030 <put8@plt>
lea    0x4(,%rbp,8),%edi
call   1030 <put8@plt>
shl    $0x3,%ebx
or     %r14d,%ebx
mov    %ebx,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @mov_reg64_preg64preg64(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = call i32 @put8(i32 72)
%8 = call i32 @put8(i32 139)
%9 = load i32, i32* %4
%10 = shl i32 %9, 3
%11 = or i32 %10, 4
%12 = call i32 @put8(i32 %11)
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = shl i32 %14, 3
%16 = or i32 %13, %15
%17 = call i32 @put8(i32 %16)
ret void
}

LLVM IR (-O2):
define void @mov_reg64_preg64preg64(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @put8(i32 72)
%5 = tail call i32 @put8(i32 139)
%6 = shl i32 %0, 3
%7 = or i32 %6, 4
%8 = tail call i32 @put8(i32 %7)
%9 = shl i32 %2, 3
%10 = or i32 %9, %1
%11 = tail call i32 @put8(i32 %10)
ret void
}
void CONF_dump_fp(void) {}


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

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

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

LLVM IR (-O2):
define void @CONF_dump_fp() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void f2(void) {
  printf("vamos brincar de bit-a-bit\n");
  if (80 ^ 91) {
    printf("Hello world\n");
  } else {
    printf("Goodbye world\n");
  }
  if (69 ^ 69) {
    printf("%d\n", 87 ^ 9);
  } else {
    printf("%d\n", 17 ^ 17);
  }
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef2(%rip),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
push   %rax
lea    0xedc(%rip),%rdi
call   1030 <puts@plt>
lea    0xeeb(%rip),%rdi
call   1030 <puts@plt>
lea    0xec0(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
pop    %rcx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"vamos brincar de bit-a-bit\0A\00"
@.str.1 = [13 x i8] c"Hello world\0A\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define void @f2() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str.2 = [4 x i8] c"%d\0A\00"
@str = [27 x i8] c"vamos brincar de bit-a-bit\00"
@str.3 = [12 x i8] c"Hello world\00"
define void @f2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 0)
ret void
}
int cmpatom(const void *x, const void *y) { return x != y; }


x86 assembly (clang, -O0):
<cmpatom>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmpatom>:
xor    %eax,%eax
cmp    %rsi,%rdi
setne  %al
ret

LLVM IR (-O0):
define i32 @cmpatom(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = icmp ne i8* %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @cmpatom(i8* readnone %0, i8* readnone %1) {
%3 = icmp ne i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int mode_t;

/* Variables and functions */
int S_IRGRP;
int S_IROTH;
int S_IRUSR;
int S_IWUSR;
int S_IXGRP;
int S_IXOTH;
int S_IXUSR;
mode_t fix_mode(mode_t mode) {
  mode_t new_mode;
  new_mode =
      mode &
      ((S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH));
  return (new_mode);
}


x86 assembly (clang, -O0):
<fix_mode>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2e9f(%rip),%rcx
mov    (%rcx),%ecx
mov    0x2ebe(%rip),%rdx
or     (%rdx),%ecx
mov    0x2ebd(%rip),%rdx
or     (%rdx),%ecx
mov    0x2e94(%rip),%rdx
or     (%rdx),%ecx
mov    0x2e9b(%rip),%rdx
or     (%rdx),%ecx
mov    0x2e7a(%rip),%rdx
or     (%rdx),%ecx
mov    0x2ea1(%rip),%rdx
or     (%rdx),%ecx
and    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fix_mode>:
mov    0x2ea9(%rip),%rcx
mov    0x2eca(%rip),%rax
mov    (%rax),%eax
or     (%rcx),%eax
mov    0x2ec7(%rip),%rcx
or     (%rcx),%eax
mov    0x2e9e(%rip),%rcx
or     (%rcx),%eax
mov    0x2ea5(%rip),%rcx
or     (%rcx),%eax
mov    0x2e84(%rip),%rcx
or     (%rcx),%eax
mov    0x2eab(%rip),%rcx
or     (%rcx),%eax
and    %edi,%eax
ret

LLVM IR (-O0):
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@S_IXUSR = global i32 0
@S_IRGRP = global i32 0
@S_IXGRP = global i32 0
@S_IROTH = global i32 0
@S_IXOTH = global i32 0
define i32 @fix_mode(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @S_IRUSR
%6 = load i32, i32* @S_IWUSR
%7 = or i32 %5, %6
%8 = load i32, i32* @S_IXUSR
%9 = or i32 %7, %8
%10 = load i32, i32* @S_IRGRP
%11 = or i32 %9, %10
%12 = load i32, i32* @S_IXGRP
%13 = or i32 %11, %12
%14 = load i32, i32* @S_IROTH
%15 = or i32 %13, %14
%16 = load i32, i32* @S_IXOTH
%17 = or i32 %15, %16
%18 = and i32 %4, %17
store i32 %18, i32* %3
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@S_IXUSR = global i32 0
@S_IRGRP = global i32 0
@S_IXGRP = global i32 0
@S_IROTH = global i32 0
@S_IXOTH = global i32 0
define i32 @fix_mode(i32 %0) {
%2 = load i32, i32* @S_IRUSR
%3 = load i32, i32* @S_IWUSR
%4 = or i32 %3, %2
%5 = load i32, i32* @S_IXUSR
%6 = or i32 %4, %5
%7 = load i32, i32* @S_IRGRP
%8 = or i32 %6, %7
%9 = load i32, i32* @S_IXGRP
%10 = or i32 %8, %9
%11 = load i32, i32* @S_IROTH
%12 = or i32 %10, %11
%13 = load i32, i32* @S_IXOTH
%14 = or i32 %12, %13
%15 = and i32 %14, %0
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main(int argc, char *argv[]) {
  system("cat /flag");
  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)
lea    0xed3(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"cat /flag\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 = call i32 @system(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"cat /flag\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @system(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int y;
};
typedef TYPE_1__ XEnterWindowEvent;

/* Variables and functions */
void set_XEnterWindowEvent_y(void *_p, int _v) {
  ((XEnterWindowEvent *)_p)->y = (int)_v;
}


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

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

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

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


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @ARGBToI400() {
ret void
}
unsigned int cfb16_get_color(unsigned int color) {
  unsigned int r, g, b;
  r = (color >> 16) & 0xff;
  g = (color >> 8) & 0xff;
  b = (color)&0xff;
  return ((((r) >> 3) << 11) | (((g) >> 2) << 5) | ((b) >> 3));
}


x86 assembly (clang, -O0):
<cfb16_get_color>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
and    $0xff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x3,%eax
shl    $0xb,%eax
mov    -0xc(%rbp),%ecx
shr    $0x2,%ecx
shl    $0x5,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
shr    $0x3,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cfb16_get_color>:
mov    %edi,%ecx
shr    $0x8,%ecx
and    $0xf800,%ecx
mov    %edi,%eax
shr    $0x5,%eax
and    $0x7e0,%eax
or     %ecx,%eax
shr    $0x3,%edi
and    $0x1f,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @cfb16_get_color(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = lshr i32 %6, 16
%8 = and i32 %7, 255
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = lshr i32 %9, 8
%11 = and i32 %10, 255
store i32 %11, i32* %4
%12 = load i32, i32* %2
%13 = and i32 %12, 255
store i32 %13, i32* %5
%14 = load i32, i32* %3
%15 = lshr i32 %14, 3
%16 = shl i32 %15, 11
%17 = load i32, i32* %4
%18 = lshr i32 %17, 2
%19 = shl i32 %18, 5
%20 = or i32 %16, %19
%21 = load i32, i32* %5
%22 = lshr i32 %21, 3
%23 = or i32 %20, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @cfb16_get_color(i32 %0) {
%2 = lshr i32 %0, 8
%3 = and i32 %2, 63488
%4 = lshr i32 %0, 5
%5 = and i32 %4, 2016
%6 = or i32 %3, %5
%7 = lshr i32 %0, 3
%8 = and i32 %7, 31
%9 = or i32 %6, %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("hello world\n"); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"hello world\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"hello world\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int is_num(const char c) {
  if (c >= '0' && c <= '9')
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<is_num>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1130 <is_num+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1130 <is_num+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1137 <is_num+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @is_num(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, 48
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %13
12: ; preds = %7, %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @is_num(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ strncmp(char *, char *, int);
int is_command_ack(char *command) {
  return command != NULL && strncmp(command, "ACK", 3) == 0;
}


x86 assembly (clang, -O0):
<is_command_ack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     114b <is_command_ack+0x3b>
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_command_ack>:
test   %rdi,%rdi
je     1137 <is_command_ack+0x27>
push   %rax
lea    0xee3(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"ACK\00"
define i32 @is_command_ack(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i64 @strncmp(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%8 = icmp eq i64 %7, 0
br label %9
9: ; preds = %5, %1
%10 = phi i1 [ false, %1 ], [ %8, %5 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
@.str = [4 x i8] c"ACK\00"
define i32 @is_command_ack(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
long long_double_from_i32(int);
int main(void) {
  assert(long_double_from_i32(42) == 42.L);
  assert(long_double_from_i32(-42) == -42.L);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2a,%edi
call   1040 <long_double_from_i32@plt>
mov    %rax,-0x10(%rbp)
fildll -0x10(%rbp)
flds   0xec1(%rip)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setnp  %cl
sete   %al
and    %cl,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0xffffffd6,%edi
call   1040 <long_double_from_i32@plt>
mov    %rax,-0x8(%rbp)
fildll -0x8(%rbp)
flds   0xe98(%rip)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setnp  %cl
sete   %al
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2a,%edi
call   1040 <long_double_from_i32@plt>
xor    %edi,%edi
cmp    $0x2a,%rax
sete   %dil
call   1030 <assert@plt>
mov    $0xffffffd6,%edi
call   1040 <long_double_from_i32@plt>
xor    %edi,%edi
cmp    $0xffffffffffffffd6,%rax
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i64 @long_double_from_i32(i32 42)
%2 = sitofp i64 %1 to x86_fp80
%3 = fcmp oeq x86_fp80 %2, 0xK4004A800000000000000
%4 = zext i1 %3 to i32
%5 = call i32 @assert(i32 %4)
%6 = call i64 @long_double_from_i32(i32 -42)
%7 = sitofp i64 %6 to x86_fp80
%8 = fcmp oeq x86_fp80 %7, 0xKC004A800000000000000
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @long_double_from_i32(i32 42)
%2 = icmp eq i64 %1, 42
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i64 @long_double_from_i32(i32 -42)
%6 = icmp eq i64 %5, -42
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
ret i32 0
}
extern void libvampsdk_v_2_1_present(void) {}


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

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

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

LLVM IR (-O2):
define void @libvampsdk_v_2_1_present() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _Block_object_assign(char *, void *, int);
void __Block_byref_id_object_copy_131(void *dst, void *src) {
  _Block_object_assign((char *)dst + 40, *(void **)((char *)src + 40), 131);
}


x86 assembly (clang, -O0):
<__Block_byref_id_object_copy_131>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x28,%rdi
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rsi
mov    $0x83,%edx
call   1030 <_Block_object_assign@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__Block_byref_id_object_copy_131>:
add    $0x28,%rdi
mov    0x28(%rsi),%rsi
mov    $0x83,%edx
jmp    1030 <_Block_object_assign@plt>

LLVM IR (-O0):
define void @__Block_byref_id_object_copy_131(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 40
%7 = load i8*, i8** %4
%8 = getelementptr inbounds i8, i8* %7, i64 40
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @_Block_object_assign(i8* %6, i8* %10, i32 131)
ret void
}

LLVM IR (-O2):
define void @__Block_byref_id_object_copy_131(i8* %0, i8* nocapture %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 40
%4 = getelementptr inbounds i8, i8* %1, i64 40
%5 = bitcast i8* %4 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @_Block_object_assign(i8* %3, i8* %6, i32 131)
ret void
}