xunge/DecIR huggingface dataset:
/* Type definitions */
struct event {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void printHiMsg(void *oldStateData, struct event *event, void *newStateData) {
  puts("Hi!");
}


x86 assembly (clang, -O0):
<printHiMsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.event = type { i32 }
@.str = [4 x i8] c"Hi!\00"
define void @printHiMsg(i8* %0, %struct.event* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca %struct.event*
%6 = alloca i8*
store i8* %0, i8** %4
store %struct.event* %1, %struct.event** %5
store i8* %2, i8** %6
%7 = call i32 @puts(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.event = type { i32 }
@.str = [4 x i8] c"Hi!\00"
define void @printHiMsg(i8* nocapture readnone %0, %struct.event* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
__attribute__((always_)) void __writeb(unsigned char val, volatile void *addr) {
  asm volatile("mov"
               "b"
               " %0,%1"
               :
               : "q"(val), "m"(*(volatile unsigned char *)addr));
}


x86 assembly (clang, -O0):
<__writeb>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x1(%rbp),%al
mov    -0x10(%rbp),%rcx
mov    %al,(%rcx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__writeb>:
mov    %dil,(%rsi)
ret

LLVM IR (-O0):
define void @__writeb(i8 zeroext %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 = load i8*, i8** %4
ret void
}

LLVM IR (-O2):
define void @__writeb(i8 zeroext %0, i8* %1) {
tail call void asm sideeffect "movb $0,$1", "q,*m,~{dirflag},~{fpsr},~{flags}"(i8 %0, i8* elementtype(i8) %1)
ret void
}
void RTAvlrGCPtrGetRoot(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlrGCPtrGetRoot() {
ret void
}
void rop3_195_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  stk1 = T ^ S;
  stk1 = ~stk1;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_195_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_195_1_0>:
or     %esi,%edx
not    %dl
mov    (%rdi),%al
and    %sil,%al
or     %dl,%al
mov    %al,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_195_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = or i8 %2, %1
%5 = xor i8 %4, -1
%6 = load i8, i8* %0
%7 = and i8 %6, %1
%8 = or i8 %7, %5
store i8 %8, i8* %0
ret void
}
void RTP_set_framenum(unsigned char *p, unsigned int v) {
  p[16] = (unsigned char)((unsigned int)(0xff & v >> 8));
  p[17] = (unsigned char)(0xff & v);
}


x86 assembly (clang, -O0):
<RTP_set_framenum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x10(%rax)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x11(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RTP_set_framenum>:
rol    $0x8,%si
mov    %si,0x10(%rdi)
ret

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

LLVM IR (-O2):
define void @RTP_set_framenum(i8* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = trunc i32 %3 to i8
%5 = getelementptr inbounds i8, i8* %0, i64 16
store i8 %4, i8* %5
%6 = trunc i32 %1 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 17
store i8 %6, i8* %7
ret void
}
int create_environment() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @create_environment() {
ret i32 0
}
void CG_toggleSpecHelp_f(void) {}


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

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

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

LLVM IR (-O2):
define void @CG_toggleSpecHelp_f() {
ret void
}
int b_twist_b2_on_midperm(mperm)
int mperm;
{
  int temp_arr[4];
  b_midperm_unpack(mperm, temp_arr);
  two_cycle(temp_arr, 2, 3);
  return b_midperm_pack(temp_arr);
}


x86 assembly (clang, -O0):
<b_twist_b2_on_midperm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1030 <b_midperm_unpack@plt>
lea    -0x20(%rbp),%rdi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x0,%al
call   1050 <two_cycle@plt>
lea    -0x20(%rbp),%rdi
mov    $0x0,%al
call   1040 <b_midperm_pack@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_twist_b2_on_midperm>:
push   %rbx
sub    $0x10,%rsp
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <b_midperm_unpack@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x3,%edx
xor    %eax,%eax
call   1050 <two_cycle@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <b_midperm_pack@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @b_twist_b2_on_midperm(i32 %0) {
%2 = alloca i32
%3 = alloca [4 x i32]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%6 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @b_midperm_unpack to i32 (i32, i32*, ...)*)(i32 %4, i32* %5)
%7 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%8 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @two_cycle to i32 (i32*, i32, i32, ...)*)(i32* %7, i32 2, i32 3)
%9 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%10 = call i32 (i32*, ...) bitcast (i32 (...)* @b_midperm_pack to i32 (i32*, ...)*)(i32* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @b_twist_b2_on_midperm(i32 %0) {
%2 = alloca [4 x i32]
%3 = bitcast [4 x i32]* %2 to i8*
%4 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%5 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @b_midperm_unpack to i32 (i32, i32*, ...)*)(i32 %0, i32* %4)
%6 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @two_cycle to i32 (i32*, i32, i32, ...)*)(i32* %4, i32 2, i32 3)
%7 = call i32 (i32*, ...) bitcast (i32 (...)* @b_midperm_pack to i32 (i32*, ...)*)(i32* %4)
ret i32 %7
}
/* Variables and functions */
int inb(int);
void waitForKeyboard() {
  while (inb(0x64) & 0x02)
    ;
}


x86 assembly (clang, -O0):
<waitForKeyboard>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <waitForKeyboard+0x9>
mov    $0x64,%edi
call   1030 <inb@plt>
and    $0x2,%eax
cmp    $0x0,%eax
je     1134 <waitForKeyboard+0x24>
jmp    1119 <waitForKeyboard+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitForKeyboard>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x64,%edi
call   1030 <inb@plt>
test   $0x2,%al
jne    1120 <waitForKeyboard+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @waitForKeyboard() {
br label %1
1: ; preds = %5, %0
%2 = call i32 @inb(i32 100)
%3 = and i32 %2, 2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @waitForKeyboard() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @inb(i32 100)
%3 = and i32 %2, 2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %1
5: ; preds = %1
ret void
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  void *si_addr;
};
typedef TYPE_1__ siginfo_t;

/* Variables and functions */
void *siginfo_si_addr(siginfo_t *si) { return si->si_addr; }


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

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

LLVM IR (-O0):
%struct.TYPE_3__ = type { i8* }
define i8* @siginfo_si_addr(%struct.TYPE_3__* %0) {
%2 = alloca %struct.TYPE_3__*
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %2
%3 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
%5 = load i8*, i8** %4
ret i8* %5
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i8* }
define i8* @siginfo_si_addr(%struct.TYPE_3__* nocapture %0) {
%2 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%3 = load i8*, i8** %2
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *gmtime_r(int /*<<< orphan*/ *, struct tm *);
struct tm *split_time(time_t timer, struct tm *tim_p) {
  return gmtime_r(&timer, tim_p);
}


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

x86 assembly (clang, -O2):
<split_time>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <gmtime_r@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define %struct.tm* @split_time(i32 %0, %struct.tm* %1) {
%3 = alloca i32
%4 = alloca %struct.tm*
store i32 %0, i32* %3
store %struct.tm* %1, %struct.tm** %4
%5 = load %struct.tm*, %struct.tm** %4
%6 = call %struct.tm* @gmtime_r(i32* %3, %struct.tm* %5)
ret %struct.tm* %6
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define %struct.tm* @split_time(i32 %0, %struct.tm* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call %struct.tm* @gmtime_r(i32* %3, %struct.tm* %1)
ret %struct.tm* %4
}
float decode_watts(unsigned char watts_encoded) {
  return ((float)watts_encoded * 4.0);
}


x86 assembly (clang, -O0):
<decode_watts>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cvtsi2ss %eax,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee2(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_watts>:
cvtsi2sd %edi,%xmm0
mulsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @decode_watts(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = uitofp i8 %3 to float
%5 = fpext float %4 to double
%6 = fmul double %5, 4.000000e+00
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @decode_watts(i8 zeroext %0) {
%2 = uitofp i8 %0 to double
%3 = fmul double %2, 4.000000e+00
%4 = fptrunc double %3 to float
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ script_write_byte(int);
void script_stop() {
  script_write_byte(145);
  script_write_byte(0);
  script_write_byte(0);
  script_write_byte(0);
  script_write_byte(0);
}


x86 assembly (clang, -O0):
<script_stop>:
push   %rbp
mov    %rsp,%rbp
mov    $0x91,%edi
call   1030 <script_write_byte@plt>
xor    %edi,%edi
call   1030 <script_write_byte@plt>
xor    %edi,%edi
call   1030 <script_write_byte@plt>
xor    %edi,%edi
call   1030 <script_write_byte@plt>
xor    %edi,%edi
call   1030 <script_write_byte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<script_stop>:
push   %rax
mov    $0x91,%edi
call   1030 <script_write_byte@plt>
xor    %edi,%edi
call   1030 <script_write_byte@plt>
xor    %edi,%edi
call   1030 <script_write_byte@plt>
xor    %edi,%edi
call   1030 <script_write_byte@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <script_write_byte@plt>

LLVM IR (-O0):
define void @script_stop() {
%1 = call i32 @script_write_byte(i32 145)
%2 = call i32 @script_write_byte(i32 0)
%3 = call i32 @script_write_byte(i32 0)
%4 = call i32 @script_write_byte(i32 0)
%5 = call i32 @script_write_byte(i32 0)
ret void
}

LLVM IR (-O2):
define void @script_stop() {
%1 = tail call i32 @script_write_byte(i32 145)
%2 = tail call i32 @script_write_byte(i32 0)
%3 = tail call i32 @script_write_byte(i32 0)
%4 = tail call i32 @script_write_byte(i32 0)
%5 = tail call i32 @script_write_byte(i32 0)
ret void
}
int is_digit(int d) { return d >= '0' && d <= '9'; }


x86 assembly (clang, -O0):
<is_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <is_digit+0x20>
cmpl   $0x39,-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):
<is_digit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @is_digit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 48
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
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 @is_digit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
scalar_t__ is_power_of_two_non_zero(int);
uint32_t fill_word_branchless(uint32_t x) {
  assert(x == 0 || is_power_of_two_non_zero(x));
  const uint32_t y = -x;
  return ((int32_t)(y) >> 31);
}


x86 assembly (clang, -O0):
<fill_word_branchless>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x9(%rbp)
je     114c <fill_word_branchless+0x2c>
mov    -0x4(%rbp),%edi
call   1040 <is_power_of_two_non_zero@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1f,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_word_branchless>:
push   %rbx
mov    %edi,%ebx
test   %edi,%edi
je     1139 <fill_word_branchless+0x19>
mov    %ebx,%edi
call   1040 <is_power_of_two_non_zero@plt>
xor    %edi,%edi
test   %rax,%rax
setne  %dil
jmp    113e <fill_word_branchless+0x1e>
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
test   %ebx,%ebx
setg   %al
neg    %eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @fill_word_branchless(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i64 @is_power_of_two_non_zero(i32 %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i32, i32* %2
%15 = sub nsw i32 0, %14
store i32 %15, i32* %3
%16 = load i32, i32* %3
%17 = ashr i32 %16, 31
ret i32 %17
}

LLVM IR (-O2):
define i32 @fill_word_branchless(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i64 @is_power_of_two_non_zero(i32 %0)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 1, %1 ], [ %6, %3 ]
%9 = tail call i32 @assert(i32 %8)
%10 = icmp sgt i32 %0, 0
%11 = sext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ reverse_sub(char *);
void main() {
  char str[] = "I   am a student.";
  reverse_sub(str);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedb(%rip),%ax
mov    %ax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <reverse_sub@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,(%rsp)
movw   $0x2e,0x10(%rsp)
mov    %rsp,%rdi
call   1030 <reverse_sub@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.str = [18 x i8] c"I am a student.\00"
define void @main() {
%1 = alloca [18 x i8]
%2 = bitcast [18 x i8]* %1 to i8*
%3 = getelementptr inbounds [18 x i8], [18 x i8]* %1, i64 0, i64 0
%4 = call i32 @reverse_sub(i8* %3)
ret void
}

LLVM IR (-O2):
@__const.main.str = [18 x i8] c"I am a student.\00"
define void @main() {
%1 = alloca [18 x i8]
%2 = getelementptr inbounds [18 x i8], [18 x i8]* %1, i64 0, i64 0
%3 = call i32 @reverse_sub(i8* %2)
ret void
}
/* Variables and functions */
int __original_dup2(int, int);
int dup2(int oldfd, int newfd) {
  int ret = 0;
  ret = __original_dup2(oldfd, newfd);
  return ret;
}


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

x86 assembly (clang, -O2):
<dup2>:
jmp    1030 <__original_dup2@plt>

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

LLVM IR (-O2):
define i32 @dup2(i32 %0, i32 %1) {
%3 = tail call i32 @__original_dup2(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Report(char *);
int astGTxExt(const char *text, float x, float y, const char *just, float upx,
              float upy, float *xb, float *yb) {
  Report("astGTxExt");
  return 0;
}


x86 assembly (clang, -O0):
<astGTxExt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movss  %xmm2,-0x1c(%rbp)
movss  %xmm3,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
lea    0xebd(%rip),%rdi
call   1030 <Report@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [10 x i8] c"astGTxExt\00"
define i32 @astGTxExt(i8* %0, float %1, float %2, i8* %3, float %4, float %5, float* %6, float* %7) {
%9 = alloca i8*
%10 = alloca float
%11 = alloca float
%12 = alloca i8*
%13 = alloca float
%14 = alloca float
%15 = alloca float*
%16 = alloca float*
store i8* %0, i8** %9
store float %1, float* %10
store float %2, float* %11
store i8* %3, i8** %12
store float %4, float* %13
store float %5, float* %14
store float* %6, float** %15
store float* %7, float** %16
%17 = call i32 @Report(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"astGTxExt\00"
define i32 @astGTxExt(i8* nocapture readnone %0, float %1, float %2, i8* nocapture readnone %3, float %4, float %5, float* nocapture readnone %6, float* nocapture readnone %7) {
%9 = tail call i32 @Report(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void die_usage(void) {
  fprintf(stderr,
          "Usage: mptcp_connect [-6] [-u] [-s MPTCP|TCP] [-p port] -m mode]"
          "[ -l ] [ -t timeout ] connect_address\n");
  exit(1);
}


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

x86 assembly (clang, -O2):
<die_usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [103 x i8] c"Usage: mptcp_connect [-6] [-u] [-s MPTCP|TCP] [-p port] -m mode][ -l ] [ -t timeout ] connect_address\0A\00"
define void @die_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [103 x i8] c"Usage: mptcp_connect [-6] [-u] [-s MPTCP|TCP] [-p port] -m mode][ -l ] [ -t timeout ] connect_address\0A\00"
define void @die_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
double pop();
int /*<<< orphan*/ push(double);
void replace() {
  double a, b;
  a = pop();
  b = pop();
  push(a);
  push(b);
}


x86 assembly (clang, -O0):
<replace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <pop@plt>
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <pop@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <push@plt>
movsd  -0x10(%rbp),%xmm0
call   1040 <push@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<replace>:
sub    $0x18,%rsp
xor    %eax,%eax
call   1030 <pop@plt>
movsd  %xmm0,0x10(%rsp)
xor    %eax,%eax
call   1030 <pop@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <push@plt>
movsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
jmp    1040 <push@plt>

LLVM IR (-O0):
define void @replace() {
%1 = alloca double
%2 = alloca double
%3 = call double (...) @pop()
store double %3, double* %1
%4 = call double (...) @pop()
store double %4, double* %2
%5 = load double, double* %1
%6 = call i32 @push(double %5)
%7 = load double, double* %2
%8 = call i32 @push(double %7)
ret void
}

LLVM IR (-O2):
define void @replace() {
%1 = tail call double (...) @pop()
%2 = tail call double (...) @pop()
%3 = tail call i32 @push(double %1)
%4 = tail call i32 @push(double %2)
ret void
}
int test2(int i) {
  int i2 = (i > 3) ? (i + 3) : (i - 5);
  return i2;
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
jle    111f <test2+0x1f>
mov    -0x4(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0xc(%rbp)
jmp    1128 <test2+0x28>
mov    -0x4(%rbp),%eax
sub    $0x5,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
xor    %eax,%eax
cmp    $0x4,%edi
setge  %al
lea    (%rdi,%rax,8),%eax
add    $0xfffffffb,%eax
ret

LLVM IR (-O0):
define i32 @test2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 3
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 3
br label %12
9: ; preds = %1
%10 = load i32, i32* %2
%11 = sub nsw i32 %10, 5
br label %12
12: ; preds = %9, %6
%13 = phi i32 [ %8, %6 ], [ %11, %9 ]
store i32 %13, i32* %3
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @test2(i32 %0) {
%2 = icmp sgt i32 %0, 3
%3 = select i1 %2, i32 3, i32 -5
%4 = add nsw i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ binario(int);
int main() {
  binario(233);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @binario(i32 233)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void Usage() {
  char *s =
      " Usage: MyFtp [options] \n               --work_dir   -w  REQUIRED "
      "server working dir \n               --ip         -i  REQUIRED server "
      "listen ip \n               --port       -p  OPTIONAL listen port \n     "
      "          --log_file   -l  OPTIONAL log file \n               --daemon  "
      "   -d  Make Daemon \n               \n               DESC: \n           "
      "    Simple ftp program made by mzy !\n               ";
  printf("%s\n", s);
}


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

x86 assembly (clang, -O2):
<Usage>:
lea    0x1076(%rip),%rdi
lea    0xee2(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [397 x i8] c" Usage: MyFtp [options] \0A --work_dir -w REQUIRED server working dir \0A --ip -i REQUIRED server listen ip \0A --port -p OPTIONAL listen port \0A --log_file -l OPTIONAL log file \0A --daemon -d Make Daemon \0A \0A DESC: \0A Simple ftp program made by mzy !\0A \00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @Usage() {
%1 = alloca i8*
store i8* getelementptr inbounds ([397 x i8], [397 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret void
}

LLVM IR (-O2):
@.str = [397 x i8] c" Usage: MyFtp [options] \0A --work_dir -w REQUIRED server working dir \0A --ip -i REQUIRED server listen ip \0A --port -p OPTIONAL listen port \0A --log_file -l OPTIONAL log file \0A --daemon -d Make Daemon \0A \0A DESC: \0A Simple ftp program made by mzy !\0A \00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @Usage() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([397 x i8], [397 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t ROL64_32(uint64_t x) {
  __asm__("rolq $32, %0" : "=r"(x) : "0"(x));
  return x;
}


x86 assembly (clang, -O0):
<ROL64_32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
rol    $0x20,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ROL64_32>:
mov    %rdi,%rax
rol    $0x20,%rax
ret

LLVM IR (-O0):
define i8* @ROL64_32(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* asm "rolq $$32, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define i8* @ROL64_32(i8* readnone %0) {
%2 = tail call i8* asm "rolq $$32, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
/* Variables and functions */
void *EVP_CIPHER_CTX_new();
void *AES128_CBC_CTX_new(void) { return EVP_CIPHER_CTX_new(); }


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

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

LLVM IR (-O0):
define i8* @AES128_CBC_CTX_new() {
%1 = call i8* (...) @EVP_CIPHER_CTX_new()
ret i8* %1
}

LLVM IR (-O2):
define i8* @AES128_CBC_CTX_new() {
%1 = tail call i8* (...) @EVP_CIPHER_CTX_new()
ret i8* %1
}
void gtk_file_chooser_get_show_hidden() {}


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

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

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

LLVM IR (-O2):
define void @gtk_file_chooser_get_show_hidden() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
struct nlattr {
  int dummy;
};

/* Variables and functions */
uint16_t nla_read_u16(const struct nlattr *nla) {
  return *(uint16_t *)(nla + 1);
}


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

x86 assembly (clang, -O2):
<nla_read_u16>:
mov    0x4(%rdi),%eax
ret

LLVM IR (-O0):
%struct.nlattr = type { i32 }
define i32 @nla_read_u16(%struct.nlattr* %0) {
%2 = alloca %struct.nlattr*
store %struct.nlattr* %0, %struct.nlattr** %2
%3 = load %struct.nlattr*, %struct.nlattr** %2
%4 = getelementptr inbounds %struct.nlattr, %struct.nlattr* %3, i64 1
%5 = bitcast %struct.nlattr* %4 to i32*
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
%struct.nlattr = type { i32 }
define i32 @nla_read_u16(%struct.nlattr* nocapture %0) {
%2 = getelementptr inbounds %struct.nlattr, %struct.nlattr* %0, i64 1, i32 0
%3 = load i32, i32* %2
ret i32 %3
}
void *cput(int c, void *cl) {
  char *s = cl;
  if (c < 0 || c > 255)
    warning("overflow in escape sequence with resulting value `%d'\n", c);
  *s++ = c;
  return s;
}


x86 assembly (clang, -O0):
<cput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     113e <cput+0x2e>
cmpl   $0xff,-0x4(%rbp)
jle    114f <cput+0x3f>
mov    -0x4(%rbp),%esi
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <warning@plt>
mov    -0x4(%rbp),%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cput>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
cmp    $0x100,%edi
jb     1130 <cput+0x20>
lea    0xed9(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <warning@plt>
mov    %bpl,(%rbx)
add    $0x1,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [55 x i8] c"overflow in escape sequence with resulting value `%d'\0A\00"
define i8* @cput(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
store i8* %6, i8** %5
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %2
%10 = load i32, i32* %3
%11 = icmp sgt i32 %10, 255
br i1 %11, label %12, label %15
12: ; preds = %9, %2
%13 = load i32, i32* %3
%14 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @warning to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %12, %9
%16 = load i32, i32* %3
%17 = trunc i32 %16 to i8
%18 = load i8*, i8** %5
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %5
store i8 %17, i8* %18
%20 = load i8*, i8** %5
ret i8* %20
}

LLVM IR (-O2):
@.str = [55 x i8] c"overflow in escape sequence with resulting value `%d'\0A\00"
define i8* @cput(i32 %0, i8* writeonly %1) {
%3 = icmp ugt i32 %0, 255
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @warning to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %6
6: ; preds = %2, %4
%7 = trunc i32 %0 to i8
%8 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %7, i8* %1
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ l_message(int /*<<< orphan*/ *, char *);
void print_version(void) {
  l_message(NULL, "Lua 5.1.2"
                  "  "
                  "Copyright (C) 1994-2007 Lua.org, PUC-Rio");
}


x86 assembly (clang, -O0):
<print_version>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
lea    0xee1(%rip),%rsi
call   1030 <l_message@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_version>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
jmp    1030 <l_message@plt>

LLVM IR (-O0):
@.str = [52 x i8] c"Lua 5.1.2 Copyright (C) 1994-2007 Lua.org, PUC-Rio\00"
define void @print_version() {
%1 = call i32 @l_message(i32* null, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [52 x i8] c"Lua 5.1.2 Copyright (C) 1994-2007 Lua.org, PUC-Rio\00"
define void @print_version() {
%1 = tail call i32 @l_message(i32* null, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct list_item {
  int dummy;
};
struct list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ list_add(struct list *, struct list_item *);
int /*<<< orphan*/ list_remove(struct list *, struct list_item *);
void list_move(struct list *to, struct list *from, struct list_item *item) {
  list_remove(from, item);
  list_add(to, item);
}


x86 assembly (clang, -O0):
<list_move>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <list_remove@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <list_add@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_move>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1040 <list_remove@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <list_add@plt>

LLVM IR (-O0):
%struct.list = type { i32 }
%struct.list_item = type { i32 }
define void @list_move(%struct.list* %0, %struct.list* %1, %struct.list_item* %2) {
%4 = alloca %struct.list*
%5 = alloca %struct.list*
%6 = alloca %struct.list_item*
store %struct.list* %0, %struct.list** %4
store %struct.list* %1, %struct.list** %5
store %struct.list_item* %2, %struct.list_item** %6
%7 = load %struct.list*, %struct.list** %5
%8 = load %struct.list_item*, %struct.list_item** %6
%9 = call i32 @list_remove(%struct.list* %7, %struct.list_item* %8)
%10 = load %struct.list*, %struct.list** %4
%11 = load %struct.list_item*, %struct.list_item** %6
%12 = call i32 @list_add(%struct.list* %10, %struct.list_item* %11)
ret void
}

LLVM IR (-O2):
%struct.list = type { i32 }
%struct.list_item = type { i32 }
define void @list_move(%struct.list* %0, %struct.list* %1, %struct.list_item* %2) {
%4 = tail call i32 @list_remove(%struct.list* %1, %struct.list_item* %2)
%5 = tail call i32 @list_add(%struct.list* %0, %struct.list_item* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprint_err(char *, char *);
int /*<<< orphan*/ fprint_msg(char *, char *);
int /*<<< orphan*/ print_err(char *);
int /*<<< orphan*/ print_msg(char *);
extern void test_C_printing(void) {
  print_msg("C Message\n");
  print_err("C Error\n");
  fprint_msg("C Message %s\n", "Fred");
  fprint_err("C Error %s\n", "Fred");
}


x86 assembly (clang, -O0):
<test_C_printing>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
call   1060 <print_msg@plt>
lea    0xeb4(%rip),%rdi
call   1040 <print_err@plt>
lea    0xeb1(%rip),%rdi
lea    0xeb8(%rip),%rsi
call   1050 <fprint_msg@plt>
lea    0xeb1(%rip),%rdi
lea    0xea5(%rip),%rsi
call   1030 <fprint_err@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_C_printing>:
push   %rbx
lea    0xeb8(%rip),%rdi
call   1060 <print_msg@plt>
lea    0xeb7(%rip),%rdi
call   1040 <print_err@plt>
lea    0xeb4(%rip),%rdi
lea    0xebb(%rip),%rbx
mov    %rbx,%rsi
call   1050 <fprint_msg@plt>
lea    0xeb1(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <fprint_err@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"C Message\0A\00"
@.str.1 = [9 x i8] c"C Error\0A\00"
@.str.2 = [14 x i8] c"C Message %s\0A\00"
@.str.3 = [5 x i8] c"Fred\00"
@.str.4 = [12 x i8] c"C Error %s\0A\00"
define void @test_C_printing() {
%1 = call i32 @print_msg(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @print_err(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @fprint_msg(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%4 = call i32 @fprint_err(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"C Message\0A\00"
@.str.1 = [9 x i8] c"C Error\0A\00"
@.str.2 = [14 x i8] c"C Message %s\0A\00"
@.str.3 = [5 x i8] c"Fred\00"
@.str.4 = [12 x i8] c"C Error %s\0A\00"
define void @test_C_printing() {
%1 = tail call i32 @print_msg(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @print_err(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @fprint_msg(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%4 = tail call i32 @fprint_err(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned long __builtin_divdeuo(unsigned long, unsigned long);
unsigned long div_deuo(unsigned long a, unsigned long b) {
  return __builtin_divdeuo(a, b);
}


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

x86 assembly (clang, -O2):
<div_deuo>:
jmp    1030 <__builtin_divdeuo@plt>

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

LLVM IR (-O2):
define i64 @div_deuo(i64 %0, i64 %1) {
%3 = tail call i64 @__builtin_divdeuo(i64 %0, i64 %1)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void bar() { printf("This is bar!\n"); }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"This is bar!\0A\00"
define void @bar() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"This is bar!\00"
define void @bar() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_max_ss(int /*<<< orphan*/, int /*<<< orphan*/);
__m128 test_mm_max_ss(__m128 A, __m128 B) { return _mm_max_ss(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_max_ss>:
jmp    1030 <_mm_max_ss@plt>

LLVM IR (-O0):
define i32 @test_mm_max_ss(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 @_mm_max_ss(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_max_ss(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_max_ss(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
void h_u24_to_be(uint8_t *buf, int val) {
  buf[0] = (uint8_t)(val >> 16);
  buf[1] = (uint8_t)(val >> 8);
  buf[2] = (uint8_t)(val >> 0);
}


x86 assembly (clang, -O0):
<h_u24_to_be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0xc(%rbp),%eax
sar    $0x0,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<h_u24_to_be>:
mov    %esi,%eax
sar    $0x10,%eax
cltq
mov    %rax,(%rdi)
movslq %esi,%rax
sar    $0x8,%esi
movslq %esi,%rcx
mov    %rcx,0x8(%rdi)
mov    %rax,0x10(%rdi)
ret

LLVM IR (-O0):
define void @h_u24_to_be(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
store i64* %0, i64** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 16
%7 = sext i32 %6 to i64
%8 = load i64*, i64** %3
%9 = getelementptr inbounds i64, i64* %8, i64 0
store i64 %7, i64* %9
%10 = load i32, i32* %4
%11 = ashr i32 %10, 8
%12 = sext i32 %11 to i64
%13 = load i64*, i64** %3
%14 = getelementptr inbounds i64, i64* %13, i64 1
store i64 %12, i64* %14
%15 = load i32, i32* %4
%16 = ashr i32 %15, 0
%17 = sext i32 %16 to i64
%18 = load i64*, i64** %3
%19 = getelementptr inbounds i64, i64* %18, i64 2
store i64 %17, i64* %19
ret void
}

LLVM IR (-O2):
define void @h_u24_to_be(i64* nocapture writeonly %0, i32 %1) {
%3 = ashr i32 %1, 16
%4 = sext i32 %3 to i64
store i64 %4, i64* %0
%5 = ashr i32 %1, 8
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i64, i64* %0, i64 1
store i64 %6, i64* %7
%8 = sext i32 %1 to i64
%9 = getelementptr inbounds i64, i64* %0, i64 2
store i64 %8, i64* %9
ret void
}
unsigned int fun_zi32(unsigned int a, unsigned int b) { return a; }


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

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

LLVM IR (-O0):
define i32 @fun_zi32(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
ret i32 %5
}

LLVM IR (-O2):
define i32 @fun_zi32(i32 returned %0, i32 %1) {
ret i32 %0
}
int strlength(char *s) {
  int n = 0;
  int i;
  char temp;
  for (n = 0; *s; n++, s++)
    ;
  return n;
}


x86 assembly (clang, -O0):
<strlength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1142 <strlength+0x42>
jmp    1128 <strlength+0x28>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1116 <strlength+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlength>:
cmpb   $0x0,(%rdi)
je     111c <strlength+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlength+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strlength(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %8, %4 ], [ %0, %1 ]
%6 = phi i32 [ %7, %4 ], [ 0, %1 ]
%7 = add nuw nsw i32 %6, 1
%8 = getelementptr inbounds i8, i8* %5, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ writeidew(int, int /*<<< orphan*/);
void ide_write_sec_w(uint16_t addr, uint16_t val, void *priv) {
  writeidew(1, val);
}


x86 assembly (clang, -O0):
<ide_write_sec_w>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    $0x1,%edi
call   1030 <writeidew@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ide_write_sec_w>:
mov    $0x1,%edi
jmp    1030 <writeidew@plt>

LLVM IR (-O0):
define void @ide_write_sec_w(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = call i32 @writeidew(i32 1, i32 %7)
ret void
}

LLVM IR (-O2):
define void @ide_write_sec_w(i32 %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @writeidew(i32 1, i32 %1)
ret void
}
void cli_val_mips_attr_deinit(struct cli_val_mips_attr *a) {}


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

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

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

LLVM IR (-O2):
%struct.cli_val_mips_attr = type opaque
define void @cli_val_mips_attr_deinit(%struct.cli_val_mips_attr* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *putSymbol(char *_name) {
  char *p = (char *)malloc(strlen(_name) + 1);
  strcpy(p, _name);
  return p;
}


x86 assembly (clang, -O0):
<putSymbol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putSymbol>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @putSymbol(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = load i8*, i8** %2
%11 = call i32 @strcpy(i8* %9, i8* %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define i8* @putSymbol(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strcpy(i8* %5, i8* %0)
ret i8* %5
}