xunge/DecIR huggingface dataset:
int read_number(char *str) {
  int Result = 0;
  while (*str) {
    Result *= 10;
    Result += *str - '0';
    str++;
  }
  return Result;
}


x86 assembly (clang, -O0):
<read_number>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1144 <read_number+0x44>
imul   $0xa,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <read_number+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_number>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <read_number+0x28>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
lea    (%rax,%rax,4),%eax
movsbl %cl,%ecx
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <read_number+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @read_number(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %12, %4 ], [ %0, %1 ]
%8 = mul nsw i32 %6, 10
%9 = sext i8 %5 to i32
%10 = add i32 %8, -48
%11 = add i32 %10, %9
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %16
}
int gamecp_split(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @gamecp_split() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void f1(int argc) {
  char test[argc];
  if (0)
  label:
    printf("boom!\n");
  if (argc-- == 0)
    return;
  goto label;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
test   $0x1,%al
jne    1138 <f1+0x28>
jmp    1149 <f1+0x39>
jmp    113d <f1+0x2d>
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
jne    1169 <f1+0x59>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret
jmp    113d <f1+0x2d>

x86 assembly (clang, -O2):
<f1>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
je     113d <f1+0x2d>
mov    %edi,%ebx
lea    0xedf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <puts@plt>
add    $0xffffffff,%ebx
jne    1130 <f1+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"boom!\0A\00"
define void @f1(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %3
%8 = alloca i8, i64 %6
store i64 %6, i64* %4
br i1 false, label %9, label %12
9: ; preds = %1
br label %10
10: ; preds = %18, %9
%11 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %1
%13 = load i32, i32* %2
%14 = add nsw i32 %13, -1
store i32 %14, i32* %2
%15 = icmp eq i32 %13, 0
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load i8*, i8** %3
ret void
18: ; preds = %12
br label %10
}

LLVM IR (-O2):
@str = [6 x i8] c"boom!\00"
define void @f1(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %4
3: ; preds = %4, %1
ret void
4: ; preds = %1, %4
%5 = phi i32 [ %6, %4 ], [ %0, %1 ]
%6 = add nsw i32 %5, -1
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%8 = icmp eq i32 %6, 0
br i1 %8, label %3, label %4
}
int append_char(b, c)
struct dynamic_buffer *b;
int c;
{
  char _ = c;
  return append_chars(b, &_, 1);
}


x86 assembly (clang, -O0):
<append_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xd(%rbp),%rsi
mov    $0x1,%edx
mov    $0x0,%al
call   1030 <append_chars@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<append_char>:
push   %rax
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
xor    %eax,%eax
call   1030 <append_chars@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.dynamic_buffer = type opaque
define i32 @append_char(%struct.dynamic_buffer* %0, i32 %1) {
%3 = alloca %struct.dynamic_buffer*
%4 = alloca i32
%5 = alloca i8
store %struct.dynamic_buffer* %0, %struct.dynamic_buffer** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = trunc i32 %6 to i8
store i8 %7, i8* %5
%8 = load %struct.dynamic_buffer*, %struct.dynamic_buffer** %3
%9 = call i32 (%struct.dynamic_buffer*, i8*, i32, ...) bitcast (i32 (...)* @append_chars to i32 (%struct.dynamic_buffer*, i8*, i32, ...)*)(%struct.dynamic_buffer* %8, i8* %5, i32 1)
ret i32 %9
}

LLVM IR (-O2):
%struct.dynamic_buffer = type opaque
define i32 @append_char(%struct.dynamic_buffer* %0, i32 %1) {
%3 = alloca i8
%4 = trunc i32 %1 to i8
store i8 %4, i8* %3
%5 = call i32 (%struct.dynamic_buffer*, i8*, i32, ...) bitcast (i32 (...)* @append_chars to i32 (%struct.dynamic_buffer*, i8*, i32, ...)*)(%struct.dynamic_buffer* %0, i8* %3, i32 1)
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void smpte_fec_set_d(uint8_t *p_fec) { p_fec[12] |= 0x40; }


x86 assembly (clang, -O0):
<smpte_fec_set_d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x30(%rax),%ecx
or     $0x40,%ecx
mov    %ecx,0x30(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<smpte_fec_set_d>:
orb    $0x40,0x30(%rdi)
ret

LLVM IR (-O0):
define void @smpte_fec_set_d(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 12
%5 = load i32, i32* %4
%6 = or i32 %5, 64
store i32 %6, i32* %4
ret void
}

LLVM IR (-O2):
define void @smpte_fec_set_d(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 12
%3 = load i32, i32* %2
%4 = or i32 %3, 64
store i32 %4, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_checksum();
int test_main() {
  test_checksum();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @test_main() {
%1 = call i32 (...) @test_checksum()
ret i32 0
}

LLVM IR (-O2):
define i32 @test_main() {
%1 = tail call i32 (...) @test_checksum()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ LCD_Cursor(int /*<<< orphan*/);
int /*<<< orphan*/ LCD_DisplayString(int, char *);
void waitStartMessage() {
  LCD_DisplayString(1, "<- Play         -> Hi-Score");
  LCD_Cursor(0);
}


x86 assembly (clang, -O0):
<waitStartMessage>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xed0(%rip),%rsi
call   1040 <LCD_DisplayString@plt>
xor    %edi,%edi
call   1030 <LCD_Cursor@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitStartMessage>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x1,%edi
call   1040 <LCD_DisplayString@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <LCD_Cursor@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"<- Play -> Hi-Score\00"
define void @waitStartMessage() {
%1 = call i32 @LCD_DisplayString(i32 1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @LCD_Cursor(i32 0)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"<- Play -> Hi-Score\00"
define void @waitStartMessage() {
%1 = tail call i32 @LCD_DisplayString(i32 1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @LCD_Cursor(i32 0)
ret void
}
char int_to_rfm_m$send$send(short arg_0x82e5390,
                            struct TOS_Msg *arg_0x82e5558) {
  char result;
  result = generic_comm$send_msg$send(4, arg_0x82e5390, arg_0x82e5558);
  return result;
}


x86 assembly (clang, -O0):
<int_to_rfm_m$send$send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movswl -0x2(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    $0x4,%edi
mov    $0x0,%al
call   1030 <generic_comm$send_msg$send@plt>
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_to_rfm_m$send$send>:
push   %rax
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x4,%edi
xor    %eax,%eax
call   1030 <generic_comm$send_msg$send@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.TOS_Msg = type opaque
define signext i8 @"int_to_rfm_m$send$send"(i16 signext %0, %struct.TOS_Msg* %1) {
%3 = alloca i16
%4 = alloca %struct.TOS_Msg*
%5 = alloca i8
store i16 %0, i16* %3
store %struct.TOS_Msg* %1, %struct.TOS_Msg** %4
%6 = load i16, i16* %3
%7 = sext i16 %6 to i32
%8 = load %struct.TOS_Msg*, %struct.TOS_Msg** %4
%9 = call i32 (i32, i32, %struct.TOS_Msg*, ...) bitcast (i32 (...)* @"generic_comm$send_msg$send" to i32 (i32, i32, %struct.TOS_Msg*, ...)*)(i32 4, i32 %7, %struct.TOS_Msg* %8)
%10 = trunc i32 %9 to i8
store i8 %10, i8* %5
%11 = load i8, i8* %5
ret i8 %11
}

LLVM IR (-O2):
%struct.TOS_Msg = type opaque
define signext i8 @"int_to_rfm_m$send$send"(i16 signext %0, %struct.TOS_Msg* %1) {
%3 = sext i16 %0 to i32
%4 = tail call i32 (i32, i32, %struct.TOS_Msg*, ...) bitcast (i32 (...)* @"generic_comm$send_msg$send" to i32 (i32, i32, %struct.TOS_Msg*, ...)*)(i32 4, i32 %3, %struct.TOS_Msg* %1)
%5 = trunc i32 %4 to i8
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(int argc, char const *argv[]) {
  const char *a = NULL;
  int b;
  b = *a;
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %6
%8 = load i8*, i8** %6
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
store i32 %10, i32* %7
%11 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @exit(i32 0)
unreachable
}
int fn3(int i) { return i == 10 << ((sizeof(int) * 8) - 1); }


x86 assembly (clang, -O0):
<fn3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @fn3(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
scalar_t__ IFF_TAP;
unsigned long iff_tap() { return (unsigned long)IFF_TAP; }


x86 assembly (clang, -O0):
<iff_tap>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iff_tap>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%rax
ret

LLVM IR (-O0):
@IFF_TAP = global i64 0
define i64 @iff_tap() {
%1 = load i64, i64* @IFF_TAP
ret i64 %1
}

LLVM IR (-O2):
@IFF_TAP = global i64 0
define i64 @iff_tap() {
%1 = load i64, i64* @IFF_TAP
ret i64 %1
}
/* Variables and functions */
int prsDefVar();
int prsStatList();
int prsStat() {
  int err;
  err = prsDefVar();
  if (err != 0)
    return err;
  err = prsStatList();
  if (err != 0)
    return err;
  return 0;
}


x86 assembly (clang, -O0):
<prsStat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <prsDefVar@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1147 <prsStat+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116d <prsStat+0x4d>
mov    $0x0,%al
call   1040 <prsStatList@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1166 <prsStat+0x46>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116d <prsStat+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prsStat>:
push   %rax
xor    %eax,%eax
call   1030 <prsDefVar@plt>
test   %eax,%eax
je     112e <prsStat+0xe>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
jmp    1040 <prsStatList@plt>

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

LLVM IR (-O2):
define i32 @prsStat() {
%1 = tail call i32 (...) @prsDefVar()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @prsStatList()
br label %5
5: ; preds = %3, %0
%6 = phi i32 [ %1, %0 ], [ %4, %3 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int func_one() {
  printf("This is function one\n");
  return 1;
}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int _NSIG;
int __signalfd(int, int /*<<< orphan*/ const *, int);
int /*<<< orphan*/ errno;
int signalfd(int fd, const sigset_t *mask, int flags) {
  if (flags) {
    errno = EINVAL;
    return -1;
  }
  return __signalfd(fd, mask, _NSIG / 8);
}


x86 assembly (clang, -O0):
<signalfd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     114a <signalfd+0x3a>
mov    0x2e9d(%rip),%rax
mov    (%rax),%ecx
mov    0x2e9c(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    116c <signalfd+0x5c>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    0x2e98(%rip),%rax
mov    (%rax),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
call   1030 <__signalfd@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signalfd>:
test   %edx,%edx
je     112c <signalfd+0x1c>
mov    0x2eb5(%rip),%rax
mov    (%rax),%eax
mov    0x2eb4(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret
mov    0x2ebd(%rip),%rax
mov    (%rax),%eax
lea    0x7(%rax),%edx
test   %eax,%eax
cmovns %eax,%edx
sar    $0x3,%edx
jmp    1030 <__signalfd@plt>

LLVM IR (-O0):
@EINVAL = global i32 0
@errno = global i32 0
@_NSIG = global i32 0
define i32 @signalfd(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32 %2, i32* %7
%8 = load i32, i32* %7
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i32, i32* @EINVAL
store i32 %11, i32* @errno
store i32 -1, i32* %4
br label %18
12: ; preds = %3
%13 = load i32, i32* %5
%14 = load i32*, i32** %6
%15 = load i32, i32* @_NSIG
%16 = sdiv i32 %15, 8
%17 = call i32 @__signalfd(i32 %13, i32* %14, i32 %16)
store i32 %17, i32* %4
br label %18
18: ; preds = %12, %10
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
@EINVAL = global i32 0
@errno = global i32 0
@_NSIG = global i32 0
define i32 @signalfd(i32 %0, i32* %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = load i32, i32* @EINVAL
store i32 %6, i32* @errno
br label %11
7: ; preds = %3
%8 = load i32, i32* @_NSIG
%9 = sdiv i32 %8, 8
%10 = tail call i32 @__signalfd(i32 %0, i32* %1, i32 %9)
br label %11
11: ; preds = %7, %5
%12 = phi i32 [ -1, %5 ], [ %10, %7 ]
ret i32 %12
}
/* Type definitions */
struct lifo {
  int dummy;
};

/* Variables and functions */
double pop(struct lifo *);
double opr_add(struct lifo *stack) {
  double op1, op2;
  op1 = pop(stack);
  op2 = pop(stack);
  return op2 + op1;
}


x86 assembly (clang, -O0):
<opr_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pop@plt>
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pop@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opr_add>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1030 <pop@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1030 <pop@plt>
addsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.lifo = type { i32 }
define double @opr_add(%struct.lifo* %0) {
%2 = alloca %struct.lifo*
%3 = alloca double
%4 = alloca double
store %struct.lifo* %0, %struct.lifo** %2
%5 = load %struct.lifo*, %struct.lifo** %2
%6 = call double @pop(%struct.lifo* %5)
store double %6, double* %3
%7 = load %struct.lifo*, %struct.lifo** %2
%8 = call double @pop(%struct.lifo* %7)
store double %8, double* %4
%9 = load double, double* %4
%10 = load double, double* %3
%11 = fadd double %9, %10
ret double %11
}

LLVM IR (-O2):
%struct.lifo = type { i32 }
define double @opr_add(%struct.lifo* %0) {
%2 = tail call double @pop(%struct.lifo* %0)
%3 = tail call double @pop(%struct.lifo* %0)
%4 = fadd double %2, %3
ret double %4
}
/* Variables and functions */
char *strrchr(char const *, char);
int COM_FilePathLength(const char *in) {
  const char *s;
  s = strrchr(in, '/');
  if (!s)
    s = in;
  return s - in;
}


x86 assembly (clang, -O0):
<COM_FilePathLength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1141 <COM_FilePathLength+0x31>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<COM_FilePathLength>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
cmove  %ebx,%eax
sub    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @COM_FilePathLength(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = load i8*, i8** %2
store i8* %9, i8** %3
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
%12 = load i8*, i8** %2
%13 = ptrtoint i8* %11 to i64
%14 = ptrtoint i8* %12 to i64
%15 = sub i64 %13, %14
%16 = trunc i64 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @COM_FilePathLength(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = select i1 %3, i8* %0, i8* %2
%5 = ptrtoint i8* %4 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = trunc i64 %7 to i32
ret i32 %8
}
/* Variables and functions */
int *findMin(int *, int);
int /*<<< orphan*/ printTab(int *, int);
int main() {
  int a[6] = {2, 2, 2, 3, 4, 1};
  int *min = findMin(a, 6);
  printTab(a, 6);
  printTab(min + 1, min[0]);
  printTab(min, min[0] + 1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x6,%esi
call   1040 <findMin@plt>
mov    %rax,-0x28(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x6,%esi
call   1030 <printTab@plt>
mov    -0x28(%rbp),%rdi
add    $0x4,%rdi
mov    -0x28(%rbp),%rax
mov    (%rax),%esi
call   1030 <printTab@plt>
mov    -0x28(%rbp),%rdi
mov    -0x28(%rbp),%rax
mov    (%rax),%esi
add    $0x1,%esi
call   1030 <printTab@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    0xee2(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xec6(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x6,%esi
call   1040 <findMin@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    $0x6,%esi
call   1030 <printTab@plt>
lea    0x4(%rbx),%rdi
mov    (%rbx),%esi
call   1030 <printTab@plt>
mov    (%rbx),%esi
add    $0x1,%esi
mov    %rbx,%rdi
call   1030 <printTab@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.a = [6 x i32] [i32 2, i32 2, i32 2, i32 3, i32 4, i32 1]
define i32 @main() {
%1 = alloca [6 x i32]
%2 = alloca i32*
%3 = bitcast [6 x i32]* %1 to i8*
%4 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%5 = call i32* @findMin(i32* %4, i32 6)
store i32* %5, i32** %2
%6 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%7 = call i32 @printTab(i32* %6, i32 6)
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 1
%10 = load i32*, i32** %2
%11 = getelementptr inbounds i32, i32* %10, i64 0
%12 = load i32, i32* %11
%13 = call i32 @printTab(i32* %9, i32 %12)
%14 = load i32*, i32** %2
%15 = load i32*, i32** %2
%16 = getelementptr inbounds i32, i32* %15, i64 0
%17 = load i32, i32* %16
%18 = add nsw i32 %17, 1
%19 = call i32 @printTab(i32* %14, i32 %18)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [6 x i32] [i32 2, i32 2, i32 2, i32 3, i32 4, i32 1]
define i32 @main() {
%1 = alloca [6 x i32]
%2 = bitcast [6 x i32]* %1 to i8*
%3 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%4 = call i32* @findMin(i32* %3, i32 6)
%5 = call i32 @printTab(i32* %3, i32 6)
%6 = getelementptr inbounds i32, i32* %4, i64 1
%7 = load i32, i32* %4
%8 = call i32 @printTab(i32* %6, i32 %7)
%9 = load i32, i32* %4
%10 = add nsw i32 %9, 1
%11 = call i32 @printTab(i32* %4, i32 %10)
ret i32 0
}
/* Variables and functions */
_Bool isdigit(unsigned char);
_Bool dns_isdigit(unsigned char c) { return isdigit(c); }


x86 assembly (clang, -O0):
<dns_isdigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <isdigit@plt>
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dns_isdigit>:
jmp    1030 <isdigit@plt>

LLVM IR (-O0):
define zeroext i1 @dns_isdigit(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call zeroext i1 @isdigit(i8 zeroext %3)
ret i1 %4
}

LLVM IR (-O2):
define zeroext i1 @dns_isdigit(i8 zeroext %0) {
%2 = tail call zeroext i1 @isdigit(i8 zeroext %0)
ret i1 %2
}
void UART_DEB_ScbEnableIntr(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_epel_hv16_12_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, char, int);
int main(int argc, char **argv) {
  char buf[16];
  memset(buf, 'A', 65);
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    %rsp,%rdi
mov    $0x41,%esi
mov    $0x41,%edx
call   1030 <memset@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [16 x i8]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%7 = call i32 @memset(i8* %6, i8 signext 65, i32 65)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [16 x i8]
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%5 = call i32 @memset(i8* %4, i8 signext 65, i32 65)
ret i32 0
}
int test_imm_69uint8_mem(unsigned char *val) {
  return ((*val) & (-0x69 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_69uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -105
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void gen_PDUcrq(char *pdu, int type, unsigned int v) {
  pdu[0] = type;
  pdu[1] = (v >> 8) & 0xFF;
  pdu[2] = v & 0xFF;
}


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

x86 assembly (clang, -O2):
<gen_PDUcrq>:
mov    %sil,(%rdi)
mov    %dh,0x1(%rdi)
mov    %dl,0x2(%rdi)
ret

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

LLVM IR (-O2):
define void @gen_PDUcrq(i8* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = trunc i32 %1 to i8
store i8 %4, i8* %0
%5 = lshr i32 %2, 8
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %6, i8* %7
%8 = trunc i32 %2 to i8
%9 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %8, i8* %9
ret void
}
float atanf(float x) {
  float res = 0.0F;
  asm volatile("fld1\n\t"
               "fpatan"
               : "=t"(res)
               : "0"(x));
  return res;
}


x86 assembly (clang, -O0):
<atanf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
flds   -0xc(%rbp)
fld1
fpatan
fstps  -0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<atanf>:
movss  %xmm0,-0x4(%rsp)
flds   -0x4(%rsp)
fld1
fpatan
fstps  -0x8(%rsp)
movss  -0x8(%rsp),%xmm0
ret

LLVM IR (-O0):
define float @atanf(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
store float 0.000000e+00, float* %3
%4 = load float, float* %2
%5 = call float asm sideeffect "fld1\0A\09fpatan", "={st},0,~{dirflag},~{fpsr},~{flags}"(float %4)
store float %5, float* %3
%6 = load float, float* %3
ret float %6
}

LLVM IR (-O2):
define float @atanf(float %0) {
%2 = tail call float asm sideeffect "fld1\0A\09fpatan", "={st},0,~{dirflag},~{fpsr},~{flags}"(float %0)
ret float %2
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int clog2(uint64_t x) {
  if (!x)
    return x;
  int r = 0;
  while (x - 1 > (1ull << r) - 1)
    r++;
  return r;
}


x86 assembly (clang, -O0):
<clog2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111c <clog2+0x1c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115a <clog2+0x5a>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
sub    $0x1,%rcx
cmp    %rcx,%rax
jbe    1154 <clog2+0x54>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <clog2+0x23>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clog2>:
test   %edi,%edi
je     1125 <clog2+0x25>
add    $0xffffffff,%edi
movslq %edi,%rax
xor    %ecx,%ecx
nopl   0x0(%rax)
mov    %rax,%rdx
shr    %cl,%rdx
add    $0x1,%rcx
test   %rdx,%rdx
jne    1110 <clog2+0x10>
add    $0xffffffff,%ecx
mov    %ecx,%eax
ret
xor    %ecx,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @clog2(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = sext i32 %4 to i64
br label %6
6: ; preds = %6, %3
%7 = phi i64 [ %10, %6 ], [ 0, %3 ]
%8 = lshr i64 %5, %7
%9 = icmp eq i64 %8, 0
%10 = add nuw i64 %7, 1
br i1 %9, label %11, label %6
11: ; preds = %6
%12 = trunc i64 %7 to i32
br label %13
13: ; preds = %11, %1
%14 = phi i32 [ 0, %1 ], [ %12, %11 ]
ret i32 %14
}
void instruc_16() {}


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

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

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

LLVM IR (-O2):
define void @instruc_16() {
ret void
}
/* Variables and functions */
double exp(double);
double log(double);
double pow(double b, double e) { return exp(e * log(b)); }


x86 assembly (clang, -O0):
<pow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow>:
push   %rax
movsd  %xmm1,(%rsp)
call   1040 <log@plt>
mulsd  (%rsp),%xmm0
pop    %rax
jmp    1030 <exp@plt>

LLVM IR (-O0):
define double @pow(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* %3
%7 = call double @log(double %6)
%8 = fmul double %5, %7
%9 = call double @exp(double %8)
ret double %9
}

LLVM IR (-O2):
define double @pow(double %0, double %1) {
%3 = tail call double @log(double %0)
%4 = fmul double %3, %1
%5 = tail call double @exp(double %4)
ret double %5
}
void skip_comma_in_command(char **current_cmd) {
  while (*current_cmd[0] == ',') {
    (*current_cmd)++;
  }
}


x86 assembly (clang, -O0):
<skip_comma_in_command>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x2c,%eax
jne    112e <skip_comma_in_command+0x2e>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1108 <skip_comma_in_command+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_comma_in_command>:
mov    (%rdi),%rax
cmpb   $0x2c,(%rax)
jne    111c <skip_comma_in_command+0x1c>
add    $0x1,%rax
nopl   0x0(%rax)
mov    %rax,(%rdi)
cmpb   $0x2c,(%rax)
lea    0x1(%rax),%rax
je     1110 <skip_comma_in_command+0x10>
ret

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

LLVM IR (-O2):
define void @skip_comma_in_command(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 44
br i1 %4, label %5, label %10
5: ; preds = %1, %5
%6 = phi i8* [ %7, %5 ], [ %2, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
store i8* %7, i8** %0
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 44
br i1 %9, label %5, label %10
10: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_is_odd(void *);
int ft_is_even(void *data) { return (!ft_is_odd(data)); }


x86 assembly (clang, -O0):
<ft_is_even>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ft_is_odd@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ft_is_even(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @ft_is_odd(i8* %3)
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @ft_is_even(i8* %0) {
%2 = tail call i32 @ft_is_odd(i8* %0)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
const char *_mcrypt_get_algorithms_name() { return "WAKE"; }


x86 assembly (clang, -O0):
<_mcrypt_get_algorithms_name>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mcrypt_get_algorithms_name>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"WAKE\00"
define i8* @_mcrypt_get_algorithms_name() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [5 x i8] c"WAKE\00"
define i8* @_mcrypt_get_algorithms_name() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
int pcapack_colsums(const int m, const int n, double *x, double *colsums) {
  int i, j;
  double tmp;
#pragma omp parallel for
  for (j = 0; j < m; j++) {
    tmp = 0.;

    for (i = 0; i < n; i++) {
      tmp += x[i + m * j];
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<pcapack_colsums>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1183 <pcapack_colsums+0x83>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1170 <pcapack_colsums+0x70>
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    -0x4(%rbp),%edx
imul   -0x20(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1134 <pcapack_colsums+0x34>
jmp    1175 <pcapack_colsums+0x75>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1119 <pcapack_colsums+0x19>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @pcapack_colsums(i32 %0, i32 %1, double* %2, double* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca double*
%8 = alloca double*
%9 = alloca i32
%10 = alloca i32
%11 = alloca double
store i32 %0, i32* %5
store i32 %1, i32* %6
store double* %2, double** %7
store double* %3, double** %8
store i32 0, i32* %10
br label %12
12: ; preds = %37, %4
%13 = load i32, i32* %10
%14 = load i32, i32* %5
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %40
16: ; preds = %12
store double 0.000000e+00, double* %11
store i32 0, i32* %9
br label %17
17: ; preds = %33, %16
%18 = load i32, i32* %9
%19 = load i32, i32* %6
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %36
21: ; preds = %17
%22 = load double*, double** %7
%23 = load i32, i32* %9
%24 = load i32, i32* %5
%25 = load i32, i32* %10
%26 = mul nsw i32 %24, %25
%27 = add nsw i32 %23, %26
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds double, double* %22, i64 %28
%30 = load double, double* %29
%31 = load double, double* %11
%32 = fadd double %31, %30
store double %32, double* %11
br label %33
33: ; preds = %21
%34 = load i32, i32* %9
%35 = add nsw i32 %34, 1
store i32 %35, i32* %9
br label %17
36: ; preds = %17
br label %37
37: ; preds = %36
%38 = load i32, i32* %10
%39 = add nsw i32 %38, 1
store i32 %39, i32* %10
br label %12
40: ; preds = %12
ret i32 0
}

LLVM IR (-O2):
define i32 @pcapack_colsums(i32 %0, i32 %1, double* nocapture readnone %2, double* nocapture readnone %3) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int print_message(const char *msg) {
  printf("A STRING: %s\n", msg);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"A STRING: %s\0A\00"
define i32 @print_message(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
/* Type definitions */
struct wire_packet {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mpool_packet_free(struct wire_packet *);
void wire_packet_free(struct wire_packet *P) { mpool_packet_free(P); }


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

x86 assembly (clang, -O2):
<wire_packet_free>:
jmp    1030 <mpool_packet_free@plt>

LLVM IR (-O0):
%struct.wire_packet = type { i32 }
define void @wire_packet_free(%struct.wire_packet* %0) {
%2 = alloca %struct.wire_packet*
store %struct.wire_packet* %0, %struct.wire_packet** %2
%3 = load %struct.wire_packet*, %struct.wire_packet** %2
%4 = call i32 @mpool_packet_free(%struct.wire_packet* %3)
ret void
}

LLVM IR (-O2):
%struct.wire_packet = type { i32 }
define void @wire_packet_free(%struct.wire_packet* %0) {
%2 = tail call i32 @mpool_packet_free(%struct.wire_packet* %0)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int onlyodds(uint32_t i) {
  for (; ((i % 10) & 1); i /= 10)
    ;
  return !i;
}


x86 assembly (clang, -O0):
<onlyodds>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
and    $0x1,%edx
cmp    $0x0,%edx
je     1136 <onlyodds+0x36>
jmp    1123 <onlyodds+0x23>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    1107 <onlyodds+0x7>
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<onlyodds>:
test   $0x1,%dil
je     112d <onlyodds+0x2d>
cs nopw 0x0(%rax,%rax,1)
movslq %edi,%rax
imul   $0x66666667,%rax,%rdi
mov    %rdi,%rax
shr    $0x3f,%rax
sar    $0x22,%rdi
add    %eax,%edi
test   $0x1,%dil
jne    1110 <onlyodds+0x10>
xor    %eax,%eax
test   %edi,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @onlyodds(i32 %0) {
%2 = srem i32 %0, 10
%3 = and i32 %2, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %11, label %5
5: ; preds = %1, %5
%6 = phi i32 [ %7, %5 ], [ %0, %1 ]
%7 = sdiv i32 %6, 10
%8 = srem i32 %7, 10
%9 = and i32 %8, 1
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %5
11: ; preds = %5, %1
%12 = phi i32 [ %0, %1 ], [ %7, %5 ]
%13 = icmp eq i32 %12, 0
%14 = zext i1 %13 to i32
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int /*<<< orphan*/ __infer_nondet_int();
uid_t getuid(void) { return __infer_nondet_int(); }


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

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

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

LLVM IR (-O2):
define i32 @getuid() {
%1 = tail call i32 (...) @__infer_nondet_int()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ lnm_control();
int /*<<< orphan*/ lnm_init();
scalar_t__ monitorFD_p(int);
int real_close(int);
int /*<<< orphan*/ stopFD(int);
int close(int d) {
  int rv;
  lnm_init();
  lnm_control();
  rv = real_close(d);
  if (!rv && monitorFD_p(d)) {
    ;
    stopFD(d);
  }
  return rv;
}


x86 assembly (clang, -O0):
<close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1060 <lnm_init@plt>
mov    $0x0,%al
call   1050 <lnm_control@plt>
mov    -0x4(%rbp),%edi
call   1070 <real_close@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1198 <close+0x48>
mov    -0x4(%rbp),%edi
call   1040 <monitorFD_p@plt>
cmp    $0x0,%rax
je     1198 <close+0x48>
mov    -0x4(%rbp),%edi
call   1030 <stopFD@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %eax,%eax
call   1060 <lnm_init@plt>
xor    %eax,%eax
call   1050 <lnm_control@plt>
mov    %ebx,%edi
call   1070 <real_close@plt>
mov    %eax,%ebp
test   %eax,%eax
jne    1183 <close+0x33>
mov    %ebx,%edi
call   1040 <monitorFD_p@plt>
test   %rax,%rax
je     1183 <close+0x33>
mov    %ebx,%edi
call   1030 <stopFD@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @lnm_init()
%5 = call i32 (...) @lnm_control()
%6 = load i32, i32* %2
%7 = call i32 @real_close(i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = icmp ne i32 %8, 0
br i1 %9, label %17, label %10
10: ; preds = %1
%11 = load i32, i32* %2
%12 = call i64 @monitorFD_p(i32 %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %10
%15 = load i32, i32* %2
%16 = call i32 @stopFD(i32 %15)
br label %17
17: ; preds = %14, %10, %1
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @close(i32 %0) {
%2 = tail call i32 (...) @lnm_init()
%3 = tail call i32 (...) @lnm_control()
%4 = tail call i32 @real_close(i32 %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = tail call i64 @monitorFD_p(i32 %0)
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = tail call i32 @stopFD(i32 %0)
br label %11
11: ; preds = %9, %6, %1
ret i32 %4
}
void XkbTranslateKeyCode() {}


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

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

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

LLVM IR (-O2):
define void @XkbTranslateKeyCode() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, char *);
void printfMapChar(char *nameChar, char *mapChar) {
  printf("%s = %s addr: %p\n\n", nameChar, mapChar, mapChar);
}


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

x86 assembly (clang, -O2):
<printfMapChar>:
mov    %rsi,%rcx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
mov    %rcx,%rdx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"%s = %s addr: %p\0A\0A\00"
define void @printfMapChar(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 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6, i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"%s = %s addr: %p\0A\0A\00"
define void @printfMapChar(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %1)
ret void
}