xunge/DecIR huggingface dataset:
int fib(int n) {
  if (n <= 0)
    return 0;
  else if (n == 1)
    return 1;
  else
    return fib(n - 1) + fib(n - 2);
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1131 <fib+0x21>
movl   $0x0,-0x4(%rbp)
jmp    116a <fib+0x5a>
cmpl   $0x1,-0x8(%rbp)
jne    1147 <fib+0x37>
movl   $0x1,-0x4(%rbp)
jmp    116a <fib+0x5a>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
jle    1140 <fib+0x30>
mov    %edi,%ebx
lea    -0x1(%rbx),%ebp
xor    %r14d,%r14d
test   %ebp,%ebp
je     1145 <fib+0x35>
lea    -0x1(%rbx),%edi
call   1030 <fib@plt>
lea    -0x2(%rbx),%ecx
add    %eax,%r14d
add    $0xfffffffe,%ebp
cmp    $0x2,%ebx
mov    %ecx,%ebx
ja     1120 <fib+0x10>
xor    %eax,%eax
jmp    114a <fib+0x3a>
xor    %r14d,%r14d
jmp    114d <fib+0x3d>
mov    $0x1,%eax
add    %eax,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %17, label %3
3: ; preds = %1, %7
%4 = phi i32 [ %10, %7 ], [ %0, %1 ]
%5 = phi i32 [ %11, %7 ], [ 0, %1 ]
%6 = icmp eq i32 %4, 1
br i1 %6, label %13, label %7
7: ; preds = %3
%8 = add nsw i32 %4, -1
%9 = tail call i32 @fib(i32 %8)
%10 = add nsw i32 %4, -2
%11 = add nsw i32 %9, %5
%12 = icmp ult i32 %4, 3
br i1 %12, label %13, label %3
13: ; preds = %3, %7
%14 = phi i32 [ %11, %7 ], [ %5, %3 ]
%15 = phi i32 [ 0, %7 ], [ 1, %3 ]
%16 = add nsw i32 %15, %14
br label %17
17: ; preds = %13, %1
%18 = phi i32 [ %16, %13 ], [ 0, %1 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ wifi_pm_gpio_ctrl(char *, int);
void sif_platform_target_speed(int high_speed) {
  wifi_pm_gpio_ctrl("esp_wl_rst", high_speed);
}


x86 assembly (clang, -O0):
<sif_platform_target_speed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <wifi_pm_gpio_ctrl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sif_platform_target_speed>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <wifi_pm_gpio_ctrl@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"esp_wl_rst\00"
define void @sif_platform_target_speed(i32 %0) {
%2 = tail call i32 @wifi_pm_gpio_ctrl(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int g(void (*p)(void)) { p(); }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
call   *-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
jmp    *%rdi

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

LLVM IR (-O2):
define i32 @g(void ()* nocapture %0) {
tail call void %0()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void list_free_aux(void *x, void *pfreelist) {
  void **px = x;
  void **pfree = pfreelist;
  assert(x != NULL);
  assert(pfreelist != NULL);
  ;
  *px = *pfree;
  *pfree = px;
  ;
  return;
}


x86 assembly (clang, -O0):
<list_free_aux>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_free_aux>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
xor    %edi,%edi
test   %r14,%r14
setne  %dil
call   1030 <assert@plt>
mov    (%r14),%rax
mov    %rax,(%rbx)
mov    %rbx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @list_free_aux(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
store i8** %8, i8*** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i8**
store i8** %10, i8*** %6
%11 = load i8*, i8** %3
%12 = icmp ne i8* %11, null
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i8*, i8** %4
%16 = icmp ne i8* %15, null
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
%19 = load i8**, i8*** %6
%20 = load i8*, i8** %19
%21 = load i8**, i8*** %5
store i8* %20, i8** %21
%22 = load i8**, i8*** %5
%23 = bitcast i8** %22 to i8*
%24 = load i8**, i8*** %6
store i8* %23, i8** %24
ret void
}

LLVM IR (-O2):
define void @list_free_aux(i8* %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
%4 = bitcast i8* %1 to i8**
%5 = icmp ne i8* %0, null
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = icmp ne i8* %1, null
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
%11 = load i8*, i8** %4
store i8* %11, i8** %3
store i8* %0, i8** %4
ret void
}
void BN_to_ASN1_ENUMERATED(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define i32 @av_reset() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ f1(int);
int main(void) { f1(25); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x19,%edi
call   1030 <f1@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @f1(i32 25)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f1(i32 25)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ OOPS(char *);
int /*<<< orphan*/ PTRACE_TRACEME;
scalar_t__ ptrace(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/ *,
                  int /*<<< orphan*/ *);
void ptrace__traceme(void) {
  if (ptrace(PTRACE_TRACEME, 0, NULL, NULL))
    OOPS("ptrace(PTRACE_TRACEME)");
}


x86 assembly (clang, -O0):
<ptrace__traceme>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rdx
call   1040 <ptrace@plt>
cmp    $0x0,%rax
je     1151 <ptrace__traceme+0x31>
lea    0xeb4(%rip),%rdi
call   1030 <OOPS@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptrace__traceme>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1040 <ptrace@plt>
test   %rax,%rax
je     1147 <ptrace__traceme+0x27>
lea    0xebf(%rip),%rdi
pop    %rax
jmp    1030 <OOPS@plt>
pop    %rax
ret

LLVM IR (-O0):
@PTRACE_TRACEME = global i32 0
@.str = [23 x i8] c"ptrace(PTRACE_TRACEME)\00"
define void @ptrace__traceme() {
%1 = load i32, i32* @PTRACE_TRACEME
%2 = call i64 @ptrace(i32 %1, i32 0, i32* null, i32* null)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @OOPS(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
ret void
}

LLVM IR (-O2):
@PTRACE_TRACEME = global i32 0
@.str = [23 x i8] c"ptrace(PTRACE_TRACEME)\00"
define void @ptrace__traceme() {
%1 = load i32, i32* @PTRACE_TRACEME
%2 = tail call i64 @ptrace(i32 %1, i32 0, i32* null, i32* null)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @OOPS(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
ret void
}
/* Type definitions */
struct __test_metadata {
  int dummy;
};
struct __fixture_variant_metadata {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ epoll3(struct __test_metadata *);
void wrapper_epoll3(struct __test_metadata *_metadata,
                    struct __fixture_variant_metadata *variant) {
  epoll3(_metadata);
}


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

x86 assembly (clang, -O2):
<wrapper_epoll3>:
jmp    1030 <epoll3@plt>

LLVM IR (-O0):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_epoll3(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* %1) {
%3 = alloca %struct.__test_metadata*
%4 = alloca %struct.__fixture_variant_metadata*
store %struct.__test_metadata* %0, %struct.__test_metadata** %3
store %struct.__fixture_variant_metadata* %1, %struct.__fixture_variant_metadata** %4
%5 = load %struct.__test_metadata*, %struct.__test_metadata** %3
%6 = call i32 @epoll3(%struct.__test_metadata* %5)
ret void
}

LLVM IR (-O2):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_epoll3(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* nocapture readnone %1) {
%3 = tail call i32 @epoll3(%struct.__test_metadata* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print(int);
int /*<<< orphan*/ printf(char *);
void main() {
  printf("Printing Numbers 1 to 100\n");
  print(100);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x64,%edi
call   1040 <print@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x64,%edi
pop    %rax
jmp    1040 <print@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Printing Numbers 1 to 100\0A\00"
define void @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @print(i32 100)
ret void
}

LLVM IR (-O2):
@str = [26 x i8] c"Printing Numbers 1 to 100\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @print(i32 100)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int, int);
void i830_debug_xy(char *result, int len, int reg, uint32_t val,
                   uint32_t devid) {
  snprintf(result, len, "%d, %d", (val & 0xffff), ((val & 0xffff0000) >> 16));
}


x86 assembly (clang, -O0):
<i830_debug_xy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%ecx
and    $0xffff,%ecx
mov    -0x14(%rbp),%r8d
and    $0xffff0000,%r8d
shr    $0x10,%r8d
lea    0xeb1(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i830_debug_xy>:
mov    %ecx,%r8d
movzwl %r8w,%ecx
shr    $0x10,%r8d
lea    0xede(%rip),%rdx
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%d, %d\00"
define void @i830_debug_xy(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %9
%14 = and i32 %13, 65535
%15 = load i32, i32* %9
%16 = and i32 %15, -65536
%17 = lshr i32 %16, 16
%18 = call i32 @snprintf(i8* %11, i32 %12, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %17)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d, %d\00"
define void @i830_debug_xy(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = and i32 %3, 65535
%7 = lshr i32 %3, 16
%8 = tail call i32 @snprintf(i8* %0, i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ntohl(int /*<<< orphan*/);
uint32_t minipack_unpack_map32(void *ptr, size_t *sz) {
  *sz = 5;
  return ntohl(*((uint32_t *)(ptr + 1)));
}


x86 assembly (clang, -O0):
<minipack_unpack_map32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movq   $0x5,(%rax)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%edi
call   1030 <ntohl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<minipack_unpack_map32>:
movq   $0x5,(%rsi)
mov    0x1(%rdi),%edi
jmp    1030 <ntohl@plt>

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

LLVM IR (-O2):
define i32 @minipack_unpack_map32(i8* nocapture %0, i64* nocapture writeonly %1) {
store i64 5, i64* %1
%3 = getelementptr i8, i8* %0, i64 1
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = tail call i32 @ntohl(i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ executeApplescriptAsync(char *, char *);
void previousSong() { executeApplescriptAsync("iTunes", "back track"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"iTunes\00"
@.str.1 = [11 x i8] c"back track\00"
define void @previousSong() {
%1 = call i32 @executeApplescriptAsync(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"iTunes\00"
@.str.1 = [11 x i8] c"back track\00"
define void @previousSong() {
%1 = tail call i32 @executeApplescriptAsync(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int check_mark2prio(const struct xt_tgchk_param *par) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.xt_tgchk_param = type opaque
define i32 @check_mark2prio(%struct.xt_tgchk_param* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
struct vec2 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vec2_round(float *, float *);
__attribute__((always_)) struct vec2 *psvec2_round(struct vec2 *result,
                                                   struct vec2 *a) {
  vec2_round((float *)result, (float *)a);
  return result;
}


x86 assembly (clang, -O0):
<psvec2_round>:
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 <vec2_round@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psvec2_round>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec2_round@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec2 = type { i32 }
define %struct.vec2* @psvec2_round(%struct.vec2* %0, %struct.vec2* %1) {
%3 = alloca %struct.vec2*
%4 = alloca %struct.vec2*
store %struct.vec2* %0, %struct.vec2** %3
store %struct.vec2* %1, %struct.vec2** %4
%5 = load %struct.vec2*, %struct.vec2** %3
%6 = bitcast %struct.vec2* %5 to float*
%7 = load %struct.vec2*, %struct.vec2** %4
%8 = bitcast %struct.vec2* %7 to float*
%9 = call i32 @vec2_round(float* %6, float* %8)
%10 = load %struct.vec2*, %struct.vec2** %3
ret %struct.vec2* %10
}

LLVM IR (-O2):
%struct.vec2 = type { i32 }
define %struct.vec2* @psvec2_round(%struct.vec2* returned %0, %struct.vec2* %1) {
%3 = bitcast %struct.vec2* %0 to float*
%4 = bitcast %struct.vec2* %1 to float*
%5 = tail call i32 @vec2_round(float* %3, float* %4)
ret %struct.vec2* %0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void ha7net_readpages_free(char *data) {
  if (data)
    free(data);
}


x86 assembly (clang, -O0):
<ha7net_readpages_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <ha7net_readpages_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ha7net_readpages_free>:
test   %rdi,%rdi
je     111a <ha7net_readpages_free+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @ha7net_readpages_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @ha7net_readpages_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int rand();
int agt_rand(int a, int b) {
  int n;
  n = a + (rand() >> 2) % (b - a + 1);
  return n;
}


x86 assembly (clang, -O0):
<agt_rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
sar    $0x2,%eax
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%eax
add    %edx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<agt_rand>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sar    $0x2,%eax
sub    %ebp,%ebx
add    $0x1,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @agt_rand(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = call i32 (...) @rand()
%8 = ashr i32 %7, 2
%9 = load i32, i32* %4
%10 = load i32, i32* %3
%11 = sub nsw i32 %9, %10
%12 = add nsw i32 %11, 1
%13 = srem i32 %8, %12
%14 = add nsw i32 %6, %13
store i32 %14, i32* %5
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
define i32 @agt_rand(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = ashr i32 %3, 2
%5 = sub i32 1, %0
%6 = add i32 %5, %1
%7 = srem i32 %4, %6
%8 = add nsw i32 %7, %0
ret i32 %8
}
char *skip_space(char *str) {
  while (*str == ' ' || *str == '\t') {
    str++;
  }
  return str;
}


x86 assembly (clang, -O0):
<skip_space>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x9(%rbp)
je     112d <skip_space+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113d <skip_space+0x3d>
jmp    114e <skip_space+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <skip_space+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_space>:
mov    %rdi,%rax
jmp    1114 <skip_space+0x14>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rax
movzbl (%rax),%ecx
cmp    $0x20,%cl
je     1110 <skip_space+0x10>
cmp    $0x9,%cl
je     1110 <skip_space+0x10>
ret

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

LLVM IR (-O2):
define i8* @skip_space(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 32, label %5
i8 9, label %5
]
5: ; preds = %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
ret i8* %3
}
void nseel_asm_uplus(void) { __asm__(""); }


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

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

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

LLVM IR (-O2):
define void @nseel_asm_uplus() {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
scalar_t__ calloc(int, long);
int /*<<< orphan*/ memerror();
int /*<<< orphan*/ odd_malloc(long);
void *mymalloc(long x) {
  void *new_block;
  if ((x <= 0) || (x > 1000000000))
    odd_malloc(x);
  new_block = (void *)calloc(1, x);
  if (!new_block) {
    memerror();
    return (void *)new_block;
  } else
    return (void *)new_block;
}


x86 assembly (clang, -O0):
<mymalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jle    1155 <mymalloc+0x25>
cmpq   $0x3b9aca00,-0x10(%rbp)
3b
jle    115e <mymalloc+0x2e>
mov    -0x10(%rbp),%rdi
call   1050 <odd_malloc@plt>
mov    -0x10(%rbp),%rsi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    118f <mymalloc+0x5f>
mov    $0x0,%al
call   1040 <memerror@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1197 <mymalloc+0x67>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mymalloc>:
push   %rbx
mov    %rdi,%rbx
lea    -0x3b9aca01(%rdi),%rax
cmp    $0xffffffffc46535ff,%rax
ja     114b <mymalloc+0x1b>
mov    %rbx,%rdi
call   1050 <odd_malloc@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1167 <mymalloc+0x37>
xor    %eax,%eax
call   1040 <memerror@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @mymalloc(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = icmp sle i64 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = load i64, i64* %3
%9 = icmp sgt i64 %8, 1000000000
br i1 %9, label %10, label %13
10: ; preds = %7, %1
%11 = load i64, i64* %3
%12 = call i32 @odd_malloc(i64 %11)
br label %13
13: ; preds = %10, %7
%14 = load i64, i64* %3
%15 = call i64 @calloc(i32 1, i64 %14)
%16 = inttoptr i64 %15 to i8*
store i8* %16, i8** %4
%17 = load i8*, i8** %4
%18 = icmp ne i8* %17, null
br i1 %18, label %22, label %19
19: ; preds = %13
%20 = call i32 (...) @memerror()
%21 = load i8*, i8** %4
store i8* %21, i8** %2
br label %24
22: ; preds = %13
%23 = load i8*, i8** %4
store i8* %23, i8** %2
br label %24
24: ; preds = %22, %19
%25 = load i8*, i8** %2
ret i8* %25
}

LLVM IR (-O2):
define i8* @mymalloc(i64 %0) {
%2 = add i64 %0, -1000000001
%3 = icmp ult i64 %2, -1000000000
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @odd_malloc(i64 %0)
br label %6
6: ; preds = %1, %4
%7 = tail call i64 @calloc(i32 1, i64 %0)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = tail call i32 (...) @memerror()
br label %11
11: ; preds = %6, %9
%12 = inttoptr i64 %7 to i8*
ret i8* %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void print_result(double *a) { printf("%lf\n", *a); }


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

x86 assembly (clang, -O2):
<print_result>:
movsd  (%rdi),%xmm0
lea    0xee5(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%lf\0A\00"
define void @print_result(double* nocapture %0) {
%2 = load double, double* %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %2)
ret void
}
void FS_FreeFile(void *buffer) {
  extern unsigned char fact3_data[];
  if (buffer == fact3_data) {
    return;
  }
  Z_Free(buffer);
}


x86 assembly (clang, -O0):
<FS_FreeFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
cmp    %rax,-0x8(%rbp)
jne    1132 <FS_FreeFile+0x22>
jmp    113d <FS_FreeFile+0x2d>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <Z_Free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FS_FreeFile>:
cmp    0x2ec9(%rip),%rdi
je     1120 <FS_FreeFile+0x10>
xor    %eax,%eax
jmp    1030 <Z_Free@plt>
ret

LLVM IR (-O0):
@fact3_data = external global [0 x i8]
define void @FS_FreeFile(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, getelementptr inbounds ([0 x i8], [0 x i8]* @fact3_data, i64 0, i64 0)
br i1 %4, label %5, label %6
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @Z_Free to i32 (i8*, ...)*)(i8* %7)
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
@fact3_data = external global [0 x i8]
define void @FS_FreeFile(i8* %0) {
%2 = icmp eq i8* %0, getelementptr inbounds ([0 x i8], [0 x i8]* @fact3_data, i64 0, i64 0)
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @Z_Free to i32 (i8*, ...)*)(i8* %0)
br label %5
5: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SYS_pivot_root;
scalar_t__ syscall(int /*<<< orphan*/, char const *, char const *);
int /*<<< orphan*/ xerror(char *);
void xpivot_root(const char *new_root, const char *put_old) {
  if (syscall(SYS_pivot_root, new_root, put_old) < 0)
    xerror("pivot_root");
}


x86 assembly (clang, -O0):
<xpivot_root>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <syscall@plt>
cmp    $0x0,%rax
jge    115c <xpivot_root+0x3c>
lea    0xea9(%rip),%rdi
call   1030 <xerror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xpivot_root>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
call   1040 <syscall@plt>
test   %rax,%rax
js     113c <xpivot_root+0x1c>
pop    %rax
ret
lea    0xebd(%rip),%rdi
pop    %rax
jmp    1030 <xerror@plt>

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

LLVM IR (-O2):
@SYS_pivot_root = global i32 0
@.str = [11 x i8] c"pivot_root\00"
define void @xpivot_root(i8* %0, i8* %1) {
%3 = load i32, i32* @SYS_pivot_root
%4 = tail call i64 @syscall(i32 %3, i8* %0, i8* %1)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @xerror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
ret void
}
/* Variables and functions */
scalar_t__ linux_overcommit_memory_value();
int /*<<< orphan*/ warning(char *);
void linux_overcommit_memory_warning(void) {
  if (linux_overcommit_memory_value() == 0) {
    warning("Please, for correct work set the overcommit memory value to 1. "
            "Run the command 'sysctl vm.overcommit_memory=1'.");
  }
}


x86 assembly (clang, -O0):
<linux_overcommit_memory_warning>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <linux_overcommit_memory_value@plt>
cmp    $0x0,%rax
jne    1141 <linux_overcommit_memory_warning+0x21>
lea    0xec4(%rip),%rdi
call   1030 <warning@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<linux_overcommit_memory_warning>:
push   %rax
xor    %eax,%eax
call   1040 <linux_overcommit_memory_value@plt>
test   %rax,%rax
je     112f <linux_overcommit_memory_warning+0xf>
pop    %rax
ret
lea    0xeca(%rip),%rdi
pop    %rax
jmp    1030 <warning@plt>

LLVM IR (-O0):
@.str = [112 x i8] c"Please, for correct work set the overcommit memory value to 1. Run the command 'sysctl vm.overcommit_memory=1'.\00"
define void @linux_overcommit_memory_warning() {
%1 = call i64 (...) @linux_overcommit_memory_value()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @warning(i8* getelementptr inbounds ([112 x i8], [112 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
@.str = [112 x i8] c"Please, for correct work set the overcommit memory value to 1. Run the command 'sysctl vm.overcommit_memory=1'.\00"
define void @linux_overcommit_memory_warning() {
%1 = tail call i64 (...) @linux_overcommit_memory_value()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @warning(i8* getelementptr inbounds ([112 x i8], [112 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret void
}
void McASPPinGPIOSet(unsigned int baseAddr, unsigned int pinMask) {
  (*((volatile unsigned int *)(baseAddr + (0x10)))) |= pinMask;
}


x86 assembly (clang, -O0):
<McASPPinGPIOSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edx
mov    -0x4(%rbp),%eax
add    $0x10,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<McASPPinGPIOSet>:
add    $0x10,%edi
or     %esi,(%rdi)
ret

LLVM IR (-O0):
define void @McASPPinGPIOSet(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = add i32 %6, 16
%8 = zext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
%10 = load volatile i32, i32* %9
%11 = or i32 %10, %5
store volatile i32 %11, i32* %9
ret void
}

LLVM IR (-O2):
define void @McASPPinGPIOSet(i32 %0, i32 %1) {
%3 = add i32 %0, 16
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = or i32 %6, %1
store volatile i32 %7, i32* %5
ret void
}
void c_pomp_master_end_(struct ompregdescr *r) { (void)0; }


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

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

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

LLVM IR (-O2):
%struct.ompregdescr = type opaque
define void @c_pomp_master_end_(%struct.ompregdescr* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ output(int, int /*<<< orphan*/);
void right_stop() {
  output(25, 0);
  output(24, 0);
}


x86 assembly (clang, -O0):
<right_stop>:
push   %rbp
mov    %rsp,%rbp
mov    $0x19,%edi
xor    %esi,%esi
call   1030 <output@plt>
mov    $0x18,%edi
xor    %esi,%esi
call   1030 <output@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<right_stop>:
push   %rax
mov    $0x19,%edi
xor    %esi,%esi
call   1030 <output@plt>
mov    $0x18,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <output@plt>

LLVM IR (-O0):
define void @right_stop() {
%1 = call i32 @output(i32 25, i32 0)
%2 = call i32 @output(i32 24, i32 0)
ret void
}

LLVM IR (-O2):
define void @right_stop() {
%1 = tail call i32 @output(i32 25, i32 0)
%2 = tail call i32 @output(i32 24, i32 0)
ret void
}
/* Variables and functions */
size_t min_sz(size_t x, size_t y) { return x < y ? x : y; }


x86 assembly (clang, -O0):
<min_sz>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1127 <min_sz+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <min_sz+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min_sz>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovb  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @min_sz(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 = icmp ult i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @min_sz(i64 %0, i64 %1) {
%3 = icmp ult i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
int test_tmax(void) { return 0x7FFFFFFF; }


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

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

LLVM IR (-O0):
define i32 @test_tmax() {
ret i32 2147483647
}

LLVM IR (-O2):
define i32 @test_tmax() {
ret i32 2147483647
}
int sort_double(const double *a1, const double *a2) {
  if (*a1 < *a2)
    return (-1);
  if (*a1 > *a2)
    return (1);
  return 0;
}


x86 assembly (clang, -O0):
<sort_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1132 <sort_double+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    115b <sort_double+0x5b>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    1154 <sort_double+0x54>
movl   $0x1,-0x4(%rbp)
jmp    115b <sort_double+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort_double>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @sort_double(double* %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
%6 = load double*, double** %4
%7 = load double, double* %6
%8 = load double*, double** %5
%9 = load double, double* %8
%10 = fcmp olt double %7, %9
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 -1, i32* %3
br label %20
12: ; preds = %2
%13 = load double*, double** %4
%14 = load double, double* %13
%15 = load double*, double** %5
%16 = load double, double* %15
%17 = fcmp ogt double %14, %16
br i1 %17, label %18, label %19
18: ; preds = %12
store i32 1, i32* %3
br label %20
19: ; preds = %12
store i32 0, i32* %3
br label %20
20: ; preds = %19, %18, %11
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @sort_double(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = fcmp olt double %3, %4
%6 = fcmp ogt double %3, %4
%7 = zext i1 %6 to i32
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
void g_object_watch_closure() {}


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

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

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

LLVM IR (-O2):
define void @g_object_watch_closure() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ name;

/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ reverse_name(char *);
int /*<<< orphan*/ stdin;
int main(void) {
  char name[80];
  printf("Enter your first and last name: ");
  fgets(name, sizeof(name), stdin);
  reverse_name(name);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    -0x60(%rbp),%rdi
mov    0x2e92(%rip),%rax
mov    (%rax),%edx
mov    $0x50,%esi
call   1040 <fgets@plt>
lea    -0x60(%rbp),%rdi
call   1050 <reverse_name@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1040 <fgets@plt>
mov    %rbx,%rdi
call   1050 <reverse_name@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Enter your first and last name: \00"
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [80 x i8]
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%5 = load i32, i32* @stdin
%6 = call i32 @fgets(i8* %4, i32 80, i32 %5)
%7 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%8 = call i32 @reverse_name(i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"Enter your first and last name: \00"
@stdin = global i32 0
define i32 @main() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %2, i32 80, i32 %4)
%6 = call i32 @reverse_name(i8* %2)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void TimerLoadSet(uint32_t ui32Base, uint32_t ui32Timer, uint32_t ui32Value) {
  ;

  ;
  if (ui32Timer & 0x000000ff) {
    (*((volatile uint32_t *)(ui32Base + 0x00000028))) = ui32Value;
  }
  if (ui32Timer & 0x0000ff00) {
    (*((volatile uint32_t *)(ui32Base + 0x0000002C))) = ui32Value;
  }
}


x86 assembly (clang, -O0):
<TimerLoadSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff,%eax
cmp    $0x0,%eax
je     112b <TimerLoadSet+0x2b>
mov    -0xc(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x28,%eax
cltq
mov    %ecx,(%rax)
mov    -0x8(%rbp),%eax
and    $0xff00,%eax
cmp    $0x0,%eax
je     1149 <TimerLoadSet+0x49>
mov    -0xc(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x2c,%eax
cltq
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerLoadSet>:
movslq %edi,%rax
test   %sil,%sil
je     110b <TimerLoadSet+0xb>
mov    %edx,0x28(%rax)
test   $0xff00,%esi
je     1116 <TimerLoadSet+0x16>
mov    %edx,0x2c(%rax)
ret

LLVM IR (-O0):
define void @TimerLoadSet(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = and i32 %7, 255
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %3
%11 = load i32, i32* %6
%12 = load i32, i32* %4
%13 = add nsw i32 %12, 40
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i32*
store volatile i32 %11, i32* %15
br label %16
16: ; preds = %10, %3
%17 = load i32, i32* %5
%18 = and i32 %17, 65280
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %26
20: ; preds = %16
%21 = load i32, i32* %6
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 44
%24 = sext i32 %23 to i64
%25 = inttoptr i64 %24 to i32*
store volatile i32 %21, i32* %25
br label %26
26: ; preds = %20, %16
ret void
}

LLVM IR (-O2):
define void @TimerLoadSet(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %1, 255
%5 = icmp eq i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = add nsw i32 %0, 40
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store volatile i32 %2, i32* %9
br label %10
10: ; preds = %6, %3
%11 = and i32 %1, 65280
%12 = icmp eq i32 %11, 0
br i1 %12, label %17, label %13
13: ; preds = %10
%14 = add nsw i32 %0, 44
%15 = sext i32 %14 to i64
%16 = inttoptr i64 %15 to i32*
store volatile i32 %2, i32* %16
br label %17
17: ; preds = %13, %10
ret void
}
void a_store_l(volatile void *p, long x) {
  __asm__("mov %1, %0" : "=m"(*(long *)p) : "r"(x) : "memory");
}


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

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

LLVM IR (-O0):
define void @a_store_l(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i64*
%7 = load i64, i64* %4
ret void
}

LLVM IR (-O2):
define void @a_store_l(i8* %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
tail call void asm "mov $1, $0", "=*m,r,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %3, i64 %1)
ret void
}
/* Type definitions */
struct in_addr {
  int /*<<< orphan*/ s_addr;
};

/* Variables and functions */
char const *inet_ntoa(struct in_addr);
int /*<<< orphan*/ ntohl(unsigned int);
const char *get_ipv4_addr(unsigned int addr) {
  struct in_addr a;
  a.s_addr = ntohl(addr);
  return inet_ntoa(a);
}


x86 assembly (clang, -O0):
<get_ipv4_addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <ntohl@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <inet_ntoa@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_ipv4_addr>:
push   %rax
call   1040 <ntohl@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <inet_ntoa@plt>

LLVM IR (-O0):
%struct.in_addr = type { i32 }
define i8* @get_ipv4_addr(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.in_addr
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @ntohl(i32 %4)
%6 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %3, i32 0, i32 0
store i32 %5, i32* %6
%7 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %3, i32 0, i32 0
%8 = load i32, i32* %7
%9 = call i8* @inet_ntoa(i32 %8)
ret i8* %9
}

LLVM IR (-O2):
define i8* @get_ipv4_addr(i32 %0) {
%2 = tail call i32 @ntohl(i32 %0)
%3 = tail call i8* @inet_ntoa(i32 %2)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ f3();
int main(void) {
  f3();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f3()
ret i32 0
}
void forStmtGoto() {
  int i, x;
  goto l;
  for (i = 0; i < 10; ++i) {
  l:
    x++;
  }
}


x86 assembly (clang, -O0):
<forStmtGoto>:
push   %rbp
mov    %rsp,%rbp
jmp    1118 <forStmtGoto+0x18>
cmpl   $0xa,-0x4(%rbp)
jge    112f <forStmtGoto+0x2f>
jmp    1118 <forStmtGoto+0x18>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1109 <forStmtGoto+0x9>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @forStmtGoto() {
%1 = alloca i32
%2 = alloca i32
br label %8
3: ; No predecessors!
store i32 0, i32* %1
br label %4
4: ; preds = %11, %3
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %14
7: ; preds = %4
br label %8
8: ; preds = %7, %0
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %11
11: ; preds = %8
%12 = load i32, i32* %1
%13 = add nsw i32 %12, 1
store i32 %13, i32* %1
br label %4
14: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @forStmtGoto() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ call_function();
int main() {
  call_function();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @call_function()
ret i32 0
}
int get_penalty(int a, int b) {
  int p = 0;
  while (a > b) {
    a >>= 3;
    ++p;
  }
  return p;
}


x86 assembly (clang, -O0):
<get_penalty>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1134 <get_penalty+0x34>
mov    -0x4(%rbp),%eax
sar    $0x3,%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <get_penalty+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_penalty>:
xor    %eax,%eax
cmp    %esi,%edi
jle    111a <get_penalty+0x1a>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
sar    $0x3,%edi
add    $0x1,%eax
cmp    %esi,%edi
jg     1110 <get_penalty+0x10>
ret

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

LLVM IR (-O2):
define i32 @get_penalty(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
br i1 %3, label %4, label %10
4: ; preds = %2, %4
%5 = phi i32 [ %8, %4 ], [ 0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %0, %2 ]
%7 = ashr i32 %6, 3
%8 = add nuw nsw i32 %5, 1
%9 = icmp sgt i32 %7, %1
br i1 %9, label %4, label %10
10: ; preds = %4, %2
%11 = phi i32 [ 0, %2 ], [ %8, %4 ]
ret i32 %11
}