xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fatal_error(char *);
void *malloc(size_t);
void *safe_malloc(size_t size) {
  void *const mem = malloc(size);
  if (size != 0 && !mem)
    fatal_error("Out of memory");
  return mem;
}


x86 assembly (clang, -O0):
<safe_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     115b <safe_malloc+0x3b>
cmpq   $0x0,-0x10(%rbp)
jne    115b <safe_malloc+0x3b>
lea    0xeaa(%rip),%rdi
call   1030 <fatal_error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_malloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <malloc@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     1145 <safe_malloc+0x25>
test   %r14,%r14
jne    1145 <safe_malloc+0x25>
lea    0xec0(%rip),%rdi
call   1030 <fatal_error@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Out of memory\00"
define i8* @safe_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i64, i64* %2
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = icmp ne i8* %9, null
br i1 %10, label %13, label %11
11: ; preds = %8
%12 = call i32 @fatal_error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %8, %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@.str = [14 x i8] c"Out of memory\00"
define noalias i8* @safe_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i64 %0, 0
%4 = icmp ne i8* %2, null
%5 = or i1 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @fatal_error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret i8* %2
}
void tight_loop_contents() {}


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

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

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

LLVM IR (-O2):
define void @tight_loop_contents() {
ret void
}
int ft_is_prime(int nb) {
  int i;
  int lim;
  i = 2;
  lim = nb / i;
  if (nb <= 1)
    return (0);
  while (i < lim) {
    if (nb % i == 0)
      return (0);
    i++;
    lim = nb / i;
  }
  return (1);
}


