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

/* Type definitions */
struct TYPE_3__ {
  unsigned long window;
};
struct TYPE_4__ {
  TYPE_1__ xdestroywindow;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xdestroywindow_window(void *_p, unsigned long _v) {
  ((XEvent *)_p)->xdestroywindow.window = (unsigned long)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define void @set_XEvent_xdestroywindow_window(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
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i64 %5, i64* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xdestroywindow_window(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void fb(char *optarg) { printf("s: %s\n", optarg); }


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

x86 assembly (clang, -O2):
<fb>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"s: %s\0A\00"
define void @fb(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int sortByWeight(void const *, void const *, int);
int _sortByWeight1(const void *a, const void *b) {
  return sortByWeight(a, b, 1);
}


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

x86 assembly (clang, -O2):
<_sortByWeight1>:
mov    $0x1,%edx
jmp    1030 <sortByWeight@plt>

LLVM IR (-O0):
define i32 @_sortByWeight1(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 = call i32 @sortByWeight(i8* %5, i8* %6, i32 1)
ret i32 %7
}

LLVM IR (-O2):
define i32 @_sortByWeight1(i8* %0, i8* %1) {
%3 = tail call i32 @sortByWeight(i8* %0, i8* %1, i32 1)
ret i32 %3
}
void muon_neutrino(void) {}


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

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

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

LLVM IR (-O2):
define void @muon_neutrino() {
ret void
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
size_t strnlen(char const *, size_t);
char *strndup(const char *s, size_t n) {
  size_t len = strnlen(s, n);
  char *new;
  new = malloc(len + 1);
  if (new) {
    new[len] = '\0';
    memcpy(new, s, len);
  }
  return new;
}


x86 assembly (clang, -O0):
<strndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strnlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     118a <strndup+0x5a>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strndup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strnlen@plt>
mov    %rax,%r15
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1164 <strndup+0x34>
movb   $0x0,(%rbx,%r15,1)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @strndup(i8* %0, i64 %1) {
%3 = tail call i64 @strnlen(i8* %0, i64 %1)
%4 = add i64 %3, 1
%5 = tail call i8* @malloc(i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = getelementptr inbounds i8, i8* %5, i64 %3
store i8 0, i8* %8
%9 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %3)
br label %10
10: ; preds = %7, %2
ret i8* %5
}
void test_mail_send() {}


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

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

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

LLVM IR (-O2):
define void @test_mail_send() {
ret void
}
int cairo_code_draw_hip2bg_get_height() { return 400; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_hip2bg_get_height() {
ret i32 400
}

LLVM IR (-O2):
define i32 @cairo_code_draw_hip2bg_get_height() {
ret i32 400
}
/* Variables and functions */
scalar_t__ gc_alloc(int, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
char *dynamic_strcpy(char *str) {
  char *tmp = (char *)gc_alloc(sizeof(char) * (strlen(str) + 1),
                               "hash.c:dynamic_strcpy");
  strcpy(tmp, str);
  return tmp;
}


x86 assembly (clang, -O0):
<dynamic_strcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
lea    0xea9(%rip),%rsi
call   1050 <gc_alloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [22 x i8] c"hash.c:dynamic_strcpy\00"
define i8* @dynamic_strcpy(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = add nsw i32 %5, 1
%7 = sext i32 %6 to i64
%8 = mul i64 1, %7
%9 = trunc i64 %8 to i32
%10 = call i64 @gc_alloc(i32 %9, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %3
%12 = load i8*, i8** %3
%13 = load i8*, i8** %2
%14 = call i32 @strcpy(i8* %12, i8* %13)
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@.str = [22 x i8] c"hash.c:dynamic_strcpy\00"
define i8* @dynamic_strcpy(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i64 @gc_alloc(i32 %3, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strcpy(i8* %5, i8* %0)
ret i8* %5
}
/* Variables and functions */
int dialog_msgbox(char const *, char *, int /*<<< orphan*/, int /*<<< orphan*/,
                  int);
int /*<<< orphan*/ numeric_arg(char **, int);
int call_msgbox(const char *t, char *av[], int *offset_add) {
  *offset_add = 4;
  return dialog_msgbox(t, av[1], numeric_arg(av, 2), numeric_arg(av, 3), 1);
}


x86 assembly (clang, -O0):
<call_msgbox>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x4,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2,%esi
call   1040 <numeric_arg@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x3,%esi
call   1040 <numeric_arg@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    %eax,%ecx
mov    $0x1,%r8d
call   1030 <dialog_msgbox@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_msgbox>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
movl   $0x4,(%rdx)
mov    0x8(%rsi),%r15
mov    %rsi,%rdi
mov    $0x2,%esi
call   1040 <numeric_arg@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    $0x3,%esi
call   1040 <numeric_arg@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %ebp,%edx
mov    %eax,%ecx
mov    $0x1,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <dialog_msgbox@plt>

LLVM IR (-O0):
define i32 @call_msgbox(i8* %0, i8** %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i32*
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %6
store i32 4, i32* %7
%8 = load i8*, i8** %4
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = load i8**, i8*** %5
%13 = call i32 @numeric_arg(i8** %12, i32 2)
%14 = load i8**, i8*** %5
%15 = call i32 @numeric_arg(i8** %14, i32 3)
%16 = call i32 @dialog_msgbox(i8* %8, i8* %11, i32 %13, i32 %15, i32 1)
ret i32 %16
}

LLVM IR (-O2):
define i32 @call_msgbox(i8* %0, i8** %1, i32* nocapture writeonly %2) {
store i32 4, i32* %2
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = tail call i32 @numeric_arg(i8** %1, i32 2)
%7 = tail call i32 @numeric_arg(i8** %1, i32 3)
%8 = tail call i32 @dialog_msgbox(i8* %0, i8* %5, i32 %6, i32 %7, i32 1)
ret i32 %8
}
void ieee80211_debugfs_key_update_default(struct ieee80211_sub_if_data *sdata) {
}


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

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

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

LLVM IR (-O2):
%struct.ieee80211_sub_if_data = type opaque
define void @ieee80211_debugfs_key_update_default(%struct.ieee80211_sub_if_data* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int div2(int a, int b) {
  if (b != 0) {
    return a / b;
  } else {
    printf("error!\n");
    return 1;
  }
}


x86 assembly (clang, -O0):
<div2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1137 <div2+0x27>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x4(%rbp)
jmp    114a <div2+0x3a>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<div2>:
test   %esi,%esi
je     111a <div2+0xa>
mov    %edi,%eax
cltd
idiv   %esi
ret
push   %rax
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
@str = [7 x i8] c"error!\00"
define i32 @div2(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = sdiv i32 %0, %1
br label %8
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ %5, %4 ], [ 1, %6 ]
ret i32 %9
}
/* Variables and functions */
char *inputString(char);
char *inputLine() { return inputString('\n'); }


x86 assembly (clang, -O0):
<inputLine>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1030 <inputString@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<inputLine>:
mov    $0xa,%edi
jmp    1030 <inputString@plt>

LLVM IR (-O0):
define i8* @inputLine() {
%1 = call i8* @inputString(i8 signext 10)
ret i8* %1
}

LLVM IR (-O2):
define i8* @inputLine() {
%1 = tail call i8* @inputString(i8 signext 10)
ret i8* %1
}
long CDRstop(void) { return 0; }


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

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

LLVM IR (-O0):
define i64 @CDRstop() {
ret i64 0
}

LLVM IR (-O2):
define i64 @CDRstop() {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ assem_debug(char *);
int /*<<< orphan*/ output_byte(int);
void emit_cdq(void) {
  assem_debug("cdq");
  output_byte(0x99);
}


x86 assembly (clang, -O0):
<emit_cdq>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <assem_debug@plt>
mov    $0x99,%edi
call   1040 <output_byte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_cdq>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <assem_debug@plt>
mov    $0x99,%edi
pop    %rax
jmp    1040 <output_byte@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"cdq\00"
define void @emit_cdq() {
%1 = call i32 @assem_debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @output_byte(i32 153)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"cdq\00"
define void @emit_cdq() {
%1 = tail call i32 @assem_debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @output_byte(i32 153)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ stdout;
void set_color(int color) {
  printf("\033[%d;1m", color);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<set_color>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_color>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"\1B[%d;1m\00"
@stdout = global i32 0
define void @set_color(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @stdout
%6 = call i32 @fflush(i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"\1B[%d;1m\00"
@stdout = global i32 0
define void @set_color(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ boolTerm();
int /*<<< orphan*/ emitln(char *);
int /*<<< orphan*/ match(char);
void boolXor() {
  match('~');
  boolTerm();
  emitln("pop\t%%ebx");
  emitln("xor\t%%ebx,%%eax");
}


x86 assembly (clang, -O0):
<boolXor>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7e,%edi
call   1040 <match@plt>
mov    $0x0,%al
call   1050 <boolTerm@plt>
lea    0xeb4(%rip),%rdi
call   1030 <emitln@plt>
lea    0xeb2(%rip),%rdi
call   1030 <emitln@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<boolXor>:
push   %rax
mov    $0x7e,%edi
call   1040 <match@plt>
xor    %eax,%eax
call   1050 <boolTerm@plt>
lea    0xeb7(%rip),%rdi
call   1030 <emitln@plt>
lea    0xeb5(%rip),%rdi
pop    %rax
jmp    1030 <emitln@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"pop\09%%ebx\00"
@.str.1 = [16 x i8] c"xor\09%%ebx,%%eax\00"
define void @boolXor() {
%1 = call i32 @match(i8 signext 126)
%2 = call i32 (...) @boolTerm()
%3 = call i32 @emitln(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @emitln(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"pop\09%%ebx\00"
@.str.1 = [16 x i8] c"xor\09%%ebx,%%eax\00"
define void @boolXor() {
%1 = tail call i32 @match(i8 signext 126)
%2 = tail call i32 (...) @boolTerm()
%3 = tail call i32 @emitln(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @emitln(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void __halt() {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<__halt>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <__halt+0x9>
jmp    1109 <__halt+0x9>

x86 assembly (clang, -O2):
<__halt>:
jmp    1100 <__halt>

LLVM IR (-O0):
define void @__halt() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @__halt() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int chdir(char const *);
int c0x_setcurrdir(const char *dir) { return (chdir(dir)); }


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

x86 assembly (clang, -O2):
<c0x_setcurrdir>:
jmp    1030 <chdir@plt>

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

LLVM IR (-O2):
define i32 @c0x_setcurrdir(i8* %0) {
%2 = tail call i32 @chdir(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ pushstr(char *);
int strlen(char *);
void procstr(char *cmd) {
  cmd++;
  if (cmd[strlen(cmd) - 1] == '"')
    cmd[strlen(cmd) - 1] = '\0';
  pushstr(cmd);
}


x86 assembly (clang, -O0):
<procstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x22,%eax
jne    1183 <procstr+0x63>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rdi
call   1040 <pushstr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<procstr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0x1(%rdi),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
cmpb   $0x22,(%rax,%r14,1)
jne    114b <procstr+0x2b>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <pushstr@plt>

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

LLVM IR (-O2):
define void @procstr(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = tail call i32 @strlen(i8* %2)
%4 = add nsw i32 %3, -1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %2, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 34
br i1 %8, label %9, label %14
9: ; preds = %1
%10 = tail call i32 @strlen(i8* %2)
%11 = add nsw i32 %10, -1
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %2, i64 %12
store i8 0, i8* %13
br label %14
14: ; preds = %9, %1
%15 = tail call i32 @pushstr(i8* %2)
ret void
}
int ft_isalnum(int c) {
  if ((c >= 65 && c <= 90) || (c >= 97 && c <= 122) || (c >= '0' && c <= '9'))
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_isalnum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jl     111b <ft_isalnum+0x1b>
cmpl   $0x5a,-0x8(%rbp)
jle    1143 <ft_isalnum+0x43>
cmpl   $0x61,-0x8(%rbp)
jl     112f <ft_isalnum+0x2f>
cmpl   $0x7a,-0x8(%rbp)
jle    1143 <ft_isalnum+0x43>
cmpl   $0x30,-0x8(%rbp)
jl     114f <ft_isalnum+0x4f>
cmpl   $0x39,-0x8(%rbp)
jg     114f <ft_isalnum+0x4f>
movl   $0x1,-0x4(%rbp)
jmp    1156 <ft_isalnum+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isalnum>:
mov    %edi,%eax
and    $0xffffffdf,%eax
add    $0xffffffbf,%eax
cmp    $0x1a,%eax
setb   %al
add    $0xffffffd0,%edi
cmp    $0xa,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @ft_isalnum(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 90
br i1 %8, label %21, label %9
9: ; preds = %6, %1
%10 = load i32, i32* %3
%11 = icmp sge i32 %10, 97
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i32, i32* %3
%14 = icmp sle i32 %13, 122
br i1 %14, label %21, label %15
15: ; preds = %12, %9
%16 = load i32, i32* %3
%17 = icmp sge i32 %16, 48
br i1 %17, label %18, label %22
18: ; preds = %15
%19 = load i32, i32* %3
%20 = icmp sle i32 %19, 57
br i1 %20, label %21, label %22
21: ; preds = %18, %12, %6
store i32 1, i32* %2
br label %23
22: ; preds = %18, %15
store i32 0, i32* %2
br label %23
23: ; preds = %22, %21
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @ft_isalnum(i32 %0) {
%2 = and i32 %0, -33
%3 = add i32 %2, -65
%4 = icmp ult i32 %3, 26
%5 = add i32 %0, -48
%6 = icmp ult i32 %5, 10
%7 = or i1 %6, %4
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void swap(int a, int b) {
  int temp = 0;
  printf("in func before swap a = %d; b = %d;\n", a, b);
  temp = a;
  a = b;
  b = temp;
  printf("in func after swap a = %d; b = %d;\n", a, b);
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xee2(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
lea    0xef7(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"in func before swap a = %d; b = %d;\0A\00"
@.str.1 = [36 x i8] c"in func after swap a = %d; b = %d;\0A\00"
define void @swap(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
%9 = load i32, i32* %3
store i32 %9, i32* %5
%10 = load i32, i32* %4
store i32 %10, i32* %3
%11 = load i32, i32* %5
store i32 %11, i32* %4
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 %12, i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"in func before swap a = %d; b = %d;\0A\00"
@.str.1 = [36 x i8] c"in func after swap a = %d; b = %d;\0A\00"
define void @swap(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 %1, i32 %0)
ret void
}
int mymkdir(dirname) const char *dirname;
{
  int ret = 0;
  ret = mkdir(dirname, 0775);
  return ret;
}


x86 assembly (clang, -O0):
<mymkdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1fd,%esi
mov    $0x0,%al
call   1030 <mkdir@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mymkdir>:
mov    $0x1fd,%esi
xor    %eax,%eax
jmp    1030 <mkdir@plt>

LLVM IR (-O0):
define i32 @mymkdir(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%4 = load i8*, i8** %2
%5 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @mkdir to i32 (i8*, i32, ...)*)(i8* %4, i32 509)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @mymkdir(i8* %0) {
%2 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @mkdir to i32 (i8*, i32, ...)*)(i8* %0, i32 509)
ret i32 %2
}
int test_imm_76int64_lowword_mem(long long *val) {
  return ((*val) & (0x76 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_76int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 118
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
double difftime(int /*<<< orphan*/, int /*<<< orphan*/);
extern double __difftime(time_t time1, time_t time0) {
  return difftime(time1, time0);
}


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

x86 assembly (clang, -O2):
<__difftime>:
jmp    1030 <difftime@plt>

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

LLVM IR (-O2):
define double @__difftime(i32 %0, i32 %1) {
%3 = tail call double @difftime(i32 %0, i32 %1)
ret double %3
}
float UI_ProportionalSizeScale(int style) {
  if (style & 0x00000010) {
    return 0.75;
  }
  if (style & 0x00020000) {
    return 0.4;
  }
  return 1.0f;
}


x86 assembly (clang, -O0):
<UI_ProportionalSizeScale>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x10,%eax
cmp    $0x0,%eax
je     1128 <UI_ProportionalSizeScale+0x28>
movss  0xeea(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1158 <UI_ProportionalSizeScale+0x58>
mov    -0x8(%rbp),%eax
and    $0x20000,%eax
cmp    $0x0,%eax
je     114b <UI_ProportionalSizeScale+0x4b>
movss  0xec3(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1158 <UI_ProportionalSizeScale+0x58>
movss  0xead(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<UI_ProportionalSizeScale>:
xor    %eax,%eax
test   $0x20000,%edi
sete   %cl
test   $0x10,%dil
je     111a <UI_ProportionalSizeScale+0x1a>
movss  0xeef(%rip),%xmm0
ret
mov    %cl,%al
lea    0xedd(%rip),%rcx
movss  (%rcx,%rax,4),%xmm0
ret

LLVM IR (-O0):
define float @UI_ProportionalSizeScale(i32 %0) {
%2 = alloca float
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = and i32 %4, 16
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store float 7.500000e-01, float* %2
br label %14
8: ; preds = %1
%9 = load i32, i32* %3
%10 = and i32 %9, 131072
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store float 0x3FD99999A0000000, float* %2
br label %14
13: ; preds = %8
store float 1.000000e+00, float* %2
br label %14
14: ; preds = %13, %12, %7
%15 = load float, float* %2
ret float %15
}

LLVM IR (-O2):
define float @UI_ProportionalSizeScale(i32 %0) {
%2 = and i32 %0, 16
%3 = icmp eq i32 %2, 0
%4 = and i32 %0, 131072
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, float 1.000000e+00, float 0x3FD99999A0000000
%7 = select i1 %3, float %6, float 7.500000e-01
ret float %7
}
/* Type definitions */
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
uint32_t ts(int32_t track, int32_t sector) {
  int sectors_per_track = 16;
  return ((track * sectors_per_track) + sector) * 256;
}


x86 assembly (clang, -O0):
<ts>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x10,-0xc(%rbp)
mov    -0x4(%rbp),%eax
imul   -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
shl    $0x8,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts>:
shl    $0x4,%edi
lea    (%rdi,%rsi,1),%eax
shl    $0x8,%eax
ret

LLVM IR (-O0):
define i32 @ts(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 16, i32* %5
%6 = load i32, i32* %3
%7 = load i32, i32* %5
%8 = mul nsw i32 %6, %7
%9 = load i32, i32* %4
%10 = add nsw i32 %8, %9
%11 = mul nsw i32 %10, 256
ret i32 %11
}

LLVM IR (-O2):
define i32 @ts(i32 %0, i32 %1) {
%3 = shl nsw i32 %0, 4
%4 = add nsw i32 %3, %1
%5 = shl nsw i32 %4, 8
ret i32 %5
}
int acpi_video_register(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @acpi_video_register() {
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int x;
};
typedef TYPE_1__ XCrossingEvent;

/* Variables and functions */
void set_XCrossingEvent_x(void *_p, int _v) {
  ((XCrossingEvent *)_p)->x = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XCrossingEvent_x>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XCrossingEvent_x(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XCrossingEvent_x(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
int counter(int *val, int *count) {
  if ((*val > 2) && (*val < 7)) {
    *count = *count + 1;
  } else if (*val == 10) {
    *count = *count - 1;
  }
  return *count;
}


x86 assembly (clang, -O0):
<counter>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x2,(%rax)
jle    113a <counter+0x3a>
mov    -0x8(%rbp),%rax
cmpl   $0x7,(%rax)
jge    113a <counter+0x3a>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
jmp    115b <counter+0x5b>
mov    -0x8(%rbp),%rax
cmpl   $0xa,(%rax)
jne    1156 <counter+0x56>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
sub    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
jmp    115b <counter+0x5b>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<counter>:
mov    (%rdi),%ecx
lea    -0x3(%rcx),%eax
cmp    $0x3,%eax
ja     1111 <counter+0x11>
mov    (%rsi),%eax
add    $0x1,%eax
jmp    111b <counter+0x1b>
mov    (%rsi),%eax
cmp    $0xa,%ecx
jne    111d <counter+0x1d>
add    $0xffffffff,%eax
mov    %eax,(%rsi)
ret

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

LLVM IR (-O2):
define i32 @counter(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = add i32 %3, -3
%5 = icmp ult i32 %4, 4
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
br label %14
9: ; preds = %2
%10 = icmp eq i32 %3, 10
%11 = load i32, i32* %1
br i1 %10, label %12, label %16
12: ; preds = %9
%13 = add nsw i32 %11, -1
br label %14
14: ; preds = %6, %12
%15 = phi i32 [ %13, %12 ], [ %8, %6 ]
store i32 %15, i32* %1
br label %16
16: ; preds = %14, %9
%17 = phi i32 [ %11, %9 ], [ %15, %14 ]
ret i32 %17
}
/* Variables and functions */
bool nrf51_errata_59(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf51_errata_59() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pmfLDPlat(double, double, double *, int, double *);
void pmfLDPlat_R_wrapper(double *m, double *e, double *eta, int *etaLen,
                         double *prob) {
  pmfLDPlat(*m, *e, eta, *etaLen, prob);
}


x86 assembly (clang, -O0):
<pmfLDPlat_R_wrapper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
mov    -0x28(%rbp),%rdx
call   1030 <pmfLDPlat@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmfLDPlat_R_wrapper>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
mov    (%rcx),%esi
mov    %rdx,%rdi
mov    %r8,%rdx
jmp    1030 <pmfLDPlat@plt>

LLVM IR (-O0):
define void @pmfLDPlat_R_wrapper(double* %0, double* %1, double* %2, i32* %3, double* %4) {
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
%9 = alloca i32*
%10 = alloca double*
store double* %0, double** %6
store double* %1, double** %7
store double* %2, double** %8
store i32* %3, i32** %9
store double* %4, double** %10
%11 = load double*, double** %6
%12 = load double, double* %11
%13 = load double*, double** %7
%14 = load double, double* %13
%15 = load double*, double** %8
%16 = load i32*, i32** %9
%17 = load i32, i32* %16
%18 = load double*, double** %10
%19 = call i32 @pmfLDPlat(double %12, double %14, double* %15, i32 %17, double* %18)
ret void
}

LLVM IR (-O2):
define void @pmfLDPlat_R_wrapper(double* nocapture %0, double* nocapture %1, double* %2, i32* nocapture %3, double* %4) {
%6 = load double, double* %0
%7 = load double, double* %1
%8 = load i32, i32* %3
%9 = tail call i32 @pmfLDPlat(double %6, double %7, double* %2, i32 %8, double* %4)
ret void
}
int fibonacciRek(int n) {
  int temp = 0;
  if (n == 1) {
    return 1;
  } else if (n == 0) {
    return 0;
  } else {
    return fibonacciRek(n - 1) + fibonacciRek(n - 2);
  }
}


x86 assembly (clang, -O0):
<fibonacciRek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1138 <fibonacciRek+0x28>
movl   $0x1,-0x4(%rbp)
jmp    1171 <fibonacciRek+0x61>
cmpl   $0x0,-0x8(%rbp)
jne    114e <fibonacciRek+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    1171 <fibonacciRek+0x61>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fibonacciRek@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fibonacciRek@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibonacciRek>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%ebx
jb     1132 <fibonacciRek+0x22>
nopl   0x0(%rax)
lea    -0x1(%rbx),%edi
call   1030 <fibonacciRek@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x2,%ebx
jae    1120 <fibonacciRek+0x10>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fibonacciRek(i32 %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i32 [ 0, %1 ], [ %10, %6 ]
%4 = phi i32 [ %0, %1 ], [ %9, %6 ]
%5 = icmp ult i32 %4, 2
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = add nsw i32 %4, -1
%8 = tail call i32 @fibonacciRek(i32 %7)
%9 = add nsw i32 %4, -2
%10 = add nsw i32 %8, %3
br label %2
11: ; preds = %2
%12 = add nsw i32 %4, %3
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int const);
void putd(const int value) { printf("%d\n", value); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @putd(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void maze_solve_usage(void) {
  fprintf(stderr, "\t--threadstats\n");
  fprintf(stderr, "\t\tEnable printing of per-thread work statistics.\n");
  fprintf(stderr, "\t\tDefault: No printing.\n");
}


x86 assembly (clang, -O0):
<maze_solve_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xed7(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
lea    0xef4(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<maze_solve_usage>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xee1(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf05(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"\09--threadstats\0A\00"
@.str.1 = [50 x i8] c"\09\09Enable printing of per-thread work statistics.\0A\00"
@.str.2 = [25 x i8] c"\09\09Default: No printing.\0A\00"
define void @maze_solve_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"\09--threadstats\0A\00"
@.str.1 = [50 x i8] c"\09\09Enable printing of per-thread work statistics.\0A\00"
@.str.2 = [25 x i8] c"\09\09Default: No printing.\0A\00"
define void @maze_solve_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_ptx_bar_sync(int /*<<< orphan*/);
void sync() { __builtin_ptx_bar_sync(0); }


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

x86 assembly (clang, -O2):
<sync>:
xor    %edi,%edi
jmp    1030 <__builtin_ptx_bar_sync@plt>

LLVM IR (-O0):
define void @sync() {
%1 = call i32 @__builtin_ptx_bar_sync(i32 0)
ret void
}

LLVM IR (-O2):
define void @sync() {
%1 = tail call i32 @__builtin_ptx_bar_sync(i32 0)
ret void
}
int truncate_to(int number, int limit) {
  if (number > limit) {
    return limit;
  }
  return number;
}


x86 assembly (clang, -O0):
<truncate_to>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1121 <truncate_to+0x21>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <truncate_to+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<truncate_to>:
mov    %edi,%eax
cmp    %esi,%edi
cmovg  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @truncate_to(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ initGPIO();
int /*<<< orphan*/ initTimer2AndIC3();
int /*<<< orphan*/ initWiFIREadc();
int /*<<< orphan*/ setADCpos();
int32_t main(void) {
  initGPIO();
  initWiFIREadc();
  initTimer2AndIC3();
  while (1)
    setADCpos();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <initGPIO@plt>
mov    $0x0,%al
call   1030 <initWiFIREadc@plt>
mov    $0x0,%al
call   1060 <initTimer2AndIC3@plt>
mov    $0x0,%al
call   1050 <setADCpos@plt>
jmp    1164 <main+0x24>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <initGPIO@plt>
xor    %eax,%eax
call   1030 <initWiFIREadc@plt>
xor    %eax,%eax
call   1060 <initTimer2AndIC3@plt>
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <setADCpos@plt>
jmp    1160 <main+0x20>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @initGPIO()
%3 = call i32 (...) @initWiFIREadc()
%4 = call i32 (...) @initTimer2AndIC3()
br label %5
5: ; preds = %0, %5
%6 = call i32 (...) @setADCpos()
br label %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @initGPIO()
%2 = tail call i32 (...) @initWiFIREadc()
%3 = tail call i32 (...) @initTimer2AndIC3()
br label %4
4: ; preds = %0, %4
%5 = tail call i32 (...) @setADCpos()
br label %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ MC_avg2_8(int, int /*<<< orphan*/ *,
                             int /*<<< orphan*/ const *, int, int,
                             int /*<<< orphan*/);
void MC_avg_y_8_mmxext(uint8_t *dest, const uint8_t *ref, int stride,
                       int height) {
  MC_avg2_8(height, dest, ref, stride, stride, 0);
}


x86 assembly (clang, -O0):
<MC_avg_y_8_mmxext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x14(%rbp),%r8d
xor    %r9d,%r9d
call   1030 <MC_avg2_8@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MC_avg_y_8_mmxext>:
mov    %edx,%r8d
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %ecx,%edi
mov    %r8d,%ecx
xor    %r9d,%r9d
jmp    1030 <MC_avg2_8@plt>

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

LLVM IR (-O2):
define void @MC_avg_y_8_mmxext(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = tail call i32 @MC_avg2_8(i32 %3, i32* %0, i32* %1, i32 %2, i32 %2, i32 0)
ret void
}
void ag(void) {}


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

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

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

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