xunge/DecIR huggingface dataset:
int is_prime(int n, int i) {
  for (i = 2; i <= n; i++) {
    if (n % i == 0 && i != n) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1158 <is_prime+0x58>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1145 <is_prime+0x45>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     1145 <is_prime+0x45>
movl   $0x0,-0x4(%rbp)
jmp    115f <is_prime+0x5f>
jmp    114a <is_prime+0x4a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <is_prime+0x11>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
mov    $0x1,%eax
cmp    $0x2,%edi
jl     1141 <is_prime+0x41>
mov    $0x1,%ecx
sub    %edi,%ecx
mov    $0x2,%esi
jmp    1132 <is_prime+0x32>
nopl   0x0(%rax,%rax,1)
lea    (%rcx,%rsi,1),%eax
add    $0x1,%eax
mov    %esi,%edx
add    $0x1,%edx
mov    %edx,%esi
cmp    $0x2,%eax
je     1142 <is_prime+0x42>
mov    %edi,%eax
cltd
idiv   %esi
cmp    %esi,%edi
je     1120 <is_prime+0x20>
test   %edx,%edx
jne    1120 <is_prime+0x20>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @is_prime(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 2, i32* %5
br label %6
6: ; preds = %21, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp sle i32 %7, %8
br i1 %9, label %10, label %24
10: ; preds = %6
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = srem i32 %11, %12
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %20
15: ; preds = %10
%16 = load i32, i32* %5
%17 = load i32, i32* %4
%18 = icmp ne i32 %16, %17
br i1 %18, label %19, label %20
19: ; preds = %15
store i32 0, i32* %3
br label %25
20: ; preds = %15, %10
br label %21
21: ; preds = %20
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %6
24: ; preds = %6
store i32 1, i32* %3
br label %25
25: ; preds = %24, %19
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @is_prime(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = add nuw i32 %8, 1
%6 = icmp eq i32 %8, %0
br i1 %6, label %13, label %7
7: ; preds = %2, %4
%8 = phi i32 [ %5, %4 ], [ 2, %2 ]
%9 = srem i32 %0, %8
%10 = icmp ne i32 %9, 0
%11 = icmp eq i32 %8, %0
%12 = or i1 %11, %10
br i1 %12, label %4, label %13
13: ; preds = %7, %4, %2
%14 = phi i32 [ 1, %2 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ CAN1_ISR();
int /*<<< orphan*/ USART2_ISR();
void USART2_CAN1_ISR(void) {
  USART2_ISR();
  CAN1_ISR();
}


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

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

LLVM IR (-O0):
define void @USART2_CAN1_ISR() {
%1 = call i32 (...) @USART2_ISR()
%2 = call i32 (...) @CAN1_ISR()
ret void
}

LLVM IR (-O2):
define void @USART2_CAN1_ISR() {
%1 = tail call i32 (...) @USART2_ISR()
%2 = tail call i32 (...) @CAN1_ISR()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ func();
int /*<<< orphan*/ printf(char *);
int main() {
  int a = 0;
  while (1) {
    func();
  }
  do {
    func();
    a += 1;
  } while (0);
  switch (a) {
  case 0:
    func();
    a += 1;
    break;
  case 1:
    func();
    goto byebye;
    break;
  default:
    break;
  }
byebye:
  printf("See ya!");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <func@plt>
jmp    1126 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <func@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
@.str = [8 x i8] c"See ya!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %0, %3
%4 = call i32 (...) @func()
br label %3
5: ; No predecessors!
%6 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @func()
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ int_log2(unsigned long);
unsigned long mfspr(int);
int /*<<< orphan*/ printf(char *, unsigned long);
int /*<<< orphan*/ setreg(int, int /*<<< orphan*/);
void interrupt_handler() {
  unsigned long int picsr = mfspr(((9 << (11)) + 2));
  printf("PICSR = 0x%08lx\n", picsr);
  setreg(0x98000000, int_log2(picsr & -picsr));
}


x86 assembly (clang, -O0):
<interrupt_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4802,%edi
call   1050 <mfspr@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xe9f(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
sub    -0x8(%rbp),%rax
and    %rax,%rdi
call   1060 <int_log2@plt>
mov    %eax,%esi
mov    $0x98000000,%edi
call   1030 <setreg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<interrupt_handler>:
push   %rbx
mov    $0x4802,%edi
call   1050 <mfspr@plt>
mov    %rax,%rbx
lea    0xeab(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
neg    %rdi
and    %rbx,%rdi
call   1060 <int_log2@plt>
mov    $0x98000000,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <setreg@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"PICSR = 0x%08lx\0A\00"
define void @interrupt_handler() {
%1 = alloca i64
%2 = call i64 @mfspr(i32 18434)
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i64 %3)
%5 = load i64, i64* %1
%6 = load i64, i64* %1
%7 = sub i64 0, %6
%8 = and i64 %5, %7
%9 = call i32 @int_log2(i64 %8)
%10 = call i32 @setreg(i32 -1744830464, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"PICSR = 0x%08lx\0A\00"
define void @interrupt_handler() {
%1 = tail call i64 @mfspr(i32 18434)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i64 %1)
%3 = sub i64 0, %1
%4 = and i64 %1, %3
%5 = tail call i32 @int_log2(i64 %4)
%6 = tail call i32 @setreg(i32 -1744830464, i32 %5)
ret void
}
/* Type definitions */
struct in_addr {
  int /*<<< orphan*/ s_addr;
};
typedef int /*<<< orphan*/ in_addr_t;

/* Variables and functions */
int /*<<< orphan*/ INADDR_NONE;
scalar_t__ __inet_aton(char const *, struct in_addr *);
in_addr_t __inet_addr(const char *cp) {
  struct in_addr val;
  if (__inet_aton(cp, &val))
    return (val.s_addr);
  return (INADDR_NONE);
}


x86 assembly (clang, -O0):
<__inet_addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <__inet_aton@plt>
cmp    $0x0,%rax
je     113e <__inet_addr+0x2e>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114a <__inet_addr+0x3a>
mov    0x2ea3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__inet_addr>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rsi
call   1030 <__inet_aton@plt>
test   %rax,%rax
jne    112e <__inet_addr+0x1e>
mov    0x2eba(%rip),%rbx
mov    (%rbx),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.in_addr = type { i32 }
@INADDR_NONE = global i32 0
define i32 @__inet_addr(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.in_addr
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @__inet_aton(i8* %5, %struct.in_addr* %4)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %4, i32 0, i32 0
%10 = load i32, i32* %9
store i32 %10, i32* %2
br label %13
11: ; preds = %1
%12 = load i32, i32* @INADDR_NONE
store i32 %12, i32* %2
br label %13
13: ; preds = %11, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.in_addr = type { i32 }
@INADDR_NONE = global i32 0
define i32 @__inet_addr(i8* %0) {
%2 = alloca %struct.in_addr
%3 = bitcast %struct.in_addr* %2 to i8*
%4 = call i64 @__inet_aton(i8* %0, %struct.in_addr* %2)
%5 = icmp eq i64 %4, 0
%6 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = load i32, i32* @INADDR_NONE
%9 = select i1 %5, i32 %8, i32 %7
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ luai_writestringerror(char *, char const *);
void l_message(const char *pname, const char *msg) {
  if (pname)
    luai_writestringerror("%s: ", pname);
  luai_writestringerror("%s\n", msg);
}


x86 assembly (clang, -O0):
<l_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113b <l_message+0x2b>
mov    -0x8(%rbp),%rsi
lea    0xeca(%rip),%rdi
call   1030 <luai_writestringerror@plt>
mov    -0x10(%rbp),%rsi
lea    0xebf(%rip),%rdi
call   1030 <luai_writestringerror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<l_message>:
push   %rbx
mov    %rsi,%rbx
test   %rdi,%rdi
je     1128 <l_message+0x18>
mov    %rdi,%rsi
lea    0xedd(%rip),%rdi
call   1030 <luai_writestringerror@plt>
lea    0xed6(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <luai_writestringerror@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%s: \00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @l_message(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 = icmp ne i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = call i32 @luai_writestringerror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %10
10: ; preds = %7, %2
%11 = load i8*, i8** %4
%12 = call i32 @luai_writestringerror(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %11)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s: \00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @l_message(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @luai_writestringerror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %4, %2
%7 = tail call i32 @luai_writestringerror(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %1)
ret void
}
char *remove_chr(char *s, char search) {
  char ch;
  char *begin = s;
  char *d = s;
  while ((ch = *s)) {
    if (ch != search) {
      *d++ = ch;
    }
    s++;
  }
  *d = 0;
  return begin;
}


x86 assembly (clang, -O0):
<remove_chr>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0xa(%rbp)
cmp    $0x0,%al
je     1164 <remove_chr+0x64>
movsbl -0xa(%rbp),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
je     1153 <remove_chr+0x53>
mov    -0xa(%rbp),%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111e <remove_chr+0x1e>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_chr>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     1138 <remove_chr+0x38>
lea    0x1(%rax),%rdx
mov    %rax,%rdi
jmp    112b <remove_chr+0x2b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdx),%ecx
add    $0x1,%rdx
test   %cl,%cl
je     1138 <remove_chr+0x38>
cmp    %sil,%cl
je     1120 <remove_chr+0x20>
mov    %cl,(%rdi)
add    $0x1,%rdi
jmp    1120 <remove_chr+0x20>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define i8* @remove_chr(i8* returned %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %17, label %5
5: ; preds = %2, %12
%6 = phi i8 [ %15, %12 ], [ %3, %2 ]
%7 = phi i8* [ %13, %12 ], [ %0, %2 ]
%8 = phi i8* [ %14, %12 ], [ %0, %2 ]
%9 = icmp eq i8 %6, %1
br i1 %9, label %12, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %6, i8* %7
br label %12
12: ; preds = %10, %5
%13 = phi i8* [ %11, %10 ], [ %7, %5 ]
%14 = getelementptr inbounds i8, i8* %8, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %5
17: ; preds = %12, %2
%18 = phi i8* [ %0, %2 ], [ %13, %12 ]
store i8 0, i8* %18
ret i8* %0
}
/* Variables and functions */
int read_args(int, char **);
int dataset_init(int argc, char *argv[]) { return read_args(argc, argv); }


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

x86 assembly (clang, -O2):
<dataset_init>:
jmp    1030 <read_args@plt>

LLVM IR (-O0):
define i32 @dataset_init(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = load i8**, i8*** %4
%7 = call i32 @read_args(i32 %5, i8** %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @dataset_init(i32 %0, i8** %1) {
%3 = tail call i32 @read_args(i32 %0, i8** %1)
ret i32 %3
}
void g_cclosure_marshal_VOID__BOXED() {}


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

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

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

LLVM IR (-O2):
define void @g_cclosure_marshal_VOID__BOXED() {
ret void
}
void juman_log_err_null(const char *format, ...) {}


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

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

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

LLVM IR (-O2):
define void @juman_log_err_null(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IPC_RMID;
int semctl(int, int /*<<< orphan*/, int /*<<< orphan*/);
int remove_sem(int semid) { return semctl(semid, 0, IPC_RMID); }


x86 assembly (clang, -O0):
<remove_sem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <semctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_sem>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
jmp    1030 <semctl@plt>

LLVM IR (-O0):
@IPC_RMID = global i32 0
define i32 @remove_sem(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @IPC_RMID
%5 = call i32 @semctl(i32 %3, i32 0, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@IPC_RMID = global i32 0
define i32 @remove_sem(i32 %0) {
%2 = load i32, i32* @IPC_RMID
%3 = tail call i32 @semctl(i32 %0, i32 0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ merge(int, int, int);
void mergesort(int pocz, int kon) {
  int sr;
  if (pocz < kon) {
    sr = (pocz + kon) / 2;
    mergesort(pocz, sr);
    mergesort(sr + 1, kon);
    merge(pocz, sr, kon);
  }
}


x86 assembly (clang, -O0):
<mergesort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1172 <mergesort+0x52>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <mergesort@plt>
mov    -0xc(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%esi
call   1040 <mergesort@plt>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1030 <merge@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mergesort>:
cmp    %esi,%edi
jge    1160 <mergesort+0x40>
push   %r15
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%r15d
lea    (%r14,%r15,1),%eax
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
sar    %ebx
mov    %ebx,%esi
call   1040 <mergesort@plt>
lea    0x1(%rbx),%edi
mov    %r14d,%esi
call   1040 <mergesort@plt>
mov    %r15d,%edi
mov    %ebx,%esi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <merge@plt>
ret

LLVM IR (-O0):
define void @mergesort(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %23
9: ; preds = %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = add nsw i32 %10, %11
%13 = sdiv i32 %12, 2
store i32 %13, i32* %5
%14 = load i32, i32* %3
%15 = load i32, i32* %5
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
%18 = load i32, i32* %4
%19 = load i32, i32* %3
%20 = load i32, i32* %5
%21 = load i32, i32* %4
%22 = call i32 @merge(i32 %19, i32 %20, i32 %21)
br label %23
23: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
define void @mergesort(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
br i1 %3, label %5, label %4
4: ; preds = %2, %5
ret void
5: ; preds = %2
%6 = add nsw i32 %1, %0
%7 = sdiv i32 %6, 2
tail call void @mergesort(i32 %0, i32 %7)
%8 = add nsw i32 %7, 1
tail call void @mergesort(i32 %8, i32 %1)
%9 = tail call i32 @merge(i32 %0, i32 %7, i32 %1)
br label %4
}
void RTSemMutexSetSubClass(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSemMutexSetSubClass() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FB_PRINT_CONVERT_BIN_NEWLINE(int);
int /*<<< orphan*/ fb_LPrintInit();
int /*<<< orphan*/ fb_PrintFixString(int, int /*<<< orphan*/,
                                     int /*<<< orphan*/);
int /*<<< orphan*/ fb_hFloat2Str(double, char *, int, int);
void fb_LPrintDouble(int fnum, double val, int mask) {
  char buffer[16 + 1 + 9 + 1];
  fb_LPrintInit();
  fb_PrintFixString(fnum, fb_hFloat2Str(val, buffer, 16, 0x00000001),
                    FB_PRINT_CONVERT_BIN_NEWLINE(mask));
}


x86 assembly (clang, -O0):
<fb_LPrintDouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    $0x0,%al
call   1030 <fb_LPrintInit@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    -0x30(%rbp),%rdi
mov    $0x10,%esi
mov    $0x1,%edx
call   1060 <fb_hFloat2Str@plt>
mov    %eax,-0x34(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <FB_PRINT_CONVERT_BIN_NEWLINE@plt>
mov    -0x38(%rbp),%edi
mov    -0x34(%rbp),%esi
mov    %eax,%edx
call   1050 <fb_PrintFixString@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_LPrintDouble>:
push   %rbp
push   %r14
push   %rbx
sub    $0x30,%rsp
mov    %esi,%ebx
movsd  %xmm0,0x8(%rsp)
mov    %edi,%r14d
xor    %eax,%eax
call   1030 <fb_LPrintInit@plt>
lea    0x10(%rsp),%rdi
movsd  0x8(%rsp),%xmm0
mov    $0x10,%esi
mov    $0x1,%edx
call   1060 <fb_hFloat2Str@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1040 <FB_PRINT_CONVERT_BIN_NEWLINE@plt>
mov    %r14d,%edi
mov    %ebp,%esi
mov    %eax,%edx
call   1050 <fb_PrintFixString@plt>
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @fb_LPrintDouble(i32 %0, double %1, i32 %2) {
%4 = alloca i32
%5 = alloca double
%6 = alloca i32
%7 = alloca [27 x i8]
store i32 %0, i32* %4
store double %1, double* %5
store i32 %2, i32* %6
%8 = call i32 (...) @fb_LPrintInit()
%9 = load i32, i32* %4
%10 = load double, double* %5
%11 = getelementptr inbounds [27 x i8], [27 x i8]* %7, i64 0, i64 0
%12 = call i32 @fb_hFloat2Str(double %10, i8* %11, i32 16, i32 1)
%13 = load i32, i32* %6
%14 = call i32 @FB_PRINT_CONVERT_BIN_NEWLINE(i32 %13)
%15 = call i32 @fb_PrintFixString(i32 %9, i32 %12, i32 %14)
ret void
}

LLVM IR (-O2):
define void @fb_LPrintDouble(i32 %0, double %1, i32 %2) {
%4 = alloca [27 x i8]
%5 = getelementptr inbounds [27 x i8], [27 x i8]* %4, i64 0, i64 0
%6 = tail call i32 (...) @fb_LPrintInit()
%7 = call i32 @fb_hFloat2Str(double %1, i8* %5, i32 16, i32 1)
%8 = call i32 @FB_PRINT_CONVERT_BIN_NEWLINE(i32 %2)
%9 = call i32 @fb_PrintFixString(i32 %0, i32 %7, i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen_nest_pack(char *);
int /*<<< orphan*/ gen_nest_unpack(char *);
int gen_nest_packing(char *dirname) {
  gen_nest_pack(dirname);
  gen_nest_unpack(dirname);
  return 0;
}


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

x86 assembly (clang, -O2):
<gen_nest_packing>:
push   %rbx
mov    %rdi,%rbx
call   1030 <gen_nest_pack@plt>
mov    %rbx,%rdi
call   1040 <gen_nest_unpack@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @gen_nest_packing(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @gen_nest_pack(i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @gen_nest_unpack(i8* %5)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_nest_packing(i8* %0) {
%2 = tail call i32 @gen_nest_pack(i8* %0)
%3 = tail call i32 @gen_nest_unpack(i8* %0)
ret i32 0
}
void sg_process_destroy_comp(void) {}


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

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

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

LLVM IR (-O2):
define void @sg_process_destroy_comp() {
ret void
}
unsigned int test3(unsigned int x, unsigned int y, unsigned int z,
                   unsigned int weight, unsigned int w1, unsigned int w2,
                   unsigned int w3) {
  unsigned int wtmp1 = w1 * weight;
  unsigned int wtmp2 = w2 * weight;
  unsigned int wtmp3 = w3 * weight;
  unsigned int tmp1 = x * wtmp1;
  unsigned int tmp2 = y * wtmp2;
  unsigned int tmp3 = z * wtmp3;
  return tmp1 + tmp2 + tmp3;
}


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x14(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    0x10(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x1c(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x20(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x24(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x28(%rbp),%eax
add    -0x2c(%rbp),%eax
add    -0x30(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test3>:
imul   %r8d,%edi
imul   %r9d,%esi
lea    (%rsi,%rdi,1),%eax
imul   0x8(%rsp),%edx
add    %edx,%eax
imul   %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test3(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%21 = load i32, i32* %12
%22 = load i32, i32* %11
%23 = mul i32 %21, %22
store i32 %23, i32* %15
%24 = load i32, i32* %13
%25 = load i32, i32* %11
%26 = mul i32 %24, %25
store i32 %26, i32* %16
%27 = load i32, i32* %14
%28 = load i32, i32* %11
%29 = mul i32 %27, %28
store i32 %29, i32* %17
%30 = load i32, i32* %8
%31 = load i32, i32* %15
%32 = mul i32 %30, %31
store i32 %32, i32* %18
%33 = load i32, i32* %9
%34 = load i32, i32* %16
%35 = mul i32 %33, %34
store i32 %35, i32* %19
%36 = load i32, i32* %10
%37 = load i32, i32* %17
%38 = mul i32 %36, %37
store i32 %38, i32* %20
%39 = load i32, i32* %18
%40 = load i32, i32* %19
%41 = add i32 %39, %40
%42 = load i32, i32* %20
%43 = add i32 %41, %42
ret i32 %43
}

LLVM IR (-O2):
define i32 @test3(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = mul i32 %4, %0
%9 = mul i32 %5, %1
%10 = mul i32 %6, %2
%11 = add i32 %9, %8
%12 = add i32 %11, %10
%13 = mul i32 %12, %3
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ decode(int *, int *, int *);
int /*<<< orphan*/ printf(char *, int, int, int);
void main() {
  int a = 3;
  int b = 5;
  int c = 9;
  decode(&a, &b, &c);
  printf("a = %d, b = %d, c = %d\n", a, b, c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x9,-0xc(%rbp)
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <decode@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movl   $0x3,0x14(%rsp)
movl   $0x5,0x10(%rsp)
movl   $0x9,0xc(%rsp)
lea    0x14(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1040 <decode@plt>
mov    0x14(%rsp),%esi
mov    0x10(%rsp),%edx
mov    0xc(%rsp),%ecx
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [24 x i8] c"a = %d, b = %d, c = %d\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
store i32 3, i32* %1
%5 = bitcast i32* %2 to i8*
store i32 5, i32* %2
%6 = bitcast i32* %3 to i8*
store i32 9, i32* %3
%7 = call i32 @decode(i32* %1, i32* %2, i32* %3)
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9, i32 %10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Open Source SW Project\n");
  printf("Code edit check\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>
lea    0xee6(%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>
lea    0xef3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Open Source SW Project\0A\00"
@.str.1 = [17 x i8] c"Code edit check\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [23 x i8] c"Open Source SW Project\00"
@str.2 = [16 x i8] c"Code edit check\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int fabs(double);
int isDoubleNonZero(double x) { return fabs(x) < 10e-12; }


x86 assembly (clang, -O0):
<isDoubleNonZero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xecd(%rip),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isDoubleNonZero>:
push   %rax
call   1030 <fabs@plt>
xor    %ecx,%ecx
test   %eax,%eax
setle  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @isDoubleNonZero(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @fabs(double %3)
%5 = sitofp i32 %4 to double
%6 = fcmp olt double %5, 0x3DA5FD7FE1796495
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @isDoubleNonZero(double %0) {
%2 = tail call i32 @fabs(double %0)
%3 = icmp slt i32 %2, 1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int, int, int, int, int, int);
int test_callfunc8(char *dest, int n_args, int a1, int a2, int a3, int a4,
                   int a5, int a6) {
  sprintf(dest, "%d %d %d %d %d %d %d", n_args, a1, a2, a3, a4, a5, a6);
  return n_args;
}


x86 assembly (clang, -O0):
<test_callfunc8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    -0x1c(%rbp),%r11d
mov    0x10(%rbp),%r10d
mov    0x18(%rbp),%eax
lea    0xea9(%rip),%rsi
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   1030 <sprintf@plt>
mov    -0xc(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_callfunc8>:
push   %rbx
mov    %r9d,%eax
mov    %r8d,%r9d
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%ebx
mov    0x10(%rsp),%r10d
mov    0x18(%rsp),%r11d
sub    $0x8,%rsp
lea    0xecd(%rip),%rsi
mov    %ebx,%edx
push   %r11
push   %r10
push   %rax
call   1030 <sprintf@plt>
add    $0x20,%rsp
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [21 x i8] c"%d %d %d %d %d %d %d\00"
define i32 @test_callfunc8(i8* nocapture writeonly %0, i32 returned %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7) {
%9 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void fid_run_free(void *run) { free(run); }


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

x86 assembly (clang, -O2):
<fid_run_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @fid_run_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int f389(int *);
int f390(int *p) { return f389(p); }


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

x86 assembly (clang, -O2):
<f390>:
jmp    1030 <f389@plt>

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

LLVM IR (-O2):
define i32 @f390(i32* %0) {
%2 = tail call i32 @f389(i32* %0)
ret i32 %2
}
int jan1(int yr) {
  int y, d;
  y = yr + 1900;
  d = (4 + y + (y + 3) / 4 - (y - 1701) / 100 + (y - 1601) / 400 + 3) % 7;
  return d;
}


x86 assembly (clang, -O0):
<jan1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x76c,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
add    $0x3,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x6a5,%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x641,%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
add    $0x3,%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jan1>:
lea    0x76f(%rdi),%ecx
lea    0x772(%rdi),%eax
test   %ecx,%ecx
cmovns %ecx,%eax
sar    $0x2,%eax
lea    0xc7(%rdi),%ecx
movslq %ecx,%rcx
imul   $0xffffffffae147ae1,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    $0x5,%ecx
add    %edx,%ecx
lea    0x12b(%rdi),%edx
movslq %edx,%rdx
imul   $0x51eb851f,%rdx,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
shr    $0x20,%rdx
sar    $0x7,%edx
add    %esi,%edx
add    %edi,%eax
add    %ecx,%eax
lea    (%rax,%rdx,1),%ecx
add    $0x773,%ecx
add    %edx,%eax
movslq %ecx,%rcx
imul   $0xffffffff92492493,%rcx,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
add    $0x773,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x2,%ecx
add    %edx,%ecx
lea    0x0(,%rcx,8),%edx
sub    %edx,%ecx
add    %ecx,%eax
add    $0x773,%eax
ret

LLVM IR (-O0):
define i32 @jan1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1900
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = add nsw i32 4, %7
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 3
%11 = sdiv i32 %10, 4
%12 = add nsw i32 %8, %11
%13 = load i32, i32* %3
%14 = sub nsw i32 %13, 1701
%15 = sdiv i32 %14, 100
%16 = sub nsw i32 %12, %15
%17 = load i32, i32* %3
%18 = sub nsw i32 %17, 1601
%19 = sdiv i32 %18, 400
%20 = add nsw i32 %16, %19
%21 = add nsw i32 %20, 3
%22 = srem i32 %21, 7
store i32 %22, i32* %4
%23 = load i32, i32* %4
ret i32 %23
}

LLVM IR (-O2):
define i32 @jan1(i32 %0) {
%2 = add nsw i32 %0, 1903
%3 = sdiv i32 %2, 4
%4 = add nsw i32 %0, 199
%5 = sdiv i32 %4, -100
%6 = add nsw i32 %0, 299
%7 = sdiv i32 %6, 400
%8 = add i32 %0, 1907
%9 = add i32 %8, %3
%10 = add i32 %9, %5
%11 = add i32 %10, %7
%12 = srem i32 %11, 7
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int putwin(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int macro_putwin(WINDOW *win, const char *filename) {
  FILE *filep;
  int ierr;
  filep = fopen(filename, "w");
  ierr = putwin(win, filep);
  fclose(filep);
  return (ierr);
}


x86 assembly (clang, -O0):
<macro_putwin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <putwin@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<macro_putwin>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rax
mov    %rdi,%r14
lea    0xebf(%rip),%rsi
mov    %rax,%rdi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <putwin@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
define i32 @macro_putwin(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32
store i32* %0, i32** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = call i32* @fopen(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %8, i32** %5
%9 = load i32*, i32** %3
%10 = load i32*, i32** %5
%11 = call i32 @putwin(i32* %9, i32* %10)
store i32 %11, i32* %6
%12 = load i32*, i32** %5
%13 = call i32 @fclose(i32* %12)
%14 = load i32, i32* %6
ret i32 %14
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
define i32 @macro_putwin(i32* %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @putwin(i32* %0, i32* %3)
%5 = tail call i32 @fclose(i32* %3)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct chirp_client {
  int dummy;
};
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ send_command(struct chirp_client *, int /*<<< orphan*/,
                                char *, int /*<<< orphan*/);
int64_t chirp_client_fsync_begin(struct chirp_client *c, int64_t fd,
                                 time_t stoptime) {
  return send_command(c, stoptime, "fsync %lld\n", fd);
}


x86 assembly (clang, -O0):
<chirp_client_fsync_begin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%ecx
lea    0xecd(%rip),%rdx
call   1030 <send_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chirp_client_fsync_begin>:
mov    %esi,%ecx
lea    0xee7(%rip),%rax
mov    %edx,%esi
mov    %rax,%rdx
jmp    1030 <send_command@plt>

LLVM IR (-O0):
%struct.chirp_client = type { i32 }
@.str = [12 x i8] c"fsync %lld\0A\00"
define i32 @chirp_client_fsync_begin(%struct.chirp_client* %0, i32 %1, i32 %2) {
%4 = alloca %struct.chirp_client*
%5 = alloca i32
%6 = alloca i32
store %struct.chirp_client* %0, %struct.chirp_client** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.chirp_client*, %struct.chirp_client** %4
%8 = load i32, i32* %6
%9 = load i32, i32* %5
%10 = call i32 @send_command(%struct.chirp_client* %7, i32 %8, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.chirp_client = type { i32 }
@.str = [12 x i8] c"fsync %lld\0A\00"
define i32 @chirp_client_fsync_begin(%struct.chirp_client* %0, i32 %1, i32 %2) {
%4 = tail call i32 @send_command(%struct.chirp_client* %0, i32 %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %4
}
/* Variables and functions */
unsigned int ppi_read_port(int);
unsigned int PPI_ReadPortC(void) { return ppi_read_port(2); }


x86 assembly (clang, -O0):
<PPI_ReadPortC>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <ppi_read_port@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PPI_ReadPortC>:
mov    $0x2,%edi
jmp    1030 <ppi_read_port@plt>

LLVM IR (-O0):
define i32 @PPI_ReadPortC() {
%1 = call i32 @ppi_read_port(i32 2)
ret i32 %1
}

LLVM IR (-O2):
define i32 @PPI_ReadPortC() {
%1 = tail call i32 @ppi_read_port(i32 2)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ syscall3(int, int, int);
void get_xy(char *x, char *y) { syscall3(513, (int)x, (int)y); }


x86 assembly (clang, -O0):
<get_xy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%esi
mov    -0x10(%rbp),%rax
mov    %eax,%edx
mov    $0x201,%edi
call   1030 <syscall3@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_xy>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x201,%edi
jmp    1030 <syscall3@plt>

LLVM IR (-O0):
define void @get_xy(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 = ptrtoint i8* %5 to i32
%7 = load i8*, i8** %4
%8 = ptrtoint i8* %7 to i32
%9 = call i32 @syscall3(i32 513, i32 %6, i32 %8)
ret void
}

LLVM IR (-O2):
define void @get_xy(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = trunc i64 %3 to i32
%5 = ptrtoint i8* %1 to i64
%6 = trunc i64 %5 to i32
%7 = tail call i32 @syscall3(i32 513, i32 %4, i32 %6)
ret void
}
unsigned short revend16(unsigned short i) {
  return ((i >> 8) & 0xff) | ((i << 8) & 0xff00);
}


x86 assembly (clang, -O0):
<revend16>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
movzwl -0x2(%rbp),%ecx
shl    $0x8,%ecx
and    $0xff00,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<revend16>:
mov    %edi,%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @revend16(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = ashr i32 %4, 8
%6 = and i32 %5, 255
%7 = load i16, i16* %2
%8 = zext i16 %7 to i32
%9 = shl i32 %8, 8
%10 = and i32 %9, 65280
%11 = or i32 %6, %10
%12 = trunc i32 %11 to i16
ret i16 %12
}

LLVM IR (-O2):
define zeroext i16 @revend16(i16 zeroext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}
void txt_noteoff(chan, pitch, vol) {
  prtime();
  printf("Note off, chan=%d pitch=%d vol=%d\n", chan + 1, pitch, vol);
}


x86 assembly (clang, -O0):
<txt_noteoff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x0,%al
call   1040 <prtime@plt>
mov    -0x4(%rbp),%esi
add    $0x1,%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<txt_noteoff>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <prtime@plt>
add    $0x1,%ebx
lea    0xec4(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %r14d,%ecx
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"Note off, chan=%d pitch=%d vol=%d\0A\00"
define void @txt_noteoff(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = call i32 (...) @prtime()
%8 = load i32, i32* %4
%9 = add nsw i32 %8, 1
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10, i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"Note off, chan=%d pitch=%d vol=%d\0A\00"
define void @txt_noteoff(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 (...) @prtime()
%5 = add nsw i32 %0, 1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %1, i32 %2)
ret void
}
char isleap(int year) {
  if (!(year % 100)) {
    return (char)(year % 400);
  } else {
    return (char)(year % 4);
  }
}


x86 assembly (clang, -O0):
<isleap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1130 <isleap+0x30>
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
mov    %dl,%al
mov    %al,-0x1(%rbp)
jmp    1140 <isleap+0x40>
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %dl,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isleap>:
mov    %edi,%eax
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
ror    $0x2,%ecx
cmp    $0x28f5c29,%ecx
mov    $0x190,%ecx
mov    $0x4,%esi
cmovb  %ecx,%esi
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define signext i8 @isleap(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = srem i32 %4, 100
%6 = icmp ne i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i32, i32* %3
%9 = srem i32 %8, 400
%10 = trunc i32 %9 to i8
store i8 %10, i8* %2
br label %15
11: ; preds = %1
%12 = load i32, i32* %3
%13 = srem i32 %12, 4
%14 = trunc i32 %13 to i8
store i8 %14, i8* %2
br label %15
15: ; preds = %11, %7
%16 = load i8, i8* %2
ret i8 %16
}

LLVM IR (-O2):
define signext i8 @isleap(i32 %0) {
%2 = srem i32 %0, 100
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 400, i32 4
%5 = srem i32 %0, %4
%6 = trunc i32 %5 to i8
ret i8 %6
}
/* Variables and functions */
int /*<<< orphan*/ deviceStop();
void machineStop() { deviceStop(); }


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

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

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

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