xunge/DecIR huggingface dataset:
unsigned xrop3_127_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = T & S;
  stk1 = D & stk2;
  stk1 = ~stk1;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_127_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_127_1_1>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
or     %ecx,%eax
not    %eax
or     %edi,%esi
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_127_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %7
%23 = load i32, i32* %6
%24 = and i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %5
%26 = load i32, i32* %9
%27 = and i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = xor i32 %28, -1
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = load i32, i32* %6
%32 = xor i32 %31, -1
%33 = and i32 %30, %32
%34 = load i32, i32* %7
%35 = xor i32 %34, -1
%36 = and i32 %33, %35
%37 = load i32, i32* %5
%38 = load i32, i32* %6
%39 = and i32 %37, %38
%40 = or i32 %36, %39
%41 = load i32, i32* %5
%42 = load i32, i32* %7
%43 = and i32 %41, %42
%44 = or i32 %40, %43
ret i32 %44
}

LLVM IR (-O2):
define i32 @xrop3_127_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = or i32 %6, %4
%8 = xor i32 %7, -1
%9 = or i8 %1, %0
%10 = zext i8 %9 to i32
%11 = or i32 %10, %8
ret i32 %11
}
int com_list(char *arg) {
  if (!arg)
    arg = "";
  return (0);
}


x86 assembly (clang, -O0):
<com_list>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    111e <com_list+0x1e>
lea    0xee6(%rip),%rax
mov    %rax,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @com_list(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 %6, label %5
5: ; preds = %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %2
br label %6
6: ; preds = %5, %1
ret i32 0
}

