xunge/DecIR huggingface dataset:
int isleap(int year) {
  return ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0);
}


x86 assembly (clang, -O0):
<isleap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1134 <isleap+0x34>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x5(%rbp)
jne    1148 <isleap+0x48>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isleap>:
test   $0x3,%dil
jne    112c <isleap+0x2c>
movslq %edi,%rax
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x64,%eax,%ecx
mov    %edi,%edx
mov    $0x1,%eax
sub    %ecx,%edx
je     112c <isleap+0x2c>
ret
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
ror    $0x4,%ecx
xor    %eax,%eax
cmp    $0xa3d70b,%ecx
setb   %al
ret

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

LLVM IR (-O2):
define i32 @isleap(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp ne i32 %2, 0
%4 = srem i32 %0, 100
%5 = icmp eq i32 %4, 0
%6 = or i1 %3, %5
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = srem i32 %0, 400
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %1, %7
%12 = phi i32 [ %10, %7 ], [ 1, %1 ]
ret i32 %12
}
int vde_chain_nm5_n_out(void) { return 3; }


x86 assembly (clang, -O0):
<vde_chain_nm5_n_out>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @vde_chain_nm5_n_out() {
ret i32 3
}

LLVM IR (-O2):
define i32 @vde_chain_nm5_n_out() {
ret i32 3
}
/* Variables and functions */
int /*<<< orphan*/ uart_send(char);
void uart_puts(char *s) {
  while (*s) {
    if (*s == '\n')
      uart_send('\r');
    uart_send(*s++);
  }
}


x86 assembly (clang, -O0):
<uart_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     115f <uart_puts+0x4f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1143 <uart_puts+0x33>
mov    $0xd,%edi
call   1030 <uart_send@plt>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <uart_send@plt>
jmp    111c <uart_puts+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_puts>:
push   %rbx
mov    %rdi,%rbx
jmp    1139 <uart_puts+0x29>
cs nopw 0x0(%rax,%rax,1)
mov    $0xd,%edi
call   1030 <uart_send@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
movsbl %al,%edi
call   1030 <uart_send@plt>
movzbl (%rbx),%eax
cmp    $0xa,%al
je     1120 <uart_puts+0x10>
test   %al,%al
jne    112d <uart_puts+0x1d>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @uart_puts(i8* nocapture %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %10, %8 ]
%4 = load i8, i8* %3
switch i8 %4, label %8 [
i8 0, label %12
i8 10, label %5
]
5: ; preds = %2
%6 = tail call i32 @uart_send(i8 signext 13)
%7 = load i8, i8* %3
br label %8
8: ; preds = %2, %5
%9 = phi i8 [ %4, %2 ], [ %7, %5 ]
%10 = getelementptr inbounds i8, i8* %3, i64 1
%11 = tail call i32 @uart_send(i8 signext %9)
br label %2
12: ; preds = %2
ret void
}
void XtRealloc() {}


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

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

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

LLVM IR (-O2):
define void @XtRealloc() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vff_init(int, int, int);
void vff_init_zero(void) { vff_init(0., 0., 0.); }


x86 assembly (clang, -O0):
<vff_init_zero>:
push   %rbp
mov    %rsp,%rbp
xor    %edx,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1030 <vff_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vff_init_zero>:
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <vff_init@plt>

