xunge/DecIR huggingface dataset:
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  void *uc_link;
};
typedef TYPE_1__ ucontext_t;
typedef int /*<<< orphan*/ siginfo_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ getcontext(TYPE_1__ *);
void sighandler(int sig, siginfo_t *sip, void *arg) {
  ucontext_t uc2;
  getcontext(&uc2);
  assert(uc2.uc_link == arg);
}


x86 assembly (clang, -O0):
<sighandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
call   1040 <getcontext@plt>
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sighandler>:
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
lea    0x8(%rsp),%rdi
call   1040 <getcontext@plt>
xor    %edi,%edi
cmp    %rbx,0x8(%rsp)
sete   %al
mov    %al,%dil
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i8* }
define void @sighandler(i32 %0, i32* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca %struct.TYPE_3__
store i32 %0, i32* %4
store i32* %1, i32** %5
store i8* %2, i8** %6
%8 = call i32 @getcontext(%struct.TYPE_3__* %7)
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %7, i32 0, i32 0
%10 = load i8*, i8** %9
%11 = load i8*, i8** %6
%12 = icmp eq i8* %10, %11
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
ret void
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i8* }
define void @sighandler(i32 %0, i32* nocapture readnone %1, i8* readnone %2) {
%4 = alloca %struct.TYPE_3__
%5 = bitcast %struct.TYPE_3__* %4 to i8*
%6 = call i32 @getcontext(%struct.TYPE_3__* %4)
%7 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %4, i64 0, i32 0
%8 = load i8*, i8** %7
%9 = icmp eq i8* %8, %2
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
ret void
}
void ffi_cparser_init(void) { return; }


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

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

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

