xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() {
  static char str[] = "Hello world.\n";
  printf("%s", str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    0x2efb(%rip),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@main.str = internal global [14 x i8] c"Hello world.\0A\00"
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @main.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@main.str = internal global [14 x i8] c"Hello world.\0A\00"
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @main.str, i64 0, i64 0))
ret i32 0
}
void bu_compile_cons(args) struct conscell *args;
{
  int n = bu_compile_arg_list(args);
  if (n != 2)
    goto er;
  EMIT1ATM("CONS");
  EMITEND();
  return;
er:
  cerror("cons: wrong # of args", args);
}


x86 assembly (clang, -O0):
<bu_compile_cons>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <bu_compile_arg_list@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
je     1169 <bu_compile_cons+0x29>
jmp    1183 <bu_compile_cons+0x43>
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1050 <EMIT1ATM@plt>
mov    $0x0,%al
call   1030 <EMITEND@plt>
jmp    1195 <bu_compile_cons+0x55>
mov    -0x8(%rbp),%rsi
lea    0xe77(%rip),%rdi
mov    $0x0,%al
call   1060 <cerror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bu_compile_cons>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <bu_compile_arg_list@plt>
cmp    $0x2,%eax
jne    1166 <bu_compile_cons+0x26>
lea    0xea9(%rip),%rdi
xor    %eax,%eax
call   1050 <EMIT1ATM@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <EMITEND@plt>
lea    0xe98(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1060 <cerror@plt>

LLVM IR (-O0):
%struct.conscell = type opaque
@.str = [5 x i8] c"CONS\00"
@.str.1 = [22 x i8] c"cons: wrong # of args\00"
define void @bu_compile_cons(%struct.conscell* %0) {
%2 = alloca %struct.conscell*
%3 = alloca i32
store %struct.conscell* %0, %struct.conscell** %2
%4 = load %struct.conscell*, %struct.conscell** %2
%5 = call i32 (%struct.conscell*, ...) bitcast (i32 (...)* @bu_compile_arg_list to i32 (%struct.conscell*, ...)*)(%struct.conscell* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %9
8: ; preds = %1
br label %12
9: ; preds = %1
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @EMIT1ATM to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%11 = call i32 (...) @EMITEND()
br label %15
12: ; preds = %8
%13 = load %struct.conscell*, %struct.conscell** %2
%14 = call i32 (i8*, %struct.conscell*, ...) bitcast (i32 (...)* @cerror to i32 (i8*, %struct.conscell*, ...)*)(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), %struct.conscell* %13)
br label %15
15: ; preds = %12, %9
ret void
}

LLVM IR (-O2):
%struct.conscell = type opaque
@.str = [5 x i8] c"CONS\00"
@.str.1 = [22 x i8] c"cons: wrong # of args\00"
define void @bu_compile_cons(%struct.conscell* %0) {
%2 = tail call i32 (%struct.conscell*, ...) bitcast (i32 (...)* @bu_compile_arg_list to i32 (%struct.conscell*, ...)*)(%struct.conscell* %0)
%3 = icmp eq i32 %2, 2
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @EMIT1ATM to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 (...) @EMITEND()
br label %9
7: ; preds = %1
%8 = tail call i32 (i8*, %struct.conscell*, ...) bitcast (i32 (...)* @cerror to i32 (i8*, %struct.conscell*, ...)*)(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), %struct.conscell* %0)
br label %9
9: ; preds = %7, %4
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint64_t;

/* Variables and functions */
uint64_t load_3(const uint8_t *in) {
  uint64_t result;
  result = ((uint64_t)in[0]);
  result |= ((uint64_t)in[1]) << 8;
  result |= ((uint64_t)in[2]) << 16;
  return result;
}


x86 assembly (clang, -O0):
<load_3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
shl    $0x8,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rax
shl    $0x10,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_3>:
mov    0x8(%rdi),%ecx
mov    0x10(%rdi),%eax
shl    $0x8,%ecx
or     (%rdi),%ecx
shl    $0x10,%eax
or     %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @load_3(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = trunc i64 %2 to i32
%4 = getelementptr inbounds i64, i64* %0, i64 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i64, i64* %0, i64 2
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
%12 = shl i32 %11, 16
%13 = or i32 %8, %12
ret i32 %13
}
/* Type definitions */
struct const_Intrusive_List {
  int dummy;
};
struct const_Intrusive_Link {
  int dummy;
};
struct Intrusive_List {
  int dummy;
};
struct Intrusive_Link {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ push_back_IL(struct Intrusive_List *,
                                struct Intrusive_Link *);
void push_back_const_IL(const struct const_Intrusive_List *lst,
                        const struct const_Intrusive_Link *curr) {
  push_back_IL((struct Intrusive_List *)lst, (struct Intrusive_Link *)curr);
}


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

x86 assembly (clang, -O2):
<push_back_const_IL>:
jmp    1030 <push_back_IL@plt>

LLVM IR (-O0):
%struct.const_Intrusive_List = type { i32 }
%struct.const_Intrusive_Link = type { i32 }
%struct.Intrusive_List = type { i32 }
%struct.Intrusive_Link = type { i32 }
define void @push_back_const_IL(%struct.const_Intrusive_List* %0, %struct.const_Intrusive_Link* %1) {
%3 = alloca %struct.const_Intrusive_List*
%4 = alloca %struct.const_Intrusive_Link*
store %struct.const_Intrusive_List* %0, %struct.const_Intrusive_List** %3
store %struct.const_Intrusive_Link* %1, %struct.const_Intrusive_Link** %4
%5 = load %struct.const_Intrusive_List*, %struct.const_Intrusive_List** %3
%6 = bitcast %struct.const_Intrusive_List* %5 to %struct.Intrusive_List*
%7 = load %struct.const_Intrusive_Link*, %struct.const_Intrusive_Link** %4
%8 = bitcast %struct.const_Intrusive_Link* %7 to %struct.Intrusive_Link*
%9 = call i32 @push_back_IL(%struct.Intrusive_List* %6, %struct.Intrusive_Link* %8)
ret void
}

LLVM IR (-O2):
%struct.const_Intrusive_List = type { i32 }
%struct.const_Intrusive_Link = type { i32 }
%struct.Intrusive_List = type { i32 }
%struct.Intrusive_Link = type { i32 }
define void @push_back_const_IL(%struct.const_Intrusive_List* %0, %struct.const_Intrusive_Link* %1) {
%3 = bitcast %struct.const_Intrusive_List* %0 to %struct.Intrusive_List*
%4 = bitcast %struct.const_Intrusive_Link* %1 to %struct.Intrusive_Link*
%5 = tail call i32 @push_back_IL(%struct.Intrusive_List* %3, %struct.Intrusive_Link* %4)
ret void
}
int get_event_code(int type) { return (0x12 << type); }


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

x86 assembly (clang, -O2):
<get_event_code>:
mov    %edi,%ecx
mov    $0x12,%eax
shl    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @get_event_code(i32 %0) {
%2 = shl i32 18, %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ serial_line_write(unsigned char);
void dev_put(unsigned char byte) {
  if (byte == 0xC0) {
    serial_line_write(0xDB);
    serial_line_write(0xDC);
  } else if (byte == 0xDB) {
    serial_line_write(0xDB);
    serial_line_write(0xDD);
  } else {
    serial_line_write(byte);
  }
}


x86 assembly (clang, -O0):
<dev_put>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0xc0,%eax
jne    1146 <dev_put+0x36>
mov    $0xdb,%edi
call   1030 <serial_line_write@plt>
mov    $0xdc,%edi
call   1030 <serial_line_write@plt>
jmp    117c <dev_put+0x6c>
movzbl -0x1(%rbp),%eax
cmp    $0xdb,%eax
jne    116e <dev_put+0x5e>
mov    $0xdb,%edi
call   1030 <serial_line_write@plt>
mov    $0xdd,%edi
call   1030 <serial_line_write@plt>
jmp    1177 <dev_put+0x67>
movzbl -0x1(%rbp),%edi
call   1030 <serial_line_write@plt>
jmp    117c <dev_put+0x6c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dev_put>:
push   %rbx
mov    %edi,%ebx
cmp    $0xc0,%bl
je     1121 <dev_put+0x11>
cmp    $0xdb,%bl
jne    112d <dev_put+0x1d>
mov    $0xdd,%bl
jmp    1123 <dev_put+0x13>
mov    $0xdc,%bl
mov    $0xdb,%edi
call   1030 <serial_line_write@plt>
movzbl %bl,%edi
pop    %rbx
jmp    1030 <serial_line_write@plt>

LLVM IR (-O0):
define void @dev_put(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp eq i32 %4, 192
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = call i32 @serial_line_write(i8 zeroext -37)
%8 = call i32 @serial_line_write(i8 zeroext -36)
br label %20
9: ; preds = %1
%10 = load i8, i8* %2
%11 = zext i8 %10 to i32
%12 = icmp eq i32 %11, 219
br i1 %12, label %13, label %16
13: ; preds = %9
%14 = call i32 @serial_line_write(i8 zeroext -37)
%15 = call i32 @serial_line_write(i8 zeroext -35)
br label %19
16: ; preds = %9
%17 = load i8, i8* %2
%18 = call i32 @serial_line_write(i8 zeroext %17)
br label %19
19: ; preds = %16, %13
br label %20
20: ; preds = %19, %6
ret void
}

LLVM IR (-O2):
define void @dev_put(i8 zeroext %0) {
switch i8 %0, label %6 [
i8 -64, label %3
i8 -37, label %2
]
2: ; preds = %1
br label %3
3: ; preds = %1, %2
%4 = phi i8 [ -35, %2 ], [ -36, %1 ]
%5 = tail call i32 @serial_line_write(i8 zeroext -37)
br label %6
6: ; preds = %3, %1
%7 = phi i8 [ %0, %1 ], [ %4, %3 ]
%8 = tail call i32 @serial_line_write(i8 zeroext %7)
ret void
}
void exchange(unsigned long *a, unsigned long *b) {
  unsigned long cache = *a;
  *a = *b;
  *b = cache;
}


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

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

LLVM IR (-O0):
define void @exchange(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca i64
store i64* %0, i64** %3
store i64* %1, i64** %4
%6 = load i64*, i64** %3
%7 = load i64, i64* %6
store i64 %7, i64* %5
%8 = load i64*, i64** %4
%9 = load i64, i64* %8
%10 = load i64*, i64** %3
store i64 %9, i64* %10
%11 = load i64, i64* %5
%12 = load i64*, i64** %4
store i64 %11, i64* %12
ret void
}

LLVM IR (-O2):
define void @exchange(i64* nocapture %0, i64* nocapture %1) {
%3 = load i64, i64* %0
%4 = load i64, i64* %1
store i64 %4, i64* %0
store i64 %3, i64* %1
ret void
}
void foo746(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo746(i32 %0) {
ret void
}
void syncReadLine(void) {
  _serverPanic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/"
               "heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c",
               130, "Function '%s' is disabled.", __func__);
}


x86 assembly (clang, -O0):
<syncReadLine>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x82,%esi
lea    0xf79(%rip),%rdx
lea    0xf8d(%rip),%rcx
mov    $0x0,%al
call   1030 <_serverPanic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<syncReadLine>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x82,%esi
xor    %eax,%eax
jmp    1030 <_serverPanic@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.syncReadLine = [13 x i8] c"syncReadLine\00"
define void @syncReadLine() {
%1 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 130, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.syncReadLine, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.syncReadLine = [13 x i8] c"syncReadLine\00"
define void @syncReadLine() {
%1 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 130, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.syncReadLine, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ script_write_byte(int);
void script_direct(int rspeed, int lspeed) {
  script_write_byte(145);
  script_write_byte(((rspeed & 0xFFFF) >> 8));
  script_write_byte((rspeed & 0xFF));
  script_write_byte(((lspeed & 0xFFFF) >> 8));
  script_write_byte((lspeed & 0xFF));
}


x86 assembly (clang, -O0):
<script_direct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x91,%edi
call   1030 <script_write_byte@plt>
mov    -0x4(%rbp),%edi
and    $0xffff,%edi
sar    $0x8,%edi
call   1030 <script_write_byte@plt>
mov    -0x4(%rbp),%edi
and    $0xff,%edi
call   1030 <script_write_byte@plt>
mov    -0x8(%rbp),%edi
and    $0xffff,%edi
sar    $0x8,%edi
call   1030 <script_write_byte@plt>
mov    -0x8(%rbp),%edi
and    $0xff,%edi
call   1030 <script_write_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<script_direct>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
mov    $0x91,%edi
call   1030 <script_write_byte@plt>
movzbl %bh,%edi
call   1030 <script_write_byte@plt>
movzbl %bl,%edi
call   1030 <script_write_byte@plt>
mov    %ebp,%ebx
movzbl %bh,%edi
call   1030 <script_write_byte@plt>
movzbl %bl,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <script_write_byte@plt>

LLVM IR (-O0):
define void @script_direct(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @script_write_byte(i32 145)
%6 = load i32, i32* %3
%7 = and i32 %6, 65535
%8 = ashr i32 %7, 8
%9 = call i32 @script_write_byte(i32 %8)
%10 = load i32, i32* %3
%11 = and i32 %10, 255
%12 = call i32 @script_write_byte(i32 %11)
%13 = load i32, i32* %4
%14 = and i32 %13, 65535
%15 = ashr i32 %14, 8
%16 = call i32 @script_write_byte(i32 %15)
%17 = load i32, i32* %4
%18 = and i32 %17, 255
%19 = call i32 @script_write_byte(i32 %18)
ret void
}

LLVM IR (-O2):
define void @script_direct(i32 %0, i32 %1) {
%3 = tail call i32 @script_write_byte(i32 145)
%4 = lshr i32 %0, 8
%5 = and i32 %4, 255
%6 = tail call i32 @script_write_byte(i32 %5)
%7 = and i32 %0, 255
%8 = tail call i32 @script_write_byte(i32 %7)
%9 = lshr i32 %1, 8
%10 = and i32 %9, 255
%11 = tail call i32 @script_write_byte(i32 %10)
%12 = and i32 %1, 255
%13 = tail call i32 @script_write_byte(i32 %12)
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int compare_str(const void *str1, const void *str2) {
  int retval;
  if ((retval = strcmp((const char *)str1, (const char *)str2)) > 0)
    return 1;
  else if (retval < 0)
    return -1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<compare_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
jle    1145 <compare_str+0x35>
movl   $0x1,-0x4(%rbp)
jmp    1162 <compare_str+0x52>
cmpl   $0x0,-0x1c(%rbp)
jge    115b <compare_str+0x4b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1162 <compare_str+0x52>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_str>:
push   %rax
call   1030 <strcmp@plt>
mov    %eax,%ecx
sar    $0x1f,%ecx
test   %eax,%eax
mov    $0x1,%eax
cmovle %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @compare_str(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = call i32 @strcmp(i8* %7, i8* %8)
store i32 %9, i32* %6
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 1, i32* %3
br label %17
12: ; preds = %2
%13 = load i32, i32* %6
%14 = icmp slt i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %12
store i32 -1, i32* %3
br label %17
16: ; preds = %12
store i32 0, i32* %3
br label %17
17: ; preds = %16, %15, %11
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @compare_str(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = ashr i32 %3, 31
%5 = icmp slt i32 %3, 1
%6 = select i1 %5, i32 %4, i32 1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void WRITE_BOOL(int a, int w) {
  const char *res;
  if (a == 1) {
    res = "true";
  } else {
    res = "false";
  }
  printf("%s", res);
}


x86 assembly (clang, -O0):
<WRITE_BOOL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1138 <WRITE_BOOL+0x28>
lea    0xed1(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1143 <WRITE_BOOL+0x33>
lea    0xec6(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WRITE_BOOL>:
cmp    $0x1,%edi
lea    0xee6(%rip),%rax
lea    0xee4(%rip),%rsi
cmove  %rax,%rsi
lea    0xedf(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"true\00"
@.str.1 = [6 x i8] c"false\00"
@.str.2 = [3 x i8] c"%s\00"
define void @WRITE_BOOL(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1
%4 = select i1 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %4)
ret void
}
void lgdt(void *gdt, unsigned int limit) {}


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

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

LLVM IR (-O0):
define void @lgdt(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @lgdt(i8* nocapture %0, i32 %1) {
ret void
}
void RTHeapSimpleSize(void) {}


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

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

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

LLVM IR (-O2):
define void @RTHeapSimpleSize() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
void __attribute__((weak, noreturn)) abort(void) {
  _exit(1);
  while (1)
    ;
}


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

x86 assembly (clang, -O2):
<abort>:
push   %rax
mov    $0x1,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define weak void @abort() {
%1 = call i32 @_exit(i32 1)
unreachable
}

LLVM IR (-O2):
define weak void @abort() {
%1 = tail call i32 @_exit(i32 1)
unreachable
}
void EC_GROUP_set_point_conversion_form(void) {}


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

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

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

LLVM IR (-O2):
define void @EC_GROUP_set_point_conversion_form() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ drawCSquare(int /*<<< orphan*/, int /*<<< orphan*/, int, int,
                               void *);
int /*<<< orphan*/ setCursorPos(int /*<<< orphan*/);
void paintBg(int carg, void **pargs) {
  drawCSquare(0, 0, 768, 1024, pargs[1]);
  setCursorPos(0);
}


x86 assembly (clang, -O0):
<paintBg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%r8
xor    %esi,%esi
mov    $0x300,%edx
mov    $0x400,%ecx
mov    %esi,%edi
call   1030 <drawCSquare@plt>
xor    %edi,%edi
call   1040 <setCursorPos@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<paintBg>:
push   %rax
mov    0x8(%rsi),%r8
xor    %edi,%edi
xor    %esi,%esi
mov    $0x300,%edx
mov    $0x400,%ecx
call   1030 <drawCSquare@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <setCursorPos@plt>

LLVM IR (-O0):
define void @paintBg(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 1
%7 = load i8*, i8** %6
%8 = call i32 @drawCSquare(i32 0, i32 0, i32 768, i32 1024, i8* %7)
%9 = call i32 @setCursorPos(i32 0)
ret void
}

LLVM IR (-O2):
define void @paintBg(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @drawCSquare(i32 0, i32 0, i32 768, i32 1024, i8* %4)
%6 = tail call i32 @setCursorPos(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stdout;
void write_line(char *line) { fprintf(stdout, "%s\n", line); }


x86 assembly (clang, -O0):
<write_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_line>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @write_line(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ menu();
int main() { menu(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @menu()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ uart_init();
void main(void) { uart_init(); }


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

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

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @uart_init()
ret void
}
int main() {
  unsigned int i = 0;
  for (i = 0; i < 5000000; i++)
    return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x4c4b40,-0x8(%rbp)
jae    112d <main+0x2d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void g(int a) { asm(""); }


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

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

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

LLVM IR (-O2):
define void @g(i32 %0) {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
int do_737() { return 737; }


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

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

LLVM IR (-O0):
define i32 @do_737() {
ret i32 737
}

LLVM IR (-O2):
define i32 @do_737() {
ret i32 737
}
void gtk_toggle_action_get_active() {}


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

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

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

LLVM IR (-O2):
define void @gtk_toggle_action_get_active() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_unary4();
void do_app4(void) { do_unary4(); }


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

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

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

LLVM IR (-O2):
define void @do_app4() {
%1 = tail call i32 (...) @do_unary4()
ret void
}
int unlink(char *name) {}


x86 assembly (clang, -O0):
<unlink>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @unlink(i8* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ test();
void main(void) {
  test();
  ;
}


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

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

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @test()
ret void
}
void gtk_label_get_mnemonic_keyval() {}


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

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

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

LLVM IR (-O2):
define void @gtk_label_get_mnemonic_keyval() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("new branch test\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
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 = [17 x i8] c"new branch test\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [16 x i8] c"new branch test\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
size_t splitvdirect_bit_LaceKVE_size();
size_t get_splitvdirect_bit_LaceKVE_size(size_t x) {
  return x & splitvdirect_bit_LaceKVE_size();
}


x86 assembly (clang, -O0):
<get_splitvdirect_bit_LaceKVE_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <splitvdirect_bit_LaceKVE_size@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
and    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_splitvdirect_bit_LaceKVE_size>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <splitvdirect_bit_LaceKVE_size@plt>
and    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @get_splitvdirect_bit_LaceKVE_size(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 (...) @splitvdirect_bit_LaceKVE_size()
%5 = and i64 %3, %4
ret i64 %5
}

LLVM IR (-O2):
define i64 @get_splitvdirect_bit_LaceKVE_size(i64 %0) {
%2 = tail call i64 (...) @splitvdirect_bit_LaceKVE_size()
%3 = and i64 %2, %0
ret i64 %3
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ send_event;
};
typedef TYPE_1__ XSelectionEvent;

/* Variables and functions */
int get_XSelectionEvent_send_event(void *_p) {
  return (int)((XSelectionEvent *)_p)->send_event;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XSelectionEvent_send_event(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, char *);
int dangerous() {
  char array[10];
  scanf("%s", array);
}


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

x86 assembly (clang, -O2):
<dangerous>:
sub    $0x18,%rsp
lea    0xee5(%rip),%rdi
lea    0xe(%rsp),%rsi
call   1030 <scanf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @dangerous() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @dangerous() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 undef
}
unsigned int fn2(signed int a) { return a - ((a / 3) * 3); }


x86 assembly (clang, -O0):
<fn2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
imul   $0x3,%ecx,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn2>:
movslq %edi,%rax
imul   $0x55555556,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @fn2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = sdiv i32 %4, 3
%6 = mul nsw i32 %5, 3
%7 = sub nsw i32 %3, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @fn2(i32 %0) {
%2 = srem i32 %0, 3
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void prompt(void) {
  printf("OK\n");
  fflush(stdout);
}


x86 assembly (clang, -O0):
<prompt>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<prompt>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
@str = [3 x i8] c"OK\00"
define void @prompt() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ recurse(int);
int main(int argc, char *argv[]) {
  recurse(100);
  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)
mov    $0x64,%edi
call   1030 <recurse@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @recurse(i32 100)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void __attribute__((stdcall)) foo(int a, int b, int c) {
  static int last_align = -1;
  int dummy, align = (int)&dummy & 15;
  if (last_align < 0)
    last_align = align;
  else if (align != last_align)
    abort();
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
lea    -0x10(%rbp),%rax
and    $0xf,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,0x2ef6(%rip)
jge    1146 <foo+0x36>
mov    -0x14(%rbp),%eax
mov    %eax,0x2ee7(%rip)
jmp    1161 <foo+0x51>
mov    -0x14(%rbp),%eax
cmp    0x2ed9(%rip),%eax
je     115c <foo+0x4c>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    1161 <foo+0x51>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
lea    0x4(%rsp),%rax
and    $0xc,%eax
mov    0x2f09(%rip),%ecx
test   %ecx,%ecx
js     1129 <foo+0x19>
cmp    %ecx,%eax
jne    1131 <foo+0x21>
pop    %rax
ret
mov    %eax,0x2ef9(%rip)
pop    %rax
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@foo.last_align = internal global i32 -1
define void @foo(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = ptrtoint i32* %7 to i32
%10 = and i32 %9, 15
store i32 %10, i32* %8
%11 = load i32, i32* @foo.last_align
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %3
%14 = load i32, i32* %8
store i32 %14, i32* @foo.last_align
br label %22
15: ; preds = %3
%16 = load i32, i32* %8
%17 = load i32, i32* @foo.last_align
%18 = icmp ne i32 %16, %17
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = call i32 (...) @abort()
unreachable
21: ; preds = %15
br label %22
22: ; preds = %21, %13
ret void
}

LLVM IR (-O2):
@foo.last_align = internal unnamed_addr global i32 -1
define void @foo(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = ptrtoint i32* %4 to i64
%7 = trunc i64 %6 to i32
%8 = and i32 %7, 12
%9 = load i32, i32* @foo.last_align
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %3
store i32 %8, i32* @foo.last_align
br label %16
12: ; preds = %3
%13 = icmp eq i32 %8, %9
br i1 %13, label %16, label %14
14: ; preds = %12
%15 = call i32 (...) @abort()
unreachable
16: ; preds = %12, %11
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int highly_divisible_triangular_number(int);
int main() {
  assert(28 == highly_divisible_triangular_number(5));
  assert(73920 == highly_divisible_triangular_number(100));
  assert(76576500 == highly_divisible_triangular_number(500));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%edi
call   1040 <highly_divisible_triangular_number@plt>
mov    %eax,%ecx
mov    $0x1c,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x64,%edi
call   1040 <highly_divisible_triangular_number@plt>
mov    %eax,%ecx
mov    $0x120c0,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x1f4,%edi
call   1040 <highly_divisible_triangular_number@plt>
mov    %eax,%ecx
mov    $0x49076f4,%eax
cmp    %ecx,%eax
sete   %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    $0x5,%edi
call   1040 <highly_divisible_triangular_number@plt>
xor    %edi,%edi
cmp    $0x1c,%eax
sete   %dil
call   1030 <assert@plt>
mov    $0x64,%edi
call   1040 <highly_divisible_triangular_number@plt>
xor    %edi,%edi
cmp    $0x120c0,%eax
sete   %dil
call   1030 <assert@plt>
mov    $0x1f4,%edi
call   1040 <highly_divisible_triangular_number@plt>
xor    %edi,%edi
cmp    $0x49076f4,%eax
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @highly_divisible_triangular_number(i32 5)
%3 = icmp eq i32 28, %2
%4 = zext i1 %3 to i32
%5 = call i32 @assert(i32 %4)
%6 = call i32 @highly_divisible_triangular_number(i32 100)
%7 = icmp eq i32 73920, %6
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = call i32 @highly_divisible_triangular_number(i32 500)
%11 = icmp eq i32 76576500, %10
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @highly_divisible_triangular_number(i32 5)
%2 = icmp eq i32 %1, 28
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @highly_divisible_triangular_number(i32 100)
%6 = icmp eq i32 %5, 73920
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @highly_divisible_triangular_number(i32 500)
%10 = icmp eq i32 %9, 76576500
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
ret i32 0
}
double pnm_fmod(double x, int q) {
  while (x < 0)
    x += q;
  while (x > q)
    x -= q;
  return x;
}


x86 assembly (clang, -O0):
<pnm_fmod>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    112e <pnm_fmod+0x2e>
cvtsi2sdl -0xc(%rbp),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    110c <pnm_fmod+0xc>
jmp    1133 <pnm_fmod+0x33>
movsd  -0x8(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jbe    115f <pnm_fmod+0x5f>
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1133 <pnm_fmod+0x33>
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pnm_fmod>:
xorpd  %xmm2,%xmm2
ucomisd %xmm0,%xmm2
cvtsi2sd %edi,%xmm1
jbe    1124 <pnm_fmod+0x24>
xchg   %ax,%ax
addsd  %xmm1,%xmm0
ucomisd %xmm0,%xmm2
ja     1110 <pnm_fmod+0x10>
jmp    1124 <pnm_fmod+0x24>
nopl   0x0(%rax)
subsd  %xmm1,%xmm0
ucomisd %xmm1,%xmm0
ja     1120 <pnm_fmod+0x20>
ret

LLVM IR (-O0):
define double @pnm_fmod(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
br label %5
5: ; preds = %8, %2
%6 = load double, double* %3
%7 = fcmp olt double %6, 0.000000e+00
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = load i32, i32* %4
%10 = sitofp i32 %9 to double
%11 = load double, double* %3
%12 = fadd double %11, %10
store double %12, double* %3
br label %5
13: ; preds = %5
br label %14
14: ; preds = %19, %13
%15 = load double, double* %3
%16 = load i32, i32* %4
%17 = sitofp i32 %16 to double
%18 = fcmp ogt double %15, %17
br i1 %18, label %19, label %24
19: ; preds = %14
%20 = load i32, i32* %4
%21 = sitofp i32 %20 to double
%22 = load double, double* %3
%23 = fsub double %22, %21
store double %23, double* %3
br label %14
24: ; preds = %14
%25 = load double, double* %3
ret double %25
}

LLVM IR (-O2):
define double @pnm_fmod(double %0, i32 %1) {
%3 = fcmp olt double %0, 0.000000e+00
%4 = sitofp i32 %1 to double
br i1 %3, label %8, label %5
5: ; preds = %8, %2
%6 = phi double [ %0, %2 ], [ %10, %8 ]
%7 = fcmp ogt double %6, %4
br i1 %7, label %12, label %16
8: ; preds = %2, %8
%9 = phi double [ %10, %8 ], [ %0, %2 ]
%10 = fadd double %9, %4
%11 = fcmp olt double %10, 0.000000e+00
br i1 %11, label %8, label %5
12: ; preds = %5, %12
%13 = phi double [ %14, %12 ], [ %6, %5 ]
%14 = fsub double %13, %4
%15 = fcmp ogt double %14, %4
br i1 %15, label %12, label %16
16: ; preds = %12, %5
%17 = phi double [ %6, %5 ], [ %14, %12 ]
ret double %17
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_unpacklo_pi32(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 test_mm_unpacklo_pi32(__m64 a, __m64 b) {
  return _mm_unpacklo_pi32(a, b);
}


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

x86 assembly (clang, -O2):
<test_mm_unpacklo_pi32>:
jmp    1030 <_mm_unpacklo_pi32@plt>

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

LLVM IR (-O2):
define i32 @test_mm_unpacklo_pi32(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_unpacklo_pi32(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stdout;
void version(void) {
  fprintf(stdout,
          "%s %s\n"
          "Copyright © 2008 Free Software Foundation, Inc.\n"
          "License GPLv3+: GNU GPL version 3 or later "
          "<http://gnu.org/licenses/gpl.html>\n"
          "This is free software: you are free to change and redistribute it.\n"
          "There is NO WARRANTY, to the extent permitted by law.\n"
          "\n"
          "Written by Matthieu Crapet <mcrapet@gmail.com>.\n",
          "userspace-vfd", "1.0");
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
lea    0x1005(%rip),%rdx
lea    0x100c(%rip),%rcx
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<version>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
lea    0x1009(%rip),%rdx
lea    0x1010(%rip),%rcx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [304 x i8] c"%s %s\0ACopyright \C2\A9 2008 Free Software Foundation, Inc.\0ALicense GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\0AThis is free software: you are free to change and redistribute it.\0AThere is NO WARRANTY, to the extent permitted by law.\0A\0AWritten by Matthieu Crapet <mcrapet@gmail.com>.\0A\00"
@.str.1 = [14 x i8] c"userspace-vfd\00"
@.str.2 = [4 x i8] c"1.0\00"
define void @version() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([304 x i8], [304 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [304 x i8] c"%s %s\0ACopyright \C2\A9 2008 Free Software Foundation, Inc.\0ALicense GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\0AThis is free software: you are free to change and redistribute it.\0AThere is NO WARRANTY, to the extent permitted by law.\0A\0AWritten by Matthieu Crapet <mcrapet@gmail.com>.\0A\00"
@.str.1 = [14 x i8] c"userspace-vfd\00"
@.str.2 = [4 x i8] c"1.0\00"
define void @version() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([304 x i8], [304 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret void
}