LLVM IR (-O2):
define i32 @com_list(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int CLOCKS_PER_SEC;
int clock();
int cpspc_time(void) { return clock() * 1000 / CLOCKS_PER_SEC; }


x86 assembly (clang, -O0):
<cpspc_time>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <clock@plt>
imul   $0x3e8,%eax,%eax
mov    0x2ec0(%rip),%rcx
cltd
idivl  (%rcx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpspc_time>:
push   %rax
xor    %eax,%eax
call   1030 <clock@plt>
imul   $0x3e8,%eax,%eax
mov    0x2ec3(%rip),%rcx
cltd
idivl  (%rcx)
pop    %rcx
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global i32 0
define i32 @cpspc_time() {
%1 = call i32 (...) @clock()
%2 = mul nsw i32 %1, 1000
%3 = load i32, i32* @CLOCKS_PER_SEC
%4 = sdiv i32 %2, %3
ret i32 %4
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global i32 0
define i32 @cpspc_time() {
%1 = tail call i32 (...) @clock()
%2 = mul nsw i32 %1, 1000
%3 = load i32, i32* @CLOCKS_PER_SEC
%4 = sdiv i32 %2, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  unsigned long top;
  printf("value to reach true branch: %ld\n", (-1 / (8 * sizeof(int))));
  if (top == (-1 / (8 * sizeof(int)))) {
    assert(1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0xffffffff,%esi
call   1030 <printf@plt>
movabs $0x7ffffffffffffff,%rax
ff ff 07
cmp    %rax,-0x10(%rbp)
jne    115e <main+0x3e>
mov    $0x1,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [33 x i8] c"value to reach true branch: %ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 -1)
%4 = load i64, i64* %2
%5 = icmp eq i64 %4, 576460752303423487
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @assert(i32 1)
br label %8
8: ; preds = %6, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"value to reach true branch: %ld\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 -1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ kputc(unsigned int, int /*<<< orphan*/);
void kputs(unsigned cap, char *s) {
  while (*s) {
    kputc(cap, *s++);
  }
}


x86 assembly (clang, -O0):
<kputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114b <kputs+0x3b>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%esi
call   1030 <kputc@plt>
jmp    111f <kputs+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kputs>:
push   %rbp
push   %rbx
push   %rax
mov    (%rsi),%al
test   %al,%al
je     1145 <kputs+0x35>
mov    %rsi,%rbx
mov    %edi,%ebp
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl %al,%esi
mov    %ebp,%edi
call   1030 <kputc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <kputs+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @kputs(i32 %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %8, %5 ], [ %1, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = sext i8 %6 to i32
%10 = tail call i32 @kputc(i32 %0, i32 %9)
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(char *msg) {
  printf("Usage:\n %s -s <SERVER NAME OR ADDRESS> -p <PORT NUMBER> -b <GSM "
         "NUMBER TO> -t \"<TEXT TO BE SENT>\" -c [sending check]\n",
         msg);
}


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

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

LLVM IR (-O0):
@.str = [118 x i8] c"Usage:\0A %s -s <SERVER NAME OR ADDRESS> -p <PORT NUMBER> -b <GSM NUMBER TO> -t \22<TEXT TO BE SENT>\22 -c [sending check]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([118 x i8], [118 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [118 x i8] c"Usage:\0A %s -s <SERVER NAME OR ADDRESS> -p <PORT NUMBER> -b <GSM NUMBER TO> -t \22<TEXT TO BE SENT>\22 -c [sending check]\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([118 x i8], [118 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void busywork() {
  int j = 5;
  for (int i = 0; i < 9000; i++) {
    j = j + i;
  }
  return;
}


x86 assembly (clang, -O0):
<busywork>:
push   %rbp
mov    %rsp,%rbp
movl   $0x5,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x2328,-0x8(%rbp)
jge    1136 <busywork+0x36>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <busywork+0x12>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @busywork() {
ret void
}
/* Variables and functions */
long __umount2(char const *, int /*<<< orphan*/);
long int __umount(const char *name) { return __umount2(name, 0); }


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

x86 assembly (clang, -O2):
<__umount>:
xor    %esi,%esi
jmp    1030 <__umount2@plt>

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

LLVM IR (-O2):
define i64 @__umount(i8* %0) {
%2 = tail call i64 @__umount2(i8* %0, i32 0)
ret i64 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
void transfer_YUV161616_to_YUV161616(uint16_t *(*output), uint16_t *input) {
  (*output)[0] = input[0];
  (*output)[1] = input[1];
  (*output)[2] = input[2];
  (*output) += 3;
}


x86 assembly (clang, -O0):
<transfer_YUV161616_to_YUV161616>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %ecx,0x4(%rax)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %ecx,0x8(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0xc,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<transfer_YUV161616_to_YUV161616>:
mov    (%rsi),%eax
mov    (%rdi),%rcx
mov    %eax,(%rcx)
mov    0x4(%rsi),%eax
mov    %eax,0x4(%rcx)
mov    0x8(%rsi),%eax
mov    %eax,0x8(%rcx)
add    $0xc,%rcx
mov    %rcx,(%rdi)
ret

LLVM IR (-O0):
define void @transfer_YUV161616_to_YUV161616(i32** %0, i32* %1) {
%3 = alloca i32**
%4 = alloca i32*
store i32** %0, i32*** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = load i32**, i32*** %3
%9 = load i32*, i32** %8
%10 = getelementptr inbounds i32, i32* %9, i64 0
store i32 %7, i32* %10
%11 = load i32*, i32** %4
%12 = getelementptr inbounds i32, i32* %11, i64 1
%13 = load i32, i32* %12
%14 = load i32**, i32*** %3
%15 = load i32*, i32** %14
%16 = getelementptr inbounds i32, i32* %15, i64 1
store i32 %13, i32* %16
%17 = load i32*, i32** %4
%18 = getelementptr inbounds i32, i32* %17, i64 2
%19 = load i32, i32* %18
%20 = load i32**, i32*** %3
%21 = load i32*, i32** %20
%22 = getelementptr inbounds i32, i32* %21, i64 2
store i32 %19, i32* %22
%23 = load i32**, i32*** %3
%24 = load i32*, i32** %23
%25 = getelementptr inbounds i32, i32* %24, i64 3
store i32* %25, i32** %23
ret void
}

LLVM IR (-O2):
define void @transfer_YUV161616_to_YUV161616(i32** nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = load i32*, i32** %0
store i32 %3, i32* %4
%5 = getelementptr inbounds i32, i32* %1, i64 1
%6 = load i32, i32* %5
%7 = getelementptr inbounds i32, i32* %4, i64 1
store i32 %6, i32* %7
%8 = getelementptr inbounds i32, i32* %1, i64 2
%9 = load i32, i32* %8
%10 = getelementptr inbounds i32, i32* %4, i64 2
store i32 %9, i32* %10
%11 = getelementptr inbounds i32, i32* %4, i64 3
store i32* %11, i32** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen_op_ld32_user(int, int);
void gen_op_ldf32_user(int dest, int addr) { gen_op_ld32_user(dest, addr); }


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

x86 assembly (clang, -O2):
<gen_op_ldf32_user>:
jmp    1030 <gen_op_ld32_user@plt>

LLVM IR (-O0):
define void @gen_op_ldf32_user(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 @gen_op_ld32_user(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @gen_op_ldf32_user(i32 %0, i32 %1) {
%3 = tail call i32 @gen_op_ld32_user(i32 %0, i32 %1)
ret void
}
int has_bus(char *line) {
  if (line[0] == 'b')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<has_bus>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x62,%eax
jne    1124 <has_bus+0x24>
movl   $0x1,-0x4(%rbp)
jmp    112b <has_bus+0x2b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<has_bus>:
xor    %eax,%eax
cmpb   $0x62,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @has_bus(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 98
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @has_bus(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 98
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ CreatePath(char *);
int /*<<< orphan*/ FreeMemory(void *);
int LoadFile(char *, void **, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ SaveFile(char *, void *, int);
void QCopyFile(char *from, char *to) {
  void *buffer;
  int length;
  length = LoadFile(from, &buffer, 0, 0);
  CreatePath(to);
  SaveFile(to, buffer, length);
  FreeMemory(buffer);
}


x86 assembly (clang, -O0):
<QCopyFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1060 <LoadFile@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <CreatePath@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1050 <SaveFile@plt>
mov    -0x18(%rbp),%rdi
call   1030 <FreeMemory@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<QCopyFile>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rsp,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
call   1060 <LoadFile@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <CreatePath@plt>
mov    (%rsp),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
call   1050 <SaveFile@plt>
mov    (%rsp),%rdi
call   1030 <FreeMemory@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @QCopyFile(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i32 @LoadFile(i8* %7, i8** %5, i32 0, i32 0)
store i32 %8, i32* %6
%9 = load i8*, i8** %4
%10 = call i32 @CreatePath(i8* %9)
%11 = load i8*, i8** %4
%12 = load i8*, i8** %5
%13 = load i32, i32* %6
%14 = call i32 @SaveFile(i8* %11, i8* %12, i32 %13)
%15 = load i8*, i8** %5
%16 = call i32 @FreeMemory(i8* %15)
ret void
}

LLVM IR (-O2):
define void @QCopyFile(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i32 @LoadFile(i8* %0, i8** %3, i32 0, i32 0)
%6 = call i32 @CreatePath(i8* %1)
%7 = load i8*, i8** %3
%8 = call i32 @SaveFile(i8* %1, i8* %7, i32 %5)
%9 = load i8*, i8** %3
%10 = call i32 @FreeMemory(i8* %9)
ret void
}
void error_socket(int id) {}


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

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

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

LLVM IR (-O2):
define void @error_socket(i32 %0) {
ret void
}
/* Type definitions */
struct pavl_table {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void *pavl_delete(struct pavl_table *, void *);
void *(pavl_assert_delete)(struct pavl_table *table, void *item) {
  void *p = pavl_delete(table, item);
  assert(p != NULL);
  return p;
}


x86 assembly (clang, -O0):
<pavl_assert_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <pavl_delete@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pavl_assert_delete>:
push   %rbx
call   1030 <pavl_delete@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1040 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.pavl_table = type { i32 }
define i8* @pavl_assert_delete(%struct.pavl_table* %0, i8* %1) {
%3 = alloca %struct.pavl_table*
%4 = alloca i8*
%5 = alloca i8*
store %struct.pavl_table* %0, %struct.pavl_table** %3
store i8* %1, i8** %4
%6 = load %struct.pavl_table*, %struct.pavl_table** %3
%7 = load i8*, i8** %4
%8 = call i8* @pavl_delete(%struct.pavl_table* %6, i8* %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i8*, i8** %5
ret i8* %13
}

LLVM IR (-O2):
%struct.pavl_table = type { i32 }
define i8* @pavl_assert_delete(%struct.pavl_table* %0, i8* %1) {
%3 = tail call i8* @pavl_delete(%struct.pavl_table* %0, i8* %1)
%4 = icmp ne i8* %3, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
ret i8* %3
}
/* Variables and functions */
int msx_read(char *);
int msx_is_configured() {
  return (msx_read("/proc/mosix/admin/mospe") == -1 ? 0 : 1);
}


x86 assembly (clang, -O0):
<msx_is_configured>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <msx_read@plt>
mov    %eax,%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0xffffffff,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<msx_is_configured>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <msx_read@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"/proc/mosix/admin/mospe\00"
define i32 @msx_is_configured() {
%1 = call i32 @msx_read(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, -1
%3 = zext i1 %2 to i64
%4 = select i1 %2, i32 0, i32 1
ret i32 %4
}

LLVM IR (-O2):
@.str = [24 x i8] c"/proc/mosix/admin/mospe\00"
define i32 @msx_is_configured() {
%1 = tail call i32 @msx_read(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = icmp ne i32 %1, -1
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int i2c_send_byte_2(int, int, char);
int OLED_wrdat(char dat) { return i2c_send_byte_2(0x3C, 0x40, dat); }


x86 assembly (clang, -O0):
<OLED_wrdat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x3c,%edi
mov    $0x40,%esi
movsbl -0x1(%rbp),%edx
call   1030 <i2c_send_byte_2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OLED_wrdat>:
mov    %edi,%edx
mov    $0x3c,%edi
mov    $0x40,%esi
jmp    1030 <i2c_send_byte_2@plt>

LLVM IR (-O0):
define i32 @OLED_wrdat(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @i2c_send_byte_2(i32 60, i32 64, i8 signext %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @OLED_wrdat(i8 signext %0) {
%2 = tail call i32 @i2c_send_byte_2(i32 60, i32 64, i8 signext %0)
ret i32 %2
}
void AKSC_InitDecomp8972(void) {}


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

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

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

LLVM IR (-O2):
define void @AKSC_InitDecomp8972() {
ret void
}
/* Variables and functions */
char *get_charset();
char *write_charset_8bit(void) {
  static char *mm_charset = NULL;
  if (!mm_charset && !(mm_charset = get_charset()))
    mm_charset = "x-unknown";
  return mm_charset;
}


x86 assembly (clang, -O0):
<write_charset_8bit>:
push   %rbp
mov    %rsp,%rbp
cmpq   $0x0,0x2f14(%rip)
jne    1148 <write_charset_8bit+0x38>
mov    $0x0,%al
call   1030 <get_charset@plt>
mov    %rax,0x2f00(%rip)
cmp    $0x0,%rax
jne    1148 <write_charset_8bit+0x38>
lea    0xebf(%rip),%rax
mov    %rax,0x2ee8(%rip)
mov    0x2ee1(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_charset_8bit>:
push   %rax
mov    0x2f18(%rip),%rax
test   %rax,%rax
je     111f <write_charset_8bit+0xf>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <get_charset@plt>
mov    %rax,%rcx
test   %rax,%rax
lea    0xecd(%rip),%rax
cmovne %rcx,%rax
mov    %rax,0x2ef2(%rip)
pop    %rcx
ret

LLVM IR (-O0):
@write_charset_8bit.mm_charset = internal global i8* null
@.str = [10 x i8] c"x-unknown\00"
define i8* @write_charset_8bit() {
%1 = load i8*, i8** @write_charset_8bit.mm_charset
%2 = icmp ne i8* %1, null
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = call i8* (...) @get_charset()
store i8* %4, i8** @write_charset_8bit.mm_charset
%5 = icmp ne i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %3
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** @write_charset_8bit.mm_charset
br label %7
7: ; preds = %6, %3, %0
%8 = load i8*, i8** @write_charset_8bit.mm_charset
ret i8* %8
}

LLVM IR (-O2):
@write_charset_8bit.mm_charset = internal unnamed_addr global i8* null
@.str = [10 x i8] c"x-unknown\00"
define i8* @write_charset_8bit() {
%1 = load i8*, i8** @write_charset_8bit.mm_charset
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i8* (...) @get_charset()
%5 = icmp eq i8* %4, null
%6 = select i1 %5, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %4
store i8* %6, i8** @write_charset_8bit.mm_charset
br label %7
7: ; preds = %3, %0
%8 = phi i8* [ %6, %3 ], [ %1, %0 ]
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void crash(char *msg, int code) {
  fputs(msg, stderr);
  exit(code);
}


x86 assembly (clang, -O0):
<crash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea6(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<crash>:
push   %rbx
mov    %esi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @crash(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* @stderr
%7 = call i32 @fputs(i8* %5, i32 %6)
%8 = load i32, i32* %4
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
define void @crash(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* %0, i32 %3)
%5 = tail call i32 @exit(i32 %1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int;
typedef int /*<<< orphan*/ bool_t;
typedef int /*<<< orphan*/ XDR;

/* Variables and functions */
int /*<<< orphan*/ FALSE;
bool_t x_setpostn(XDR *xdrs, u_int len) { return FALSE; }


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

x86 assembly (clang, -O2):
<x_setpostn>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

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

LLVM IR (-O2):
@FALSE = global i32 0
define i32 @x_setpostn(i32* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @FALSE
ret i32 %3
}
void draw_ortho(int xori, int yori, int xres, int yres, int display) {}


x86 assembly (clang, -O0):
<draw_ortho>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @draw_ortho(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
ret void
}

LLVM IR (-O2):
define void @draw_ortho(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
ret void
}
void concludeRep(void) {}


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

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

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

LLVM IR (-O2):
define void @concludeRep() {
ret void
}
void local_save_flags(unsigned long flags __attribute__((unused))) {
  __asm__ __volatile__("" : : : "memory");
}


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

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

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

LLVM IR (-O2):
define void @local_save_flags(i64 %0) {
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *malloc(unsigned long);
void *realloc(void *, unsigned int);
void f2(int i) {
  unsigned long j = 10;
  void *ptr = malloc(j);
  ptr = realloc(ptr, (unsigned)i);
  free(ptr);
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movq   $0xa,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1050 <realloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
push   %rbx
mov    %edi,%ebx
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
mov    %ebx,%esi
call   1050 <realloc@plt>
mov    %rax,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @f2(i32 %0) {
%2 = tail call dereferenceable_or_null(10) i8* @malloc(i64 10)
%3 = tail call i8* @realloc(i8* %2, i32 %0)
%4 = tail call i32 @free(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_trie_get_id();
int /*<<< orphan*/ test_trie_insert();
void test_trie() {
  test_trie_insert();
  test_trie_get_id();
}


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

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

LLVM IR (-O0):
define void @test_trie() {
%1 = call i32 (...) @test_trie_insert()
%2 = call i32 (...) @test_trie_get_id()
ret void
}

LLVM IR (-O2):
define void @test_trie() {
%1 = tail call i32 (...) @test_trie_insert()
%2 = tail call i32 (...) @test_trie_get_id()
ret void
}
int cmpz(int a) { return a != 0; }


x86 assembly (clang, -O0):
<cmpz>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmpz>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @cmpz(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 i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @cmpz(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
int32_t setBit_fun_int32_t(int32_t x, uint32_t i) { return x | 1 << i; }


x86 assembly (clang, -O0):
<setBit_fun_int32_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @setBit_fun_int32_t(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 = shl i32 1, %6
%8 = or i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @setBit_fun_int32_t(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = or i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Extrae_user_function(int);
int /*<<< orphan*/ printf(char *);
void fB(void) {
  Extrae_user_function(1);
  printf("fB\n");
  Extrae_user_function(0);
}


x86 assembly (clang, -O0):
<fB>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1040 <Extrae_user_function@plt>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <Extrae_user_function@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fB>:
push   %rax
mov    $0x1,%edi
call   1040 <Extrae_user_function@plt>
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <Extrae_user_function@plt>

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

LLVM IR (-O2):
@str = [3 x i8] c"fB\00"
define void @fB() {
%1 = tail call i32 @Extrae_user_function(i32 1)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @Extrae_user_function(i32 0)
ret void
}
void usbFreeDrivers() {}


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

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

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

LLVM IR (-O2):
define void @usbFreeDrivers() {
ret void
}
/* Variables and functions */
float atan2(float, float);
float futhark_atan2_32(float x, float y) { return atan2(x, y); }


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

x86 assembly (clang, -O2):
<futhark_atan2_32>:
jmp    1030 <atan2@plt>

LLVM IR (-O0):
define float @futhark_atan2_32(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @atan2(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @futhark_atan2_32(float %0, float %1) {
%3 = tail call float @atan2(float %0, float %1)
ret float %3
}
int digitValue(c)
char c;
{
  if ('0' <= c && c <= '9')
    return (c - '0');
  else if ('a' <= c && c <= 'f')
    return (c - 'a' + 10);
  else
    return (c - 'A' + 10);
}


x86 assembly (clang, -O0):
<digitValue>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%ecx
mov    $0x30,%eax
cmp    %ecx,%eax
jg     1137 <digitValue+0x37>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1137 <digitValue+0x37>
movsbl -0x5(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    1174 <digitValue+0x74>
movsbl -0x5(%rbp),%ecx
mov    $0x61,%eax
cmp    %ecx,%eax
jg     1167 <digitValue+0x67>
movsbl -0x5(%rbp),%eax
cmp    $0x66,%eax
jg     1167 <digitValue+0x67>
movsbl -0x5(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    1174 <digitValue+0x74>
movsbl -0x5(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<digitValue>:
movsbl %dil,%ecx
mov    %edi,%eax
shl    $0x18,%eax
lea    -0x2f000001(%rax),%edx
add    $0x9fffffff,%eax
xor    %esi,%esi
cmp    $0x6ffffff,%eax
setae  %sil
shl    $0x5,%esi
add    $0xffffffa9,%esi
cmp    $0xaffffff,%edx
mov    $0xffffffd0,%eax
cmovae %esi,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @digitValue(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = trunc i32 %0 to i8
store i8 %4, i8* %3
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = icmp sle i32 48, %6
br i1 %7, label %8, label %16
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp sle i32 %10, 57
br i1 %11, label %12, label %16
12: ; preds = %8
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = sub nsw i32 %14, 48
store i32 %15, i32* %2
br label %34
16: ; preds = %8, %1
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = icmp sle i32 97, %18
br i1 %19, label %20, label %29
20: ; preds = %16
%21 = load i8, i8* %3
%22 = sext i8 %21 to i32
%23 = icmp sle i32 %22, 102
br i1 %23, label %24, label %29
24: ; preds = %20
%25 = load i8, i8* %3
%26 = sext i8 %25 to i32
%27 = sub nsw i32 %26, 97
%28 = add nsw i32 %27, 10
store i32 %28, i32* %2
br label %34
29: ; preds = %20, %16
%30 = load i8, i8* %3
%31 = sext i8 %30 to i32
%32 = sub nsw i32 %31, 65
%33 = add nsw i32 %32, 10
store i32 %33, i32* %2
br label %34
34: ; preds = %29, %24, %12
%35 = load i32, i32* %2
ret i32 %35
}

LLVM IR (-O2):
define i32 @digitValue(i32 %0) {
%2 = shl i32 %0, 24
%3 = ashr exact i32 %2, 24
%4 = add i32 %2, -788529153
%5 = icmp ult i32 %4, 184549375
%6 = add i32 %2, -1610612737
%7 = icmp ult i32 %6, 117440511
%8 = select i1 %7, i32 -87, i32 -55
%9 = select i1 %5, i32 -48, i32 %8
%10 = add nsw i32 %3, %9
ret i32 %10
}
/* Variables and functions */
char *concatenate(char *, char *, int, char const *, char const *);
char *get_user_directory(const char *nm_root, const char *user) {
  return concatenate("%s/usercache/%s", "user_dir_path", 2, nm_root, user);
}


x86 assembly (clang, -O0):
<get_user_directory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
lea    0xed1(%rip),%rdi
lea    0xeda(%rip),%rsi
mov    $0x2,%edx
call   1030 <concatenate@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_user_directory>:
mov    %rsi,%r8
mov    %rdi,%rcx
lea    0xee3(%rip),%rdi
lea    0xeec(%rip),%rsi
mov    $0x2,%edx
jmp    1030 <concatenate@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"%s/usercache/%s\00"
@.str.1 = [14 x i8] c"user_dir_path\00"
define i8* @get_user_directory(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 = call i8* @concatenate(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 2, i8* %5, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
@.str = [16 x i8] c"%s/usercache/%s\00"
@.str.1 = [14 x i8] c"user_dir_path\00"
define i8* @get_user_directory(i8* %0, i8* %1) {
%3 = tail call i8* @concatenate(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 2, i8* %0, i8* %1)
ret i8* %3
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  uint64_t n = 1000;
  uint64_t k1 = n / 3;
  uint64_t k2 = n / 5;
  uint64_t k3 = n / 15;
  printf("%d\n", ((k1 * n) / 2) + ((k2 * n) / 2) - ((k3 * n) / 2) - k1 + 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3e8,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xf,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
mov    -0x10(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    %eax,%esi
mov    -0x14(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
sub    %eax,%esi
sub    -0xc(%rbp),%esi
add    $0x1,%esi
lea    0xe70(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 1000, i32* %2
%6 = load i32, i32* %2
%7 = sdiv i32 %6, 3
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = sdiv i32 %8, 5
store i32 %9, i32* %4
%10 = load i32, i32* %2
%11 = sdiv i32 %10, 15
store i32 %11, i32* %5
%12 = load i32, i32* %3
%13 = load i32, i32* %2
%14 = mul nsw i32 %12, %13
%15 = sdiv i32 %14, 2
%16 = load i32, i32* %4
%17 = load i32, i32* %2
%18 = mul nsw i32 %16, %17
%19 = sdiv i32 %18, 2
%20 = add nsw i32 %15, %19
%21 = load i32, i32* %5
%22 = load i32, i32* %2
%23 = mul nsw i32 %21, %22
%24 = sdiv i32 %23, 2
%25 = sub nsw i32 %20, %24
%26 = load i32, i32* %3
%27 = sub nsw i32 %25, %26
%28 = add nsw i32 %27, 1
%29 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %28)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 233168)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ printf(char *, int);
void my_handler(int signal) {
  printf("\nRecibida la señal %d\n", signal);
  _exit(getpid());
}


x86 assembly (clang, -O0):
<my_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xebb(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <getpid@plt>
mov    %eax,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<my_handler>:
push   %rax
mov    %edi,%esi
lea    0xec6(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1040 <getpid@plt>
mov    %eax,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"\0ARecibida la se\C3\B1al %d\0A\00"
define void @my_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 (...) @getpid()
%6 = call i32 @_exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@.str = [24 x i8] c"\0ARecibida la se\C3\B1al %d\0A\00"
define void @my_handler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 (...) @getpid()
%4 = tail call i32 @_exit(i32 %3)
unreachable
}
int test_imm_22uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x22 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_22uint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 34
%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_22uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 34
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void b_ethernet_tx(void *mem, unsigned long len, unsigned long iid) {
  asm volatile("call *0x00100020" : : "S"(mem), "c"(len), "d"(iid));
}


x86 assembly (clang, -O0):
<b_ethernet_tx>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rdx
call   *0x100020
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_ethernet_tx>:
mov    %rsi,%rcx
mov    %rdi,%rsi
call   *0x100020
ret

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

LLVM IR (-O2):
define void @b_ethernet_tx(i8* %0, i64 %1, i64 %2) {
tail call void asm sideeffect "call *0x00100020", "{si},{cx},{dx},~{dirflag},~{fpsr},~{flags}"(i8* %0, i64 %1, i64 %2)
ret void
}
void *error() {
  __asm__("int3");
  return 0;
}


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

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

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

LLVM IR (-O2):
define i8* @error() {
tail call void asm sideeffect "int3", "~{dirflag},~{fpsr},~{flags}"()
ret i8* null
}
/* Type definitions */
struct bss_t {
  int dummy;
};

/* Variables and functions */
int recv(int, unsigned char *, int, int);
int checkbyte(struct bss_t *bss, int sock) {
  unsigned char buffer[1];
  int ret;
  ret = recv(sock, buffer, 1, 32);
  if (ret < 0)
    return ret;
  if (ret == 0)
    return -1;
  return buffer[0];
}


x86 assembly (clang, -O0):
<checkbyte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x15(%rbp),%rsi
mov    $0x1,%edx
mov    $0x20,%ecx
call   1030 <recv@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    114d <checkbyte+0x3d>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116a <checkbyte+0x5a>
cmpl   $0x0,-0x1c(%rbp)
jne    1163 <checkbyte+0x53>
movl   $0xffffffff,-0x4(%rbp)
jmp    116a <checkbyte+0x5a>
movzbl -0x15(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkbyte>:
push   %rax
mov    %esi,%edi
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
mov    $0x20,%ecx
call   1030 <recv@plt>
test   %eax,%eax
js     1132 <checkbyte+0x22>
je     1134 <checkbyte+0x24>
movzbl 0x7(%rsp),%eax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.bss_t = type { i32 }
define i32 @checkbyte(%struct.bss_t* %0, i32 %1) {
%3 = alloca i32
%4 = alloca %struct.bss_t*
%5 = alloca i32
%6 = alloca [1 x i8]
%7 = alloca i32
store %struct.bss_t* %0, %struct.bss_t** %4
store i32 %1, i32* %5
%8 = load i32, i32* %5
%9 = getelementptr inbounds [1 x i8], [1 x i8]* %6, i64 0, i64 0
%10 = call i32 @recv(i32 %8, i8* %9, i32 1, i32 32)
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = load i32, i32* %7
store i32 %14, i32* %3
br label %23
15: ; preds = %2
%16 = load i32, i32* %7
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %15
store i32 -1, i32* %3
br label %23
19: ; preds = %15
%20 = getelementptr inbounds [1 x i8], [1 x i8]* %6, i64 0, i64 0
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
store i32 %22, i32* %3
br label %23
23: ; preds = %19, %18, %13
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
%struct.bss_t = type { i32 }
define i32 @checkbyte(%struct.bss_t* nocapture readnone %0, i32 %1) {
%3 = alloca [1 x i8]
%4 = getelementptr inbounds [1 x i8], [1 x i8]* %3, i64 0, i64 0
%5 = call i32 @recv(i32 %1, i8* %4, i32 1, i32 32)
%6 = icmp slt i32 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %2
%8 = icmp eq i32 %5, 0
br i1 %8, label %12, label %9
9: ; preds = %7
%10 = load i8, i8* %4
%11 = zext i8 %10 to i32
br label %12
12: ; preds = %7, %2, %9
%13 = phi i32 [ %11, %9 ], [ %5, %2 ], [ -1, %7 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ CC2420ReceiveP__InterruptFIFOP__fired();
void Atm128GpioInterruptC__0__Interrupt__fired(void) {
  CC2420ReceiveP__InterruptFIFOP__fired();
}


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

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

LLVM IR (-O0):
define void @Atm128GpioInterruptC__0__Interrupt__fired() {
%1 = call i32 (...) @CC2420ReceiveP__InterruptFIFOP__fired()
ret void
}

LLVM IR (-O2):
define void @Atm128GpioInterruptC__0__Interrupt__fired() {
%1 = tail call i32 (...) @CC2420ReceiveP__InterruptFIFOP__fired()
ret void
}
/* Variables and functions */
scalar_t__ cos(double);
float Cos(float angle) { return (float)cos((double)angle); }


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

x86 assembly (clang, -O2):
<Cos>:
push   %rax
cvtss2sd %xmm0,%xmm0
call   1030 <cos@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @Cos(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call i64 @cos(double %4)
%6 = sitofp i64 %5 to float
ret float %6
}

LLVM IR (-O2):
define float @Cos(float %0) {
%2 = fpext float %0 to double
%3 = tail call i64 @cos(double %2)
%4 = sitofp i64 %3 to float
ret float %4
}