xunge/DecIR huggingface dataset:
int cycle_length(int n) {
  int cycle = 1;
  while (n != 1) {
    if (!(n % 2)) {
      n /= 2;
    } else {
      n = 3 * n + 1;
    }
    cycle++;
  }
  return cycle;
}


x86 assembly (clang, -O0):
<cycle_length>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
je     1157 <cycle_length+0x57>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    113f <cycle_length+0x3f>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    1149 <cycle_length+0x49>
imul   $0x3,-0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <cycle_length+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cycle_length>:
mov    $0x1,%eax
cmp    $0x1,%edi
jne    110b <cycle_length+0xb>
ret
mov    $0x1,%eax
jmp    112e <cycle_length+0x2e>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    (%rdi,%rdi,2),%edi
add    $0x1,%edi
add    $0x1,%eax
cmp    $0x1,%edi
je     110a <cycle_length+0xa>
test   $0x1,%dil
jne    1120 <cycle_length+0x20>
mov    %edi,%ecx
shr    $0x1f,%ecx
add    %edi,%ecx
sar    %ecx
mov    %ecx,%edi
jmp    1126 <cycle_length+0x26>

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

LLVM IR (-O2):
define i32 @cycle_length(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %17, label %3
3: ; preds = %1, %13
%4 = phi i32 [ %15, %13 ], [ 1, %1 ]
%5 = phi i32 [ %14, %13 ], [ %0, %1 ]
%6 = and i32 %5, 1
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = sdiv i32 %5, 2
br label %13
10: ; preds = %3
%11 = mul nsw i32 %5, 3
%12 = add nsw i32 %11, 1
br label %13
13: ; preds = %10, %8
%14 = phi i32 [ %12, %10 ], [ %9, %8 ]
%15 = add nuw nsw i32 %4, 1
%16 = icmp eq i32 %14, 1
br i1 %16, label %17, label %3
17: ; preds = %13, %1
%18 = phi i32 [ 1, %1 ], [ %15, %13 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
int /*<<< orphan*/ printf(char *);
scalar_t__ wait4(int, int *, int /*<<< orphan*/, int /*<<< orphan*/ *);
void zombie_reaper(int sig) {
  int status;
  printf("Connection closed\n");
  while (wait4(-1, &status, WNOHANG, NULL) > 0)
    ;
}


x86 assembly (clang, -O0):
<zombie_reaper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
lea    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%ecx
call   1040 <wait4@plt>
cmp    $0x0,%rax
jle    1161 <zombie_reaper+0x41>
jmp    1137 <zombie_reaper+0x17>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zombie_reaper>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eb1(%rip),%r14
lea    0x4(%rsp),%rbx
nopl   0x0(%rax)
mov    (%r14),%edx
mov    $0xffffffff,%edi
mov    %rbx,%rsi
xor    %ecx,%ecx
call   1040 <wait4@plt>
test   %rax,%rax
jg     1140 <zombie_reaper+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Connection closed\0A\00"
@WNOHANG = global i32 0
define void @zombie_reaper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %9, %1
%6 = load i32, i32* @WNOHANG
%7 = call i64 @wait4(i32 -1, i32* %3, i32 %6, i32* null)
%8 = icmp sgt i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %5
br label %5
10: ; preds = %5
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
@str = [18 x i8] c"Connection closed\00"
define void @zombie_reaper(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %5, %1
%6 = load i32, i32* @WNOHANG
%7 = call i64 @wait4(i32 -1, i32* %2, i32 %6, i32* null)
%8 = icmp sgt i64 %7, 0
br i1 %8, label %5, label %9
9: ; preds = %5
ret void
}
/* Variables and functions */
int close(int);
int cachedev_put(int *cache_fd) {
  int retval = 0;
  if (*cache_fd != -1)
    retval = close(*cache_fd);
  *cache_fd = -1;
  return retval;
}


x86 assembly (clang, -O0):
<cachedev_put>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0xffffffff,(%rax)
je     113e <cachedev_put+0x2e>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <close@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movl   $0xffffffff,(%rax)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cachedev_put>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
cmp    $0xffffffff,%edi
je     1122 <cachedev_put+0x12>
call   1030 <close@plt>
jmp    1124 <cachedev_put+0x14>
xor    %eax,%eax
movl   $0xffffffff,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @cachedev_put(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, -1
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @close(i32 %2)
br label %6
6: ; preds = %4, %1
%7 = phi i32 [ %5, %4 ], [ 0, %1 ]
store i32 -1, i32* %0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_batch_context_recv_status_on_client_status() {
  fprintf(stderr, "Should never reach here");
  abort();
}


x86 assembly (clang, -O0):
<grpcsharp_batch_context_recv_status_on_client_status>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<grpcsharp_batch_context_recv_status_on_client_status>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_batch_context_recv_status_on_client_status() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_batch_context_recv_status_on_client_status() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
void key_init(void) {
  (*(volatile unsigned long *)0x7F008830) &=
      ~((0x3 << (0 * 2)) + (0x3 << (1 * 2)) + (0x3 << (2 * 2)) +
        (0x3 << (3 * 2)));
  (*(volatile unsigned long *)0x7F008830) |=
      ((0 << (0 * 2)) + (0 << (1 * 2)) + (0 << (2 * 2)) + (0 << (3 * 2)));
}


x86 assembly (clang, -O0):
<key_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7f008830,%eax
mov    (%rax),%rcx
and    $0xffffffffffffff00,%rcx
mov    $0x7f008830,%eax
mov    %rcx,(%rax)
mov    $0x7f008830,%eax
mov    (%rax),%rcx
or     $0x0,%rcx
mov    $0x7f008830,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<key_init>:
andq   $0xffffffffffffff00,0x7f008830
mov    0x7f008830,%rax
7f
mov    %rax,0x7f008830
7f
ret

LLVM IR (-O0):
define void @key_init() {
%1 = load volatile i64, i64* inttoptr (i64 2130741296 to i64*)
%2 = and i64 %1, -256
store volatile i64 %2, i64* inttoptr (i64 2130741296 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 2130741296 to i64*)
%4 = or i64 %3, 0
store volatile i64 %4, i64* inttoptr (i64 2130741296 to i64*)
ret void
}

LLVM IR (-O2):
define void @key_init() {
%1 = load volatile i64, i64* inttoptr (i64 2130741296 to i64*)
%2 = and i64 %1, -256
store volatile i64 %2, i64* inttoptr (i64 2130741296 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 2130741296 to i64*)
store volatile i64 %3, i64* inttoptr (i64 2130741296 to i64*)
ret void
}
/* Variables and functions */
scalar_t__ strlen(char const *);
scalar_t__ strncmp(char const *, char const *, scalar_t__);
int strstart(const char *phrase, const char *prefix) {
  if (strlen(phrase) < strlen(prefix))
    return 0;
  if (strncmp(prefix, phrase, strlen(prefix)) == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<strstart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
jge    1162 <strstart+0x42>
movl   $0x0,-0x4(%rbp)
jmp    11a8 <strstart+0x88>
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    %rax,%rdx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    11a1 <strstart+0x81>
movl   $0x1,-0x4(%rbp)
jmp    11a8 <strstart+0x88>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strstart>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1040 <strlen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %rax,%rdx
xor    %eax,%eax
cmp    %rdx,%rbx
jl     115b <strstart+0x3b>
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @strstart(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = icmp slt i64 %3, %4
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = tail call i64 @strncmp(i8* %1, i8* %0, i64 %4)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %2
%11 = phi i32 [ 0, %2 ], [ %9, %6 ]
ret i32 %11
}
void ADCCalibrationReset(unsigned long ulBase) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000008))) |= 0x00000008;
}


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

x86 assembly (clang, -O2):
<ADCCalibrationReset>:
orq    $0x8,0x8(%rdi)
ret

LLVM IR (-O0):
define void @ADCCalibrationReset(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 8
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = or i64 %6, 8
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @ADCCalibrationReset(i64 %0) {
%2 = add i64 %0, 8
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = or i64 %4, 8
store volatile i64 %5, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  char buffer[30];
  while (1) {
    printf("What's your name?\n");
    gets(buffer);
    printf("Hey there %s\n", buffer);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x30(%rbp),%rdi
call   1040 <gets@plt>
lea    -0x30(%rbp),%rsi
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    112f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
lea    0xece(%rip),%r14
mov    %rsp,%rbx
lea    0xeb6(%rip),%r15
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1050 <gets@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1150 <main+0x20>

LLVM IR (-O0):
@.str = [19 x i8] c"What's your name?\0A\00"
@.str.1 = [14 x i8] c"Hey there %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [30 x i8]
store i32 0, i32* %1
br label %3
3: ; preds = %0, %3
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%6 = call i32 @gets(i8* %5)
%7 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %7)
br label %3
}

LLVM IR (-O2):
@.str.1 = [14 x i8] c"Hey there %s\0A\00"
@str = [18 x i8] c"What's your name?\00"
define i32 @main() {
%1 = alloca [30 x i8]
%2 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
br label %3
3: ; preds = %3, %0
%4 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%5 = call i32 @gets(i8* %2)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %2)
br label %3
}
int main() {
  float i = 42.053;
  int j = i;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movss  0xeed(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
cvttss2si -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca i32
store i32 0, i32* %1
store float 0x404506C8C0000000, float* %2
%4 = load float, float* %2
%5 = fptosi float %4 to i32
store i32 %5, i32* %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
unsigned sancus_urzu(size_t v, size_t a, size_t b) {
  assert((v >= a) && (v <= b));
  return (unsigned)v;
}


x86 assembly (clang, -O0):
<sancus_urzu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmp    -0x10(%rbp),%rcx
mov    %al,-0x19(%rbp)
jb     1145 <sancus_urzu+0x35>
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
setbe  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sancus_urzu>:
push   %rbx
mov    %rdi,%rbx
cmp    %rsi,%rdi
setae  %al
cmp    %rdx,%rdi
setbe  %cl
and    %al,%cl
movzbl %cl,%edi
call   1030 <assert@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @sancus_urzu(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = icmp uge i64 %7, %8
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load i64, i64* %4
%12 = load i64, i64* %6
%13 = icmp ule i64 %11, %12
br label %14
14: ; preds = %10, %3
%15 = phi i1 [ false, %3 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
%18 = load i64, i64* %4
%19 = trunc i64 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @sancus_urzu(i64 %0, i64 %1, i64 %2) {
%4 = icmp uge i64 %0, %1
%5 = icmp ule i64 %0, %2
%6 = and i1 %4, %5
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = trunc i64 %0 to i32
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int /*<<< orphan*/ BIO_set_init(int /*<<< orphan*/ *, int);
int watchccs_new(BIO *bio) {
  BIO_set_init(bio, 1);
  return 1;
}


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

x86 assembly (clang, -O2):
<watchccs_new>:
push   %rax
mov    $0x1,%esi
call   1030 <BIO_set_init@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @watchccs_new(i32* %0) {
%2 = tail call i32 @BIO_set_init(i32* %0, i32 1)
ret i32 1
}
/* Type definitions */
struct linprm {
  int dummy;
};
struct disprm {
  int dummy;
};

/* Variables and functions */
int lindist(int, struct linprm *, struct disprm *, int);
int lindis(int sequence, struct linprm *lin, struct disprm *dis) {
  return lindist(sequence, lin, dis, -1);
}


x86 assembly (clang, -O0):
<lindis>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0xffffffff,%ecx
call   1030 <lindist@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lindis>:
mov    $0xffffffff,%ecx
jmp    1030 <lindist@plt>

LLVM IR (-O0):
%struct.linprm = type { i32 }
%struct.disprm = type { i32 }
define i32 @lindis(i32 %0, %struct.linprm* %1, %struct.disprm* %2) {
%4 = alloca i32
%5 = alloca %struct.linprm*
%6 = alloca %struct.disprm*
store i32 %0, i32* %4
store %struct.linprm* %1, %struct.linprm** %5
store %struct.disprm* %2, %struct.disprm** %6
%7 = load i32, i32* %4
%8 = load %struct.linprm*, %struct.linprm** %5
%9 = load %struct.disprm*, %struct.disprm** %6
%10 = call i32 @lindist(i32 %7, %struct.linprm* %8, %struct.disprm* %9, i32 -1)
ret i32 %10
}

LLVM IR (-O2):
%struct.linprm = type { i32 }
%struct.disprm = type { i32 }
define i32 @lindis(i32 %0, %struct.linprm* %1, %struct.disprm* %2) {
%4 = tail call i32 @lindist(i32 %0, %struct.linprm* %1, %struct.disprm* %2, i32 -1)
ret i32 %4
}
int count_processors(void) {
  int nproc = 0;
  return nproc;
}


x86 assembly (clang, -O0):
<count_processors>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @count_processors() {
ret i32 0
}
/* Type definitions */
struct cpumask {
  int dummy;
};

/* Variables and functions */
int smp_call_function_single(int /*<<< orphan*/, void (*)(void *), void *, int);
__attribute__((always_)) int smp_call_function_any(const struct cpumask *mask,
                                                   void (*func)(void *info),
                                                   void *info, int wait) {
  return smp_call_function_single(0, func, info, wait);
}


x86 assembly (clang, -O0):
<smp_call_function_any>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
xor    %edi,%edi
call   1030 <smp_call_function_single@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smp_call_function_any>:
xor    %edi,%edi
jmp    1030 <smp_call_function_single@plt>

LLVM IR (-O0):
%struct.cpumask = type { i32 }
define i32 @smp_call_function_any(%struct.cpumask* %0, void (i8*)* %1, i8* %2, i32 %3) {
%5 = alloca %struct.cpumask*
%6 = alloca void (i8*)*
%7 = alloca i8*
%8 = alloca i32
store %struct.cpumask* %0, %struct.cpumask** %5
store void (i8*)* %1, void (i8*)** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load void (i8*)*, void (i8*)** %6
%10 = load i8*, i8** %7
%11 = load i32, i32* %8
%12 = call i32 @smp_call_function_single(i32 0, void (i8*)* %9, i8* %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
%struct.cpumask = type { i32 }
define i32 @smp_call_function_any(%struct.cpumask* nocapture readnone %0, void (i8*)* %1, i8* %2, i32 %3) {
%5 = tail call i32 @smp_call_function_single(i32 0, void (i8*)* %1, i8* %2, i32 %3)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ AT_FDCWD;
int /*<<< orphan*/ readlinkat(int /*<<< orphan*/, char const *, char *, size_t);
ssize_t readlink(const char *restrict path, char *restrict buffer,
                 size_t size) {
  return readlinkat(AT_FDCWD, path, buffer, size);
}


x86 assembly (clang, -O0):
<readlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1030 <readlinkat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readlink>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
jmp    1030 <readlinkat@plt>

LLVM IR (-O0):
@AT_FDCWD = global i32 0
define i32 @readlink(i8* noalias %0, i8* noalias %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 i32, i32* @AT_FDCWD
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i32 @readlinkat(i32 %7, i8* %8, i8* %9, i64 %10)
ret i32 %11
}

LLVM IR (-O2):
@AT_FDCWD = global i32 0
define i32 @readlink(i8* noalias %0, i8* noalias %1, i64 %2) {
%4 = load i32, i32* @AT_FDCWD
%5 = tail call i32 @readlinkat(i32 %4, i8* %0, i8* %1, i64 %2)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ acc_device_t;

/* Variables and functions */
int /*<<< orphan*/ acc_init(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  fprintf(stderr, "CheCKpOInT\n");
  acc_init((acc_device_t)99);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
lea    0xeba(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x63,%edi
call   1040 <acc_init@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x63,%edi
call   1040 <acc_init@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [12 x i8] c"CheCKpOInT\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @acc_init(i32 99)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"CheCKpOInT\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @acc_init(i32 99)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, size_t, char *, int const);
bool cutils_cdar_DynamicArray_int_format(const int *i, char **b, size_t *s) {
  snprintf(*b, *s, "%d", *i);
  return true;
}


x86 assembly (clang, -O0):
<cutils_cdar_DynamicArray_int_format>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
lea    0xec1(%rip),%rdx
call   1030 <snprintf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cutils_cdar_DynamicArray_int_format>:
push   %rax
mov    (%rsi),%rax
mov    (%rdx),%rsi
mov    (%rdi),%ecx
lea    0xee0(%rip),%rdx
mov    %rax,%rdi
call   1030 <snprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @cutils_cdar_DynamicArray_int_format(i32* nocapture %0, i8** nocapture %1, i64* nocapture %2) {
%4 = load i8*, i8** %1
%5 = load i64, i64* %2
%6 = load i32, i32* %0
%7 = tail call i32 @snprintf(i8* %4, i64 %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ glutPostRedisplay();
void Key(unsigned char key, int x, int y) {
  switch (key) {
  case 27:
    exit(0);
  default:
    break;
  }
  glutPostRedisplay();
}


x86 assembly (clang, -O0):
<Key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x1(%rbp),%al
sub    $0x1b,%al
jne    114b <Key+0x2b>
jmp    1144 <Key+0x24>
xor    %edi,%edi
call   1040 <exit@plt>
jmp    1150 <Key+0x30>
mov    $0x0,%al
call   1030 <glutPostRedisplay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Key>:
cmp    $0x1b,%dil
je     112d <Key+0xd>
xor    %eax,%eax
jmp    1030 <glutPostRedisplay@plt>
push   %rax
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @Key(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
switch i32 %8, label %11 [
i32 27, label %9
]
9: ; preds = %3
%10 = call i32 @exit(i32 0)
unreachable
11: ; preds = %3
br label %12
12: ; preds = %11
%13 = call i32 (...) @glutPostRedisplay()
ret void
}

LLVM IR (-O2):
define void @Key(i8 zeroext %0, i32 %1, i32 %2) {
%4 = icmp eq i8 %0, 27
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %3
%8 = tail call i32 (...) @glutPostRedisplay()
ret void
}
long foo(long p) {
  {
    long xyzzy = 0;
    if (p)
      xyzzy = 2;
    return xyzzy;
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1123 <foo+0x23>
movq   $0x2,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
test   %rdi,%rdi
setne  %al
add    %rax,%rax
ret

LLVM IR (-O0):
define i64 @foo(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 0, i64* %3
%4 = load i64, i64* %2
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i64 2, i64* %3
br label %7
7: ; preds = %6, %1
%8 = load i64, i64* %3
ret i64 %8
}

LLVM IR (-O2):
define i64 @foo(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = select i1 %2, i64 0, i64 2
ret i64 %3
}
/* Variables and functions */
void *malloc(int);
void *default_malloc(int n) { return malloc(n); }


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

x86 assembly (clang, -O2):
<default_malloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @default_malloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
void fatal(const char *msg) {
  perror(msg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rax
call   1030 <perror@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @fatal(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ sys_defs_free();
int /*<<< orphan*/ sys_defs_init();
int /*<<< orphan*/ testFlowDef();
int /*<<< orphan*/ testFlowIf();
void testFlow() {
  sys_defs_init();
  testFlowIf();
  testFlowDef();
  sys_defs_free();
}


x86 assembly (clang, -O0):
<testFlow>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <sys_defs_init@plt>
mov    $0x0,%al
call   1030 <testFlowIf@plt>
mov    $0x0,%al
call   1050 <testFlowDef@plt>
mov    $0x0,%al
call   1040 <sys_defs_free@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testFlow>:
push   %rax
xor    %eax,%eax
call   1060 <sys_defs_init@plt>
xor    %eax,%eax
call   1030 <testFlowIf@plt>
xor    %eax,%eax
call   1050 <testFlowDef@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <sys_defs_free@plt>

LLVM IR (-O0):
define void @testFlow() {
%1 = call i32 (...) @sys_defs_init()
%2 = call i32 (...) @testFlowIf()
%3 = call i32 (...) @testFlowDef()
%4 = call i32 (...) @sys_defs_free()
ret void
}

LLVM IR (-O2):
define void @testFlow() {
%1 = tail call i32 (...) @sys_defs_init()
%2 = tail call i32 (...) @testFlowIf()
%3 = tail call i32 (...) @testFlowDef()
%4 = tail call i32 (...) @sys_defs_free()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CPUwfi();
void NOROM_PRCMDeepSleep(void) {
  (*((volatile unsigned long *)(0xE000ED10))) |= 0x00000004;
  CPUwfi();
  (*((volatile unsigned long *)(0xE000ED10))) &= ~(0x00000004);
}


x86 assembly (clang, -O0):
<NOROM_PRCMDeepSleep>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe000ed10,%eax
mov    (%rax),%rcx
or     $0x4,%rcx
mov    $0xe000ed10,%eax
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <CPUwfi@plt>
mov    $0xe000ed10,%eax
mov    (%rax),%rcx
and    $0xfffffffffffffffb,%rcx
mov    $0xe000ed10,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<NOROM_PRCMDeepSleep>:
push   %rbx
mov    $0xe000ed10,%ebx
orq    $0x4,(%rbx)
xor    %eax,%eax
call   1030 <CPUwfi@plt>
andq   $0xfffffffffffffffb,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @NOROM_PRCMDeepSleep() {
%1 = load volatile i64, i64* inttoptr (i64 3758157072 to i64*)
%2 = or i64 %1, 4
store volatile i64 %2, i64* inttoptr (i64 3758157072 to i64*)
%3 = call i32 (...) @CPUwfi()
%4 = load volatile i64, i64* inttoptr (i64 3758157072 to i64*)
%5 = and i64 %4, -5
store volatile i64 %5, i64* inttoptr (i64 3758157072 to i64*)
ret void
}

LLVM IR (-O2):
define void @NOROM_PRCMDeepSleep() {
%1 = load volatile i64, i64* inttoptr (i64 3758157072 to i64*)
%2 = or i64 %1, 4
store volatile i64 %2, i64* inttoptr (i64 3758157072 to i64*)
%3 = tail call i32 (...) @CPUwfi()
%4 = load volatile i64, i64* inttoptr (i64 3758157072 to i64*)
%5 = and i64 %4, -5
store volatile i64 %5, i64* inttoptr (i64 3758157072 to i64*)
ret void
}
/* Variables and functions */
bool equal_keys(void *keyA, int hashA, void *keyB, int hashB,
                bool (*equals)(void *, void *)) {
  if (keyA == keyB) {
    return true;
  }
  if (hashA != hashB) {
    return false;
  }
  return equals(keyA, keyB);
}


x86 assembly (clang, -O0):
<equal_keys>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jne    1134 <equal_keys+0x34>
movl   $0x1,-0x4(%rbp)
jmp    115d <equal_keys+0x5d>
mov    -0x14(%rbp),%eax
cmp    -0x24(%rbp),%eax
je     114c <equal_keys+0x4c>
movl   $0x0,-0x4(%rbp)
jmp    115d <equal_keys+0x5d>
mov    -0x30(%rbp),%rax
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   *%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<equal_keys>:
cmp    %rdx,%rdi
je     1111 <equal_keys+0x11>
xor    %eax,%eax
cmp    %ecx,%esi
jne    1116 <equal_keys+0x16>
mov    %rdx,%rsi
jmp    *%r8
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @equal_keys(i8* %0, i32 %1, i8* %2, i32 %3, i32 (i8*, i8*)* nocapture %4) {
%6 = icmp eq i8* %0, %2
br i1 %6, label %11, label %7
7: ; preds = %5
%8 = icmp eq i32 %1, %3
br i1 %8, label %9, label %11
9: ; preds = %7
%10 = tail call i32 %4(i8* %0, i8* %2)
br label %11
11: ; preds = %7, %5, %9
%12 = phi i32 [ %10, %9 ], [ 1, %5 ], [ 0, %7 ]
ret i32 %12
}
int gcd(int x, int y) {
  int g = y;
  while (x > 0) {
    g = x;
    x = y % x;
    y = g;
  }
  return g;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1135 <gcd+0x35>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0x4(%rbp)
mov    %edx,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1110 <gcd+0x10>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %esi,%eax
test   %edi,%edi
jle    111d <gcd+0x1d>
mov    %edi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jg     1110 <gcd+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @gcd(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* %4
store i32 %6, i32* %5
br label %7
7: ; preds = %10, %2
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %7
%11 = load i32, i32* %3
store i32 %11, i32* %5
%12 = load i32, i32* %4
%13 = load i32, i32* %3
%14 = srem i32 %12, %13
store i32 %14, i32* %3
%15 = load i32, i32* %5
store i32 %15, i32* %4
br label %7
16: ; preds = %7
%17 = load i32, i32* %5
ret i32 %17
}

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %1, %2 ]
%6 = phi i32 [ %7, %4 ], [ %0, %2 ]
%7 = srem i32 %5, %6
%8 = icmp sgt i32 %7, 0
br i1 %8, label %4, label %9
9: ; preds = %4, %2
%10 = phi i32 [ %1, %2 ], [ %6, %4 ]
ret i32 %10
}
/* Variables and functions */
long double __qerf(long double);
long double __q_erf(long double *arg) { return (__qerf(*arg)); }


x86 assembly (clang, -O0):
<__q_erf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
fldt   (%rax)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <__qerf@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__q_erf>:
sub    $0x18,%rsp
fldt   (%rdi)
fstpt  (%rsp)
call   1030 <__qerf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @__q_erf(x86_fp80* %0) {
%2 = alloca x86_fp80*
store x86_fp80* %0, x86_fp80** %2
%3 = load x86_fp80*, x86_fp80** %2
%4 = load x86_fp80, x86_fp80* %3
%5 = call x86_fp80 @__qerf(x86_fp80 %4)
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @__q_erf(x86_fp80* nocapture %0) {
%2 = load x86_fp80, x86_fp80* %0
%3 = tail call x86_fp80 @__qerf(x86_fp80 %2)
ret x86_fp80 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int sscanf(char const *, char *, double *);
int /*<<< orphan*/ stderr;
double read_real(const char *s) {
  double x;
  if (sscanf(s, "%lf", &x) != 1) {
    fprintf(stderr, "not a real number '%s'\n", s);
    exit(2);
  }
  return x;
}


x86 assembly (clang, -O0):
<read_real>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
lea    -0x10(%rbp),%rdx
call   1040 <sscanf@plt>
cmp    $0x1,%eax
je     117c <read_real+0x4c>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe97(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_real>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xec1(%rip),%rsi
lea    0x8(%rsp),%rdx
call   1040 <sscanf@plt>
cmp    $0x1,%eax
jne    115a <read_real+0x2a>
movsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
lea    0xe9a(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@stderr = global i32 0
@.str.1 = [24 x i8] c"not a real number '%s'\0A\00"
define double @read_real(i8* %0) {
%2 = alloca i8*
%3 = alloca double
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @sscanf(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %3)
%6 = icmp ne i32 %5, 1
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = load i8*, i8** %2
%10 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = call i32 @exit(i32 2)
unreachable
12: ; preds = %1
%13 = load double, double* %3
ret double %13
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@stderr = global i32 0
@.str.1 = [24 x i8] c"not a real number '%s'\0A\00"
define double @read_real(i8* %0) {
%2 = alloca double
%3 = bitcast double* %2 to i8*
%4 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%5 = icmp eq i32 %4, 1
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%9 = call i32 @exit(i32 2)
unreachable
10: ; preds = %1
%11 = load double, double* %2
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int sum = 0;
  int i;
  for (i = 0; i <= 1000; i++) {
    sum += 1;
  }
  assert(i == 1001);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3e8,-0xc(%rbp)
jg     1151 <main+0x41>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
cmpl   $0x3e9,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%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() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %10, %0
%5 = load i32, i32* %3
%6 = icmp sle i32 %5, 1000
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
store i32 %9, i32* %2
br label %10
10: ; preds = %7
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
%14 = load i32, i32* %3
%15 = icmp eq i32 %14, 1001
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
ret i32 0
}
int tonj(int i, int j, int n) { return n - 1 - j; }


x86 assembly (clang, -O0):
<tonj>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
sub    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tonj>:
not    %esi
lea    (%rsi,%rdx,1),%eax
ret

LLVM IR (-O0):
define i32 @tonj(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 = load i32, i32* %6
%8 = sub nsw i32 %7, 1
%9 = load i32, i32* %5
%10 = sub nsw i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @tonj(i32 %0, i32 %1, i32 %2) {
%4 = xor i32 %1, -1
%5 = add i32 %4, %2
ret i32 %5
}
void gtk_entry_completion_set_match_func() {}


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

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

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

LLVM IR (-O2):
define void @gtk_entry_completion_set_match_func() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ polyglot_array_typeid(int /*<<< orphan*/,
                                         int /*<<< orphan*/);
void *polyglot_as_typed(void *, int /*<<< orphan*/);
int /*<<< orphan*/ polyglot_float_typeid();
__attribute__((always_)) float *polyglot_as_float_array(void *p) {
  void *ret =
      polyglot_as_typed(p, polyglot_array_typeid(polyglot_float_typeid(), 0));
  return (float *)ret;
}


x86 assembly (clang, -O0):
<polyglot_as_float_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1040 <polyglot_float_typeid@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1050 <polyglot_array_typeid@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1030 <polyglot_as_typed@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<polyglot_as_float_array>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <polyglot_float_typeid@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1050 <polyglot_array_typeid@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <polyglot_as_typed@plt>

LLVM IR (-O0):
define float* @polyglot_as_float_array(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 (...) @polyglot_float_typeid()
%6 = call i32 @polyglot_array_typeid(i32 %5, i32 0)
%7 = call i8* @polyglot_as_typed(i8* %4, i32 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to float*
ret float* %9
}

LLVM IR (-O2):
define float* @polyglot_as_float_array(i8* %0) {
%2 = tail call i32 (...) @polyglot_float_typeid()
%3 = tail call i32 @polyglot_array_typeid(i32 %2, i32 0)
%4 = tail call i8* @polyglot_as_typed(i8* %0, i32 %3)
%5 = bitcast i8* %4 to float*
ret float* %5
}
double calculateRA(double SDTime) {
  double ra;
  ra = SDTime + 12;
  if (ra < 24)
    return ra;
  else
    return (ra - 24);
}


x86 assembly (clang, -O0):
<calculateRA>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  0xef7(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xedd(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    113d <calculateRA+0x3d>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1153 <calculateRA+0x53>
movsd  -0x18(%rbp),%xmm0
movsd  0xeb6(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculateRA>:
addsd  0xef8(%rip),%xmm0
movsd  0xef8(%rip),%xmm1
movapd %xmm0,%xmm2
cmpltsd 0xef3(%rip),%xmm2
addsd  %xmm0,%xmm1
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @calculateRA(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %3
%5 = load double, double* %3
%6 = fadd double %5, 1.200000e+01
store double %6, double* %4
%7 = load double, double* %4
%8 = fcmp olt double %7, 2.400000e+01
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load double, double* %4
store double %10, double* %2
br label %14
11: ; preds = %1
%12 = load double, double* %4
%13 = fsub double %12, 2.400000e+01
store double %13, double* %2
br label %14
14: ; preds = %11, %9
%15 = load double, double* %2
ret double %15
}

LLVM IR (-O2):
define double @calculateRA(double %0) {
%2 = fadd double %0, 1.200000e+01
%3 = fcmp olt double %2, 2.400000e+01
%4 = fadd double %2, -2.400000e+01
%5 = select i1 %3, double %2, double %4
ret double %5
}
/* Variables and functions */
char *__builtin_strncat(char *, char const *, size_t);
char *strncat(char *dest, const char *src, size_t cnt) {
  return __builtin_strncat(dest, src, cnt);
}


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

x86 assembly (clang, -O2):
<strncat>:
jmp    1100 <strncat>

LLVM IR (-O0):
define i8* @strncat(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 i8* @strncat(i8* %7, i8* %8, i64 %9)
ret i8* %10
}

LLVM IR (-O2):
define noalias i8* @strncat(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
br label %4
4: ; preds = %4, %3
br label %4
}