xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fabs(double);
double pow(double, double);
double sqrt(int /*<<< orphan*/);
double f(double x) { return (sqrt(fabs(x)) + 5.0 * pow(x, 3.0)); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <fabs@plt>
mov    %eax,%edi
call   1050 <sqrt@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xea8(%rip),%xmm1
call   1040 <pow@plt>
movsd  -0x10(%rbp),%xmm1
movsd  0xe8e(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
call   1030 <fabs@plt>
mov    %eax,%edi
call   1050 <sqrt@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0xeac(%rip),%xmm1
movsd  0x8(%rsp),%xmm0
call   1040 <pow@plt>
mulsd  0xea1(%rip),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @f(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @fabs(double %3)
%5 = call double @sqrt(i32 %4)
%6 = load double, double* %2
%7 = call double @pow(double %6, double 3.000000e+00)
%8 = call double @llvm.fmuladd.f64(double 5.000000e+00, double %7, double %5)
ret double %8
}

LLVM IR (-O2):
define double @f(double %0) {
%2 = tail call i32 @fabs(double %0)
%3 = tail call double @sqrt(i32 %2)
%4 = tail call double @pow(double %0, double 3.000000e+00)
%5 = tail call double @llvm.fmuladd.f64(double %4, double 5.000000e+00, double %3)
ret double %5
}
void g_hash_table_remove() {}


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

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

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

LLVM IR (-O2):
define void @g_hash_table_remove() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ emit_adc(int, int, int);
int /*<<< orphan*/ emit_lsrs_imm(int, int, int);
int /*<<< orphan*/ emit_rrxs(int, int);
void emit_rotcrsr(int t, int sr) {
  emit_lsrs_imm(sr, 1, sr);
  emit_rrxs(t, t);
  emit_adc(sr, sr, sr);
}


x86 assembly (clang, -O0):
<emit_rotcrsr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    $0x1,%esi
call   1030 <emit_lsrs_imm@plt>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1050 <emit_rrxs@plt>
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1040 <emit_adc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_rotcrsr>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %esi,%edi
mov    $0x1,%esi
mov    %ebx,%edx
call   1030 <emit_lsrs_imm@plt>
mov    %ebp,%edi
mov    %ebp,%esi
call   1050 <emit_rrxs@plt>
mov    %ebx,%edi
mov    %ebx,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <emit_adc@plt>

LLVM IR (-O0):
define void @emit_rotcrsr(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 = load i32, i32* %4
%7 = call i32 @emit_lsrs_imm(i32 %5, i32 1, i32 %6)
%8 = load i32, i32* %3
%9 = load i32, i32* %3
%10 = call i32 @emit_rrxs(i32 %8, i32 %9)
%11 = load i32, i32* %4
%12 = load i32, i32* %4
%13 = load i32, i32* %4
%14 = call i32 @emit_adc(i32 %11, i32 %12, i32 %13)
ret void
}

LLVM IR (-O2):
define void @emit_rotcrsr(i32 %0, i32 %1) {
%3 = tail call i32 @emit_lsrs_imm(i32 %1, i32 1, i32 %1)
%4 = tail call i32 @emit_rrxs(i32 %0, i32 %0)
%5 = tail call i32 @emit_adc(i32 %1, i32 %1, i32 %1)
ret void
}
int ft_toupper(int c) {
  if (c > 96 && c < 123) {
    c = c - 32;
  }
  return (c);
}


x86 assembly (clang, -O0):
<ft_toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x60,-0x4(%rbp)
jle    1124 <ft_toupper+0x24>
cmpl   $0x7b,-0x4(%rbp)
jge    1124 <ft_toupper+0x24>
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ft_toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 96
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 123
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 32
store i32 %10, i32* %2
br label %11
11: ; preds = %8, %5, %1
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @ft_toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int gcd(int, int);
int lcm(int u, int v) {
  int result;
  result = u * v / gcd(u, v);
  return result;
}


x86 assembly (clang, -O0):
<lcm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <gcd@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcm>:
push   %rbx
mov    %esi,%ebx
imul   %edi,%ebx
call   1030 <gcd@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
pop    %rbx
ret

LLVM IR (-O0):
define i32 @lcm(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = mul nsw i32 %6, %7
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @gcd(i32 %9, i32 %10)
%12 = sdiv i32 %8, %11
store i32 %12, i32* %5
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
define i32 @lcm(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = tail call i32 @gcd(i32 %0, i32 %1)
%5 = sdiv i32 %3, %4
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ *newwin(int, int, int, int /*<<< orphan*/);
WINDOW *initRoomStatus(int myHeight, int height, int width) {
  return newwin(myHeight, width, height - myHeight, 0);
}


x86 assembly (clang, -O0):
<initRoomStatus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
sub    -0x4(%rbp),%edx
xor    %ecx,%ecx
call   1030 <newwin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initRoomStatus>:
mov    %esi,%eax
sub    %edi,%eax
mov    %edx,%esi
mov    %eax,%edx
xor    %ecx,%ecx
jmp    1030 <newwin@plt>

LLVM IR (-O0):
define i32* @initRoomStatus(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* %4
%8 = load i32, i32* %6
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = sub nsw i32 %9, %10
%12 = call i32* @newwin(i32 %7, i32 %8, i32 %11, i32 0)
ret i32* %12
}

LLVM IR (-O2):
define i32* @initRoomStatus(i32 %0, i32 %1, i32 %2) {
%4 = sub nsw i32 %1, %0
%5 = tail call i32* @newwin(i32 %0, i32 %2, i32 %4, i32 0)
ret i32* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello!\n");
  return (0);
}


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

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

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

LLVM IR (-O2):
@str = [7 x i8] c"Hello!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct ship {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Write(int, struct ship *, long, int /*<<< orphan*/,
                         int /*<<< orphan*/, int /*<<< orphan*/);
void send_captured(struct ship *ship, long a) { Write(2, ship, a, 0, 0, 0); }


x86 assembly (clang, -O0):
<send_captured>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x2,%edi
xor    %r9d,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <Write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_captured>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x2,%edi
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <Write@plt>

LLVM IR (-O0):
%struct.ship = type { i32 }
define void @send_captured(%struct.ship* %0, i64 %1) {
%3 = alloca %struct.ship*
%4 = alloca i64
store %struct.ship* %0, %struct.ship** %3
store i64 %1, i64* %4
%5 = load %struct.ship*, %struct.ship** %3
%6 = load i64, i64* %4
%7 = call i32 @Write(i32 2, %struct.ship* %5, i64 %6, i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
%struct.ship = type { i32 }
define void @send_captured(%struct.ship* %0, i64 %1) {
%3 = tail call i32 @Write(i32 2, %struct.ship* %0, i64 %1, i32 0, i32 0, i32 0)
ret void
}
compar(s1, s2) char s1[], s2[];
{
  int c, i;
  i = 0;
l:
  if (s1[i] != s2[i])
    return (1);
  if (s1[i++] == '\0')
    return (0);
  goto l;
}


x86 assembly (clang, -O0):
<compar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x18(%rbp),%rcx
movslq -0x20(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
je     113f <compar+0x3f>
movl   $0x1,-0x4(%rbp)
jmp    116f <compar+0x6f>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x20(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    116a <compar+0x6a>
movl   $0x0,-0x4(%rbp)
jmp    116f <compar+0x6f>
jmp    1113 <compar+0x13>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compar>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%ecx
cmp    (%rsi,%rax,1),%cl
jne    1124 <compar+0x24>
add    $0x1,%rax
test   %cl,%cl
jne    1110 <compar+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @compar(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %10, %2
%4 = phi i64 [ %11, %10 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %1, i64 %4
%8 = load i8, i8* %7
%9 = icmp eq i8 %6, %8
br i1 %9, label %10, label %13
10: ; preds = %3
%11 = add nuw i64 %4, 1
%12 = icmp eq i8 %6, 0
br i1 %12, label %13, label %3
13: ; preds = %10, %3
%14 = phi i32 [ 1, %3 ], [ 0, %10 ]
ret i32 %14
}
/* Variables and functions */
char *utf8_prev_char(const char *p) {
  for (;;) {
    p--;
    if ((*p & 0xc0) != 0x80)
      return (char *)p;
  }
}


x86 assembly (clang, -O0):
<utf8_prev_char>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
je     1131 <utf8_prev_char+0x31>
mov    -0x8(%rbp),%rax
pop    %rbp
ret
jmp    1108 <utf8_prev_char+0x8>

x86 assembly (clang, -O2):
<utf8_prev_char>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl -0x1(%rax),%ecx
add    $0xffffffffffffffff,%rax
and    $0xc0,%cl
cmp    $0x80,%cl
je     1110 <utf8_prev_char+0x10>
ret

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

LLVM IR (-O2):
define i8* @utf8_prev_char(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i8, i8* %3, i64 -1
%5 = load i8, i8* %4
%6 = and i8 %5, -64
%7 = icmp eq i8 %6, -128
br i1 %7, label %2, label %8
8: ; preds = %2
ret i8* %4
}
int execute_flock() { return 0; }


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

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

LLVM IR (-O0):
define i32 @execute_flock() {
ret i32 0
}

LLVM IR (-O2):
define i32 @execute_flock() {
ret i32 0
}
unsigned long long unsignedlonglong_ignoring_signedlong(unsigned long long x,
                                                        signed long y) {
  return x;
}


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

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

LLVM IR (-O0):
define i64 @unsignedlonglong_ignoring_signedlong(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @unsignedlonglong_ignoring_signedlong(i64 returned %0, i64 %1) {
ret i64 %0
}
/* Variables and functions */
int random_number(int, int);
char inputChar() {
  int a = random_number(32, 126);
  char c;
  while (1) {
    if (a >= 48 && a <= 57) {
      a = random_number(32, 126);
    } else {
      break;
    }
  }
  c = (char)a;
  return c;
}


x86 assembly (clang, -O0):
<inputChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x20,%edi
mov    $0x7e,%esi
call   1030 <random_number@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x30,-0x4(%rbp)
jl     1155 <inputChar+0x45>
cmpl   $0x39,-0x4(%rbp)
jg     1155 <inputChar+0x45>
mov    $0x20,%edi
mov    $0x7e,%esi
call   1030 <random_number@plt>
mov    %eax,-0x4(%rbp)
jmp    115a <inputChar+0x4a>
jmp    115f <inputChar+0x4f>
jmp    112a <inputChar+0x1a>
mov    -0x4(%rbp),%eax
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inputChar>:
push   %rax
mov    $0x20,%edi
mov    $0x7e,%esi
call   1030 <random_number@plt>
mov    %eax,%ecx
add    $0xffffffd0,%ecx
cmp    $0x9,%ecx
ja     1147 <inputChar+0x37>
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
mov    $0x7e,%esi
call   1030 <random_number@plt>
lea    -0x30(%rax),%ecx
cmp    $0xa,%ecx
jb     1130 <inputChar+0x20>
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @inputChar() {
%1 = alloca i32
%2 = alloca i8
%3 = call i32 @random_number(i32 32, i32 126)
store i32 %3, i32* %1
br label %4
4: ; preds = %0, %13
%5 = load i32, i32* %1
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = load i32, i32* %1
%9 = icmp sle i32 %8, 57
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 @random_number(i32 32, i32 126)
store i32 %11, i32* %1
br label %13
12: ; preds = %7, %4
br label %14
13: ; preds = %10
br label %4
14: ; preds = %12
%15 = load i32, i32* %1
%16 = trunc i32 %15 to i8
store i8 %16, i8* %2
%17 = load i8, i8* %2
ret i8 %17
}

LLVM IR (-O2):
define signext i8 @inputChar() {
%1 = tail call i32 @random_number(i32 32, i32 126)
%2 = add i32 %1, -48
%3 = icmp ult i32 %2, 10
br i1 %3, label %4, label %8
4: ; preds = %0, %4
%5 = tail call i32 @random_number(i32 32, i32 126)
%6 = add i32 %5, -48
%7 = icmp ult i32 %6, 10
br i1 %7, label %4, label %8
8: ; preds = %4, %0
%9 = phi i32 [ %1, %0 ], [ %5, %4 ]
%10 = trunc i32 %9 to i8
ret i8 %10
}
void __clf(void) { __asm__ __volatile__("" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @__clf() {
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
void f(int a, ...) {
  __builtin_va_list l;
  __builtin_va_arg(l, float);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x38(%rbp)
add    $0x4,%rax
mov    %rax,-0x30(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x24(%rbp)
cmp    $0xa0,%eax
ja     1148 <f+0x48>
mov    -0x30(%rbp),%rcx
mov    -0x24(%rbp),%edx
mov    -0x38(%rbp),%rsi
movslq %edx,%rax
add    0x10(%rsi),%rax
add    $0x10,%edx
mov    %edx,(%rcx)
mov    %rax,-0x40(%rbp)
jmp    115f <f+0x5f>
mov    -0x38(%rbp),%rcx
mov    0x8(%rcx),%rdx
mov    %rdx,%rax
add    $0x8,%rdx
mov    %rdx,0x8(%rcx)
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.__va_list_tag = type { i32, i32, i8*, i8* }
define void @f(i32 %0, ...) {
%2 = alloca i32
%3 = alloca [1 x %struct.__va_list_tag]
store i32 %0, i32* %2
%4 = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %3, i64 0, i64 0
%5 = getelementptr inbounds %struct.__va_list_tag, %struct.__va_list_tag* %4, i32 0, i32 1
%6 = load i32, i32* %5
%7 = icmp ule i32 %6, 160
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = getelementptr inbounds %struct.__va_list_tag, %struct.__va_list_tag* %4, i32 0, i32 3
%10 = load i8*, i8** %9
%11 = getelementptr i8, i8* %10, i32 %6
%12 = bitcast i8* %11 to float*
%13 = add i32 %6, 16
store i32 %13, i32* %5
br label %19
14: ; preds = %1
%15 = getelementptr inbounds %struct.__va_list_tag, %struct.__va_list_tag* %4, i32 0, i32 2
%16 = load i8*, i8** %15
%17 = bitcast i8* %16 to float*
%18 = getelementptr i8, i8* %16, i32 8
store i8* %18, i8** %15
br label %19
19: ; preds = %14, %8
%20 = phi float* [ %12, %8 ], [ %17, %14 ]
%21 = load float, float* %20
ret void
}

LLVM IR (-O2):
define void @f(i32 %0, ...) {
ret void
}
/* Variables and functions */
scalar_t__ __timezone;
double JDLocalTimetoUTC(double localJD) {
  return localJD + (double)__timezone / 86400.0;
}


x86 assembly (clang, -O0):
<JDLocalTimetoUTC>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    0x2ed3(%rip),%rax
cvtsi2sdq (%rax),%xmm1
movsd  0xede(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<JDLocalTimetoUTC>:
mov    0x2ee1(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  0xeec(%rip),%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
@__timezone = global i64 0
define double @JDLocalTimetoUTC(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load i64, i64* @__timezone
%5 = sitofp i64 %4 to double
%6 = fdiv double %5, 8.640000e+04
%7 = fadd double %3, %6
ret double %7
}

LLVM IR (-O2):
@__timezone = global i64 0
define double @JDLocalTimetoUTC(double %0) {
%2 = load i64, i64* @__timezone
%3 = sitofp i64 %2 to double
%4 = fdiv double %3, 8.640000e+04
%5 = fadd double %4, %0
ret double %5
}
int max_2_int(int a, int b) {
  if (a > b)
    return a;
  return b;
}


x86 assembly (clang, -O0):
<max_2_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1121 <max_2_int+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <max_2_int+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_2_int>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @max_2_int(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
int test_imm_4Eint64_lowword_mem(long long *val) {
  return ((*val) & (0x4E << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_4Eint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 78
%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_4Eint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 78
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void freeDynamicGrid(short **array) {
  free(array[0]);
  free(array);
}


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

x86 assembly (clang, -O2):
<freeDynamicGrid>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @freeDynamicGrid(i16** %0) {
%2 = alloca i16**
store i16** %0, i16*** %2
%3 = load i16**, i16*** %2
%4 = getelementptr inbounds i16*, i16** %3, i64 0
%5 = load i16*, i16** %4
%6 = bitcast i16* %5 to i8*
%7 = load i16**, i16*** %2
%8 = bitcast i16** %7 to i8*
ret void
}

LLVM IR (-O2):
define void @freeDynamicGrid(i16** nocapture %0) {
%2 = bitcast i16** %0 to i8**
%3 = load i8*, i8** %2
tail call void @free(i8* %3)
%4 = bitcast i16** %0 to i8*
tail call void @free(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ssd1306_clearScreen8();
void ssd1331_clearScreen8(void) { ssd1306_clearScreen8(); }


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

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

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

LLVM IR (-O2):
define void @ssd1331_clearScreen8() {
%1 = tail call i32 (...) @ssd1306_clearScreen8()
ret void
}
/* Variables and functions */
int hash(char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  int hashed;
  char word[200];
  scanf("%s", word);
  hashed = hash(word);
  printf("%d", hashed);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xd0(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1050 <scanf@plt>
lea    -0xd0(%rbp),%rdi
call   1030 <hash@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe95(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xd0,%rsp
lea    0xec1(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <hash@plt>
lea    0xeaa(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [200 x i8]
%2 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @hash(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int strcmp(char *, char *);
int comparator_string(char *a, char *b) {
  if (a == b)
    return 0;
  if (a == NULL)
    return -1;
  if (b == NULL)
    return 1;
  return strcmp(a, b);
}


x86 assembly (clang, -O0):
<comparator_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    113a <comparator_string+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    1178 <comparator_string+0x68>
cmpq   $0x0,-0x10(%rbp)
jne    1151 <comparator_string+0x41>
movl   $0xffffffff,-0x4(%rbp)
jmp    1178 <comparator_string+0x68>
cmpq   $0x0,-0x18(%rbp)
jne    1168 <comparator_string+0x58>
movl   $0x1,-0x4(%rbp)
jmp    1178 <comparator_string+0x68>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<comparator_string>:
cmp    %rsi,%rdi
je     1124 <comparator_string+0x14>
test   %rdi,%rdi
je     1127 <comparator_string+0x17>
test   %rsi,%rsi
je     112d <comparator_string+0x1d>
jmp    1030 <strcmp@plt>
xor    %eax,%eax
ret
mov    $0xffffffff,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @comparator_string(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 = load i8*, i8** %5
%8 = icmp eq i8* %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 0, i32* %3
br label %22
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %14
13: ; preds = %10
store i32 -1, i32* %3
br label %22
14: ; preds = %10
%15 = load i8*, i8** %5
%16 = icmp eq i8* %15, null
br i1 %16, label %17, label %18
17: ; preds = %14
store i32 1, i32* %3
br label %22
18: ; preds = %14
%19 = load i8*, i8** %4
%20 = load i8*, i8** %5
%21 = call i32 @strcmp(i8* %19, i8* %20)
store i32 %21, i32* %3
br label %22
22: ; preds = %18, %17, %13, %9
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @comparator_string(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, %1
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = icmp eq i8* %0, null
br i1 %5, label %10, label %6
6: ; preds = %4
%7 = icmp eq i8* %1, null
br i1 %7, label %10, label %8
8: ; preds = %6
%9 = tail call i32 @strcmp(i8* %0, i8* %1)
br label %10
10: ; preds = %6, %4, %2, %8
%11 = phi i32 [ %9, %8 ], [ 0, %2 ], [ -1, %4 ], [ 1, %6 ]
ret i32 %11
}
double f6(double x) { return 1 / (1 + x); }


x86 assembly (clang, -O0):
<f6>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm1
addsd  -0x8(%rbp),%xmm1
movsd  0xee2(%rip),%xmm0
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f6>:
movsd  0xef8(%rip),%xmm1
addsd  %xmm1,%xmm0
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @f6(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double 1.000000e+00, %3
%5 = fdiv double 1.000000e+00, %4
ret double %5
}

LLVM IR (-O2):
define double @f6(double %0) {
%2 = fadd double %0, 1.000000e+00
%3 = fdiv double 1.000000e+00, %2
ret double %3
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_creds_has_permitted_cap(void *c, int capability) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_creds_has_permitted_cap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
mov    0x2ecc(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_creds_has_permitted_cap>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_creds_has_permitted_cap(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_creds_has_permitted_cap(i8* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Type definitions */
struct bufsize {
  int dummy;
};
struct buffers {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ codec_bench_dec(struct buffers *, struct bufsize const *,
                                   char const *, unsigned int);
int /*<<< orphan*/ codec_bench_enc(struct buffers *, struct bufsize const *,
                                   char const *, unsigned int);
void codec_bench(struct buffers *b, const struct bufsize *bs, const char *name,
                 unsigned int flags) {
  codec_bench_enc(b, bs, name, flags);
  codec_bench_dec(b, bs, name, flags);
}


x86 assembly (clang, -O0):
<codec_bench>:
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    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <codec_bench_enc@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1040 <codec_bench_dec@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<codec_bench>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %rdx,%r15
mov    %rsi,%rbp
mov    %rdi,%rbx
call   1030 <codec_bench_enc@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r15,%rdx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <codec_bench_dec@plt>

LLVM IR (-O0):
%struct.buffers = type { i32 }
%struct.bufsize = type { i32 }
define void @codec_bench(%struct.buffers* %0, %struct.bufsize* %1, i8* %2, i32 %3) {
%5 = alloca %struct.buffers*
%6 = alloca %struct.bufsize*
%7 = alloca i8*
%8 = alloca i32
store %struct.buffers* %0, %struct.buffers** %5
store %struct.bufsize* %1, %struct.bufsize** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load %struct.buffers*, %struct.buffers** %5
%10 = load %struct.bufsize*, %struct.bufsize** %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 @codec_bench_enc(%struct.buffers* %9, %struct.bufsize* %10, i8* %11, i32 %12)
%14 = load %struct.buffers*, %struct.buffers** %5
%15 = load %struct.bufsize*, %struct.bufsize** %6
%16 = load i8*, i8** %7
%17 = load i32, i32* %8
%18 = call i32 @codec_bench_dec(%struct.buffers* %14, %struct.bufsize* %15, i8* %16, i32 %17)
ret void
}

LLVM IR (-O2):
%struct.buffers = type { i32 }
%struct.bufsize = type { i32 }
define void @codec_bench(%struct.buffers* %0, %struct.bufsize* %1, i8* %2, i32 %3) {
%5 = tail call i32 @codec_bench_enc(%struct.buffers* %0, %struct.bufsize* %1, i8* %2, i32 %3)
%6 = tail call i32 @codec_bench_dec(%struct.buffers* %0, %struct.bufsize* %1, i8* %2, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putnbr(int const);
int /*<<< orphan*/ write(int, char *, int);
void ft_putnbr_endl(const int n) {
  (void)ft_putnbr(n);
  (void)write(0x01, "\n", 0x01);
  return;
}


x86 assembly (clang, -O0):
<ft_putnbr_endl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <ft_putnbr@plt>
mov    $0x1,%edx
lea    0xec1(%rip),%rsi
mov    %edx,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putnbr_endl>:
push   %rax
call   1040 <ft_putnbr@plt>
lea    0xed3(%rip),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
pop    %rax
jmp    1030 <write@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @ft_putnbr_endl(i32 %0) {
%2 = tail call i32 @ft_putnbr(i32 %0)
%3 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ asc2c(int /*<<< orphan*/, int /*<<< orphan*/, int);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int main(int argc, char **argv) {
  asc2c(stdin, stdout, argc - 1);
  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    0x2ebb(%rip),%rax
mov    (%rax),%edi
mov    0x2ea2(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
sub    $0x1,%edx
call   1030 <asc2c@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%eax
mov    0x2eb7(%rip),%rcx
mov    (%rcx),%esi
lea    -0x1(%rdi),%edx
mov    %eax,%edi
call   1030 <asc2c@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdin = global i32 0
@stdout = global i32 0
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* @stdin
%7 = load i32, i32* @stdout
%8 = load i32, i32* %4
%9 = sub nsw i32 %8, 1
%10 = call i32 @asc2c(i32 %6, i32 %7, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@stdout = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stdin
%4 = load i32, i32* @stdout
%5 = add nsw i32 %0, -1
%6 = tail call i32 @asc2c(i32 %3, i32 %4, i32 %5)
ret i32 0
}
void init_pair(int index, char *foreground, char *background) {}


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

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

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

LLVM IR (-O2):
define void @init_pair(i32 %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nlopt_srand(unsigned long);
void nlosr_(const int *seed) { nlopt_srand((unsigned long)*seed); }


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

x86 assembly (clang, -O2):
<nlosr_>:
movslq (%rdi),%rdi
jmp    1030 <nlopt_srand@plt>

LLVM IR (-O0):
define void @nlosr_(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = sext i32 %4 to i64
%6 = call i32 @nlopt_srand(i64 %5)
ret void
}

LLVM IR (-O2):
define void @nlosr_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = sext i32 %2 to i64
%4 = tail call i32 @nlopt_srand(i64 %3)
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
scalar_t__ count_letters(scalar_t__);
uint64_t solve(uint64_t n) {
  uint64_t result = 0;
  for (uint64_t i = 1; i <= n; ++i) {
    result += count_letters(i);
  }
  return result;
}


x86 assembly (clang, -O0):
<solve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jg     115c <solve+0x4c>
mov    -0x18(%rbp),%rdi
call   1030 <count_letters@plt>
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    112c <solve+0x1c>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solve>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
jle    114f <solve+0x3f>
mov    %rdi,%r14
neg    %r14
mov    $0x1,%ebx
xor    %r15d,%r15d
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <count_letters@plt>
add    %rax,%r15
lea    (%r14,%rbx,1),%rax
add    $0x1,%rax
add    $0x1,%rbx
cmp    $0x1,%rax
jne    1130 <solve+0x20>
jmp    1152 <solve+0x42>
xor    %r15d,%r15d
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @solve(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %2
store i64 0, i64* %3
store i64 1, i64* %4
br label %5
5: ; preds = %14, %1
%6 = load i64, i64* %4
%7 = load i64, i64* %2
%8 = icmp sle i64 %6, %7
br i1 %8, label %9, label %17
9: ; preds = %5
%10 = load i64, i64* %4
%11 = call i64 @count_letters(i64 %10)
%12 = load i64, i64* %3
%13 = add nsw i64 %12, %11
store i64 %13, i64* %3
br label %14
14: ; preds = %9
%15 = load i64, i64* %4
%16 = add nsw i64 %15, 1
store i64 %16, i64* %4
br label %5
17: ; preds = %5
%18 = load i64, i64* %3
ret i64 %18
}

LLVM IR (-O2):
define i64 @solve(i64 %0) {
%2 = icmp slt i64 %0, 1
br i1 %2, label %3, label %5
3: ; preds = %5, %1
%4 = phi i64 [ 0, %1 ], [ %9, %5 ]
ret i64 %4
5: ; preds = %1, %5
%6 = phi i64 [ %10, %5 ], [ 1, %1 ]
%7 = phi i64 [ %9, %5 ], [ 0, %1 ]
%8 = tail call i64 @count_letters(i64 %6)
%9 = add nsw i64 %8, %7
%10 = add nuw i64 %6, 1
%11 = icmp eq i64 %6, %0
br i1 %11, label %3, label %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ write_array_f64(int /*<<< orphan*/ *, double const *,
                                   unsigned int const);
void write_named_array_f64(FILE *f, const char *name, const double *x,
                           const unsigned int len) {
  fprintf(f, "\"%s\":[", name);
  write_array_f64(f, x, len);
  fprintf(f, "]");
}


x86 assembly (clang, -O0):
<write_named_array_f64>:
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    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xeba(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1040 <write_array_f64@plt>
mov    -0x8(%rbp),%rdi
lea    0xe9f(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_named_array_f64>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %rdx,%rbx
mov    %rsi,%rdx
mov    %rdi,%rbp
lea    0xeb9(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1050 <write_array_f64@plt>
mov    $0x5d,%edi
mov    %rbp,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <fputc@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"\22%s\22:[\00"
@.str.1 = [2 x i8] c"]\00"
define void @write_named_array_f64(i32* %0, i8* %1, double* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca double*
%8 = alloca i32
store i32* %0, i32** %5
store i8* %1, i8** %6
store double* %2, double** %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = load i8*, i8** %6
%11 = call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = load i32*, i32** %5
%13 = load double*, double** %7
%14 = load i32, i32* %8
%15 = call i32 @write_array_f64(i32* %12, double* %13, i32 %14)
%16 = load i32*, i32** %5
%17 = call i32 (i32*, i8*, ...) @fprintf(i32* %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"\22%s\22:[\00"
define void @write_named_array_f64(i32* %0, i8* %1, double* %2, i32 %3) {
%5 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %1)
%6 = tail call i32 @write_array_f64(i32* %0, double* %2, i32 %3)
%7 = tail call i32 @fputc(i32 93, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SHUT_RDWR;
int /*<<< orphan*/ close(int);
int recv(int, char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ shutdown(int, int /*<<< orphan*/);
void receive_data_asynch(int source_sock) {
  char buffer[1024];
  int n;
  while ((n = recv(source_sock, buffer, 1024, 0)) > 0)
    ;
  shutdown(source_sock, SHUT_RDWR);
  close(source_sock);
}


x86 assembly (clang, -O0):
<receive_data_asynch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x410(%rbp),%rsi
mov    $0x400,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,-0x414(%rbp)
cmp    $0x0,%eax
jle    1168 <receive_data_asynch+0x38>
jmp    113e <receive_data_asynch+0xe>
mov    -0x4(%rbp),%edi
mov    0x2e7e(%rip),%rax
mov    (%rax),%esi
call   1040 <shutdown@plt>
mov    -0x4(%rbp),%edi
call   1050 <close@plt>
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<receive_data_asynch>:
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    %edi,%ebx
mov    %rsp,%r14
nop
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x400,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
test   %eax,%eax
jg     1140 <receive_data_asynch+0x10>
mov    0x2e94(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
call   1040 <shutdown@plt>
mov    %ebx,%edi
call   1050 <close@plt>
add    $0x408,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SHUT_RDWR = global i32 0
define void @receive_data_asynch(i32 %0) {
%2 = alloca i32
%3 = alloca [1024 x i8]
%4 = alloca i32
store i32 %0, i32* %2
br label %5
5: ; preds = %10, %1
%6 = load i32, i32* %2
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%8 = call i32 @recv(i32 %6, i8* %7, i32 1024, i32 0)
store i32 %8, i32* %4
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %5
br label %5
11: ; preds = %5
%12 = load i32, i32* %2
%13 = load i32, i32* @SHUT_RDWR
%14 = call i32 @shutdown(i32 %12, i32 %13)
%15 = load i32, i32* %2
%16 = call i32 @close(i32 %15)
ret void
}

LLVM IR (-O2):
@SHUT_RDWR = global i32 0
define void @receive_data_asynch(i32 %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
br label %4
4: ; preds = %4, %1
%5 = call i32 @recv(i32 %0, i8* %3, i32 1024, i32 0)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %4, label %7
7: ; preds = %4
%8 = load i32, i32* @SHUT_RDWR
%9 = call i32 @shutdown(i32 %0, i32 %8)
%10 = call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SETHLm(int);
void SET6HLm() { SETHLm(0x40); }


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

x86 assembly (clang, -O2):
<SET6HLm>:
mov    $0x40,%edi
jmp    1030 <SETHLm@plt>

LLVM IR (-O0):
define void @SET6HLm() {
%1 = call i32 @SETHLm(i32 64)
ret void
}

LLVM IR (-O2):
define void @SET6HLm() {
%1 = tail call i32 @SETHLm(i32 64)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ UART1_Init(int);
void serial_init() { UART1_Init(9600); }


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

x86 assembly (clang, -O2):
<serial_init>:
mov    $0x2580,%edi
jmp    1030 <UART1_Init@plt>

LLVM IR (-O0):
define void @serial_init() {
%1 = call i32 @UART1_Init(i32 9600)
ret void
}

LLVM IR (-O2):
define void @serial_init() {
%1 = tail call i32 @UART1_Init(i32 9600)
ret void
}
int xmlUCSIsLatin1Supplement(int code) {
  return (((code >= 0x0080) && (code <= 0x00FF)));
}


x86 assembly (clang, -O0):
<xmlUCSIsLatin1Supplement>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x80,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsLatin1Supplement+0x26>
cmpl   $0xff,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsLatin1Supplement>:
and    $0xffffff80,%edi
xor    %eax,%eax
cmp    $0x80,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @xmlUCSIsLatin1Supplement(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 128
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 255
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @xmlUCSIsLatin1Supplement(i32 %0) {
%2 = and i32 %0, -128
%3 = icmp eq i32 %2, 128
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef unsigned int uint16_t;

/* Variables and functions */
uint8_t pcg_output_xsh_rs_16_8(uint16_t state) {
  return (uint8_t)(((state >> 7u) ^ state) >> ((state >> 14u) + 3u));
}


x86 assembly (clang, -O0):
<pcg_output_xsh_rs_16_8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x7,%eax
xor    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0xe,%ecx
add    $0x3,%ecx
shr    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pcg_output_xsh_rs_16_8>:
mov    %edi,%eax
shr    $0x7,%eax
xor    %edi,%eax
shr    $0xe,%edi
lea    0x3(%rdi),%ecx
shr    %cl,%eax
ret

LLVM IR (-O0):
define i32 @pcg_output_xsh_rs_16_8(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 7
%5 = load i32, i32* %2
%6 = xor i32 %4, %5
%7 = load i32, i32* %2
%8 = lshr i32 %7, 14
%9 = add i32 %8, 3
%10 = lshr i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @pcg_output_xsh_rs_16_8(i32 %0) {
%2 = lshr i32 %0, 7
%3 = xor i32 %2, %0
%4 = lshr i32 %0, 14
%5 = add nuw nsw i32 %4, 3
%6 = lshr i32 %3, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void str05() {
  int x = 5, y = 7;
  if (x == y)
    ;
  { printf("not working\n"); }
  if (x)
    ;
}


x86 assembly (clang, -O0):
<str05>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x5,-0x4(%rbp)
movl   $0x7,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1137 <str05+0x27>
jmp    1137 <str05+0x27>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x0,-0x4(%rbp)
je     1152 <str05+0x42>
jmp    1152 <str05+0x42>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [12 x i8] c"not working\00"
define void @str05() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
void debug_objects_early_init(void) {}


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

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

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

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