LLVM IR (-O2):
define void @ffi_cparser_init() {
ret void
}
int network_connect_client(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @network_connect_client() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int host_flash_close(void *handle) {
  FILE *file;
  file = (FILE *)handle;
  if (!fclose(file))
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<host_flash_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
cmp    $0x0,%eax
jne    1142 <host_flash_close+0x32>
movl   $0x0,-0x4(%rbp)
jmp    1149 <host_flash_close+0x39>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @host_flash_close(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @fclose(i32* %2)
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
void genround_w_s() {}


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

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

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

LLVM IR (-O2):
define void @genround_w_s() {
ret void
}
int int_mult(int x, int y, int index) { return x * y; }


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

x86 assembly (clang, -O2):
<int_mult>:
mov    %edi,%eax
imul   %esi,%eax
ret

LLVM IR (-O0):
define i32 @int_mult(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* %5
%9 = mul nsw i32 %7, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @int_mult(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %1, %0
ret i32 %4
}
/* Variables and functions */
scalar_t__ leap_year(int);
int month_days(int year, int month) {
  const int month_days[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  return month_days[month - 1] + (month == 2 && leap_year(year));
}


x86 assembly (clang, -O0):
<month_days>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x30,%edx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0x40(%rbp,%rax,4),%eax
mov    %eax,-0x48(%rbp)
xor    %eax,%eax
cmpl   $0x2,-0x8(%rbp)
mov    %al,-0x41(%rbp)
jne    1173 <month_days+0x53>
mov    -0x4(%rbp),%edi
call   1030 <leap_year@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x41(%rbp)
mov    -0x48(%rbp),%eax
mov    -0x41(%rbp),%cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<month_days>:
push   %rbx
movslq %esi,%rcx
lea    0xee5(%rip),%rax
mov    -0x4(%rax,%rcx,4),%ebx
xor    %eax,%eax
cmp    $0x2,%ecx
jne    1136 <month_days+0x26>
call   1030 <leap_year@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@__const.month_days.month_days = [12 x i32] [i32 31, i32 28, i32 31, i32 30, i32 31, i32 30, i32 31, i32 31, i32 30, i32 31, i32 30, i32 31]
define i32 @month_days(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [12 x i32]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = bitcast [12 x i32]* %5 to i8*
%7 = load i32, i32* %4
%8 = sub nsw i32 %7, 1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [12 x i32], [12 x i32]* %5, i64 0, i64 %9
%11 = load i32, i32* %10
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, 2
br i1 %13, label %14, label %18
14: ; preds = %2
%15 = load i32, i32* %3
%16 = call i64 @leap_year(i32 %15)
%17 = icmp ne i64 %16, 0
br label %18
18: ; preds = %14, %2
%19 = phi i1 [ false, %2 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
%21 = add nsw i32 %11, %20
ret i32 %21
}

LLVM IR (-O2):
@__const.month_days.month_days = [12 x i32] [i32 31, i32 28, i32 31, i32 30, i32 31, i32 30, i32 31, i32 31, i32 30, i32 31, i32 30, i32 31]
define i32 @month_days(i32 %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [12 x i32], [12 x i32]* @__const.month_days.month_days, i64 0, i64 %4
%6 = load i32, i32* %5
%7 = icmp eq i32 %1, 2
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = tail call i64 @leap_year(i32 %0)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %8, %2
%13 = phi i32 [ 0, %2 ], [ %11, %8 ]
%14 = add nsw i32 %13, %6
ret i32 %14
}
/* Variables and functions */
int dlink_get_first();
int peek() { return dlink_get_first(); }


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

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

LLVM IR (-O0):
define i32 @peek() {
%1 = call i32 (...) @dlink_get_first()
ret i32 %1
}

LLVM IR (-O2):
define i32 @peek() {
%1 = tail call i32 (...) @dlink_get_first()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf(argv[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    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @printf(i8* %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @printf(i8* dereferenceable(1) %4)
ret i32 0
}
int params__is_address_ending_char(char c) { return (c == ':'); }


x86 assembly (clang, -O0):
<params__is_address_ending_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x3a,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<params__is_address_ending_char>:
xor    %eax,%eax
cmp    $0x3a,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @params__is_address_ending_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 58
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @params__is_address_ending_char(i8 signext %0) {
%2 = icmp eq i8 %0, 58
%3 = zext i1 %2 to i32
ret i32 %3
}
unsigned xrop3_213_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = T & S;
  stk2 = ~stk2;
  stk1 = D & stk2;
  stk1 = ~stk1;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_213_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_213_0_0>:
and    %esi,%edi
lea    -0x100(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @xrop3_213_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %7
%23 = load i32, i32* %6
%24 = and i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %9
%26 = xor i32 %25, -1
store i32 %26, i32* %9
%27 = load i32, i32* %5
%28 = load i32, i32* %9
%29 = and i32 %27, %28
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = xor i32 %30, -1
store i32 %31, i32* %8
%32 = load i32, i32* %8
ret i32 %32
}

LLVM IR (-O2):
define i32 @xrop3_213_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = and i8 %1, %0
%4 = zext i8 %3 to i32
%5 = or i32 %4, -256
ret i32 %5
}
/* Type definitions */
struct pc_temp_ocv_lut {
  int dummy;
};

/* Variables and functions */
int EINVAL;
int interpolate_ocv(struct pc_temp_ocv_lut *pc_temp_ocv, int batt_temp_degc,
                    int pc) {
  return -EINVAL;
}


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

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

LLVM IR (-O0):
%struct.pc_temp_ocv_lut = type { i32 }
@EINVAL = global i32 0
define i32 @interpolate_ocv(%struct.pc_temp_ocv_lut* %0, i32 %1, i32 %2) {
%4 = alloca %struct.pc_temp_ocv_lut*
%5 = alloca i32
%6 = alloca i32
store %struct.pc_temp_ocv_lut* %0, %struct.pc_temp_ocv_lut** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* @EINVAL
%8 = sub nsw i32 0, %7
ret i32 %8
}

LLVM IR (-O2):
%struct.pc_temp_ocv_lut = type { i32 }
@EINVAL = global i32 0
define i32 @interpolate_ocv(%struct.pc_temp_ocv_lut* nocapture readnone %0, i32 %1, i32 %2) {
%4 = load i32, i32* @EINVAL
%5 = sub nsw i32 0, %4
ret i32 %5
}
int my_count_nb(int nb) {
  int loop;
  int count;
  loop = 0;
  count = 0;
  while (!loop) {
    if (nb == 0 || nb == -1)
      ++loop;
    else {
      nb /= 10;
      ++count;
    }
  }
  return (count);
}


x86 assembly (clang, -O0):
<my_count_nb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    112b <my_count_nb+0x2b>
jmp    1169 <my_count_nb+0x69>
cmpl   $0x0,-0x4(%rbp)
je     113f <my_count_nb+0x3f>
cmpl   $0xffffffff,-0x4(%rbp)
jne    114d <my_count_nb+0x4d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1164 <my_count_nb+0x64>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <my_count_nb+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_count_nb>:
lea    0x1(%rdi),%ecx
xor    %eax,%eax
cmp    $0x2,%ecx
jb     1135 <my_count_nb+0x35>
xor    %eax,%eax
nopl   0x0(%rax)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
lea    (%rcx,%rdx,1),%edi
add    $0x1,%eax
add    %edx,%ecx
add    $0x1,%ecx
cmp    $0x1,%ecx
ja     1110 <my_count_nb+0x10>
ret

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

LLVM IR (-O2):
define i32 @my_count_nb(i32 %0) {
%2 = add i32 %0, 1
%3 = icmp ult i32 %2, 2
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ %0, %1 ]
%6 = phi i32 [ %8, %4 ], [ 0, %1 ]
%7 = sdiv i32 %5, 10
%8 = add nuw nsw i32 %6, 1
%9 = add nsw i32 %7, 1
%10 = icmp ult i32 %9, 2
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, double, double);
void output_ypr_text(double in_YawPitchRoll_deg[3]) {
  printf("%+.8f,%+.8f,%+.8f\r\n", in_YawPitchRoll_deg[0],
         in_YawPitchRoll_deg[1], in_YawPitchRoll_deg[2]);
}


x86 assembly (clang, -O0):
<output_ypr_text>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm2
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_ypr_text>:
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
movsd  0x10(%rdi),%xmm2
lea    0xedb(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"%+.8f,%+.8f,%+.8f\0D\0A\00"
define void @output_ypr_text(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = load double*, double** %2
%7 = getelementptr inbounds double, double* %6, i64 1
%8 = load double, double* %7
%9 = load double*, double** %2
%10 = getelementptr inbounds double, double* %9, i64 2
%11 = load double, double* %10
%12 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), double %5, double %8, double %11)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"%+.8f,%+.8f,%+.8f\0D\0A\00"
define void @output_ypr_text(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = getelementptr inbounds double, double* %0, i64 2
%6 = load double, double* %5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), double %2, double %4, double %6)
ret void
}
void deferred_split_huge_page(struct page *page) {}


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

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

LLVM IR (-O0):
%struct.page = type opaque
define void @deferred_split_huge_page(%struct.page* %0) {
%2 = alloca %struct.page*
store %struct.page* %0, %struct.page** %2
ret void
}

LLVM IR (-O2):
%struct.page = type opaque
define void @deferred_split_huge_page(%struct.page* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ question_four();
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
int main() {
  srand((unsigned)time(NULL));
  question_four();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1050 <question_four@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
call   1050 <question_four@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @time(i32* null)
%3 = trunc i64 %2 to i32
%4 = call i32 @srand(i32 %3)
%5 = call i32 (...) @question_four()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @time(i32* null)
%2 = trunc i64 %1 to i32
%3 = tail call i32 @srand(i32 %2)
%4 = tail call i32 (...) @question_four()
ret i32 0
}
float version() { return 0.1; }


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
movss  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<version>:
movss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @version() {
ret float 0x3FB99999A0000000
}

LLVM IR (-O2):
define float @version() {
ret float 0x3FB99999A0000000
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ strcat(char *, char *);
int main(void) {
  char s[11] = "CABDE";
  strcat(s + 2, "CABDE");
  printf("%d", s[0] - s[2]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0xf(%rbp)
mov    0xec7(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xebf(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0xf(%rbp),%rdi
add    $0x2,%rdi
lea    0xeae(%rip),%rsi
call   1040 <strcat@plt>
movsbl -0xf(%rbp),%eax
movsbl -0xd(%rbp),%ecx
sub    %ecx,%eax
lea    0xe9e(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x4544424143,%rax
mov    %rax,0x8(%rsp)
movl   $0x0,0xf(%rsp)
lea    0xa(%rsp),%rdi
lea    0xec4(%rip),%rsi
call   1040 <strcat@plt>
mov    0x8(%rsp),%al
sub    0xa(%rsp),%al
movsbl %al,%esi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.s = [11 x i8] c"CABDE\00\00\00\00\00\00"
@.str = [6 x i8] c"CABDE\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [11 x i8]
store i32 0, i32* %1
%3 = bitcast [11 x i8]* %2 to i8*
%4 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds i8, i8* %4, i64 2
%6 = call i32 @strcat(i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%7 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 2
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = sub nsw i32 %9, %12
%14 = trunc i32 %13 to i8
%15 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %14)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [11 x i8] c"CABDE\00\00\00\00\00\00"
@.str = [6 x i8] c"CABDE\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [11 x i8]
%2 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 0
%3 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 2
%4 = call i32 @strcat(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = load i8, i8* %2
%6 = load i8, i8* %3
%7 = sub i8 %5, %6
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %7)
ret i32 0
}
unsigned int strhash(const char *s) {
  const char *p = s;
  unsigned int h = *p;
  if (h) {
    for (p += 1; *p; p++)
      h = (h << 5) - h + *p;
  }
  return h;
}


x86 assembly (clang, -O0):
<strhash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1168 <strhash+0x68>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1163 <strhash+0x63>
mov    -0x14(%rbp),%eax
shl    $0x5,%eax
sub    -0x14(%rbp),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1130 <strhash+0x30>
jmp    1168 <strhash+0x68>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strhash>:
movsbl (%rdi),%eax
test   %eax,%eax
je     1138 <strhash+0x38>
mov    0x1(%rdi),%cl
test   %cl,%cl
je     1137 <strhash+0x37>
add    $0x2,%rdi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%edx
shl    $0x5,%edx
sub    %eax,%edx
movsbl %cl,%eax
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1120 <strhash+0x20>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @strhash(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
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %31
11: ; preds = %1
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 1
store i8* %13, i8** %3
br label %14
14: ; preds = %27, %11
%15 = load i8*, i8** %3
%16 = load i8, i8* %15
%17 = icmp ne i8 %16, 0
br i1 %17, label %18, label %30
18: ; preds = %14
%19 = load i32, i32* %4
%20 = shl i32 %19, 5
%21 = load i32, i32* %4
%22 = sub i32 %20, %21
%23 = load i8*, i8** %3
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = add i32 %22, %25
store i32 %26, i32* %4
br label %27
27: ; preds = %18
%28 = load i8*, i8** %3
%29 = getelementptr inbounds i8, i8* %28, i32 1
store i8* %29, i8** %3
br label %14
30: ; preds = %14
br label %31
31: ; preds = %30, %1
%32 = load i32, i32* %4
ret i32 %32
}

LLVM IR (-O2):
define i32 @strhash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %19, label %4
4: ; preds = %1
%5 = sext i8 %2 to i32
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %19, label %9
9: ; preds = %4, %9
%10 = phi i8 [ %17, %9 ], [ %7, %4 ]
%11 = phi i8* [ %16, %9 ], [ %6, %4 ]
%12 = phi i32 [ %15, %9 ], [ %5, %4 ]
%13 = mul i32 %12, 31
%14 = sext i8 %10 to i32
%15 = add i32 %13, %14
%16 = getelementptr inbounds i8, i8* %11, i64 1
%17 = load i8, i8* %16
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %9
19: ; preds = %9, %4, %1
%20 = phi i32 [ 0, %1 ], [ %5, %4 ], [ %15, %9 ]
ret i32 %20
}
void uinit_(double *x, double *u, int *npde) {
  (void)x;
  (void)u;
  (void)npde;
  u[0] = 1.04;
  u[1] = 0.96;
  u[2] = 0.0;
  u[3] = 0.0;
}


x86 assembly (clang, -O0):
<uinit_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  0xeec(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0xed4(%rip),%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x10(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x18(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uinit_>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rsi)
xorps  %xmm0,%xmm0
movups %xmm0,0x10(%rsi)
ret

LLVM IR (-O0):
define void @uinit_(double* %0, double* %1, i32* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca i32*
store double* %0, double** %4
store double* %1, double** %5
store i32* %2, i32** %6
%7 = load double*, double** %4
%8 = load double*, double** %5
%9 = load i32*, i32** %6
%10 = load double*, double** %5
%11 = getelementptr inbounds double, double* %10, i64 0
store double 1.040000e+00, double* %11
%12 = load double*, double** %5
%13 = getelementptr inbounds double, double* %12, i64 1
store double 0x3FEEB851EB851EB8, double* %13
%14 = load double*, double** %5
%15 = getelementptr inbounds double, double* %14, i64 2
store double 0.000000e+00, double* %15
%16 = load double*, double** %5
%17 = getelementptr inbounds double, double* %16, i64 3
store double 0.000000e+00, double* %17
ret void
}

LLVM IR (-O2):
define void @uinit_(double* nocapture readnone %0, double* nocapture writeonly %1, i32* nocapture readnone %2) {
%4 = bitcast double* %1 to <2 x double>*
store <2 x double> <double 1.040000e+00, double 0x3FEEB851EB851EB8>, <2 x double>* %4
%5 = getelementptr inbounds double, double* %1, i64 2
%6 = bitcast double* %5 to i8*
ret void
}
void RTAvloU32Insert(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @DBNC_Init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ERR_load_BIO_strings();
int /*<<< orphan*/ OpenSSL_add_all_algorithms();
int /*<<< orphan*/ SSL_library_init();
int /*<<< orphan*/ SSL_load_error_strings();
void init_openssl() {
  SSL_load_error_strings();
  SSL_library_init();
  ERR_load_BIO_strings();
  OpenSSL_add_all_algorithms();
}


x86 assembly (clang, -O0):
<init_openssl>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <SSL_load_error_strings@plt>
mov    $0x0,%al
call   1030 <SSL_library_init@plt>
mov    $0x0,%al
call   1060 <ERR_load_BIO_strings@plt>
mov    $0x0,%al
call   1040 <OpenSSL_add_all_algorithms@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_openssl>:
push   %rax
xor    %eax,%eax
call   1050 <SSL_load_error_strings@plt>
xor    %eax,%eax
call   1030 <SSL_library_init@plt>
xor    %eax,%eax
call   1060 <ERR_load_BIO_strings@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <OpenSSL_add_all_algorithms@plt>

LLVM IR (-O0):
define void @init_openssl() {
%1 = call i32 (...) @SSL_load_error_strings()
%2 = call i32 (...) @SSL_library_init()
%3 = call i32 (...) @ERR_load_BIO_strings()
%4 = call i32 (...) @OpenSSL_add_all_algorithms()
ret void
}

LLVM IR (-O2):
define void @init_openssl() {
%1 = tail call i32 (...) @SSL_load_error_strings()
%2 = tail call i32 (...) @SSL_library_init()
%3 = tail call i32 (...) @ERR_load_BIO_strings()
%4 = tail call i32 (...) @OpenSSL_add_all_algorithms()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ fenv_t;

/* Variables and functions */
int ENOTSUP;
int fegetenv(fenv_t *envp) { return -ENOTSUP; }


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

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

LLVM IR (-O0):
@ENOTSUP = global i32 0
define i32 @fegetenv(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @ENOTSUP
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
@ENOTSUP = global i32 0
define i32 @fegetenv(i32* nocapture readnone %0) {
%2 = load i32, i32* @ENOTSUP
%3 = sub nsw i32 0, %2
ret i32 %3
}
/* Variables and functions */
void fork() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @TestLocaleString() {
ret void
}
OP(dd, e2) { op_e2(); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <op_e2@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_e2()
ret i32 undef
}
void free_double_char(char **double_tab, int a) {
  int i;
  for (i = 0; i < a; i++) {
    free(double_tab[i]);
  }
  free(double_tab);
}


x86 assembly (clang, -O0):
<free_double_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <free_double_char+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <free_double_char+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_double_char>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <free_double_char+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_double_char+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_double_char(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
%5 = alloca i32
store i8** %0, i8*** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %16, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = load i8**, i8*** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8*, i8** %11, i64 %13
%15 = load i8*, i8** %14
br label %16
16: ; preds = %10
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
store i32 %18, i32* %5
br label %6
19: ; preds = %6
%20 = load i8**, i8*** %3
%21 = bitcast i8** %20 to i8*
ret void
}

LLVM IR (-O2):
define void @free_double_char(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
tail call void @free(i8* %9)
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
%13 = bitcast i8** %0 to i8*
tail call void @free(i8* %13)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cng_put_pixel(int, int);
int Affiche4(int x, int y) { cng_put_pixel(-x, y); }


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

x86 assembly (clang, -O2):
<Affiche4>:
neg    %edi
jmp    1030 <cng_put_pixel@plt>

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

LLVM IR (-O2):
define i32 @Affiche4(i32 %0, i32 %1) {
%3 = sub nsw i32 0, %0
%4 = tail call i32 @cng_put_pixel(i32 %3, i32 %1)
ret i32 undef
}
/* Type definitions */
struct Person {
  int dummy;
};

/* Variables and functions */
struct Person *create_Person(char *, int, int);
int /*<<< orphan*/ destroy_Person(struct Person *);
int /*<<< orphan*/ print_Person(struct Person *);
int main() {
  struct Person *Joe = create_Person("Joe", 30, 190);
  print_Person(Joe);
  destroy_Person(Joe);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x1e,%esi
mov    $0xbe,%edx
call   1040 <create_Person@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <print_Person@plt>
mov    -0x8(%rbp),%rdi
call   1030 <destroy_Person@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
mov    $0x1e,%esi
mov    $0xbe,%edx
call   1040 <create_Person@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <print_Person@plt>
mov    %rbx,%rdi
call   1030 <destroy_Person@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.Person = type { i32 }
@.str = [4 x i8] c"Joe\00"
define i32 @main() {
%1 = alloca %struct.Person*
%2 = call %struct.Person* @create_Person(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 30, i32 190)
store %struct.Person* %2, %struct.Person** %1
%3 = load %struct.Person*, %struct.Person** %1
%4 = call i32 @print_Person(%struct.Person* %3)
%5 = load %struct.Person*, %struct.Person** %1
%6 = call i32 @destroy_Person(%struct.Person* %5)
ret i32 0
}

LLVM IR (-O2):
%struct.Person = type { i32 }
@.str = [4 x i8] c"Joe\00"
define i32 @main() {
%1 = tail call %struct.Person* @create_Person(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 30, i32 190)
%2 = tail call i32 @print_Person(%struct.Person* %1)
%3 = tail call i32 @destroy_Person(%struct.Person* %1)
ret i32 0
}
void Load_Image(unsigned short a, const char *directory) {}


x86 assembly (clang, -O0):
<Load_Image>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @Load_Image(i16 zeroext %0, i8* %1) {
%3 = alloca i16
%4 = alloca i8*
store i16 %0, i16* %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @Load_Image(i16 zeroext %0, i8* nocapture %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ intmax_t;

/* Variables and functions */
int /*<<< orphan*/ wcstoll(int /*<<< orphan*/ const *, int /*<<< orphan*/ **,
                           int);
intmax_t wcstoimax(const wchar_t *restrict s, wchar_t **restrict p, int base) {
  return wcstoll(s, p, base);
}


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

x86 assembly (clang, -O2):
<wcstoimax>:
jmp    1030 <wcstoll@plt>

LLVM IR (-O0):
define i32 @wcstoimax(i32* noalias %0, i32** noalias %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*** %5
%9 = load i32, i32* %6
%10 = call i32 @wcstoll(i32* %7, i32** %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @wcstoimax(i32* noalias %0, i32** noalias %1, i32 %2) {
%4 = tail call i32 @wcstoll(i32* %0, i32** %1, i32 %2)
ret i32 %4
}
int okn_tsm_init(struct okn_tsm *t) { return 1; }


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

x86 assembly (clang, -O2):
<okn_tsm_init>:
mov    $0x1,%eax
ret

LLVM IR (-O0):
%struct.okn_tsm = type opaque
define i32 @okn_tsm_init(%struct.okn_tsm* %0) {
%2 = alloca %struct.okn_tsm*
store %struct.okn_tsm* %0, %struct.okn_tsm** %2
ret i32 1
}

LLVM IR (-O2):
%struct.okn_tsm = type opaque
define i32 @okn_tsm_init(%struct.okn_tsm* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int cfg_processor_get_hex_int_attr(void *, char *);
int cfg_io_get_gpio_ie_addr(void *port) {
  return cfg_processor_get_hex_int_attr(port, "ie");
}


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

x86 assembly (clang, -O2):
<cfg_io_get_gpio_ie_addr>:
lea    0xee9(%rip),%rsi
jmp    1030 <cfg_processor_get_hex_int_attr@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"ie\00"
define i32 @cfg_io_get_gpio_ie_addr(i8* %0) {
%2 = tail call i32 @cfg_processor_get_hex_int_attr(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
double clamp(double percent) {
  return percent < 0.0 ? 0.0 : percent > 100.0 ? 100.0 : percent;
}


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1124 <clamp+0x24>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1161 <clamp+0x61>
movsd  -0x8(%rbp),%xmm0
movsd  0xecf(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    114d <clamp+0x4d>
movsd  0xebd(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1157 <clamp+0x57>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp>:
movsd  0xef8(%rip),%xmm1
minsd  %xmm0,%xmm1
xorpd  %xmm2,%xmm2
cmpltsd %xmm2,%xmm0
andnpd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @clamp(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %6
5: ; preds = %1
br label %14
6: ; preds = %1
%7 = load double, double* %2
%8 = fcmp ogt double %7, 1.000000e+02
br i1 %8, label %9, label %10
9: ; preds = %6
br label %12
10: ; preds = %6
%11 = load double, double* %2
br label %12
12: ; preds = %10, %9
%13 = phi double [ 1.000000e+02, %9 ], [ %11, %10 ]
br label %14
14: ; preds = %12, %5
%15 = phi double [ 0.000000e+00, %5 ], [ %13, %12 ]
ret double %15
}

LLVM IR (-O2):
define double @clamp(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fcmp ogt double %0, 1.000000e+02
%4 = select i1 %3, double 1.000000e+02, double %0
%5 = select i1 %2, double 0.000000e+00, double %4
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ test3();
int main(void) {
  test3();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test3()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test3()
ret i32 0
}
/* Variables and functions */
int ebxmodcall();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = ebxmodcall();
  printf("ebx = %d\n", a);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <ebxmodcall@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"ebx = %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @ebxmodcall()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int max(int, int /*<<< orphan*/);
int input4_max_tail_sum(int *a, int n) {
  int i;
  int mts;
  mts = 0;
  for (i = 0; i < n; i++) {
    mts = max(mts + a[i], 0);
  }
  return mts;
}


x86 assembly (clang, -O0):
<input4_max_tail_sum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115f <input4_max_tail_sum+0x4f>
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
add    (%rax,%rcx,4),%edi
xor    %esi,%esi
call   1030 <max@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <input4_max_tail_sum+0x1d>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<input4_max_tail_sum>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1148 <input4_max_tail_sum+0x38>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    (%r14,%rbx,4),%eax
mov    %eax,%edi
xor    %esi,%esi
call   1030 <max@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <input4_max_tail_sum+0x20>
jmp    114a <input4_max_tail_sum+0x3a>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @input4_max_tail_sum(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %15
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %13, %6 ]
%8 = phi i32 [ 0, %4 ], [ %12, %6 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %7
%10 = load i32, i32* %9
%11 = add nsw i32 %10, %8
%12 = tail call i32 @max(i32 %11, i32 0)
%13 = add nuw nsw i64 %7, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %15, label %6
15: ; preds = %6, %2
%16 = phi i32 [ 0, %2 ], [ %12, %6 ]
ret i32 %16
}
int main() {
  void (*func)(void) = 0;
  func();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
call   *-0x10(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca void ()*
store i32 0, i32* %1
store void ()* null, void ()** %2
%3 = load void ()*, void ()** %2
ret i32 0
}

LLVM IR (-O2):
/* Variables and functions */
int test_level_three(int, int, int, int, void (*)(void *), void *);
int test_level_two(int one, int two, int three, int four,
                   void (*callback_func)(void *), void *data) {
  return test_level_three(one + 2, two + 4, three + 6, four + 8, callback_func,
                          data) +
         2;
}


x86 assembly (clang, -O0):
<test_level_two>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x4(%rbp),%edi
add    $0x2,%edi
mov    -0x8(%rbp),%esi
add    $0x4,%esi
mov    -0xc(%rbp),%edx
add    $0x6,%edx
mov    -0x10(%rbp),%ecx
add    $0x8,%ecx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
call   1030 <test_level_three@plt>
add    $0x2,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_level_two>:
push   %rax
add    $0x2,%edi
add    $0x4,%esi
add    $0x6,%edx
add    $0x8,%ecx
call   1030 <test_level_three@plt>
add    $0x2,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test_level_two(i32 %0, i32 %1, i32 %2, i32 %3, void (i8*)* %4, i8* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca void (i8*)*
%12 = alloca i8*
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store void (i8*)* %4, void (i8*)** %11
store i8* %5, i8** %12
%13 = load i32, i32* %7
%14 = add nsw i32 %13, 2
%15 = load i32, i32* %8
%16 = add nsw i32 %15, 4
%17 = load i32, i32* %9
%18 = add nsw i32 %17, 6
%19 = load i32, i32* %10
%20 = add nsw i32 %19, 8
%21 = load void (i8*)*, void (i8*)** %11
%22 = load i8*, i8** %12
%23 = call i32 @test_level_three(i32 %14, i32 %16, i32 %18, i32 %20, void (i8*)* %21, i8* %22)
%24 = add nsw i32 %23, 2
ret i32 %24
}

LLVM IR (-O2):
define i32 @test_level_two(i32 %0, i32 %1, i32 %2, i32 %3, void (i8*)* %4, i8* %5) {
%7 = add nsw i32 %0, 2
%8 = add nsw i32 %1, 4
%9 = add nsw i32 %2, 6
%10 = add nsw i32 %3, 8
%11 = tail call i32 @test_level_three(i32 %7, i32 %8, i32 %9, i32 %10, void (i8*)* %4, i8* %5)
%12 = add nsw i32 %11, 2
ret i32 %12
}