xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  int i;
  printf("Usage: tmu2header [OPTION]... [file.tmu]\n"
         "Transforms a Trilo Tracker Music file into a MSX C header\n"
         " -h, --help           Print this help.\n"
         " -o, --output=FILE    output file,\n"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [175 x i8] c"Usage: tmu2header [OPTION]... [file.tmu]\0ATransforms a Trilo Tracker Music file into a MSX C header\0A -h, --help Print this help.\0A -o, --output=FILE output file,\0A\0A\00"
define void @usage() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([175 x i8], [175 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [174 x i8] c"Usage: tmu2header [OPTION]... [file.tmu]\0ATransforms a Trilo Tracker Music file into a MSX C header\0A -h, --help Print this help.\0A -o, --output=FILE output file,\0A\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([174 x i8], [174 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int main_(int, char **);
int main(int argc, char *argv[]) { return main_(argc, argv); }


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <main_@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @main_(i32 %0, i8** %1)
ret i32 %3
}
int main() {
  int a = 3;
  return a |= 5;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
mov    -0x8(%rbp),%eax
or     $0x5,%eax
mov    %eax,-0x8(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 7
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t ia_unsetbit32(uint32_t word, int i) { return word & ~(1 << i); }


x86 assembly (clang, -O0):
<ia_unsetbit32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ia_unsetbit32(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 = shl i32 1, %6
%8 = xor i32 %7, -1
%9 = and i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @ia_unsetbit32(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = xor i32 %3, -1
%5 = and i32 %4, %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ DrawLevelElementExt(int, int, int /*<<< orphan*/,
                                       int /*<<< orphan*/, int,
                                       int /*<<< orphan*/, int);
void DrawLevelElementThruMask(int x, int y, int element) {
  DrawLevelElementExt(x, y, 0, 0, element, 0, 1);
}


x86 assembly (clang, -O0):
<DrawLevelElementThruMask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%r8d
xor    %r9d,%r9d
mov    %r9d,%edx
mov    %r9d,%ecx
movl   $0x1,(%rsp)
call   1030 <DrawLevelElementExt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DrawLevelElementThruMask>:
push   %rax
mov    %edx,%r8d
movl   $0x1,(%rsp)
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r9d,%r9d
call   1030 <DrawLevelElementExt@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @DrawLevelElementThruMask(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* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @DrawLevelElementExt(i32 %7, i32 %8, i32 0, i32 0, i32 %9, i32 0, i32 1)
ret void
}

LLVM IR (-O2):
define void @DrawLevelElementThruMask(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @DrawLevelElementExt(i32 %0, i32 %1, i32 0, i32 0, i32 %2, i32 0, i32 1)
ret void
}
void RTMd5Update(void) {}


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

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

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

LLVM IR (-O2):
define void @RTMd5Update() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ remove_pidfile();
void signal_handler_clear_pidfile(int signal_num) { remove_pidfile(); }


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

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

LLVM IR (-O0):
define void @signal_handler_clear_pidfile(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @remove_pidfile()
ret void
}

LLVM IR (-O2):
define void @signal_handler_clear_pidfile(i32 %0) {
%2 = tail call i32 (...) @remove_pidfile()
ret void
}
/* Type definitions */
struct darr {
  int dummy;
};

/* Variables and functions */
void *darr_element(struct darr *, int /*<<< orphan*/);
void *darr_begin(struct darr *d) { return darr_element(d, 0); }


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

x86 assembly (clang, -O2):
<darr_begin>:
xor    %esi,%esi
jmp    1030 <darr_element@plt>

LLVM IR (-O0):
%struct.darr = type { i32 }
define i8* @darr_begin(%struct.darr* %0) {
%2 = alloca %struct.darr*
store %struct.darr* %0, %struct.darr** %2
%3 = load %struct.darr*, %struct.darr** %2
%4 = call i8* @darr_element(%struct.darr* %3, i32 0)
ret i8* %4
}

LLVM IR (-O2):
%struct.darr = type { i32 }
define i8* @darr_begin(%struct.darr* %0) {
%2 = tail call i8* @darr_element(%struct.darr* %0, i32 0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMR97_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMR97_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMR97_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ local_bh_disable();
void __rcu_read_lock_bh(void) { local_bh_disable(); }


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

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

LLVM IR (-O0):
define void @__rcu_read_lock_bh() {
%1 = call i32 (...) @local_bh_disable()
ret void
}

LLVM IR (-O2):
define void @__rcu_read_lock_bh() {
%1 = tail call i32 (...) @local_bh_disable()
ret void
}
void RTDbgModLineByOrdinalA(void) {}


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

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

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

LLVM IR (-O2):
define void @RTDbgModLineByOrdinalA() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int fdatasync(int fd) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<fdatasync>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2eda(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec1(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdatasync>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @fdatasync(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @fdatasync(i32 %0) {
%2 = load i32, i32* @ENOSYS
store i32 %2, i32* @errno
ret i32 -1
}
/* Variables and functions */
float calc_mean();
int /*<<< orphan*/ printf(char *, float);
int main(int argc, const char *argv[]) {
  float result;
  result = calc_mean();
  printf("Valor medio: %.2f\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <calc_mean@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <calc_mean@plt>
lea    0xed1(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Valor medio: %.2f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call float (...) @calc_mean()
store float %7, float* %6
%8 = load float, float* %6
%9 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), float %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"Valor medio: %.2f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call float (...) @calc_mean()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), float %3)
ret i32 0
}
int cmp1DescULL(const void *pa, const void *pb) {
  const unsigned long long *a = (const unsigned long long *)pa;
  const unsigned long long *b = (const unsigned long long *)pb;
  if (a[1] < b[1])
    return +1;
  if (a[1] > b[1])
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<cmp1DescULL>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rax
mov    -0x28(%rbp),%rcx
cmp    0x8(%rcx),%rax
jae    113e <cmp1DescULL+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    1167 <cmp1DescULL+0x67>
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rax
mov    -0x28(%rbp),%rcx
cmp    0x8(%rcx),%rax
jbe    1160 <cmp1DescULL+0x60>
movl   $0xffffffff,-0x4(%rbp)
jmp    1167 <cmp1DescULL+0x67>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp1DescULL>:
mov    0x8(%rdi),%rax
mov    0x8(%rsi),%rcx
xor    %edx,%edx
cmp    %rcx,%rax
seta   %dl
neg    %edx
cmp    %rcx,%rax
mov    $0x1,%eax
cmovae %edx,%eax
ret

LLVM IR (-O0):
define i32 @cmp1DescULL(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64*
%7 = alloca i64*
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i64*
store i64* %9, i64** %6
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to i64*
store i64* %11, i64** %7
%12 = load i64*, i64** %6
%13 = getelementptr inbounds i64, i64* %12, i64 1
%14 = load i64, i64* %13
%15 = load i64*, i64** %7
%16 = getelementptr inbounds i64, i64* %15, i64 1
%17 = load i64, i64* %16
%18 = icmp ult i64 %14, %17
br i1 %18, label %19, label %20
19: ; preds = %2
store i32 1, i32* %3
br label %30
20: ; preds = %2
%21 = load i64*, i64** %6
%22 = getelementptr inbounds i64, i64* %21, i64 1
%23 = load i64, i64* %22
%24 = load i64*, i64** %7
%25 = getelementptr inbounds i64, i64* %24, i64 1
%26 = load i64, i64* %25
%27 = icmp ugt i64 %23, %26
br i1 %27, label %28, label %29
28: ; preds = %20
store i32 -1, i32* %3
br label %30
29: ; preds = %20
store i32 0, i32* %3
br label %30
30: ; preds = %29, %28, %19
%31 = load i32, i32* %3
ret i32 %31
}

LLVM IR (-O2):
define i32 @cmp1DescULL(i8* nocapture %0, i8* nocapture %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 8
%4 = bitcast i8* %3 to i64*
%5 = load i64, i64* %4
%6 = getelementptr inbounds i8, i8* %1, i64 8
%7 = bitcast i8* %6 to i64*
%8 = load i64, i64* %7
%9 = icmp ult i64 %5, %8
%10 = icmp ugt i64 %5, %8
%11 = sext i1 %10 to i32
%12 = select i1 %9, i32 1, i32 %11
ret i32 %12
}
long long llrintf(float x) {
  long long r;
  __asm__("cvtss2si %1, %0" : "=r"(r) : "x"(x));
  return r;
}


x86 assembly (clang, -O0):
<llrintf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2si %xmm0,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<llrintf>:
cvtss2si %xmm0,%rax
ret

LLVM IR (-O0):
define i64 @llrintf(float %0) {
%2 = alloca float
%3 = alloca i64
store float %0, float* %2
%4 = load float, float* %2
%5 = call i64 asm "cvtss2si $1, $0", "=r,x,~{dirflag},~{fpsr},~{flags}"(float %4)
store i64 %5, i64* %3
%6 = load i64, i64* %3
ret i64 %6
}

LLVM IR (-O2):
define i64 @llrintf(float %0) {
%2 = tail call i64 asm "cvtss2si $1, $0", "=r,x,~{dirflag},~{fpsr},~{flags}"(float %0)
ret i64 %2
}
void __attribute__((weak)) SysTick_RTOS_Hook(void) {}


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

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

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

LLVM IR (-O2):
define weak void @SysTick_RTOS_Hook() {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ detail;
};
typedef TYPE_1__ XLeaveWindowEvent;

/* Variables and functions */
int get_XLeaveWindowEvent_detail(void *_p) {
  return (int)((XLeaveWindowEvent *)_p)->detail;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XLeaveWindowEvent_detail(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
void __stack_chk_fail() {}


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

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

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

LLVM IR (-O2):
define void @__stack_chk_fail() {
ret void
}
int main() {
  unsigned long eax;
  asm("xorl %%esi, %%esi;"
      "xorl %%edi, %%edi;"
      "cpuid_loop: movl %%edi, %%eax;"
      "xorl %%ecx, %%ecx;"
      "cpuid;"
      "xorl %%eax, %%esi;"
      "cmpl %%esi, %%eax;"
      "jne not_first_time;"
      "leal 0x1(%%eax, 1), %%edi;"
      "not_first_time: xorl %%ebx, %%esi;"
      "xorl %%ecx, %%esi;"
      "xorl %%edx, %%esi;"
      "subl $1, %%edi;"
      "jne cpuid_loop;"
      "movl %%esi, %%eax;"
      : "=a"(eax));
  printf("%#.8lx\n", eax);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %esi,%esi
xor    %edi,%edi

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %esi,%esi
xor    %edi,%edi

LLVM IR (-O0):
@.str = [8 x i8] c"%#.8lx\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
%3 = call i64 asm "xorl %esi, %esi;xorl %edi, %edi;cpuid_loop: movl %edi, %eax;xorl %ecx, %ecx;cpuid;xorl %eax, %esi;cmpl %esi, %eax;jne not_first_time;leal 0x1(%eax, 1), %edi;not_first_time: xorl %ebx, %esi;xorl %ecx, %esi;xorl %edx, %esi;subl $$1, %edi;jne cpuid_loop;movl %esi, %eax;", "={ax},~{dirflag},~{fpsr},~{flags}"()
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%#.8lx\0A\00"
define i32 @main() {
%1 = tail call i64 asm "xorl %esi, %esi;xorl %edi, %edi;cpuid_loop: movl %edi, %eax;xorl %ecx, %ecx;cpuid;xorl %eax, %esi;cmpl %esi, %eax;jne not_first_time;leal 0x1(%eax, 1), %edi;not_first_time: xorl %ebx, %esi;xorl %ecx, %esi;xorl %edx, %esi;subl $$1, %edi;jne cpuid_loop;movl %esi, %eax;", "={ax},~{dirflag},~{fpsr},~{flags}"()
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
int main(int argc, char **argv, char **envp) {
  int i;
  for (i = 0; i < argc; i++)
    printf("argv[%d] = \"%s\"\n", i, argv[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1166 <main+0x56>
mov    -0x1c(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1131 <main+0x21>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1147 <main+0x37>
mov    %rsi,%r14
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [17 x i8] c"argv[%d] = \22%s\22\0A\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca i32
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
store i32 0, i32* %8
br label %9
9: ; preds = %21, %3
%10 = load i32, i32* %8
%11 = load i32, i32* %5
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %24
13: ; preds = %9
%14 = load i32, i32* %8
%15 = load i8**, i8*** %6
%16 = load i32, i32* %8
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8*, i8** %15, i64 %17
%19 = load i8*, i8** %18
%20 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %14, i8* %19)
br label %21
21: ; preds = %13
%22 = load i32, i32* %8
%23 = add nsw i32 %22, 1
store i32 %23, i32* %8
br label %9
24: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"argv[%d] = \22%s\22\0A\00"
define i32 @main(i32 %0, i8** nocapture %1, i8** nocapture readnone %2) {
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %0 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %13, %7 ]
%9 = getelementptr inbounds i8*, i8** %1, i64 %8
%10 = load i8*, i8** %9
%11 = trunc i64 %8 to i32
%12 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %11, i8* %10)
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %15, label %7
15: ; preds = %7, %3
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ G_SoundIndex(char *);
void PrecacheRadioSounds() { G_SoundIndex("sound/radio/click.wav"); }


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"sound/radio/click.wav\00"
define void @PrecacheRadioSounds() {
%1 = call i32 @G_SoundIndex(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"sound/radio/click.wav\00"
define void @PrecacheRadioSounds() {
%1 = tail call i32 @G_SoundIndex(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ move(int, int);
int /*<<< orphan*/ printw(char *);
void printbottominstructions(void) {
  move(17, 42);
  printw("|Replace # with the number of the  |");
  move(17 + 1, 42);
  printw("|tableau you want.                 |");
  move(17 + 2, 42);
  printw("*----------------------------------*");
}


x86 assembly (clang, -O0):
<printbottominstructions>:
push   %rbp
mov    %rsp,%rbp
mov    $0x11,%edi
mov    $0x2a,%esi
call   1040 <move@plt>
lea    0xec6(%rip),%rdi
call   1030 <printw@plt>
mov    $0x12,%edi
mov    $0x2a,%esi
call   1040 <move@plt>
lea    0xed0(%rip),%rdi
call   1030 <printw@plt>
mov    $0x13,%edi
mov    $0x2a,%esi
call   1040 <move@plt>
lea    0xeda(%rip),%rdi
call   1030 <printw@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printbottominstructions>:
push   %rax
mov    $0x11,%edi
mov    $0x2a,%esi
call   1040 <move@plt>
lea    0xec9(%rip),%rdi
call   1030 <printw@plt>
mov    $0x12,%edi
mov    $0x2a,%esi
call   1040 <move@plt>
lea    0xed3(%rip),%rdi
call   1030 <printw@plt>
mov    $0x13,%edi
mov    $0x2a,%esi
call   1040 <move@plt>
lea    0xedd(%rip),%rdi
pop    %rax
jmp    1030 <printw@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"|Replace # with the number of the |\00"
@.str.1 = [37 x i8] c"|tableau you want. |\00"
@.str.2 = [37 x i8] c"*----------------------------------*\00"
define void @printbottominstructions() {
%1 = call i32 @move(i32 17, i32 42)
%2 = call i32 @printw(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @move(i32 18, i32 42)
%4 = call i32 @printw(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @move(i32 19, i32 42)
%6 = call i32 @printw(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"|Replace # with the number of the |\00"
@.str.1 = [37 x i8] c"|tableau you want. |\00"
@.str.2 = [37 x i8] c"*----------------------------------*\00"
define void @printbottominstructions() {
%1 = tail call i32 @move(i32 17, i32 42)
%2 = tail call i32 @printw(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @move(i32 18, i32 42)
%4 = tail call i32 @printw(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @move(i32 19, i32 42)
%6 = tail call i32 @printw(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
ret void
}
int qual_char_is_invalid(char ch) {
  if ('A' <= ch && ch <= 'Z')
    return 0;
  if ('a' <= ch && ch <= 'z')
    return 0;
  if ('0' <= ch && ch <= '9')
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<qual_char_is_invalid>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%ecx
mov    $0x41,%eax
cmp    %ecx,%eax
jg     1134 <qual_char_is_invalid+0x34>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     1134 <qual_char_is_invalid+0x34>
movl   $0x0,-0x4(%rbp)
jmp    118f <qual_char_is_invalid+0x8f>
movsbl -0x5(%rbp),%ecx
mov    $0x61,%eax
cmp    %ecx,%eax
jg     115e <qual_char_is_invalid+0x5e>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jg     115e <qual_char_is_invalid+0x5e>
movl   $0x0,-0x4(%rbp)
jmp    118f <qual_char_is_invalid+0x8f>
movsbl -0x5(%rbp),%ecx
mov    $0x30,%eax
cmp    %ecx,%eax
jg     1188 <qual_char_is_invalid+0x88>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1188 <qual_char_is_invalid+0x88>
movl   $0x0,-0x4(%rbp)
jmp    118f <qual_char_is_invalid+0x8f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qual_char_is_invalid>:
mov    %edi,%eax
and    $0xdf,%al
add    $0xa5,%al
cmp    $0xe6,%al
setb   %al
add    $0xc6,%dil
cmp    $0xf6,%dil
setb   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @qual_char_is_invalid(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sle i32 65, %5
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 90
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 0, i32* %2
br label %31
12: ; preds = %7, %1
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp sle i32 97, %14
br i1 %15, label %16, label %21
16: ; preds = %12
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = icmp sle i32 %18, 122
br i1 %19, label %20, label %21
20: ; preds = %16
store i32 0, i32* %2
br label %31
21: ; preds = %16, %12
%22 = load i8, i8* %3
%23 = sext i8 %22 to i32
%24 = icmp sle i32 48, %23
br i1 %24, label %25, label %30
25: ; preds = %21
%26 = load i8, i8* %3
%27 = sext i8 %26 to i32
%28 = icmp sle i32 %27, 57
br i1 %28, label %29, label %30
29: ; preds = %25
store i32 0, i32* %2
br label %31
30: ; preds = %25, %21
store i32 1, i32* %2
br label %31
31: ; preds = %30, %29, %20, %11
%32 = load i32, i32* %2
ret i32 %32
}

LLVM IR (-O2):
define i32 @qual_char_is_invalid(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -91
%4 = icmp ult i8 %3, -26
%5 = add i8 %0, -58
%6 = icmp ult i8 %5, -10
%7 = and i1 %6, %4
%8 = zext i1 %7 to i32
ret i32 %8
}
int main() {
  unsigned long long a;
  unsigned long long addr;
  if (a + addr > 0x0ffffffffULL) {
    return 1;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    $0xffffffff,%ecx
cmp    %rcx,%rax
jbe    1128 <main+0x28>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
store i32 0, i32* %1
%4 = load i64, i64* %2
%5 = load i64, i64* %3
%6 = add i64 %4, %5
%7 = icmp ugt i64 %6, 4294967295
br i1 %7, label %8, label %9
8: ; preds = %0
store i32 1, i32* %1
br label %9
9: ; preds = %8, %0
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ putPixel(short, short, char);
void setPixel(short x, short y, char color) { putPixel(x, y, color); }


x86 assembly (clang, -O0):
<setPixel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %si,%cx
mov    %di,%dx
mov    %dx,-0x2(%rbp)
mov    %cx,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x2(%rbp),%cx
mov    -0x4(%rbp),%ax
movswl %cx,%edi
movswl %ax,%esi
movsbl -0x5(%rbp),%edx
call   1030 <putPixel@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setPixel>:
jmp    1030 <putPixel@plt>

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

LLVM IR (-O2):
define void @setPixel(i16 signext %0, i16 signext %1, i8 signext %2) {
%4 = tail call i32 @putPixel(i16 signext %0, i16 signext %1, i8 signext %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setenv(char *, char *, int);
void desabilita_cache_compilacao() { setenv("CUDA_CACHE_DISABLE", "1", 1); }


x86 assembly (clang, -O0):
<desabilita_cache_compilacao>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xef1(%rip),%rsi
mov    $0x1,%edx
call   1030 <setenv@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<desabilita_cache_compilacao>:
lea    0xee9(%rip),%rdi
lea    0xef5(%rip),%rsi
mov    $0x1,%edx
jmp    1030 <setenv@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"CUDA_CACHE_DISABLE\00"
@.str.1 = [2 x i8] c"1\00"
define void @desabilita_cache_compilacao() {
%1 = call i32 @setenv(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"CUDA_CACHE_DISABLE\00"
@.str.1 = [2 x i8] c"1\00"
define void @desabilita_cache_compilacao() {
%1 = tail call i32 @setenv(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RamWrite32A(int, int /*<<< orphan*/);
void ClrMesFil(void) {
  RamWrite32A(0x0000 + 0x0308, 0);
  RamWrite32A(0x0004 + 0x0000 + 0x0308, 0);
  RamWrite32A(0x0004 + 0x0004 + 0x0000 + 0x0308, 0);
  RamWrite32A(0x0004 + 0x0004 + 0x0004 + 0x0000 + 0x0308, 0);
  RamWrite32A(0x0000 + 0x0318, 0);
  RamWrite32A(0x0004 + 0x0000 + 0x0318, 0);
  RamWrite32A(0x0004 + 0x0004 + 0x0000 + 0x0318, 0);
  RamWrite32A(0x0004 + 0x0004 + 0x0004 + 0x0000 + 0x0318, 0);
}


x86 assembly (clang, -O0):
<ClrMesFil>:
push   %rbp
mov    %rsp,%rbp
mov    $0x308,%edi
xor    %esi,%esi
call   1030 <RamWrite32A@plt>
mov    $0x30c,%edi
xor    %esi,%esi
call   1030 <RamWrite32A@plt>
mov    $0x310,%edi
xor    %esi,%esi
call   1030 <RamWrite32A@plt>
mov    $0x314,%edi
xor    %esi,%esi
call   1030 <RamWrite32A@plt>
mov    $0x318,%edi
xor    %esi,%esi
call   1030 <RamWrite32A@plt>
mov    $0x31c,%edi
xor    %esi,%esi
call   1030 <RamWrite32A@plt>
mov    $0x320,%edi
xor    %esi,%esi
call   1030 <RamWrite32A@plt>
mov    $0x324,%edi
xor    %esi,%esi
call   1030 <RamWrite32A@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ClrMesFil>:
push   %rax
mov    $0x308,%edi
xor    %esi,%esi
call   1030 <RamWrite32A@plt>
mov    $0x30c,%edi
xor    %esi,%esi
call   1030 <RamWrite32A@plt>
mov    $0x310,%edi
xor    %esi,%esi
call   1030 <RamWrite32A@plt>
mov    $0x314,%edi
xor    %esi,%esi
call   1030 <RamWrite32A@plt>
mov    $0x318,%edi
xor    %esi,%esi
call   1030 <RamWrite32A@plt>
mov    $0x31c,%edi
xor    %esi,%esi
call   1030 <RamWrite32A@plt>
mov    $0x320,%edi
xor    %esi,%esi
call   1030 <RamWrite32A@plt>
mov    $0x324,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <RamWrite32A@plt>

LLVM IR (-O0):
define void @ClrMesFil() {
%1 = call i32 @RamWrite32A(i32 776, i32 0)
%2 = call i32 @RamWrite32A(i32 780, i32 0)
%3 = call i32 @RamWrite32A(i32 784, i32 0)
%4 = call i32 @RamWrite32A(i32 788, i32 0)
%5 = call i32 @RamWrite32A(i32 792, i32 0)
%6 = call i32 @RamWrite32A(i32 796, i32 0)
%7 = call i32 @RamWrite32A(i32 800, i32 0)
%8 = call i32 @RamWrite32A(i32 804, i32 0)
ret void
}

LLVM IR (-O2):
define void @ClrMesFil() {
%1 = tail call i32 @RamWrite32A(i32 776, i32 0)
%2 = tail call i32 @RamWrite32A(i32 780, i32 0)
%3 = tail call i32 @RamWrite32A(i32 784, i32 0)
%4 = tail call i32 @RamWrite32A(i32 788, i32 0)
%5 = tail call i32 @RamWrite32A(i32 792, i32 0)
%6 = tail call i32 @RamWrite32A(i32 796, i32 0)
%7 = tail call i32 @RamWrite32A(i32 800, i32 0)
%8 = tail call i32 @RamWrite32A(i32 804, i32 0)
ret void
}
void uint8_to_buff(unsigned long val, unsigned char *buff, unsigned int *off) {
  buff[*off + 0] = val & 0xff;
  *off += 1;
}


x86 assembly (clang, -O0):
<uint8_to_buff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
and    $0xff,%rax
mov    %al,%dl
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rcx),%ecx
add    $0x0,%ecx
mov    %ecx,%ecx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint8_to_buff>:
mov    (%rdx),%eax
mov    %dil,(%rsi,%rax,1)
addl   $0x1,(%rdx)
ret

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

LLVM IR (-O2):
define void @uint8_to_buff(i64 %0, i8* nocapture writeonly %1, i32* nocapture %2) {
%4 = trunc i64 %0 to i8
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %1, i64 %6
store i8 %4, i8* %7
%8 = load i32, i32* %2
%9 = add i32 %8, 1
store i32 %9, i32* %2
ret void
}
int main() {
  int *a;
  int b;
  b = 12;
  a = &b;
  return *a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xc,-0x14(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void write_fileheader(void) {
  printf("/* This file was generated by libavcodec/tableprint */\n");
  printf("#include <stdint.h>\n");
}


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

x86 assembly (clang, -O2):
<write_fileheader>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf13(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [56 x i8] c"/* This file was generated by libavcodec/tableprint */\0A\00"
@.str.1 = [21 x i8] c"#include <stdint.h>\0A\00"
define void @write_fileheader() {
%1 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [55 x i8] c"/* This file was generated by libavcodec/tableprint */\00"
@str.2 = [20 x i8] c"#include <stdint.h>\00"
define void @write_fileheader() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.2, i64 0, i64 0))
ret void
}
int(ars_d_set_tcpopt_wscale)(struct ars_packet *pkt, int layer, char *f,
                             char *v) {
  return 0;
}


x86 assembly (clang, -O0):
<ars_d_set_tcpopt_wscale>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ars_packet = type opaque
define i32 @ars_d_set_tcpopt_wscale(%struct.ars_packet* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca %struct.ars_packet*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store %struct.ars_packet* %0, %struct.ars_packet** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
ret i32 0
}

LLVM IR (-O2):
%struct.ars_packet = type opaque
define i32 @ars_d_set_tcpopt_wscale(%struct.ars_packet* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i8* nocapture readnone %3) {
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
struct lldp_tlv {
  int dummy;
};

/* Variables and functions */
uint8_t tlvpush(uint8_t *buffer, struct lldp_tlv *tlv) { return -1; }


x86 assembly (clang, -O0):
<tlvpush>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.lldp_tlv = type { i32 }
define i32 @tlvpush(i32* nocapture readnone %0, %struct.lldp_tlv* nocapture readnone %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ usbClassSetConfiguration(int /*<<< orphan*/);
void usbClassResetSeen(void) { usbClassSetConfiguration(0); }


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

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

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

LLVM IR (-O2):
define void @usbClassResetSeen() {
%1 = tail call i32 @usbClassSetConfiguration(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ perror(char *);
int setuid(int /*<<< orphan*/);
void cmd_setuid(int argc, char *argv[]) {
  if (setuid(atoi(argv[1])) == -1)
    perror("setuid");
}


x86 assembly (clang, -O0):
<cmd_setuid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
call   1050 <setuid@plt>
cmp    $0xffffffff,%eax
jne    1168 <cmd_setuid+0x38>
lea    0xe9d(%rip),%rdi
call   1030 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_setuid>:
push   %rax
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
call   1050 <setuid@plt>
cmp    $0xffffffff,%eax
je     1148 <cmd_setuid+0x18>
pop    %rax
ret
lea    0xeb1(%rip),%rdi
pop    %rax
jmp    1030 <perror@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"setuid\00"
define void @cmd_setuid(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = tail call i32 @setuid(i32 %5)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
ret void
}
unsigned char uart0GetChar(unsigned char *pRxChar) {
  if (((*((volatile unsigned long *)0xE000C014)) & 0x01) != 0x00) {
    *pRxChar = (*((volatile unsigned long *)0xE000C000));
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<uart0GetChar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    $0xe000c014,%eax
mov    (%rax),%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     1137 <uart0GetChar+0x37>
mov    $0xe000c000,%eax
mov    (%rax),%rax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
movb   $0x1,-0x1(%rbp)
jmp    113b <uart0GetChar+0x3b>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart0GetChar>:
mov    $0xe000c000,%eax
testq  $0x1,0x14(%rax)
jne    1112 <uart0GetChar+0x12>
xor    %eax,%eax
ret
mov    (%rax),%rax
mov    %al,(%rdi)
mov    $0x1,%al
ret

LLVM IR (-O0):
define zeroext i8 @uart0GetChar(i8* %0) {
%2 = alloca i8
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load volatile i64, i64* inttoptr (i64 3758145556 to i64*)
%5 = and i64 %4, 1
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load volatile i64, i64* inttoptr (i64 3758145536 to i64*)
%9 = trunc i64 %8 to i8
%10 = load i8*, i8** %3
store i8 %9, i8* %10
store i8 1, i8* %2
br label %12
11: ; preds = %1
store i8 0, i8* %2
br label %12
12: ; preds = %11, %7
%13 = load i8, i8* %2
ret i8 %13
}

LLVM IR (-O2):
define zeroext i8 @uart0GetChar(i8* nocapture writeonly %0) {
%2 = load volatile i64, i64* inttoptr (i64 3758145556 to i64*)
%3 = and i64 %2, 1
%4 = icmp eq i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load volatile i64, i64* inttoptr (i64 3758145536 to i64*)
%7 = trunc i64 %6 to i8
store i8 %7, i8* %0
br label %8
8: ; preds = %1, %5
%9 = phi i8 [ 1, %5 ], [ 0, %1 ]
ret i8 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void md_par_beg(FILE *fw, int term) {
  switch (term) {
  case 0:
    fprintf(fw, "\n");
    break;
  case 1:
    fprintf(fw, "<p>\n");
    break;
  case 2:
    fprintf(fw, "\n");
    break;
  }
}


x86 assembly (clang, -O0):
<md_par_beg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     1154 <md_par_beg+0x44>
jmp    1132 <md_par_beg+0x22>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     1169 <md_par_beg+0x59>
jmp    1143 <md_par_beg+0x33>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     117e <md_par_beg+0x6e>
jmp    118e <md_par_beg+0x7e>
mov    -0x8(%rbp),%rdi
lea    0xea4(%rip),%rsi
call   1030 <fprintf@plt>
jmp    118e <md_par_beg+0x7e>
mov    -0x8(%rbp),%rdi
lea    0xe8c(%rip),%rsi
call   1030 <fprintf@plt>
jmp    118e <md_par_beg+0x7e>
mov    -0x8(%rbp),%rdi
lea    0xe7a(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<md_par_beg>:
mov    %rdi,%rcx
cmp    $0x2,%esi
je     1131 <md_par_beg+0x11>
cmp    $0x1,%esi
je     113e <md_par_beg+0x1e>
test   %esi,%esi
jne    1154 <md_par_beg+0x34>
mov    $0xa,%edi
mov    %rcx,%rsi
jmp    1030 <fputc@plt>
lea    0xebb(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
jmp    1040 <fwrite@plt>
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [5 x i8] c"<p>\0A\00"
define void @md_par_beg(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
switch i32 %5, label %15 [
i32 0, label %6
i32 1, label %9
i32 2, label %12
]
6: ; preds = %2
%7 = load i32*, i32** %3
%8 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %15
9: ; preds = %2
%10 = load i32*, i32** %3
%11 = call i32 @fprintf(i32* %10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %15
12: ; preds = %2
%13 = load i32*, i32** %3
%14 = call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %2, %12, %9, %6
ret void
}

LLVM IR (-O2):
@.str.1 = [5 x i8] c"<p>\0A\00"
define void @md_par_beg(i32* nocapture %0, i32 %1) {
switch i32 %1, label %9 [
i32 0, label %3
i32 1, label %5
i32 2, label %7
]
3: ; preds = %2
%4 = tail call i32 @fputc(i32 10, i32* %0)
br label %9
5: ; preds = %2
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 4, i64 1, i32* %0)
br label %9
7: ; preds = %2
%8 = tail call i32 @fputc(i32 10, i32* %0)
br label %9
9: ; preds = %2, %7, %5, %3
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
void ref_div_int32_t(int32_t arg1, int32_t arg2, int32_t *result) {
  *result = arg1 / arg2;
}


x86 assembly (clang, -O0):
<ref_div_int32_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ref_div_int32_t>:
mov    %rdx,%rcx
mov    %edi,%eax
cltd
idiv   %esi
mov    %eax,(%rcx)
ret

LLVM IR (-O0):
define void @ref_div_int32_t(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* %4
%8 = load i32, i32* %5
%9 = sdiv i32 %7, %8
%10 = load i32*, i32** %6
store i32 %9, i32* %10
ret void
}

LLVM IR (-O2):
define void @ref_div_int32_t(i32 %0, i32 %1, i32* nocapture writeonly %2) {
%4 = sdiv i32 %0, %1
store i32 %4, i32* %2
ret void
}
void WebPInitAlphaProcessingSSE41(void) {}


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

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

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

LLVM IR (-O2):
define void @WebPInitAlphaProcessingSSE41() {
ret void
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *strdup(const char *s) {
  char *res = (char *)malloc(strlen(s) + 1);
  if (res)
    strcpy(res, s);
  return res;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116d <strdup+0x3d>
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):
<strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1158 <strdup+0x28>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %15
11: ; preds = %1
%12 = load i8*, i8** %3
%13 = load i8*, i8** %2
%14 = call i32 @strcpy(i8* %12, i8* %13)
br label %15
15: ; preds = %11, %1
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @strcpy(i8* %5, i8* %0)
br label %9
9: ; preds = %7, %1
ret i8* %5
}