LLVM IR (-O0):
define void @vff_init_zero() {
%1 = call i32 @vff_init(i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @vff_init_zero() {
%1 = tail call i32 @vff_init(i32 0, i32 0, i32 0)
ret void
}
int xmlUCSIsCombiningDiacriticalMarksforSymbols(int code) {
  return (((code >= 0x20D0) && (code <= 0x20FF)));
}


x86 assembly (clang, -O0):
<xmlUCSIsCombiningDiacriticalMarksforSymbols>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x20d0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsCombiningDiacriticalMarksforSymbols+0x26>
cmpl   $0x20ff,-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):
<xmlUCSIsCombiningDiacriticalMarksforSymbols>:
add    $0xffffdf30,%edi
xor    %eax,%eax
cmp    $0x30,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @xmlUCSIsCombiningDiacriticalMarksforSymbols(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 8400
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 8447
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 @xmlUCSIsCombiningDiacriticalMarksforSymbols(i32 %0) {
%2 = add i32 %0, -8400
%3 = icmp ult i32 %2, 48
%4 = zext i1 %3 to i32
ret i32 %4
}
void xmlrpc_client_teardown_global_const(void) {}


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

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

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

LLVM IR (-O2):
define void @xmlrpc_client_teardown_global_const() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CallBack2(int, void *, void *);
int /*<<< orphan*/ CheckRunningInMainThread(char *);
void HistoryInsert(const char *dataPtr, int dataLen) {
  if (!CheckRunningInMainThread("HistoryInsert"))
    return;
  CallBack2(101 + 512, (void *)dataPtr, (void *)dataLen);
}


x86 assembly (clang, -O0):
<HistoryInsert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <CheckRunningInMainThread@plt>
cmp    $0x0,%eax
jne    1149 <HistoryInsert+0x29>
jmp    115b <HistoryInsert+0x3b>
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rdx
mov    $0x265,%edi
call   1040 <CallBack2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HistoryInsert>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xed1(%rip),%rdi
call   1030 <CheckRunningInMainThread@plt>
test   %eax,%eax
je     114e <HistoryInsert+0x2e>
movslq %ebp,%rdx
mov    $0x265,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <CallBack2@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"HistoryInsert\00"
define void @HistoryInsert(i8* %0, i32 %1) {
%3 = tail call i32 @CheckRunningInMainThread(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = sext i32 %1 to i64
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 @CallBack2(i32 613, i8* %0, i8* %7)
br label %9
9: ; preds = %2, %5
ret void
}
int cairo_code_draw_blackLEDbutton_get_height() { return 45; }


x86 assembly (clang, -O0):
<cairo_code_draw_blackLEDbutton_get_height>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2d,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @cairo_code_draw_blackLEDbutton_get_height() {
ret i32 45
}

LLVM IR (-O2):
define i32 @cairo_code_draw_blackLEDbutton_get_height() {
ret i32 45
}
int in_mandel(double x0, double y0, int n) {
  double x = 0, y = 0, xtemp;
  return 5;
  while (n > 0) {
    xtemp = x * x - y * y + x0;
    y = 2 * x * y + y0;
    x = xtemp;
    n -= 1;
    if (x * x + y * y > 4)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<in_mandel>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    $0x5,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @in_mandel(double %0, double %1, i32 %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca i32
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %4
store double %1, double* %5
store i32 %2, i32* %6
store double 0.000000e+00, double* %7
store double 0.000000e+00, double* %8
ret i32 5
}

LLVM IR (-O2):
define i32 @in_mandel(double %0, double %1, i32 %2) {
ret i32 5
}
/* Variables and functions */
int ffsl(long mask) {
  int bit;
  if (mask == 0)
    return (0);
  for (bit = 1; !(mask & 1); bit++)
    mask = (unsigned long)mask >> 1;
  return (bit);
}


x86 assembly (clang, -O0):
<ffsl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <ffsl+0x1f>
movl   $0x0,-0x4(%rbp)
jmp    1164 <ffsl+0x64>
movl   $0x1,-0x14(%rbp)
mov    -0x10(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1144 <ffsl+0x44>
jmp    115e <ffsl+0x5e>
mov    -0x10(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <ffsl+0x26>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffsl>:
test   %rdi,%rdi
je     1130 <ffsl+0x30>
mov    $0x1,%eax
test   $0x1,%dil
jne    112f <ffsl+0x2f>
mov    $0x1,%eax
mov    %rdi,%rcx
nopl   0x0(%rax,%rax,1)
shr    %rcx
add    $0x1,%eax
test   $0x2,%dil
mov    %rcx,%rdi
je     1120 <ffsl+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ffsl(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = and i64 %0, 1
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %3, %6
%7 = phi i32 [ %10, %6 ], [ 1, %3 ]
%8 = phi i64 [ %9, %6 ], [ %0, %3 ]
%9 = lshr i64 %8, 1
%10 = add nuw nsw i32 %7, 1
%11 = and i64 %8, 2
%12 = icmp eq i64 %11, 0
br i1 %12, label %6, label %13
13: ; preds = %6, %3, %1
%14 = phi i32 [ 0, %1 ], [ 1, %3 ], [ %10, %6 ]
ret i32 %14
}
void send_cmd(unsigned char cmd) {
  volatile char i;
  (*(volatile unsigned char *)0x70200008) = cmd;
  for (i = 0; i < 10; i++)
    ;
}


x86 assembly (clang, -O0):
<send_cmd>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%cl
mov    $0x70200008,%eax
mov    %cl,(%rax)
movb   $0x0,-0x2(%rbp)
mov    -0x2(%rbp),%al
movsbl %al,%eax
cmp    $0xa,%eax
jge    1139 <send_cmd+0x39>
jmp    112c <send_cmd+0x2c>
mov    -0x2(%rbp),%al
add    $0x1,%al
mov    %al,-0x2(%rbp)
jmp    1118 <send_cmd+0x18>
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_cmd>:
mov    %dil,0x70200008
70
movb   $0x0,-0x1(%rsp)
mov    -0x1(%rsp),%al
cmp    $0x9,%al
jg     112e <send_cmd+0x2e>
cs nopw 0x0(%rax,%rax,1)
nop
addb   $0x1,-0x1(%rsp)
movzbl -0x1(%rsp),%eax
cmp    $0xa,%al
jl     1120 <send_cmd+0x20>
ret

LLVM IR (-O0):
define void @send_cmd(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
%4 = load i8, i8* %2
store volatile i8 %4, i8* inttoptr (i64 1881145352 to i8*)
store volatile i8 0, i8* %3
br label %5
5: ; preds = %10, %1
%6 = load volatile i8, i8* %3
%7 = sext i8 %6 to i32
%8 = icmp slt i32 %7, 10
br i1 %8, label %9, label %13
9: ; preds = %5
br label %10
10: ; preds = %9
%11 = load volatile i8, i8* %3
%12 = add i8 %11, 1
store volatile i8 %12, i8* %3
br label %5
13: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @send_cmd(i8 zeroext %0) {
%2 = alloca i8
store volatile i8 %0, i8* inttoptr (i64 1881145352 to i8*)
store volatile i8 0, i8* %2
%3 = load volatile i8, i8* %2
%4 = icmp slt i8 %3, 10
br i1 %4, label %5, label %10
5: ; preds = %1, %5
%6 = load volatile i8, i8* %2
%7 = add i8 %6, 1
store volatile i8 %7, i8* %2
%8 = load volatile i8, i8* %2
%9 = icmp slt i8 %8, 10
br i1 %9, label %5, label %10
10: ; preds = %5, %1
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
void cast_float_to_int_Bad() {
  char arr[10];
  float x = 15000000000.0;
  int32_t y = (int32_t)x;
  if (y < 10) {
    arr[y] = 0;
  }
}


x86 assembly (clang, -O0):
<cast_float_to_int_Bad>:
push   %rbp
mov    %rsp,%rbp
movss  0xef4(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
cvttss2si -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    112c <cast_float_to_int_Bad+0x2c>
movslq -0x14(%rbp),%rax
movb   $0x0,-0xa(%rbp,%rax,1)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @cast_float_to_int_Bad() {
%1 = alloca [10 x i8]
%2 = alloca float
%3 = alloca i32
store float 0x420BF08EC0000000, float* %2
%4 = load float, float* %2
%5 = fptosi float %4 to i32
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 10
br i1 %7, label %8, label %12
8: ; preds = %0
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 %10
store i8 0, i8* %11
br label %12
12: ; preds = %8, %0
ret void
}

LLVM IR (-O2):
define void @cast_float_to_int_Bad() {
ret void
}
float u2f(unsigned x) {
  union {
    unsigned u;
    float f;
  } a;
  a.u = x;
  return a.f;
}


x86 assembly (clang, -O0):
<u2f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<u2f>:
movd   %edi,%xmm0
ret

LLVM IR (-O0):
%union.anon = type { i32 }
define float @u2f(i32 %0) {
%2 = alloca i32
%3 = alloca %union.anon
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = bitcast %union.anon* %3 to i32*
store i32 %4, i32* %5
%6 = bitcast %union.anon* %3 to float*
%7 = load float, float* %6
ret float %7
}

LLVM IR (-O2):
define float @u2f(i32 %0) {
%2 = bitcast i32 %0 to float
ret float %2
}
void g_slist_insert() {}


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

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

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

LLVM IR (-O2):
define void @g_slist_insert() {
ret void
}
/* Variables and functions */
double atof(char *);
scalar_t__ getline(char *, int);
int /*<<< orphan*/ printf(char *, double);
main() {
  char line[1000];
  while (getline(line, 1000) > 0)
    printf("%g\n", atof(line));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1050 <getline@plt>
cmp    $0x0,%rax
jle    117a <main+0x4a>
lea    -0x3f0(%rbp),%rdi
call   1030 <atof@plt>
lea    0xe90(%rip),%rdi
call   1040 <printf@plt>
jmp    1142 <main+0x12>
mov    -0x4(%rbp),%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1050 <getline@plt>
test   %rax,%rax
jle    1182 <main+0x52>
mov    %rsp,%rbx
lea    0xeaa(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <atof@plt>
mov    %r14,%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1050 <getline@plt>
test   %rax,%rax
jg     1160 <main+0x30>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%g\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1000 x i8]
store i32 0, i32* %1
br label %3
3: ; preds = %7, %0
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%5 = call i64 @getline(i8* %4, i32 1000)
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%9 = call double @atof(i8* %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %9)
br label %3
11: ; preds = %3
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@.str = [4 x i8] c"%g\0A\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i64 @getline(i8* %2, i32 1000)
%4 = icmp sgt i64 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %0, %5
%6 = call double @atof(i8* %2)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %6)
%8 = call i64 @getline(i8* %2, i32 1000)
%9 = icmp sgt i64 %8, 0
br i1 %9, label %5, label %10
10: ; preds = %5, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void version() {
  char *ver = "execpty"
              " v"
              "1.1"
              "\n"
              "Copyright (C) 2015, 2016, 2020 Andriy Martynets "
              "<andy.martynets@gmail.com>"
              "\n"
              "License GPLv3+: GNU GPL version 3 or later "
              "<http://gnu.org/licenses/gpl.html>.\n"
              "This program comes with ABSOLUTELY NO WARRANTY.\n"
              "This is free software, and you are welcome to redistribute it\n"
              "under certain conditions. See the GNU GPL for details.";
  puts(ver);
}


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

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

LLVM IR (-O0):
@.str = [332 x i8] c"execpty v1.1\0ACopyright (C) 2015, 2016, 2020 Andriy Martynets <andy.martynets@gmail.com>\0ALicense GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.\0AThis program comes with ABSOLUTELY NO WARRANTY.\0AThis is free software, and you are welcome to redistribute it\0Aunder certain conditions. See the GNU GPL for details.\00"
define void @version() {
%1 = alloca i8*
store i8* getelementptr inbounds ([332 x i8], [332 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = call i32 @puts(i8* %2)
ret void
}

LLVM IR (-O2):
@.str = [332 x i8] c"execpty v1.1\0ACopyright (C) 2015, 2016, 2020 Andriy Martynets <andy.martynets@gmail.com>\0ALicense GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.\0AThis program comes with ABSOLUTELY NO WARRANTY.\0AThis is free software, and you are welcome to redistribute it\0Aunder certain conditions. See the GNU GPL for details.\00"
define void @version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([332 x i8], [332 x i8]* @.str, i64 0, i64 0))
ret void
}
int compara(const void *a, const void *b) { return (*(int *)a - *(int *)b); }


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

x86 assembly (clang, -O2):
<compara>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @compara(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @compara(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
void foo276() {}


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

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

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

LLVM IR (-O2):
define void @foo276() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ asm_cprint(char, char, int, char);
void cprint(char chr, char attr, int times, char disppage) {
  asm_cprint(chr, attr, times, disppage);
}


x86 assembly (clang, -O0):
<cprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cl,%al
mov    %sil,%cl
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %edx,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x2(%rbp),%al
mov    -0x8(%rbp),%edx
movsbl %cl,%edi
movsbl %al,%esi
movsbl -0x9(%rbp),%ecx
call   1030 <asm_cprint@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cprint>:
jmp    1030 <asm_cprint@plt>

LLVM IR (-O0):
define void @cprint(i8 signext %0, i8 signext %1, i32 %2, i8 signext %3) {
%5 = alloca i8
%6 = alloca i8
%7 = alloca i32
%8 = alloca i8
store i8 %0, i8* %5
store i8 %1, i8* %6
store i32 %2, i32* %7
store i8 %3, i8* %8
%9 = load i8, i8* %5
%10 = load i8, i8* %6
%11 = load i32, i32* %7
%12 = load i8, i8* %8
%13 = call i32 @asm_cprint(i8 signext %9, i8 signext %10, i32 %11, i8 signext %12)
ret void
}

LLVM IR (-O2):
define void @cprint(i8 signext %0, i8 signext %1, i32 %2, i8 signext %3) {
%5 = tail call i32 @asm_cprint(i8 signext %0, i8 signext %1, i32 %2, i8 signext %3)
ret void
}
/* Variables and functions */
int solib_main(int);
int main() {
  int result;
  result = solib_main(100);
  result = solib_main(result);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x64,%edi
call   1030 <solib_main@plt>
mov    %eax,%edi
call   1030 <solib_main@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @solib_main(i32 100)
%2 = tail call i32 @solib_main(i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int xn1 = 0, xn = 1, N = 0;
  while (N < 30) {
    N++;
    xn1 = xn1 + xn;
    xn = xn1 - xn;
  }
  printf("%i", xn);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x1e,-0x10(%rbp)
jge    115e <main+0x4e>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1134 <main+0x24>
mov    -0xc(%rbp),%esi
lea    0xe98(%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
mov    $0x7d8b5,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 514229)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int syscall(int, int, int /*<<< orphan*/ *);
int getgroups(int count, gid_t list[]) { return syscall(80, count, list); }


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

x86 assembly (clang, -O2):
<getgroups>:
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x50,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @getgroups(i32 %0, i32* %1) {
%3 = tail call i32 @syscall(i32 80, i32 %0, i32* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *argv0) {
  fprintf(
      stderr,
      "Usage: %s [OPTIONS...]\n"
      "\n"
      "Options:\n"
      "  -B <board>      create image for the board specified with <board>\n"
      "  -k <file>       read kernel image from the file <file>\n"
      "  -r <file>       read rootfs image from the file <file>\n"
      "  -o <file>       write output to the file <file>\n"
      "  -V <rev>        sets the revision number to <rev>\n"
      "  -j              add jffs2 end-of-filesystem markers\n"
      "  -S              create sysupgrade instead of factory image\n"
      "  -h              show this help\n",
      argv0);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [466 x i8] c"Usage: %s [OPTIONS...]\0A\0AOptions:\0A -B <board> create image for the board specified with <board>\0A -k <file> read kernel image from the file <file>\0A -r <file> read rootfs image from the file <file>\0A -o <file> write output to the file <file>\0A -V <rev> sets the revision number to <rev>\0A -j add jffs2 end-of-filesystem markers\0A -S create sysupgrade instead of factory image\0A -h show this help\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([466 x i8], [466 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [466 x i8] c"Usage: %s [OPTIONS...]\0A\0AOptions:\0A -B <board> create image for the board specified with <board>\0A -k <file> read kernel image from the file <file>\0A -r <file> read rootfs image from the file <file>\0A -o <file> write output to the file <file>\0A -V <rev> sets the revision number to <rev>\0A -j add jffs2 end-of-filesystem markers\0A -S create sysupgrade instead of factory image\0A -h show this help\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([466 x i8], [466 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct option {
  int dummy;
};

/* Variables and functions */
int usage_with_options_internal(char const *const *, struct option const *,
                                int /*<<< orphan*/);
int parse_options_usage(const char *const *usagestr,
                        const struct option *opts) {
  return usage_with_options_internal(usagestr, opts, 0);
}


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

x86 assembly (clang, -O2):
<parse_options_usage>:
xor    %edx,%edx
jmp    1030 <usage_with_options_internal@plt>

LLVM IR (-O0):
%struct.option = type { i32 }
define i32 @parse_options_usage(i8** %0, %struct.option* %1) {
%3 = alloca i8**
%4 = alloca %struct.option*
store i8** %0, i8*** %3
store %struct.option* %1, %struct.option** %4
%5 = load i8**, i8*** %3
%6 = load %struct.option*, %struct.option** %4
%7 = call i32 @usage_with_options_internal(i8** %5, %struct.option* %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
%struct.option = type { i32 }
define i32 @parse_options_usage(i8** %0, %struct.option* %1) {
%3 = tail call i32 @usage_with_options_internal(i8** %0, %struct.option* %1, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ truclient_step(char *, char *, char *);
vuser_init() {
  truclient_step(
      "2",
      "Evaluate JavaScript code // Run conditions: var j...net/*', false);",
      "snapshot=Init_2.inf");
  return 0;
}


x86 assembly (clang, -O0):
<vuser_init>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee0(%rip),%rsi
lea    0xf1d(%rip),%rdx
call   1030 <truclient_step@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vuser_init>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xee3(%rip),%rsi
lea    0xf20(%rip),%rdx
call   1030 <truclient_step@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"2\00"
@.str.1 = [68 x i8] c"Evaluate JavaScript code // Run conditions: var j...net/*', false);\00"
@.str.2 = [20 x i8] c"snapshot=Init_2.inf\00"
define i32 @vuser_init() {
%1 = call i32 @truclient_step(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"2\00"
@.str.1 = [68 x i8] c"Evaluate JavaScript code // Run conditions: var j...net/*', false);\00"
@.str.2 = [20 x i8] c"snapshot=Init_2.inf\00"
define i32 @vuser_init() {
%1 = tail call i32 @truclient_step(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
char *s123etc(char *str) {
  register int i;
  for (i = 1; str[i] != '\0'; i++)
    str[i] = i;
  return (str);
}


x86 assembly (clang, -O0):
<s123etc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1142 <s123etc+0x42>
mov    -0xc(%rbp),%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <s123etc+0xf>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<s123etc>:
mov    %rdi,%rax
cmpb   $0x0,0x1(%rdi)
je     111e <s123etc+0x1e>
mov    $0x1,%ecx
xchg   %ax,%ax
mov    %cl,(%rax,%rcx,1)
cmpb   $0x0,0x1(%rax,%rcx,1)
lea    0x1(%rcx),%rcx
jne    1110 <s123etc+0x10>
ret

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

LLVM IR (-O2):
define i8* @s123etc(i8* returned %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %1, %5
%6 = phi i64 [ %9, %5 ], [ 1, %1 ]
%7 = phi i8* [ %10, %5 ], [ %2, %1 ]
%8 = trunc i64 %6 to i8
store i8 %8, i8* %7
%9 = add nuw nsw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ select_track();
int /*<<< orphan*/ test_dma(int, int);
void run_test() {
  if (!select_track())
    return;
  test_dma(14, 1);
  test_dma(8, 1);
  test_dma(3, 1);
  test_dma(1, 1);
  test_dma(14, 0);
  test_dma(8, 0);
  test_dma(3, 0);
  test_dma(1, 0);
}


x86 assembly (clang, -O0):
<run_test>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <select_track@plt>
cmp    $0x0,%eax
jne    1139 <run_test+0x19>
jmp    11a2 <run_test+0x82>
mov    $0xe,%edi
mov    $0x1,%esi
call   1030 <test_dma@plt>
mov    $0x8,%edi
mov    $0x1,%esi
call   1030 <test_dma@plt>
mov    $0x3,%edi
mov    $0x1,%esi
call   1030 <test_dma@plt>
mov    $0x1,%esi
mov    %esi,%edi
call   1030 <test_dma@plt>
mov    $0xe,%edi
xor    %esi,%esi
call   1030 <test_dma@plt>
mov    $0x8,%edi
xor    %esi,%esi
call   1030 <test_dma@plt>
mov    $0x3,%edi
xor    %esi,%esi
call   1030 <test_dma@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <test_dma@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_test>:
push   %rax
xor    %eax,%eax
call   1040 <select_track@plt>
test   %eax,%eax
je     1199 <run_test+0x79>
mov    $0xe,%edi
mov    $0x1,%esi
call   1030 <test_dma@plt>
mov    $0x8,%edi
mov    $0x1,%esi
call   1030 <test_dma@plt>
mov    $0x3,%edi
mov    $0x1,%esi
call   1030 <test_dma@plt>
mov    $0x1,%edi
mov    $0x1,%esi
call   1030 <test_dma@plt>
mov    $0xe,%edi
xor    %esi,%esi
call   1030 <test_dma@plt>
mov    $0x8,%edi
xor    %esi,%esi
call   1030 <test_dma@plt>
mov    $0x3,%edi
xor    %esi,%esi
call   1030 <test_dma@plt>
mov    $0x1,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <test_dma@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @run_test() {
%1 = call i32 (...) @select_track()
%2 = icmp ne i32 %1, 0
br i1 %2, label %4, label %3
3: ; preds = %0
br label %13
4: ; preds = %0
%5 = call i32 @test_dma(i32 14, i32 1)
%6 = call i32 @test_dma(i32 8, i32 1)
%7 = call i32 @test_dma(i32 3, i32 1)
%8 = call i32 @test_dma(i32 1, i32 1)
%9 = call i32 @test_dma(i32 14, i32 0)
%10 = call i32 @test_dma(i32 8, i32 0)
%11 = call i32 @test_dma(i32 3, i32 0)
%12 = call i32 @test_dma(i32 1, i32 0)
br label %13
13: ; preds = %4, %3
ret void
}

LLVM IR (-O2):
define void @run_test() {
%1 = tail call i32 (...) @select_track()
%2 = icmp eq i32 %1, 0
br i1 %2, label %12, label %3
3: ; preds = %0
%4 = tail call i32 @test_dma(i32 14, i32 1)
%5 = tail call i32 @test_dma(i32 8, i32 1)
%6 = tail call i32 @test_dma(i32 3, i32 1)
%7 = tail call i32 @test_dma(i32 1, i32 1)
%8 = tail call i32 @test_dma(i32 14, i32 0)
%9 = tail call i32 @test_dma(i32 8, i32 0)
%10 = tail call i32 @test_dma(i32 3, i32 0)
%11 = tail call i32 @test_dma(i32 1, i32 0)
br label %12
12: ; preds = %0, %3
ret void
}
void foo359() {}


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

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

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

LLVM IR (-O2):
define void @foo359() {
ret void
}
/* Variables and functions */
double exp(double);
float logstic(float x) { return 1.0 / (1.0 + exp(-(1.0 * x))); }


x86 assembly (clang, -O0):
<logstic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xed2(%rip),%xmm0
mulsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
movsd  0xeaa(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xe9e(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logstic>:
push   %rax
cvtss2sd %xmm0,%xmm0
xorps  0xee4(%rip),%xmm0
call   1030 <exp@plt>
movsd  0xee7(%rip),%xmm1
addsd  %xmm1,%xmm0
divsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @logstic(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fmul double 1.000000e+00, %4
%6 = fneg double %5
%7 = call double @exp(double %6)
%8 = fadd double 1.000000e+00, %7
%9 = fdiv double 1.000000e+00, %8
%10 = fptrunc double %9 to float
ret float %10
}

LLVM IR (-O2):
define float @logstic(float %0) {
%2 = fpext float %0 to double
%3 = fneg double %2
%4 = tail call double @exp(double %3)
%5 = fadd double %4, 1.000000e+00
%6 = fdiv double 1.000000e+00, %5
%7 = fptrunc double %6 to float
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ HSG2Time(unsigned int, int *, int *, int *);
int Time2Redbook(int, int, int);
unsigned HSG2Redbook(unsigned HSG) {
  int Min, Sec, Fra;
  HSG2Time(HSG, &Min, &Sec, &Fra);
  return Time2Redbook(Min, Sec, Fra);
}


x86 assembly (clang, -O0):
<HSG2Redbook>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1030 <HSG2Time@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <Time2Redbook@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HSG2Redbook>:
sub    $0x18,%rsp
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1030 <HSG2Time@plt>
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%esi
mov    0xc(%rsp),%edx
call   1040 <Time2Redbook@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @HSG2Redbook(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @HSG2Time(i32 %6, i32* %3, i32* %4, i32* %5)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = call i32 @Time2Redbook(i32 %8, i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @HSG2Redbook(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = call i32 @HSG2Time(i32 %0, i32* %2, i32* %3, i32* %4)
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = call i32 @Time2Redbook(i32 %9, i32 %10, i32 %11)
ret i32 %12
}
int md_post_extract(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @md_post_extract() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void caml_js_fragment_append() { exit(1); }


x86 assembly (clang, -O0):
<caml_js_fragment_append>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<caml_js_fragment_append>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @caml_js_fragment_append() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @caml_js_fragment_append() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
unsigned char tolower(unsigned char c) {
  return ('A' <= c && c <= 'Z') ? c + ('a' - 'A') : c;
}


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%ecx
mov    $0x41,%eax
cmp    %ecx,%eax
jg     1137 <tolower+0x37>
movzbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
jg     1137 <tolower+0x37>
movzbl -0x1(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    113e <tolower+0x3e>
movzbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
lea    -0x41(%rdi),%eax
lea    0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @tolower(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp sle i32 65, %4
br i1 %5, label %6, label %14
6: ; preds = %1
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = icmp sle i32 %8, 90
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i8, i8* %2
%12 = zext i8 %11 to i32
%13 = add nsw i32 %12, 32
br label %17
14: ; preds = %6, %1
%15 = load i8, i8* %2
%16 = zext i8 %15 to i32
br label %17
17: ; preds = %14, %10
%18 = phi i32 [ %13, %10 ], [ %16, %14 ]
%19 = trunc i32 %18 to i8
ret i8 %19
}

LLVM IR (-O2):
define zeroext i8 @tolower(i8 zeroext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, 32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
/* Variables and functions */
double calcMeanObliquityOfEcliptic(double);
double cos(int /*<<< orphan*/);
int /*<<< orphan*/ deg2rad(double);
double calcObliquityCorrection(double t) {
  return calcMeanObliquityOfEcliptic(t) +
         0.00256 * cos(deg2rad(125.04 - 1934.136 * t));
}


x86 assembly (clang, -O0):
<calcObliquityCorrection>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <calcMeanObliquityOfEcliptic@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeaf(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeab(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1040 <deg2rad@plt>
mov    %eax,%edi
call   1050 <cos@plt>
movsd  -0x10(%rbp),%xmm1
movsd  0xe7e(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcObliquityCorrection>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
call   1030 <calcMeanObliquityOfEcliptic@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
mulsd  0xead(%rip),%xmm0
addsd  0xead(%rip),%xmm0
call   1040 <deg2rad@plt>
mov    %eax,%edi
call   1050 <cos@plt>
mulsd  0xea1(%rip),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @calcObliquityCorrection(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @calcMeanObliquityOfEcliptic(double %3)
%5 = load double, double* %2
%6 = call double @llvm.fmuladd.f64(double 0xC09E388B43958106, double %5, double 1.250400e+02)
%7 = call i32 @deg2rad(double %6)
%8 = call double @cos(i32 %7)
%9 = call double @llvm.fmuladd.f64(double 2.560000e-03, double %8, double %4)
ret double %9
}

LLVM IR (-O2):
define double @calcObliquityCorrection(double %0) {
%2 = tail call double @calcMeanObliquityOfEcliptic(double %0)
%3 = tail call double @llvm.fmuladd.f64(double %0, double 0xC09E388B43958106, double 1.250400e+02)
%4 = tail call i32 @deg2rad(double %3)
%5 = tail call double @cos(i32 %4)
%6 = tail call double @llvm.fmuladd.f64(double %5, double 2.560000e-03, double %2)
ret double %6
}
/* Variables and functions */
int getchar();
int /*<<< orphan*/ printf(char *, int);
int rev_string(int ch) {
  if ((ch = getchar()) != '\n') {
    rev_string(ch);
  }
  printf("%c", ch);
}


x86 assembly (clang, -O0):
<rev_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x8(%rbp)
cmp    $0xa,%eax
je     1156 <rev_string+0x26>
mov    -0x8(%rbp),%edi
call   1030 <rev_string@plt>
mov    -0x8(%rbp),%esi
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rev_string>:
push   %rbx
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %eax,%ebx
cmp    $0xa,%eax
je     1144 <rev_string+0x14>
call   1030 <rev_string@plt>
lea    0xeb5(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @rev_string(i32 %0) {
%2 = tail call i32 (...) @getchar()
%3 = icmp eq i32 %2, 10
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @rev_string(i32 undef)
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ sha256_init_ctx(void *);
void sha256_init(void *context) { sha256_init_ctx(context); }


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

x86 assembly (clang, -O2):
<sha256_init>:
jmp    1030 <sha256_init_ctx@plt>

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

LLVM IR (-O2):
define void @sha256_init(i8* %0) {
%2 = tail call i32 @sha256_init_ctx(i8* %0)
ret void
}