x86 assembly (clang, -O0):
<ft_is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     112e <ft_is_prime+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    117a <ft_is_prime+0x7a>
jmp    1133 <ft_is_prime+0x33>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1173 <ft_is_prime+0x73>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    115b <ft_is_prime+0x5b>
movl   $0x0,-0x4(%rbp)
jmp    117a <ft_is_prime+0x7a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x10(%rbp)
jmp    1133 <ft_is_prime+0x33>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_is_prime>:
xor    %ecx,%ecx
cmp    $0x2,%edi
jl     113a <ft_is_prime+0x3a>
cmp    $0x6,%edi
jb     1135 <ft_is_prime+0x35>
mov    $0x2,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     113a <ft_is_prime+0x3a>
add    $0x1,%esi
mov    %edi,%eax
cltd
idiv   %esi
cmp    %eax,%esi
jl     1120 <ft_is_prime+0x20>
mov    $0x1,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_is_prime(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = icmp ugt i32 %0, 5
br i1 %4, label %5, label %13
5: ; preds = %3, %9
%6 = phi i32 [ %10, %9 ], [ 2, %3 ]
%7 = srem i32 %0, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %5
%10 = add nuw nsw i32 %6, 1
%11 = sdiv i32 %0, %10
%12 = icmp slt i32 %10, %11
br i1 %12, label %5, label %13
13: ; preds = %5, %9, %3, %1
%14 = phi i32 [ 0, %1 ], [ 1, %3 ], [ 0, %5 ], [ 1, %9 ]
ret i32 %14
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void put16_be(void *p, uint16_t x) {
  *((uint8_t *)p) = x >> 8 & 0xff;
  *((uint8_t *)p + 1) = x & 0xff;
}


x86 assembly (clang, -O0):
<put16_be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<put16_be>:
mov    %esi,%eax
movzbl %ah,%ecx
mov    %ecx,(%rdi)
movzbl %al,%eax
mov    %eax,0x4(%rdi)
ret

LLVM IR (-O0):
define void @put16_be(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 8
%7 = and i32 %6, 255
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to i32*
store i32 %7, i32* %9
%10 = load i32, i32* %4
%11 = and i32 %10, 255
%12 = load i8*, i8** %3
%13 = bitcast i8* %12 to i32*
%14 = getelementptr inbounds i32, i32* %13, i64 1
store i32 %11, i32* %14
ret void
}

LLVM IR (-O2):
define void @put16_be(i8* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = and i32 %3, 255
%5 = bitcast i8* %0 to i32*
store i32 %4, i32* %5
%6 = and i32 %1, 255
%7 = getelementptr inbounds i8, i8* %0, i64 4
%8 = bitcast i8* %7 to i32*
store i32 %6, i32* %8
ret void
}
int binary_sym(token)
int token;
{
  if (token > 2 && token < 9)
    return (1);
  if (token > 43 && token < 51)
    return (1);
  if (token == 54)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<binary_sym>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jle    1127 <binary_sym+0x27>
cmpl   $0x9,-0x8(%rbp)
jge    1127 <binary_sym+0x27>
movl   $0x1,-0x4(%rbp)
jmp    1164 <binary_sym+0x64>
cmpl   $0x2b,-0x8(%rbp)
jle    1147 <binary_sym+0x47>
cmpl   $0x33,-0x8(%rbp)
jge    1147 <binary_sym+0x47>
movl   $0x1,-0x4(%rbp)
jmp    1164 <binary_sym+0x64>
cmpl   $0x36,-0x8(%rbp)
jne    115d <binary_sym+0x5d>
movl   $0x1,-0x4(%rbp)
jmp    1164 <binary_sym+0x64>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<binary_sym>:
lea    -0x3(%rdi),%eax
cmp    $0x6,%eax
setb   %al
lea    -0x2c(%rdi),%ecx
cmp    $0x7,%ecx
setb   %cl
or     %al,%cl
cmp    $0x36,%edi
sete   %al
or     %cl,%al
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @binary_sym(i32 %0) {
%2 = add i32 %0, -3
%3 = icmp ult i32 %2, 6
%4 = add i32 %0, -44
%5 = icmp ult i32 %4, 7
%6 = or i1 %3, %5
%7 = icmp eq i32 %0, 54
%8 = or i1 %7, %6
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ clear();
int /*<<< orphan*/ crmode();
int /*<<< orphan*/ draw_field();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ nonl();
init_disp() {
  initscr();
  clear();
  crmode();
  noecho();
  nonl();
  draw_field();
}


x86 assembly (clang, -O0):
<init_disp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <initscr@plt>
mov    $0x0,%al
call   1080 <clear@plt>
mov    $0x0,%al
call   1070 <crmode@plt>
mov    $0x0,%al
call   1060 <noecho@plt>
mov    $0x0,%al
call   1050 <nonl@plt>
mov    $0x0,%al
call   1040 <draw_field@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_disp>:
push   %rax
xor    %eax,%eax
call   1030 <initscr@plt>
xor    %eax,%eax
call   1080 <clear@plt>
xor    %eax,%eax
call   1070 <crmode@plt>
xor    %eax,%eax
call   1060 <noecho@plt>
xor    %eax,%eax
call   1050 <nonl@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <draw_field@plt>

LLVM IR (-O0):
define i32 @init_disp() {
%1 = alloca i32
%2 = call i32 (...) @initscr()
%3 = call i32 (...) @clear()
%4 = call i32 (...) @crmode()
%5 = call i32 (...) @noecho()
%6 = call i32 (...) @nonl()
%7 = call i32 (...) @draw_field()
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @init_disp() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @clear()
%3 = tail call i32 (...) @crmode()
%4 = tail call i32 (...) @noecho()
%5 = tail call i32 (...) @nonl()
%6 = tail call i32 (...) @draw_field()
ret i32 undef
}
/* Type definitions */
struct timespec {
  double tv_sec;
  double tv_nsec;
};

/* Variables and functions */
double diff(struct timespec *a, struct timespec *b) {
  return ((b->tv_sec - a->tv_sec) * 1000000000.0 + (b->tv_nsec - a->tv_nsec));
}


x86 assembly (clang, -O0):
<diff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
subsd  0x8(%rax),%xmm1
movsd  0xeca(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<diff>:
movsd  (%rsi),%xmm0
movsd  0x8(%rsi),%xmm1
subsd  (%rdi),%xmm0
subsd  0x8(%rdi),%xmm1
mulsd  0xee6(%rip),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
%struct.timespec = type { double, double }
define double @diff(%struct.timespec* %0, %struct.timespec* %1) {
%3 = alloca %struct.timespec*
%4 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load %struct.timespec*, %struct.timespec** %4
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 0
%7 = load double, double* %6
%8 = load %struct.timespec*, %struct.timespec** %3
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %8, i32 0, i32 0
%10 = load double, double* %9
%11 = fsub double %7, %10
%12 = load %struct.timespec*, %struct.timespec** %4
%13 = getelementptr inbounds %struct.timespec, %struct.timespec* %12, i32 0, i32 1
%14 = load double, double* %13
%15 = load %struct.timespec*, %struct.timespec** %3
%16 = getelementptr inbounds %struct.timespec, %struct.timespec* %15, i32 0, i32 1
%17 = load double, double* %16
%18 = fsub double %14, %17
%19 = call double @llvm.fmuladd.f64(double %11, double 1.000000e+09, double %18)
ret double %19
}

LLVM IR (-O2):
%struct.timespec = type { double, double }
define double @diff(%struct.timespec* nocapture %0, %struct.timespec* nocapture %1) {
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%4 = load double, double* %3
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%6 = load double, double* %5
%7 = fsub double %4, %6
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%9 = load double, double* %8
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%11 = load double, double* %10
%12 = fsub double %9, %11
%13 = tail call double @llvm.fmuladd.f64(double %7, double 1.000000e+09, double %12)
ret double %13
}
void show_backtrace(void) {}


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

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

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

LLVM IR (-O2):
define void @show_backtrace() {
ret void
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ isdigit(char);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ ungetc(char, int /*<<< orphan*/);
void flush_stream() {
  char c;
  do {
    c = getchar();
  } while (!isdigit(c) && c != '\n');
  ungetc(c, stdin);
}


x86 assembly (clang, -O0):
<flush_stream>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isdigit@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x2(%rbp)
jne    1168 <flush_stream+0x38>
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
test   $0x1,%al
jne    1138 <flush_stream+0x8>
mov    -0x1(%rbp),%al
mov    0x2e6b(%rip),%rcx
mov    (%rcx),%esi
movsbl %al,%edi
call   1050 <ungetc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flush_stream>:
push   %rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
movsbl %al,%ebx
mov    %ebx,%edi
call   1030 <isdigit@plt>
cmp    $0xa,%bl
je     115a <flush_stream+0x2a>
test   %eax,%eax
je     1140 <flush_stream+0x10>
mov    0x2e87(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
pop    %rbx
jmp    1050 <ungetc@plt>

LLVM IR (-O0):
@stdin = global i32 0
define void @flush_stream() {
%1 = alloca i8
br label %2
2: ; preds = %12, %0
%3 = call signext i8 (...) @getchar()
store i8 %3, i8* %1
br label %4
4: ; preds = %2
%5 = load i8, i8* %1
%6 = call i32 @isdigit(i8 signext %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %4
%9 = load i8, i8* %1
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 10
br label %12
12: ; preds = %8, %4
%13 = phi i1 [ false, %4 ], [ %11, %8 ]
br i1 %13, label %2, label %14
14: ; preds = %12
%15 = load i8, i8* %1
%16 = load i32, i32* @stdin
%17 = call i32 @ungetc(i8 signext %15, i32 %16)
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
define void @flush_stream() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @getchar()
%3 = tail call i32 @isdigit(i8 signext %2)
%4 = icmp eq i32 %3, 0
%5 = icmp ne i8 %2, 10
%6 = and i1 %5, %4
br i1 %6, label %1, label %7
7: ; preds = %1
%8 = load i32, i32* @stdin
%9 = tail call i32 @ungetc(i8 signext %2, i32 %8)
ret void
}
/* Variables and functions */
char *mlr_malloc_or_die(int);
int snprintf(int /*<<< orphan*/ *, int /*<<< orphan*/, char *, double);
int /*<<< orphan*/ sprintf(char *, char *, double);
char *mlr_alloc_string_from_double(double value, char *fmt) {
  int n = snprintf(NULL, 0, fmt, value);
  char *string = mlr_malloc_or_die(n + 1);
  sprintf(string, fmt, value);
  return string;
}


x86 assembly (clang, -O0):
<mlr_alloc_string_from_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
movsd  -0x8(%rbp),%xmm0
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
call   1030 <snprintf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
add    $0x1,%edi
call   1040 <mlr_malloc_or_die@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movsd  -0x8(%rbp),%xmm0
call   1050 <sprintf@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mlr_alloc_string_from_double>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
movsd  %xmm0,(%rsp)
xor    %edi,%edi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <snprintf@plt>
lea    0x1(%rax),%edi
call   1040 <mlr_malloc_or_die@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
movsd  (%rsp),%xmm0
call   1050 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @mlr_alloc_string_from_double(double %0, i8* %1) {
%3 = alloca double
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store double %0, double* %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = load double, double* %3
%9 = call i32 @snprintf(i32* null, i32 0, i8* %7, double %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = add nsw i32 %10, 1
%12 = call i8* @mlr_malloc_or_die(i32 %11)
store i8* %12, i8** %6
%13 = load i8*, i8** %6
%14 = load i8*, i8** %4
%15 = load double, double* %3
%16 = call i32 @sprintf(i8* %13, i8* %14, double %15)
%17 = load i8*, i8** %6
ret i8* %17
}

LLVM IR (-O2):
define i8* @mlr_alloc_string_from_double(double %0, i8* %1) {
%3 = tail call i32 @snprintf(i32* null, i32 0, i8* %1, double %0)
%4 = add nsw i32 %3, 1
%5 = tail call i8* @mlr_malloc_or_die(i32 %4)
%6 = tail call i32 @sprintf(i8* dereferenceable(1) %5, i8* dereferenceable(1) %1, double %0)
ret i8* %5
}
char *(strchrnul)(const char *string, int c) {
  for (;; string++)
    if (*string == c)
      return string;
    else if (!*string)
      return string;
}


x86 assembly (clang, -O0):
<strchrnul>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    1128 <strchrnul+0x28>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115d <strchrnul+0x5d>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1142 <strchrnul+0x42>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115d <strchrnul+0x5d>
jmp    1147 <strchrnul+0x47>
jmp    114c <strchrnul+0x4c>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110b <strchrnul+0xb>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchrnul>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movsbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %ecx,%ecx
je     1120 <strchrnul+0x20>
cmp    %esi,%ecx
jne    1110 <strchrnul+0x10>
ret

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

LLVM IR (-O2):
define i8* @strchrnul(i8* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %10, %3 ]
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, %1
%8 = icmp eq i8 %5, 0
%9 = or i1 %8, %7
%10 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %9, label %11, label %3
11: ; preds = %3
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int librlc_z_repair_cleanup(char *out_data) {
  free(out_data);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @librlc_z_repair_cleanup(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i32 0
}
int ED2K_is_data(int type, int subtype) {
  if ((type == 0xE3 && subtype == 0x46) || (type == 0xD4 && subtype == 0x40) ||
      (type == 0xC5 && subtype == 0x40)) {
    return 1;
  } else
    return 0;
}


x86 assembly (clang, -O0):
<ED2K_is_data>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0xe3,-0x8(%rbp)
jne    1121 <ED2K_is_data+0x21>
cmpl   $0x46,-0xc(%rbp)
je     114f <ED2K_is_data+0x4f>
cmpl   $0xd4,-0x8(%rbp)
jne    1138 <ED2K_is_data+0x38>
cmpl   $0x40,-0xc(%rbp)
je     114f <ED2K_is_data+0x4f>
cmpl   $0xc5,-0x8(%rbp)
jne    115b <ED2K_is_data+0x5b>
cmpl   $0x40,-0xc(%rbp)
jne    115b <ED2K_is_data+0x5b>
movl   $0x1,-0x4(%rbp)
jmp    1162 <ED2K_is_data+0x62>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ED2K_is_data>:
cmp    $0xe3,%edi
jne    1113 <ED2K_is_data+0x13>
mov    $0x1,%eax
cmp    $0x46,%esi
jne    1113 <ED2K_is_data+0x13>
ret
cmp    $0xd4,%edi
sete   %al
cmp    $0x40,%esi
sete   %cl
cmp    $0xc5,%edi
sete   %dl
or     %al,%dl
and    %cl,%dl
movzbl %dl,%eax
ret

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

LLVM IR (-O2):
define i32 @ED2K_is_data(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 227
%4 = icmp eq i32 %1, 70
%5 = and i1 %3, %4
br i1 %5, label %13, label %6
6: ; preds = %2
%7 = icmp eq i32 %0, 212
%8 = icmp eq i32 %1, 64
%9 = icmp eq i32 %0, 197
%10 = or i1 %7, %9
%11 = and i1 %10, %8
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %6, %2
%14 = phi i32 [ 1, %2 ], [ %12, %6 ]
ret i32 %14
}
int bar(int i) { return 4 + i * 2; }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x4,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
lea    (%rdi,%rdi,1),%eax
add    $0x4,%eax
ret

LLVM IR (-O0):
define i32 @bar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 2
%5 = add nsw i32 4, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @bar(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = add nsw i32 %2, 4
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, double);
int /*<<< orphan*/ scanf(char *, double *);
int main(void) {
  double height;
  scanf("%lf", &height);
  printf("%.1f in = %.1f cm\n", height, height * 2.54);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  0xeb4(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm0
movsd  0xec3(%rip),%xmm1
mulsd  %xmm0,%xmm1
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [19 x i8] c"%.1f in = %.1f cm\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%4 = load double, double* %2
%5 = load double, double* %2
%6 = fmul double %5, 2.540000e+00
%7 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), double %4, double %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [19 x i8] c"%.1f in = %.1f cm\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = load double, double* %1
%5 = fmul double %4, 2.540000e+00
%6 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), double %4, double %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_proplist_set() {
  printf("NOT IMPLEMENTED:"
         "pa_proplist_set"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"NOT IMPLEMENTED:pa_proplist_set\0A\00"
define i32 @pa_proplist_set() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [32 x i8] c"NOT IMPLEMENTED:pa_proplist_set\00"
define i32 @pa_proplist_set() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
scalar_t__ mock(char *);
char *cf_s_lock_tic_hist(char *s) { return (char *)mock(s); }


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

x86 assembly (clang, -O2):
<cf_s_lock_tic_hist>:
jmp    1030 <mock@plt>

LLVM IR (-O0):
define i8* @cf_s_lock_tic_hist(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @mock(i8* %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define i8* @cf_s_lock_tic_hist(i8* %0) {
%2 = tail call i64 @mock(i8* %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
void ff_hevc_put_hevc_uni_w_pel_pixels4_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_pel_pixels4_10_sse4() {
ret void
}
void OCSP_CERTSTATUS_free(void) {}


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

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

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

LLVM IR (-O2):
define void @OCSP_CERTSTATUS_free() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int usage(const char *argv0) {
  fprintf(stderr,
          "usage: %s filein fileout xoffset yoffset width height [step = 1]\n",
          argv0);
  return 1;
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [66 x i8] c"usage: %s filein fileout xoffset yoffset width height [step = 1]\0A\00"
define i32 @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [66 x i8] c"usage: %s filein fileout xoffset yoffset width height [step = 1]\0A\00"
define i32 @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) { printf("Hello Victory\n"); }


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"Hello Victory\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int test_imm_FAint64_highword_reg(long long val) {
  return ((val >> 32) & (0xFA << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_FAint64_highword_reg>:
movabs $0xfa00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_FAint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 250
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_FAint64_highword_reg(i64 %0) {
%2 = and i64 %0, 1073741824000
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int socketcall(int, unsigned long *);
int listen(int s, int backlog) {
  unsigned long arr[2];
  arr[0] = (long)s;
  arr[1] = (long)backlog;
  return socketcall(4, arr);
}


x86 assembly (clang, -O0):
<listen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x4(%rbp),%rax
mov    %rax,-0x20(%rbp)
movslq -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rsi
mov    $0x4,%edi
call   1030 <socketcall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<listen>:
sub    $0x18,%rsp
movslq %edi,%rax
mov    %rax,(%rsp)
movslq %esi,%rax
mov    %rax,0x8(%rsp)
mov    %rsp,%rsi
mov    $0x4,%edi
call   1030 <socketcall@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @listen(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [2 x i64]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [2 x i64], [2 x i64]* %5, i64 0, i64 0
store i64 %7, i64* %8
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [2 x i64], [2 x i64]* %5, i64 0, i64 1
store i64 %10, i64* %11
%12 = getelementptr inbounds [2 x i64], [2 x i64]* %5, i64 0, i64 0
%13 = call i32 @socketcall(i32 4, i64* %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @listen(i32 %0, i32 %1) {
%3 = alloca [2 x i64]
%4 = bitcast [2 x i64]* %3 to i8*
%5 = sext i32 %0 to i64
%6 = getelementptr inbounds [2 x i64], [2 x i64]* %3, i64 0, i64 0
store i64 %5, i64* %6
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds [2 x i64], [2 x i64]* %3, i64 0, i64 1
store i64 %7, i64* %8
%9 = call i32 @socketcall(i32 4, i64* %6)
ret i32 %9
}
int compare_integers(const void *a, const void *b) {
  const int *da = (const int *)a;
  const int *db = (const int *)b;
  return (*da > *db) - (*da < *db);
}


x86 assembly (clang, -O0):
<compare_integers>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x18(%rbp),%rcx
mov    (%rcx),%ecx
mov    -0x20(%rbp),%rdx
cmp    (%rdx),%ecx
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_integers>:
mov    (%rdi),%ecx
xor    %eax,%eax
xor    %edx,%edx
cmp    (%rsi),%ecx
setg   %al
setl   %dl
sub    %edx,%eax
ret

LLVM IR (-O0):
define i32 @compare_integers(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = icmp sgt i32 %12, %14
%16 = zext i1 %15 to i32
%17 = load i32*, i32** %5
%18 = load i32, i32* %17
%19 = load i32*, i32** %6
%20 = load i32, i32* %19
%21 = icmp slt i32 %18, %20
%22 = zext i1 %21 to i32
%23 = sub nsw i32 %16, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @compare_integers(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp sgt i32 %5, %6
%8 = zext i1 %7 to i32
%9 = icmp slt i32 %5, %6
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
/* Variables and functions */
int suzerain_inorder_wavenumber_nyquist(int const, int const);
int suzerain_inorder_wavenumber_imagzero(const int N, const int w) {
  return (w == 0) + suzerain_inorder_wavenumber_nyquist(N, w);
}


x86 assembly (clang, -O0):
<suzerain_inorder_wavenumber_imagzero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <suzerain_inorder_wavenumber_nyquist@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<suzerain_inorder_wavenumber_imagzero>:
push   %rbx
mov    %esi,%ebx
call   1030 <suzerain_inorder_wavenumber_nyquist@plt>
cmp    $0x1,%ebx
adc    $0x0,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @suzerain_inorder_wavenumber_imagzero(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @suzerain_inorder_wavenumber_nyquist(i32 %8, i32 %9)
%11 = add nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @suzerain_inorder_wavenumber_imagzero(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @suzerain_inorder_wavenumber_nyquist(i32 %0, i32 %1)
%6 = add nsw i32 %5, %4
ret i32 %6
}
int test3(int b, int c) {
  int x;
  if (b)
    return x % c;
  else
    return 1;
}


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1123 <test3+0x23>
mov    -0x10(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x4(%rbp)
jmp    112a <test3+0x2a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test3(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(void) {
  int final, inicio, tempo_t;
  scanf("%d%d", &inicio, &final);
  if (final - inicio > 0) {
    tempo_t = final - inicio;
  } else {
    tempo_t = 24 + (final - inicio);
  }
  printf("O JOGO DUROU %d HORA(S)\n", tempo_t);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
cmp    $0x0,%eax
jle    1160 <main+0x40>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    116c <main+0x4c>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
add    $0x18,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    %rsp,%rsi
lea    0x4(%rsp),%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
sub    (%rsp),%eax
lea    0x18(%rax),%esi
test   %eax,%eax
cmovg  %eax,%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [25 x i8] c"O JOGO DUROU %d HORA(S)\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %2)
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %0
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = sub nsw i32 %11, %12
store i32 %13, i32* %4
br label %19
14: ; preds = %0
%15 = load i32, i32* %2
%16 = load i32, i32* %3
%17 = sub nsw i32 %15, %16
%18 = add nsw i32 24, %17
store i32 %18, i32* %4
br label %19
19: ; preds = %14, %10
%20 = load i32, i32* %4
%21 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [25 x i8] c"O JOGO DUROU %d HORA(S)\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %1)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %6, %7
%9 = icmp sgt i32 %8, 0
%10 = add nsw i32 %8, 24
%11 = select i1 %9, i32 %8, i32 %10
%12 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %11)
ret i32 0
}
/* Type definitions */
struct iterator {
  int dummy;
};
struct genhash_iter {
  int dummy;
};
struct genhash {
  int dummy;
};
struct entry_hash_iter {
  int dummy;
};
struct entry_hash {
  int dummy;
};

/* Variables and functions */
struct iterator *genhash_value_iter_init(struct genhash_iter *,
                                         struct genhash const *);
struct iterator *entry_hash_value_iter_init(struct entry_hash_iter *iter,
                                            const struct entry_hash *tthis) {
  return genhash_value_iter_init((struct genhash_iter *)iter,
                                 (const struct genhash *)tthis);
}


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

x86 assembly (clang, -O2):
<entry_hash_value_iter_init>:
jmp    1030 <genhash_value_iter_init@plt>

LLVM IR (-O0):
%struct.iterator = type { i32 }
%struct.entry_hash_iter = type { i32 }
%struct.entry_hash = type { i32 }
%struct.genhash_iter = type { i32 }
%struct.genhash = type { i32 }
define %struct.iterator* @entry_hash_value_iter_init(%struct.entry_hash_iter* %0, %struct.entry_hash* %1) {
%3 = alloca %struct.entry_hash_iter*
%4 = alloca %struct.entry_hash*
store %struct.entry_hash_iter* %0, %struct.entry_hash_iter** %3
store %struct.entry_hash* %1, %struct.entry_hash** %4
%5 = load %struct.entry_hash_iter*, %struct.entry_hash_iter** %3
%6 = bitcast %struct.entry_hash_iter* %5 to %struct.genhash_iter*
%7 = load %struct.entry_hash*, %struct.entry_hash** %4
%8 = bitcast %struct.entry_hash* %7 to %struct.genhash*
%9 = call %struct.iterator* @genhash_value_iter_init(%struct.genhash_iter* %6, %struct.genhash* %8)
ret %struct.iterator* %9
}

LLVM IR (-O2):
%struct.iterator = type { i32 }
%struct.entry_hash_iter = type { i32 }
%struct.entry_hash = type { i32 }
%struct.genhash_iter = type { i32 }
%struct.genhash = type { i32 }
define %struct.iterator* @entry_hash_value_iter_init(%struct.entry_hash_iter* %0, %struct.entry_hash* %1) {
%3 = bitcast %struct.entry_hash_iter* %0 to %struct.genhash_iter*
%4 = bitcast %struct.entry_hash* %1 to %struct.genhash*
%5 = tail call %struct.iterator* @genhash_value_iter_init(%struct.genhash_iter* %3, %struct.genhash* %4)
ret %struct.iterator* %5
}
/* Variables and functions */
int /*<<< orphan*/ BaroAltitudeHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void BaroAltitudeRequestUpdate() { UAVObjRequestUpdate(BaroAltitudeHandle()); }


x86 assembly (clang, -O0):
<BaroAltitudeRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <BaroAltitudeHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<BaroAltitudeRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <BaroAltitudeHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @BaroAltitudeRequestUpdate() {
%1 = call i32 (...) @BaroAltitudeHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @BaroAltitudeRequestUpdate() {
%1 = tail call i32 (...) @BaroAltitudeHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
int test_imm_99uint8_mem(unsigned char *val) {
  return ((*val) & (-0x99 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_99uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -153
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_99uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 103
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
uintptr_t PtrArrAt(void *arr, int n) { return (uintptr_t)((void **)arr)[n]; }


x86 assembly (clang, -O0):
<PtrArrAt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PtrArrAt>:
movslq %esi,%rax
mov    (%rdi,%rax,8),%rax
ret

LLVM IR (-O0):
define i64 @PtrArrAt(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i8**
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8*, i8** %6, i64 %8
%10 = load i8*, i8** %9
%11 = ptrtoint i8* %10 to i64
ret i64 %11
}

LLVM IR (-O2):
define i64 @PtrArrAt(i8* nocapture %0, i32 %1) {
%3 = bitcast i8* %0 to i8**
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8*, i8** %3, i64 %4
%6 = load i8*, i8** %5
%7 = ptrtoint i8* %6 to i64
ret i64 %7
}
/* Variables and functions */
scalar_t__ getnewline1(char **);
int /*<<< orphan*/ gotoendofline(char **);
int countlines(char *buf) {
  char *b = buf;
  int i;
  for (i = 0; getnewline1(&b); i++)
    gotoendofline(&b);
  return i;
}


x86 assembly (clang, -O0):
<countlines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <getnewline1@plt>
cmp    $0x0,%rax
je     1165 <countlines+0x45>
lea    -0x10(%rbp),%rdi
call   1040 <gotoendofline@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113b <countlines+0x1b>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<countlines>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
call   1030 <getnewline1@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     1158 <countlines+0x38>
mov    %rsp,%r14
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1040 <gotoendofline@plt>
add    $0x1,%ebx
mov    %r14,%rdi
call   1030 <getnewline1@plt>
test   %rax,%rax
jne    1140 <countlines+0x20>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @countlines(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %3
store i32 0, i32* %4
br label %6
6: ; preds = %11, %1
%7 = call i64 @getnewline1(i8** %3)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %6
%10 = call i32 @gotoendofline(i8** %3)
br label %11
11: ; preds = %9
%12 = load i32, i32* %4
%13 = add nsw i32 %12, 1
store i32 %13, i32* %4
br label %6
14: ; preds = %6
%15 = load i32, i32* %4
ret i32 %15
}

LLVM IR (-O2):
define i32 @countlines(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
store i8* %0, i8** %2
%4 = call i64 @getnewline1(i8** %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %1, %6
%7 = phi i32 [ %9, %6 ], [ 0, %1 ]
%8 = call i32 @gotoendofline(i8** %2)
%9 = add nuw nsw i32 %7, 1
%10 = call i64 @getnewline1(i8** %2)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %6
12: ; preds = %6, %1
%13 = phi i32 [ 0, %1 ], [ %9, %6 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ setB();
__attribute__((constructor)) void myInit() { setB(); }


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

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

LLVM IR (-O0):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @myInit, i8* null }]
define void @myInit() {
%1 = call i32 (...) @setB()
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @myInit, i8* null }]
define void @myInit() {
%1 = tail call i32 (...) @setB()
ret void
}