xunge/DecIR huggingface dataset:
/* Variables and functions */
size_t write(int, ...);
int send_msg(int fd, const char *msg, size_t msg_len) {
  if (write(fd, &msg_len, sizeof(size_t)) != sizeof(size_t))
    return 1;
  if (write(fd, msg, msg_len) != msg_len)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<send_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x18(%rbp),%rsi
mov    $0x8,%edx
mov    $0x0,%al
call   1030 <write@plt>
cmp    $0x8,%rax
je     114c <send_msg+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    117b <send_msg+0x6b>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1030 <write@plt>
cmp    -0x18(%rbp),%rax
je     1174 <send_msg+0x64>
movl   $0x1,-0x4(%rbp)
jmp    117b <send_msg+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_msg>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rdx,(%rsp)
mov    %rsp,%rsi
mov    $0x8,%edx
xor    %eax,%eax
call   1030 <write@plt>
mov    %rax,%rcx
mov    $0x1,%eax
cmp    $0x8,%rcx
jne    1155 <send_msg+0x45>
mov    (%rsp),%rdx
mov    %ebp,%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <write@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    (%rsp),%rcx
setne  %al
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @send_msg(i32 %0, i8* %1, i64 %2) {
%4 = alloca i64
store i64 %2, i64* %4
%5 = call i64 (i32, ...) @write(i32 %0, i64* %4, i64 8)
%6 = icmp eq i64 %5, 8
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = load i64, i64* %4
%9 = call i64 (i32, ...) @write(i32 %0, i8* %1, i64 %8)
%10 = load i64, i64* %4
%11 = icmp ne i64 %9, %10
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %7, %3
%14 = phi i32 [ 1, %3 ], [ %12, %7 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void thread() {
  int i;
  for (i = 0; i < 3; i++)
    printf("this is pthread\n");
}


x86 assembly (clang, -O0):
<thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
jge    1143 <thread+0x33>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <thread+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [16 x i8] c"this is pthread\00"
define void @thread() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ check_error(int);
int main(void) {
  int i = 0;
  while (i < 5) {
    i++;
    check_error(i != 3);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    114f <main+0x3f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <check_error@plt>
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @check_error(i32 1)
%2 = tail call i32 @check_error(i32 1)
%3 = tail call i32 @check_error(i32 0)
%4 = tail call i32 @check_error(i32 1)
%5 = tail call i32 @check_error(i32 1)
ret i32 0
}
int ft_toupper(int c) { return (('a' <= c && c <= 'z' ? c - 32 : c)); }


x86 assembly (clang, -O0):
<ft_toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x61,%eax
cmp    -0x4(%rbp),%eax
jg     112d <ft_toupper+0x2d>
cmpl   $0x7a,-0x4(%rbp)
jg     112d <ft_toupper+0x2d>
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <ft_toupper+0x33>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_toupper>:
lea    -0x61(%rdi),%ecx
lea    -0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @ft_toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 97, %3
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 32
br label %13
11: ; preds = %5, %1
%12 = load i32, i32* %2
br label %13
13: ; preds = %11, %8
%14 = phi i32 [ %10, %8 ], [ %12, %11 ]
ret i32 %14
}

LLVM IR (-O2):
define i32 @ft_toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help() {
  printf("  -m x    Select the flashmode [torch_on|torch_off] (default: "
         "torch_on)\n");
  printf("  -l x    Select the led [1|2] (default: 1)\n");
  printf("  -d x    Select the drive current in mA (default: 15)\n");
}


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

x86 assembly (clang, -O2):
<help>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf24(%rip),%rdi
call   1030 <puts@plt>
lea    0xf44(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [73 x i8] c" -m x Select the flashmode [torch_on|torch_off] (default: torch_on)\0A\00"
@.str.1 = [45 x i8] c" -l x Select the led [1|2] (default: 1)\0A\00"
@.str.2 = [56 x i8] c" -d x Select the drive current in mA (default: 15)\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [72 x i8] c" -m x Select the flashmode [torch_on|torch_off] (default: torch_on)\00"
@str.3 = [44 x i8] c" -l x Select the led [1|2] (default: 1)\00"
@str.4 = [55 x i8] c" -d x Select the drive current in mA (default: 15)\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([72 x i8], [72 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.4, i64 0, i64 0))
ret void
}
void bu_compile_length(args) struct conscell *args;
{
  int n = bu_compile_arg_list(args);
  if (n != 1)
    goto er;
  EMIT1ATM("LENGTH");
  EMITEND();
  return;
er:
  cerror("length: wrong # of args", args);
}


x86 assembly (clang, -O0):
<bu_compile_length>:
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   $0x1,-0xc(%rbp)
je     1169 <bu_compile_length+0x29>
jmp    1183 <bu_compile_length+0x43>
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1050 <EMIT1ATM@plt>
mov    $0x0,%al
call   1030 <EMITEND@plt>
jmp    1195 <bu_compile_length+0x55>
mov    -0x8(%rbp),%rsi
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1060 <cerror@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.conscell = type opaque
@.str = [7 x i8] c"LENGTH\00"
@.str.1 = [24 x i8] c"length: wrong # of args\00"
define void @bu_compile_length(%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, 1
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 ([7 x i8], [7 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 ([24 x i8], [24 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 = [7 x i8] c"LENGTH\00"
@.str.1 = [24 x i8] c"length: wrong # of args\00"
define void @bu_compile_length(%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, 1
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @EMIT1ATM to i32 (i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 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 ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), %struct.conscell* %0)
br label %9
9: ; preds = %7, %4
ret void
}
void setup_bootmem_node(int nid, unsigned long start, unsigned long end) {}


x86 assembly (clang, -O0):
<setup_bootmem_node>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @setup_bootmem_node(i32 %0, i64 %1, i64 %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i64
store i32 %0, i32* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
ret void
}

LLVM IR (-O2):
define void @setup_bootmem_node(i32 %0, i64 %1, i64 %2) {
ret void
}
char *_strip(char *str) {
  if (str[0] == '#') {
    str++;
  }
  return str;
}


x86 assembly (clang, -O0):
<_strip>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
jne    1124 <_strip+0x24>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_strip>:
xor    %eax,%eax
cmpb   $0x23,(%rdi)
sete   %al
add    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @_strip(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 35
%4 = zext i1 %3 to i64
%5 = getelementptr i8, i8* %0, i64 %4
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main(int argc, char *argv[]) {
  size_t mask = 0xff;
  size_t x = 0x89ABCDEF;
  size_t y = 0x76543210;
  size_t res = (x & mask) | (y & ~mask);
  assert(res == 0x765432EF);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0xff,-0x18(%rbp)
mov    $0x89abcdef,%eax
mov    %rax,-0x20(%rbp)
movq   $0x76543210,-0x28(%rbp)
76
mov    -0x20(%rbp),%rax
and    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    -0x18(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
and    %rdx,%rcx
or     %rcx,%rax
mov    %rax,-0x30(%rbp)
cmpq   $0x765432ef,-0x30(%rbp)
76
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <assert@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**
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 255, i64* %6
store i64 2309737967, i64* %7
store i64 1985229328, i64* %8
%10 = load i64, i64* %7
%11 = load i64, i64* %6
%12 = and i64 %10, %11
%13 = load i64, i64* %8
%14 = load i64, i64* %6
%15 = xor i64 %14, -1
%16 = and i64 %13, %15
%17 = or i64 %12, %16
store i64 %17, i64* %9
%18 = load i64, i64* %9
%19 = icmp eq i64 %18, 1985229551
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ iopl(int /*<<< orphan*/);
int /*<<< orphan*/ munlockall();
void end_realtime() {
  munlockall();
  iopl(0);
}


x86 assembly (clang, -O0):
<end_realtime>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <munlockall@plt>
xor    %edi,%edi
call   1030 <iopl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<end_realtime>:
push   %rax
xor    %eax,%eax
call   1040 <munlockall@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <iopl@plt>

LLVM IR (-O0):
define void @end_realtime() {
%1 = call i32 (...) @munlockall()
%2 = call i32 @iopl(i32 0)
ret void
}

LLVM IR (-O2):
define void @end_realtime() {
%1 = tail call i32 (...) @munlockall()
%2 = tail call i32 @iopl(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_option(const char *s, const char *desc, const char *def) {
  printf("  %s          %s", s, desc);
  if (def)
    printf(" (default: %s)", def);
  printf("\n");
}


x86 assembly (clang, -O0):
<print_option>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpq   $0x0,-0x18(%rbp)
je     1157 <print_option+0x47>
mov    -0x18(%rbp),%rsi
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_option>:
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xecf(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   %rbx,%rbx
je     114e <print_option+0x2e>
lea    0xecd(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [17 x i8] c" %s %s\00"
@.str.1 = [15 x i8] c" (default: %s)\00"
define void @print_option(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%5 = icmp eq i8* %2, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %2)
br label %8
8: ; preds = %6, %3
%9 = tail call i32 @putchar(i32 10)
ret void
}
/* Type definitions */
struct rlimit {
  scalar_t__ rlim_max;
  scalar_t__ rlim_cur;
};

/* Variables and functions */
int /*<<< orphan*/ RLIMIT_CORE;
int /*<<< orphan*/ setrlimit(int /*<<< orphan*/, struct rlimit *);
void no_write_coredump(void) {
  struct rlimit rlim;
  rlim.rlim_cur = 0;
  rlim.rlim_max = 0;
  setrlimit(RLIMIT_CORE, &rlim);
}


x86 assembly (clang, -O0):
<no_write_coredump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <setrlimit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<no_write_coredump>:
sub    $0x18,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <setrlimit@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.rlimit = type { i64, i64 }
@RLIMIT_CORE = global i32 0
define void @no_write_coredump() {
%1 = alloca %struct.rlimit
%2 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %1, i32 0, i32 1
store i64 0, i64* %2
%3 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %1, i32 0, i32 0
store i64 0, i64* %3
%4 = load i32, i32* @RLIMIT_CORE
%5 = call i32 @setrlimit(i32 %4, %struct.rlimit* %1)
ret void
}

LLVM IR (-O2):
%struct.rlimit = type { i64, i64 }
@RLIMIT_CORE = global i32 0
define void @no_write_coredump() {
%1 = alloca %struct.rlimit
%2 = bitcast %struct.rlimit* %1 to i8*
%3 = bitcast %struct.rlimit* %1 to i8*
%4 = load i32, i32* @RLIMIT_CORE
%5 = call i32 @setrlimit(i32 %4, %struct.rlimit* %1)
ret void
}
/* Type definitions */
struct rc_instruction {
  int dummy;
};
struct radeon_compiler {
  int dummy;
};

/* Variables and functions */
struct rc_instruction *rc_alloc_instruction(struct radeon_compiler *);
int /*<<< orphan*/ rc_insert_instruction(struct rc_instruction *,
                                         struct rc_instruction *);
struct rc_instruction *rc_insert_new_instruction(struct radeon_compiler *c,
                                                 struct rc_instruction *after) {
  struct rc_instruction *inst = rc_alloc_instruction(c);
  rc_insert_instruction(after, inst);
  return inst;
}


x86 assembly (clang, -O0):
<rc_insert_new_instruction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <rc_alloc_instruction@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <rc_insert_instruction@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rc_insert_new_instruction>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1040 <rc_alloc_instruction@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <rc_insert_instruction@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.radeon_compiler = type { i32 }
%struct.rc_instruction = type { i32 }
define %struct.rc_instruction* @rc_insert_new_instruction(%struct.radeon_compiler* %0, %struct.rc_instruction* %1) {
%3 = alloca %struct.radeon_compiler*
%4 = alloca %struct.rc_instruction*
%5 = alloca %struct.rc_instruction*
store %struct.radeon_compiler* %0, %struct.radeon_compiler** %3
store %struct.rc_instruction* %1, %struct.rc_instruction** %4
%6 = load %struct.radeon_compiler*, %struct.radeon_compiler** %3
%7 = call %struct.rc_instruction* @rc_alloc_instruction(%struct.radeon_compiler* %6)
store %struct.rc_instruction* %7, %struct.rc_instruction** %5
%8 = load %struct.rc_instruction*, %struct.rc_instruction** %4
%9 = load %struct.rc_instruction*, %struct.rc_instruction** %5
%10 = call i32 @rc_insert_instruction(%struct.rc_instruction* %8, %struct.rc_instruction* %9)
%11 = load %struct.rc_instruction*, %struct.rc_instruction** %5
ret %struct.rc_instruction* %11
}

LLVM IR (-O2):
%struct.radeon_compiler = type { i32 }
%struct.rc_instruction = type { i32 }
define %struct.rc_instruction* @rc_insert_new_instruction(%struct.radeon_compiler* %0, %struct.rc_instruction* %1) {
%3 = tail call %struct.rc_instruction* @rc_alloc_instruction(%struct.radeon_compiler* %0)
%4 = tail call i32 @rc_insert_instruction(%struct.rc_instruction* %1, %struct.rc_instruction* %3)
ret %struct.rc_instruction* %3
}
/* Variables and functions */
int /*<<< orphan*/ model_finalize();
int /*<<< orphan*/ model_initialize();
int /*<<< orphan*/ view_frontEnd();
int main() {
  model_initialize();
  view_frontEnd();
  model_finalize();
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @model_initialize()
%2 = call i32 (...) @view_frontEnd()
%3 = call i32 (...) @model_finalize()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @model_initialize()
%2 = tail call i32 (...) @view_frontEnd()
%3 = tail call i32 (...) @model_finalize()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/);
int /*<<< orphan*/ fopen(char *, char *);
void clear_file(char *filename) { fclose(fopen(filename, "w")); }


x86 assembly (clang, -O0):
<clear_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %eax,%edi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_file>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <fclose@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
define void @clear_file(i8* %0) {
%2 = tail call i32 @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @fclose(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *, char *);
void error(char *function, char *message) {
  printf("%s(): %s\n", function, message);
  exit(1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"%s(): %s\0A\00"
define void @error(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 i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [10 x i8] c"%s(): %s\0A\00"
define void @error(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/ *);
int htobe64(int);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
void knot_wire_write_u48(uint8_t *pos, uint64_t data) {
  assert(pos);
  uint64_t swapped = htobe64(data << 8);
  memcpy(pos, (uint8_t *)&swapped + 1, 6);
}


x86 assembly (clang, -O0):
<knot_wire_write_u48>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <assert@plt>
mov    -0xc(%rbp),%edi
shl    $0x8,%edi
call   1050 <htobe64@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
add    $0x4,%rsi
mov    $0x6,%edx
call   1040 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<knot_wire_write_u48>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
call   1030 <assert@plt>
shl    $0x8,%ebx
mov    %ebx,%edi
call   1050 <htobe64@plt>
mov    %eax,0x4(%rsp)
lea    0x8(%rsp),%rsi
mov    %r14,%rdi
mov    $0x6,%edx
call   1040 <memcpy@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @knot_wire_write_u48(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32*, i32** %3
%7 = call i32 @assert(i32* %6)
%8 = load i32, i32* %4
%9 = shl i32 %8, 8
%10 = call i32 @htobe64(i32 %9)
store i32 %10, i32* %5
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %5, i64 1
%13 = call i32 @memcpy(i32* %11, i32* %12, i32 6)
ret void
}

LLVM IR (-O2):
define void @knot_wire_write_u48(i32* %0, i32 %1) {
%3 = alloca i32
%4 = tail call i32 @assert(i32* %0)
%5 = bitcast i32* %3 to i8*
%6 = shl i32 %1, 8
%7 = tail call i32 @htobe64(i32 %6)
store i32 %7, i32* %3
%8 = getelementptr inbounds i32, i32* %3, i64 1
%9 = call i32 @memcpy(i32* %0, i32* %8, i32 6)
ret void
}
void i2d_OCSP_BASICRESP(void) {}


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

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

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

LLVM IR (-O2):
define void @i2d_OCSP_BASICRESP() {
ret void
}
void nested_compound_literals_float(float rad) {
  float vec[6][2] = {{0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169},
                     {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}};
  int a;
  for (a = 0; a < 6; ++a) {
    vec[a][0] *= rad;
    vec[a][1] *= rad;
  }
}


x86 assembly (clang, -O0):
<nested_compound_literals_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movss  %xmm0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xed8(%rip),%rsi
mov    $0x30,%edx
call   1030 <memcpy@plt>
movl   $0x0,-0x44(%rbp)
cmpl   $0x6,-0x44(%rbp)
jge    117b <nested_compound_literals_float+0x6b>
movss  -0x4(%rbp),%xmm0
movslq -0x44(%rbp),%rax
mulss  -0x40(%rbp,%rax,8),%xmm0
movss  %xmm0,-0x40(%rbp,%rax,8)
movss  -0x4(%rbp),%xmm0
movslq -0x44(%rbp),%rax
mulss  -0x3c(%rbp,%rax,8),%xmm0
movss  %xmm0,-0x3c(%rbp,%rax,8)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1139 <nested_compound_literals_float+0x29>
add    $0x50,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.nested_compound_literals_float.vec = [6 x [2 x float]] [[2 x float] [float 0x3FC8F5C280000000, float 0x3F947AE140000000], [2 x float] [float 0x3FD8831260000000, float 0x3FB126E980000000], [2 x float] [float 0x3FE19999A0000000, float 0x3FC5A1CAC0000000], [2 x float] [float 0x3FEA978D40000000, float 0x3FDCCCCCC0000000], [2 x float] [float 0x3FED916880000000, float 0x3FE3BE76C0000000], [2 x float] [float 0x3FEF5C2900000000, float 0x3FE9C28F60000000]]
define void @nested_compound_literals_float(float %0) {
%2 = alloca float
%3 = alloca [6 x [2 x float]]
%4 = alloca i32
store float %0, float* %2
%5 = bitcast [6 x [2 x float]]* %3 to i8*
store i32 0, i32* %4
br label %6
6: ; preds = %24, %1
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 6
br i1 %8, label %9, label %27
9: ; preds = %6
%10 = load float, float* %2
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [6 x [2 x float]], [6 x [2 x float]]* %3, i64 0, i64 %12
%14 = getelementptr inbounds [2 x float], [2 x float]* %13, i64 0, i64 0
%15 = load float, float* %14
%16 = fmul float %15, %10
store float %16, float* %14
%17 = load float, float* %2
%18 = load i32, i32* %4
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [6 x [2 x float]], [6 x [2 x float]]* %3, i64 0, i64 %19
%21 = getelementptr inbounds [2 x float], [2 x float]* %20, i64 0, i64 1
%22 = load float, float* %21
%23 = fmul float %22, %17
store float %23, float* %21
br label %24
24: ; preds = %9
%25 = load i32, i32* %4
%26 = add nsw i32 %25, 1
store i32 %26, i32* %4
br label %6
27: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @nested_compound_literals_float(float %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
char *strmcpy(char *dst, char const *src, size_t maxsize) {
  strncpy(dst, src, maxsize);
  dst[maxsize - 1] = 0;
  return dst;
}


x86 assembly (clang, -O0):
<strmcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strmcpy>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <strncpy@plt>
movb   $0x0,-0x1(%r14,%rbx,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strmcpy(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @strncpy(i8* %7, i8* %8, i64 %9)
%11 = load i8*, i8** %4
%12 = load i64, i64* %6
%13 = sub i64 %12, 1
%14 = getelementptr inbounds i8, i8* %11, i64 %13
store i8 0, i8* %14
%15 = load i8*, i8** %4
ret i8* %15
}

LLVM IR (-O2):
define i8* @strmcpy(i8* returned %0, i8* %1, i64 %2) {
%4 = tail call i32 @strncpy(i8* %0, i8* %1, i64 %2)
%5 = add i64 %2, -1
%6 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 0, i8* %6
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ gen_call(char *);
int /*<<< orphan*/ gen_pop();
void gen_unsigned_less_than(void) {
  gen_pop();
  gen_call("ccult");
}


x86 assembly (clang, -O0):
<gen_unsigned_less_than>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <gen_pop@plt>
lea    0xece(%rip),%rdi
call   1040 <gen_call@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_unsigned_less_than>:
push   %rax
xor    %eax,%eax
call   1030 <gen_pop@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <gen_call@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"ccult\00"
define void @gen_unsigned_less_than() {
%1 = call i32 (...) @gen_pop()
%2 = call i32 @gen_call(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"ccult\00"
define void @gen_unsigned_less_than() {
%1 = tail call i32 (...) @gen_pop()
%2 = tail call i32 @gen_call(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
int EQ_OP(int x, int y) { return x == y; }


x86 assembly (clang, -O0):
<EQ_OP>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<EQ_OP>:
xor    %eax,%eax
cmp    %esi,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @EQ_OP(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 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @EQ_OP(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
const char *GetRev() { return "1244"; }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"1244\00"
define i8* @GetRev() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int rom_present(char *);
int v7_vga_1024i_available(void) {
  return rom_present(L"roms/video/video7/Video Seven VGA 1024i - BIOS - v2.19 "
                     L"- 435-0062-05 - U17 - 27C256.BIN");
}


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

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

LLVM IR (-O0):
@.str = [88 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 55, i32 47, i32 86, i32 105, i32 100, i32 101, i32 111, i32 32, i32 83, i32 101, i32 118, i32 101, i32 110, i32 32, i32 86, i32 71, i32 65, i32 32, i32 49, i32 48, i32 50, i32 52, i32 105, i32 32, i32 45, i32 32, i32 66, i32 73, i32 79, i32 83, i32 32, i32 45, i32 32, i32 118, i32 50, i32 46, i32 49, i32 57, i32 32, i32 45, i32 32, i32 52, i32 51, i32 53, i32 45, i32 48, i32 48, i32 54, i32 50, i32 45, i32 48, i32 53, i32 32, i32 45, i32 32, i32 85, i32 49, i32 55, i32 32, i32 45, i32 32, i32 50, i32 55, i32 67, i32 50, i32 53, i32 54, i32 46, i32 66, i32 73, i32 78, i32 0]
define i32 @v7_vga_1024i_available() {
%1 = call i32 @rom_present(i8* bitcast ([88 x i32]* @.str to i8*))
ret i32 %1
}

LLVM IR (-O2):
@.str = [88 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 55, i32 47, i32 86, i32 105, i32 100, i32 101, i32 111, i32 32, i32 83, i32 101, i32 118, i32 101, i32 110, i32 32, i32 86, i32 71, i32 65, i32 32, i32 49, i32 48, i32 50, i32 52, i32 105, i32 32, i32 45, i32 32, i32 66, i32 73, i32 79, i32 83, i32 32, i32 45, i32 32, i32 118, i32 50, i32 46, i32 49, i32 57, i32 32, i32 45, i32 32, i32 52, i32 51, i32 53, i32 45, i32 48, i32 48, i32 54, i32 50, i32 45, i32 48, i32 53, i32 32, i32 45, i32 32, i32 85, i32 49, i32 55, i32 32, i32 45, i32 32, i32 50, i32 55, i32 67, i32 50, i32 53, i32 54, i32 46, i32 66, i32 73, i32 78, i32 0]
define i32 @v7_vga_1024i_available() {
%1 = tail call i32 @rom_present(i8* bitcast ([88 x i32]* @.str to i8*))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_factor_comments() {
  test_parser_verify_parse(test_parser_sourcefile("factor", " ! comment"),
                           "factor", "", "! comment", 0);
}


x86 assembly (clang, -O0):
<test_factor_comments>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed5(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xebf(%rip),%rdx
lea    0xeba(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_factor_comments>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xed8(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xec8(%rip),%rdx
lea    0xec3(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"factor\00"
@.str.1 = [11 x i8] c" ! comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [10 x i8] c"! comment\00"
define void @test_factor_comments() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"factor\00"
@.str.1 = [11 x i8] c" ! comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [10 x i8] c"! comment\00"
define void @test_factor_comments() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ checkNotNull(char *, char *);
char *strdup(char const *);
char *strdup_s(const char *s) {
  char *r = strdup(s);
  checkNotNull(r, "strdup() failed");
  return r;
}


x86 assembly (clang, -O0):
<strdup_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xebc(%rip),%rsi
call   1030 <checkNotNull@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup_s>:
push   %rbx
call   1040 <strdup@plt>
mov    %rax,%rbx
lea    0xed0(%rip),%rsi
mov    %rax,%rdi
call   1030 <checkNotNull@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"strdup() failed\00"
define i8* @strdup_s(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @checkNotNull(i8* %6, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
@.str = [16 x i8] c"strdup() failed\00"
define i8* @strdup_s(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = tail call i32 @checkNotNull(i8* %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
void unique_id_to_date(unsigned int id, int *y, int *m, int *d) {
  *y = id / 10000000 + 1800;
  *m = ((id % 10000000) / 625000) + 1;
  *d = ((id % 625000) / 15625) + 1;
}


x86 assembly (clang, -O0):
<unique_id_to_date>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x989680,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%ecx
add    $0x708,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
mov    $0x989680,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
mov    $0x98968,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%ecx
add    $0x1,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
mov    $0x98968,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
mov    $0x3d09,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%ecx
add    $0x1,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<unique_id_to_date>:
mov    %edi,%eax
imul   $0x6b5fca6b,%rax,%r8
mov    %r8,%r9
shr    $0x36,%r9
lea    0x708(%r9),%eax
mov    %eax,(%rsi)
imul   $0x989680,%r9d,%eax
mov    %edi,%esi
sub    %eax,%esi
imul   $0x6b5fca6b,%rsi,%rax
shr    $0x32,%rax
add    $0x1,%eax
mov    %eax,(%rdx)
shr    $0x32,%r8
imul   $0x98968,%r8d,%eax
sub    %eax,%edi
imul   $0x431bde83,%rdi,%rax
shr    $0x2c,%rax
add    $0x1,%eax
mov    %eax,(%rcx)
ret

LLVM IR (-O0):
define void @unique_id_to_date(i32 %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32, i32* %5
%10 = udiv i32 %9, 10000000
%11 = add i32 %10, 1800
%12 = load i32*, i32** %6
store i32 %11, i32* %12
%13 = load i32, i32* %5
%14 = urem i32 %13, 10000000
%15 = udiv i32 %14, 625000
%16 = add i32 %15, 1
%17 = load i32*, i32** %7
store i32 %16, i32* %17
%18 = load i32, i32* %5
%19 = urem i32 %18, 625000
%20 = udiv i32 %19, 15625
%21 = add i32 %20, 1
%22 = load i32*, i32** %8
store i32 %21, i32* %22
ret void
}

LLVM IR (-O2):
define void @unique_id_to_date(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3) {
%5 = udiv i32 %0, 10000000
%6 = add nuw nsw i32 %5, 1800
store i32 %6, i32* %1
%7 = urem i32 %0, 10000000
%8 = udiv i32 %7, 625000
%9 = add nuw nsw i32 %8, 1
store i32 %9, i32* %2
%10 = urem i32 %0, 625000
%11 = udiv i32 %10, 15625
%12 = add nuw nsw i32 %11, 1
store i32 %12, i32* %3
ret void
}
double d_d_test(double data) {
  printf("Entered %s:\n", __FUNCTION__);
  printf("Data In: %e\n", data);
  printf("Exited  %s:\n", __FUNCTION__);
  return data;
}


x86 assembly (clang, -O0):
<d_d_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    0xedc(%rip),%rdi
lea    0xee2(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
lea    0xed8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
lea    0xeba(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_d_test>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
lea    0xede(%rip),%rdi
lea    0xee4(%rip),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
movsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Entered %s:\0A\00"
@__FUNCTION__.d_d_test = [9 x i8] c"d_d_test\00"
@.str.1 = [13 x i8] c"Data In: %e\0A\00"
@.str.2 = [13 x i8] c"Exited %s:\0A\00"
define double @d_d_test(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__FUNCTION__.d_d_test, i64 0, i64 0))
%4 = load double, double* %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__FUNCTION__.d_d_test, i64 0, i64 0))
%7 = load double, double* %2
ret double %7
}

LLVM IR (-O2):
@.str = [13 x i8] c"Entered %s:\0A\00"
@__FUNCTION__.d_d_test = [9 x i8] c"d_d_test\00"
@.str.1 = [13 x i8] c"Data In: %e\0A\00"
@.str.2 = [13 x i8] c"Exited %s:\0A\00"
define double @d_d_test(double returned %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__FUNCTION__.d_d_test, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double %0)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__FUNCTION__.d_d_test, i64 0, i64 0))
ret double %0
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ a4;
};
typedef TYPE_1__ xfrm_address_t;

/* Variables and functions */
unsigned int ntohl(int /*<<< orphan*/);
unsigned int __xfrm4_addr_hash(const xfrm_address_t *addr) {
  return ntohl(addr->a4);
}


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

x86 assembly (clang, -O2):
<__xfrm4_addr_hash>:
mov    (%rdi),%edi
jmp    1030 <ntohl@plt>

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
define i32 @__xfrm4_addr_hash(%struct.TYPE_3__* %0) {
%2 = alloca %struct.TYPE_3__*
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %2
%3 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = call i32 @ntohl(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
define i32 @__xfrm4_addr_hash(%struct.TYPE_3__* nocapture %0) {
%2 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i32 @ntohl(i32 %3)
ret i32 %4
}
int view_set_title(struct view *v, const char *title) {
  (void)v;
  (void)title;
  return 0;
}


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

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

LLVM IR (-O0):
%struct.view = type opaque
define i32 @view_set_title(%struct.view* %0, i8* %1) {
%3 = alloca %struct.view*
%4 = alloca i8*
store %struct.view* %0, %struct.view** %3
store i8* %1, i8** %4
%5 = load %struct.view*, %struct.view** %3
%6 = load i8*, i8** %4
ret i32 0
}

LLVM IR (-O2):
%struct.view = type opaque
define i32 @view_set_title(%struct.view* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}