xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ __set_BASEPRI_MAX_nb(int);
uint8_t __basepriSetRetVal(uint8_t prio) {
  __set_BASEPRI_MAX_nb(prio);
  return 1;
}


x86 assembly (clang, -O0):
<__basepriSetRetVal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <__set_BASEPRI_MAX_nb@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__basepriSetRetVal>:
push   %rax
call   1030 <__set_BASEPRI_MAX_nb@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @__basepriSetRetVal(i32 %0) {
%2 = tail call i32 @__set_BASEPRI_MAX_nb(i32 %0)
ret i32 1
}
void OS_playSound(int id) {}


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

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

LLVM IR (-O0):
define void @OS_playSound(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @OS_playSound(i32 %0) {
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int solcon_length_current_dobldobl_solution_string(int *cursor, int *n) {
  int fail;
  double *c;
  fail = _ada_use_c2phc4c(526, cursor, n, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<solcon_length_current_dobldobl_solution_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x20e,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solcon_length_current_dobldobl_solution_string>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x20e,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @solcon_length_current_dobldobl_solution_string(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca double*
store i32* %0, i32** %3
store i32* %1, i32** %4
%7 = load i32*, i32** %3
%8 = load i32*, i32** %4
%9 = load double*, double** %6
%10 = call i32 @_ada_use_c2phc4c(i32 526, i32* %7, i32* %8, double* %9, i32 0)
store i32 %10, i32* %5
%11 = load i32, i32* %5
ret i32 %11
}

LLVM IR (-O2):
define i32 @solcon_length_current_dobldobl_solution_string(i32* %0, i32* %1) {
%3 = tail call i32 @_ada_use_c2phc4c(i32 526, i32* %0, i32* %1, double* undef, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void mumble_acl_callback(void *user_data) { printf("acl_callback\n"); }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fmaxf(int /*<<< orphan*/, float);
int /*<<< orphan*/ fminf(float, float);
int /*<<< orphan*/ roundf(int /*<<< orphan*/);
uint8_t clamp8_from_float(float f) {
  return roundf(fmaxf(fminf(f * 128.f + 128.f, 255.f), 0.f));
}


x86 assembly (clang, -O0):
<clamp8_from_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeba(%rip),%xmm1
mulss  %xmm1,%xmm0
addss  %xmm1,%xmm0
movss  0xea6(%rip),%xmm1
call   1030 <fminf@plt>
mov    %eax,%edi
xorps  %xmm0,%xmm0
call   1040 <fmaxf@plt>
mov    %eax,%edi
call   1050 <roundf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp8_from_float>:
push   %rax
movss  0xec7(%rip),%xmm1
mulss  %xmm1,%xmm0
addss  %xmm1,%xmm0
movss  0xebb(%rip),%xmm1
call   1030 <fminf@plt>
xorps  %xmm0,%xmm0
mov    %eax,%edi
call   1040 <fmaxf@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <roundf@plt>

LLVM IR (-O0):
define i32 @clamp8_from_float(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @llvm.fmuladd.f32(float %3, float 1.280000e+02, float 1.280000e+02)
%5 = call i32 @fminf(float %4, float 2.550000e+02)
%6 = call i32 @fmaxf(i32 %5, float 0.000000e+00)
%7 = call i32 @roundf(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @clamp8_from_float(float %0) {
%2 = tail call float @llvm.fmuladd.f32(float %0, float 1.280000e+02, float 1.280000e+02)
%3 = tail call i32 @fminf(float %2, float 2.550000e+02)
%4 = tail call i32 @fmaxf(i32 %3, float 0.000000e+00)
%5 = tail call i32 @roundf(i32 %4)
ret i32 %5
}
/* Variables and functions */
char const *ttodata(char const *, size_t, int /*<<< orphan*/, char *, size_t,
                    size_t *);
const char *atobytes(const char *src, size_t srclen, char *dst, size_t dstlen,
                     size_t *lenp) {
  return ttodata(src, srclen, 0, dst, dstlen, lenp);
}


x86 assembly (clang, -O0):
<atobytes>:
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),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
xor    %edx,%edx
call   1030 <ttodata@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atobytes>:
mov    %r8,%r9
mov    %rcx,%r8
mov    %rdx,%rcx
xor    %edx,%edx
jmp    1030 <ttodata@plt>

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

LLVM IR (-O2):
define i8* @atobytes(i8* %0, i64 %1, i8* %2, i64 %3, i64* %4) {
%6 = tail call i8* @ttodata(i8* %0, i64 %1, i32 0, i8* %2, i64 %3, i64* %4)
ret i8* %6
}
void Unoff(void) {}


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

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

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

LLVM IR (-O2):
define void @Unoff() {
ret void
}
void __attribute__((
    warning("curl_easy_setopt expects a "
            "curl_opensocket_callback argument for this option")))
__attribute__((unused)) __attribute__((no))
_curl_easy_setopt_err_opensocket_cb(void) {
  __asm__("");
}


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

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

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

LLVM IR (-O2):
define void @_curl_easy_setopt_err_opensocket_cb() {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int KEY_F(int);
int keyF(int n) { return KEY_F(n); }


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

x86 assembly (clang, -O2):
<keyF>:
jmp    1030 <KEY_F@plt>

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

LLVM IR (-O2):
define i32 @keyF(i32 %0) {
%2 = tail call i32 @KEY_F(i32 %0)
ret i32 %2
}
/* Variables and functions */
int c(int);
int d(int arg) { return 3 * c(arg); }


x86 assembly (clang, -O0):
<d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <c@plt>
imul   $0x3,%eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d>:
push   %rax
call   1030 <c@plt>
lea    (%rax,%rax,2),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @d(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @c(i32 %3)
%5 = mul nsw i32 3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @d(i32 %0) {
%2 = tail call i32 @c(i32 %0)
%3 = mul nsw i32 %2, 3
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t apic_get_id(uint8_t *baseapic) {
  uint32_t v = *((uint32_t *)&baseapic[0x20]);
  return (v >> 24) & 0xff;
}


x86 assembly (clang, -O0):
<apic_get_id>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x80(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<apic_get_id>:
movzbl 0x83(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @apic_get_id(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 32
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = ashr i32 %7, 24
%9 = and i32 %8, 255
ret i32 %9
}

LLVM IR (-O2):
define i32 @apic_get_id(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 32
%3 = load i32, i32* %2
%4 = lshr i32 %3, 24
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ sp_werror(char *, int);
char *strerror(int);
void sp_uerror(int ecode) {
  char *ename;
  ename = strerror(ecode);
  sp_werror(ename, ecode);
}


x86 assembly (clang, -O0):
<sp_uerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <strerror@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1030 <sp_werror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sp_uerror>:
push   %rbx
mov    %edi,%ebx
call   1040 <strerror@plt>
mov    %rax,%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <sp_werror@plt>

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

LLVM IR (-O2):
define void @sp_uerror(i32 %0) {
%2 = tail call i8* @strerror(i32 %0)
%3 = tail call i32 @sp_werror(i8* %2, i32 %0)
ret void
}
void add(int array[], int len, int val) {
  if (val < len) {
    array[val]++;
  }
}


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    112b <add+0x2b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
cmp    %esi,%edx
jge    110b <add+0xb>
movslq %edx,%rax
addl   $0x1,(%rdi,%rax,4)
ret

LLVM IR (-O0):
define void @add(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* %6
%8 = load i32, i32* %5
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %17
10: ; preds = %3
%11 = load i32*, i32** %4
%12 = load i32, i32* %6
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = add nsw i32 %15, 1
store i32 %16, i32* %14
br label %17
17: ; preds = %10, %3
ret void
}

LLVM IR (-O2):
define void @add(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %2, %1
br i1 %4, label %5, label %10
5: ; preds = %3
%6 = sext i32 %2 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = load i32, i32* %7
%9 = add nsw i32 %8, 1
store i32 %9, i32* %7
br label %10
10: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ swap_array(int, int, unsigned short *, unsigned short *);
void swap_shorts(int nmemb, unsigned short *x, unsigned short *y) {
  swap_array(nmemb, sizeof(short), x, y);
}


x86 assembly (clang, -O0):
<swap_shorts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x2,%esi
call   1030 <swap_array@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_shorts>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    $0x2,%esi
jmp    1030 <swap_array@plt>

LLVM IR (-O0):
define void @swap_shorts(i32 %0, i16* %1, i16* %2) {
%4 = alloca i32
%5 = alloca i16*
%6 = alloca i16*
store i32 %0, i32* %4
store i16* %1, i16** %5
store i16* %2, i16** %6
%7 = load i32, i32* %4
%8 = load i16*, i16** %5
%9 = load i16*, i16** %6
%10 = call i32 @swap_array(i32 %7, i32 2, i16* %8, i16* %9)
ret void
}

LLVM IR (-O2):
define void @swap_shorts(i32 %0, i16* %1, i16* %2) {
%4 = tail call i32 @swap_array(i32 %0, i32 2, i16* %1, i16* %2)
ret void
}
/* Variables and functions */
int strncasecmp(char const *, char const *, int);
int strnicmp(const char *s1, const char *s2, int n) {
  return (strncasecmp(s1, s2, n));
}


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

x86 assembly (clang, -O2):
<strnicmp>:
jmp    1030 <strncasecmp@plt>

LLVM IR (-O0):
define i32 @strnicmp(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 i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @strncasecmp(i8* %7, i8* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @strnicmp(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @strncasecmp(i8* %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int _ltell_r(void *);
int devo_ftell(void *stream) { return _ltell_r(stream); }


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

x86 assembly (clang, -O2):
<devo_ftell>:
jmp    1030 <_ltell_r@plt>

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

LLVM IR (-O2):
define i32 @devo_ftell(i8* %0) {
%2 = tail call i32 @_ltell_r(i8* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct stat {
  int /*<<< orphan*/ st_mtime;
};

/* Variables and functions */
int stat(char const *, struct stat *);
time_t get_mtime(const char *file) {
  struct stat stat_buf;
  if (stat(file, &stat_buf) != -1)
    return stat_buf.st_mtime;
  return (time_t)-1;
}


x86 assembly (clang, -O0):
<get_mtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
je     113d <get_mtime+0x2d>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1144 <get_mtime+0x34>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_mtime>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
je     1121 <get_mtime+0x11>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @get_mtime(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @stat(i8* %5, %struct.stat* %4)
%7 = icmp ne i32 %6, -1
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%10 = load i32, i32* %9
store i32 %10, i32* %2
br label %12
11: ; preds = %1
store i32 -1, i32* %2
br label %12
12: ; preds = %11, %8
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @get_mtime(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, -1
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
void foo_2_2_1_1_2_1_1_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_1_1_2_1_1_1_1() {
ret void
}
/* Variables and functions */
int ejtag_switch(int, long);
int mips_ejtag_portwrite(unsigned char byte) {
  return ejtag_switch(0x3001, (long)byte);
}


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

x86 assembly (clang, -O2):
<mips_ejtag_portwrite>:
mov    %edi,%esi
mov    $0x3001,%edi
jmp    1030 <ejtag_switch@plt>

LLVM IR (-O0):
define i32 @mips_ejtag_portwrite(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i64
%5 = call i32 @ejtag_switch(i32 12289, i64 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @mips_ejtag_portwrite(i8 zeroext %0) {
%2 = zext i8 %0 to i64
%3 = tail call i32 @ejtag_switch(i32 12289, i64 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void LogText(char *message) { printf("%s\n"); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @LogText(i8* nocapture readnone %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ little_endian_read_16(int /*<<< orphan*/ const *, int);
uint16_t rfcomm_event_channel_opened_get_con_handle(const uint8_t *event) {
  return little_endian_read_16(event, 9);
}


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

x86 assembly (clang, -O2):
<rfcomm_event_channel_opened_get_con_handle>:
mov    $0x9,%esi
jmp    1030 <little_endian_read_16@plt>

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

LLVM IR (-O2):
define i32 @rfcomm_event_channel_opened_get_con_handle(i32* %0) {
%2 = tail call i32 @little_endian_read_16(i32* %0, i32 9)
ret i32 %2
}
double min_d(double x1, double x2) { return (x1 < x2 ? x1 : x2); }


x86 assembly (clang, -O0):
<min_d>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <min_d+0x31>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    113b <min_d+0x3b>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<min_d>:
minsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @min_d(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @min_d(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
void nand_onchip_hwctl(struct mtd_info *mtd, int mode) { return; }


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

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

LLVM IR (-O0):
%struct.mtd_info = type opaque
define void @nand_onchip_hwctl(%struct.mtd_info* %0, i32 %1) {
%3 = alloca %struct.mtd_info*
%4 = alloca i32
store %struct.mtd_info* %0, %struct.mtd_info** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.mtd_info = type opaque
define void @nand_onchip_hwctl(%struct.mtd_info* nocapture %0, i32 %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char const *, char *);
char const *string_read_fp(int /*<<< orphan*/ *);
const char *string_read_file(const char *filename) {
  FILE *fp = fopen(filename, "r");
  return string_read_fp(fp);
}


x86 assembly (clang, -O0):
<string_read_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <string_read_fp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_read_file>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <string_read_fp@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
define i8* @string_read_file(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = call i8* @string_read_fp(i32* %6)
ret i8* %7
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i8* @string_read_file(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = tail call i8* @string_read_fp(i32* %2)
ret i8* %3
}
void curs_noecho(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ write(int /*<<< orphan*/, int *, int);
void vt_write_hex_4(uint8_t value) {
  value &= 0b1111;
  uint8_t ch;
  if (value <= 0x9) {
    ch = (value - 0x0) + '0';
  } else {
    ch = (value - 0xA) + 'A';
  }
  write(STDOUT_FILENO, &ch, sizeof(ch));
}


x86 assembly (clang, -O0):
<vt_write_hex_4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x9,-0x4(%rbp)
jg     113f <vt_write_hex_4+0x2f>
mov    -0x4(%rbp),%eax
sub    $0x0,%eax
add    $0x30,%eax
mov    %eax,-0x8(%rbp)
jmp    114b <vt_write_hex_4+0x3b>
mov    -0x4(%rbp),%eax
sub    $0xa,%eax
add    $0x41,%eax
mov    %eax,-0x8(%rbp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vt_write_hex_4>:
push   %rax
and    $0xf,%edi
lea    0x37(%rdi),%eax
lea    0x30(%rdi),%ecx
cmp    $0xa,%edi
cmovae %eax,%ecx
mov    %ecx,0x4(%rsp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
define void @vt_write_hex_4(i32 %0) {
%2 = alloca i32
%3 = and i32 %0, 15
%4 = bitcast i32* %2 to i8*
%5 = icmp ult i32 %3, 10
%6 = add nuw nsw i32 %3, 55
%7 = or i32 %3, 48
%8 = select i1 %5, i32 %7, i32 %6
store i32 %8, i32* %2
%9 = load i32, i32* @STDOUT_FILENO
%10 = call i32 @write(i32 %9, i32* %2, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
void fatal(char *message) {
  char *prefix = "[!!] Fatal Error: ",
       error_message[strlen(prefix) + strlen(message) + 1];
  strcpy(error_message, prefix);
  strcat(error_message, message);
  perror(error_message);
  exit(-1);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xe9d(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x30(%rbp),%rcx
mov    %rax,%rdx
lea    0x1(%rcx,%rdx,1),%rax
mov    %rsp,%rsi
mov    %rsi,-0x18(%rbp)
lea    0x10(%rcx,%rdx,1),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x28(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x28(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x28(%rbp),%rdi
call   1050 <perror@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <strlen@plt>
mov    %rsp,%rbx
add    $0x22,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
lea    0xe89(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <strcat@plt>
mov    %rbx,%rdi
call   1050 <perror@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"[!!] Fatal Error: \00"
define void @fatal(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %2
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8** %3
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = load i8*, i8** %2
%9 = call i64 @strlen(i8* %8)
%10 = add nsw i64 %7, %9
%11 = add nsw i64 %10, 1
%12 = call i8* @llvm.stacksave()
store i8* %12, i8** %4
%13 = alloca i8, i64 %11
store i64 %11, i64* %5
%14 = load i8*, i8** %3
%15 = call i32 @strcpy(i8* %13, i8* %14)
%16 = load i8*, i8** %2
%17 = call i32 @strcat(i8* %13, i8* %16)
%18 = call i32 @perror(i8* %13)
%19 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [19 x i8] c"[!!] Fatal Error: \00"
define void @fatal(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 19
%4 = alloca i8, i64 %3
%5 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @strcat(i8* %4, i8* %0)
%7 = call i32 @perror(i8* %4)
%8 = call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
float asin(float);
int /*<<< orphan*/ print(char *);
int /*<<< orphan*/ printid(float);
int main() {
  float a = 2, b = 3;
  a = asin(b);
  print("a -1");
  printid(a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xebd(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xeac(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
call   1050 <asin@plt>
movss  %xmm0,-0x8(%rbp)
lea    0xe99(%rip),%rdi
call   1030 <print@plt>
movss  -0x8(%rbp),%xmm0
call   1040 <printid@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movss  0xec7(%rip),%xmm0
call   1050 <asin@plt>
movss  %xmm0,0x4(%rsp)
lea    0xeb9(%rip),%rdi
call   1030 <print@plt>
movss  0x4(%rsp),%xmm0
call   1040 <printid@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"a -1\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
store float 2.000000e+00, float* %2
store float 3.000000e+00, float* %3
%4 = load float, float* %3
%5 = call float @asin(float %4)
store float %5, float* %2
%6 = call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = load float, float* %2
%8 = call i32 @printid(float %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"a -1\00"
define i32 @main() {
%1 = tail call float @asin(float 3.000000e+00)
%2 = tail call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printid(float %1)
ret i32 0
}
int test_division__by_zero() { return 1; }


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

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

LLVM IR (-O0):
define i32 @test_division__by_zero() {
ret i32 1
}

LLVM IR (-O2):
define i32 @test_division__by_zero() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int test_extension(char *, char *);
int main(void) {
  char f[] = "domy.jpg";
  char ext[] = "JPG";
  printf("%d\n", test_extension(f, ext));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0xd(%rbp)
mov    0xec8(%rip),%al
mov    %al,-0x5(%rbp)
mov    0xec0(%rip),%eax
mov    %eax,-0x11(%rbp)
lea    -0xd(%rbp),%rdi
lea    -0x11(%rbp),%rsi
call   1040 <test_extension@plt>
mov    %eax,%esi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x67706a2e796d6f64,%rax
6a 70 67
mov    %rax,0x8(%rsp)
movb   $0x0,0x10(%rsp)
movl   $0x47504a,0x4(%rsp)
lea    0x8(%rsp),%rdi
lea    0x4(%rsp),%rsi
call   1040 <test_extension@plt>
lea    0xeb3(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.f = [9 x i8] c"domy.jpg\00"
@__const.main.ext = [4 x i8] c"JPG\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [9 x i8]
%3 = alloca [4 x i8]
store i32 0, i32* %1
%4 = bitcast [9 x i8]* %2 to i8*
%5 = bitcast [4 x i8]* %3 to i8*
%6 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%8 = call i32 @test_extension(i8* %6, i8* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.f = [9 x i8] c"domy.jpg\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [9 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 0
%4 = bitcast i32* %2 to i8*
store i32 4673610, i32* %2
%5 = call i32 @test_extension(i8* %3, i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int ASM(char *);
int putchr(char c) {
  while (ASM(" IN (IN_STATUS), RU") & 0x02)
    ;
  ASM(" MOVE 2(SP), RU");
  ASM(" OUT  R, (OUT_TX_DATA)");
}


x86 assembly (clang, -O0):
<putchr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
lea    0xedb(%rip),%rdi
call   1030 <ASM@plt>
and    $0x2,%eax
cmp    $0x0,%eax
je     113b <putchr+0x2b>
jmp    111e <putchr+0xe>
lea    0xed2(%rip),%rdi
call   1030 <ASM@plt>
lea    0xed6(%rip),%rdi
call   1030 <ASM@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchr>:
push   %rbx
lea    0xee8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <ASM@plt>
test   $0x2,%al
jne    1120 <putchr+0x10>
lea    0xee1(%rip),%rdi
call   1030 <ASM@plt>
lea    0xee5(%rip),%rdi
pop    %rbx
jmp    1030 <ASM@plt>

LLVM IR (-O0):
@.str = [20 x i8] c" IN (IN_STATUS), RU\00"
@.str.1 = [16 x i8] c" MOVE 2(SP), RU\00"
@.str.2 = [23 x i8] c" OUT R, (OUT_TX_DATA)\00"
define i32 @putchr(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
br label %4
4: ; preds = %8, %1
%5 = call i32 @ASM(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%6 = and i32 %5, 2
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %4
br label %4
9: ; preds = %4
%10 = call i32 @ASM(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @ASM(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@.str = [20 x i8] c" IN (IN_STATUS), RU\00"
@.str.1 = [16 x i8] c" MOVE 2(SP), RU\00"
@.str.2 = [23 x i8] c" OUT R, (OUT_TX_DATA)\00"
define i32 @putchr(i8 signext %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @ASM(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = and i32 %3, 2
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %2
6: ; preds = %2
%7 = tail call i32 @ASM(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 @ASM(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
ret i32 undef
}
double signOf(double x) { return x > 0 ? +1 : -1; }


x86 assembly (clang, -O0):
<signOf>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
mov    $0xffffffff,%eax
mov    $0x1,%ecx
ucomisd %xmm1,%xmm0
cmova  %ecx,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<signOf>:
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
seta   %al
lea    0xeec(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm0
ret

LLVM IR (-O0):
define double @signOf(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ogt double %3, 0.000000e+00
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 1, i32 -1
%7 = sitofp i32 %6 to double
ret double %7
}

LLVM IR (-O2):
define double @signOf(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
%3 = select i1 %2, double 1.000000e+00, double -1.000000e+00
ret double %3
}
double test_acosh(double x) { return __builtin_acosh(x); }


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

x86 assembly (clang, -O2):
<test_acosh>:
jmp    1030 <acosh@plt>

LLVM IR (-O0):
define double @test_acosh(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @acosh(double %3)
ret double %4
}

LLVM IR (-O2):
define double @test_acosh(double %0) {
%2 = tail call double @acosh(double %0)
ret double %2
}
/* Variables and functions */
scalar_t__ return_long();
double return_double2(void) { return (double)return_long(); }


x86 assembly (clang, -O0):
<return_double2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <return_long@plt>
cvtsi2sd %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<return_double2>:
push   %rax
xor    %eax,%eax
call   1030 <return_long@plt>
cvtsi2sd %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @return_double2() {
%1 = call i64 (...) @return_long()
%2 = sitofp i64 %1 to double
ret double %2
}

LLVM IR (-O2):
define double @return_double2() {
%1 = tail call i64 (...) @return_long()
%2 = sitofp i64 %1 to double
ret double %2
}
/* Variables and functions */
int strlen(char *);
void drop_nl(char *str) {
  if (str[strlen(str) - 1] == '\n')
    str[strlen(str) - 1] = '\0';
}


x86 assembly (clang, -O0):
<drop_nl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-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    $0xa,%eax
jne    1167 <drop_nl+0x57>
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)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drop_nl>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
cmpb   $0xa,-0x1(%rax,%rbx,1)
jne    1131 <drop_nl+0x21>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @drop_nl(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 10
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = tail call i32 @strlen(i8* %0)
%10 = add nsw i32 %9, -1
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %0, i64 %11
store i8 0, i8* %12
br label %13
13: ; preds = %8, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
void uninitvar_strlen(const char *str) {
  char *s;
  (void)strlen(s);
  const char x;
  const char *xPtr = &x;
  (void)strlen(xPtr);
  (void)strlen(str);
}


x86 assembly (clang, -O0):
<uninitvar_strlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
lea    -0x11(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_strlen>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1030 <strlen@plt>
lea    0xf(%rsp),%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @uninitvar_strlen(i8* %0) {
%2 = alloca i8
%3 = tail call i32 @strlen(i8* undef)
%4 = call i32 @strlen(i8* %2)
%5 = call i32 @strlen(i8* %0)
ret void
}
/* Variables and functions */
int htonl(int);
int /*<<< orphan*/ write_socket(int, void *, int);
void galfa_sendpkt(int fd, void *pkt, int len) {
  int hlen = htonl(len);
  write_socket(fd, &hlen, 4);
  write_socket(fd, pkt, len);
}


x86 assembly (clang, -O0):
<galfa_sendpkt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <htonl@plt>
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x18(%rbp),%rsi
mov    $0x4,%edx
call   1030 <write_socket@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write_socket@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<galfa_sendpkt>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%ebx
mov    %rsi,%r14
mov    %edi,%ebp
mov    %edx,%edi
call   1040 <htonl@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %ebp,%edi
mov    $0x4,%edx
call   1030 <write_socket@plt>
mov    %ebp,%edi
mov    %r14,%rsi
mov    %ebx,%edx
call   1030 <write_socket@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @galfa_sendpkt(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = call i32 @htonl(i32 %8)
store i32 %9, i32* %7
%10 = load i32, i32* %4
%11 = bitcast i32* %7 to i8*
%12 = call i32 @write_socket(i32 %10, i8* %11, i32 4)
%13 = load i32, i32* %4
%14 = load i8*, i8** %5
%15 = load i32, i32* %6
%16 = call i32 @write_socket(i32 %13, i8* %14, i32 %15)
ret void
}

LLVM IR (-O2):
define void @galfa_sendpkt(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = tail call i32 @htonl(i32 %2)
store i32 %6, i32* %4
%7 = call i32 @write_socket(i32 %0, i8* %5, i32 4)
%8 = call i32 @write_socket(i32 %0, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CTI1_ERROR_DriverIRQHandler();
__attribute__((weak)) void CTI1_ERROR_IRQHandler(void) {
  CTI1_ERROR_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @CTI1_ERROR_IRQHandler() {
%1 = call i32 (...) @CTI1_ERROR_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @CTI1_ERROR_IRQHandler() {
%1 = tail call i32 (...) @CTI1_ERROR_DriverIRQHandler()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ SYS_write;
int /*<<< orphan*/ syscall3(int /*<<< orphan*/, int, uintptr_t, size_t);
ssize_t sys_write(int fd, const void *buf, size_t count) {
  return syscall3(SYS_write, fd, (uintptr_t)buf, count);
}


x86 assembly (clang, -O0):
<sys_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1030 <syscall3@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_write>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall3@plt>

LLVM IR (-O0):
@SYS_write = global i32 0
define i32 @sys_write(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32, i32* @SYS_write
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = ptrtoint i8* %9 to i64
%11 = load i64, i64* %6
%12 = call i32 @syscall3(i32 %7, i32 %8, i64 %10, i64 %11)
ret i32 %12
}

LLVM IR (-O2):
@SYS_write = global i32 0
define i32 @sys_write(i32 %0, i8* %1, i64 %2) {
%4 = load i32, i32* @SYS_write
%5 = ptrtoint i8* %1 to i64
%6 = tail call i32 @syscall3(i32 %4, i32 %0, i64 %5, i64 %2)
ret i32 %6
}
/* 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__ xkey;
};
typedef TYPE_2__ XEvent;

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


x86 assembly (clang, -O0):
<set_XEvent_xkey_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_xkey_window>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define void @set_XEvent_xkey_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_xkey_window(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
bool errata_16(void) {
  if ((((*(uint32_t *)0xF0000FE0) & 0x000000FF) == 0x6) &&
      (((*(uint32_t *)0xF0000FE4) & 0x0000000F) == 0x0)) {
    if (((*(uint32_t *)0xF0000FE8) & 0x000000F0) == 0x30) {
      return true;
    }
  }
  return false;
}


x86 assembly (clang, -O0):
<errata_16>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf0000fe0,%eax
mov    (%rax),%eax
and    $0xff,%eax
cmp    $0x6,%eax
jne    1152 <errata_16+0x52>
mov    $0xf0000fe4,%eax
mov    (%rax),%eax
and    $0xf,%eax
cmp    $0x0,%eax
jne    1152 <errata_16+0x52>
mov    $0xf0000fe8,%eax
mov    (%rax),%eax
and    $0xf0,%eax
cmp    $0x30,%eax
jne    114d <errata_16+0x4d>
movl   $0x1,-0x4(%rbp)
jmp    1159 <errata_16+0x59>
jmp    1152 <errata_16+0x52>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<errata_16>:
mov    $0xf0000fe0,%eax
cmpb   $0x6,(%rax)
jne    1122 <errata_16+0x22>
testb  $0xf,0x4(%rax)
jne    1122 <errata_16+0x22>
mov    $0xf0,%ecx
and    0x8(%rax),%ecx
mov    $0x1,%eax
cmp    $0x30,%ecx
je     1124 <errata_16+0x24>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @errata_16() {
%1 = alloca i32
%2 = load i32, i32* inttoptr (i64 4026535904 to i32*)
%3 = and i32 %2, 255
%4 = icmp eq i32 %3, 6
br i1 %4, label %5, label %15
5: ; preds = %0
%6 = load i32, i32* inttoptr (i64 4026535908 to i32*)
%7 = and i32 %6, 15
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = load i32, i32* inttoptr (i64 4026535912 to i32*)
%11 = and i32 %10, 240
%12 = icmp eq i32 %11, 48
br i1 %12, label %13, label %14
13: ; preds = %9
store i32 1, i32* %1
br label %16
14: ; preds = %9
br label %15
15: ; preds = %14, %5, %0
store i32 0, i32* %1
br label %16
16: ; preds = %15, %13
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
define i32 @errata_16() {
%1 = load i32, i32* inttoptr (i64 4026535904 to i32*)
%2 = and i32 %1, 255
%3 = icmp eq i32 %2, 6
br i1 %3, label %4, label %12
4: ; preds = %0
%5 = load i32, i32* inttoptr (i64 4026535908 to i32*)
%6 = and i32 %5, 15
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = load i32, i32* inttoptr (i64 4026535912 to i32*)
%10 = and i32 %9, 240
%11 = icmp eq i32 %10, 48
br i1 %11, label %13, label %12
12: ; preds = %8, %4, %0
br label %13
13: ; preds = %8, %12
%14 = phi i32 [ 0, %12 ], [ 1, %8 ]
ret i32 %14
}