xunge/DecIR huggingface dataset:
/* Variables and functions */
int strcmp(char *, char *);
int cmp_names(const void *p1, const void *p2) {
  return strcmp(*(char **)p1, *(char **)p2);
}


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

x86 assembly (clang, -O2):
<cmp_names>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @cmp_names(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
unsigned short unsignedshort_ignoring_unsignedint(unsigned short x,
                                                  unsigned int y) {
  return x;
}


x86 assembly (clang, -O0):
<unsignedshort_ignoring_unsignedint>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define zeroext i16 @unsignedshort_ignoring_unsignedint(i16 returned zeroext %0, i32 %1) {
ret i16 %0
}
/* Variables and functions */
int /*<<< orphan*/ err(int, int /*<<< orphan*/ *);
void *realloc(void *, size_t);
void *brealloc(void *p, size_t sz) {
  void *q;
  q = realloc(p, sz);
  if (q == NULL)
    err(1, NULL);
  return (q);
}


x86 assembly (clang, -O0):
<brealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115a <brealloc+0x3a>
mov    $0x1,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <err@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<brealloc>:
push   %rbx
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <brealloc+0x1a>
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <err@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @brealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @err(i32 1, i32* null)
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ ll_delete(void **, void *, void (*)(void *));
void ll_destroy(void **baseptr, void (*destructor)(void *)) {
  if (!baseptr)
    return;
  while (*baseptr)
    ll_delete(baseptr, *baseptr, destructor);
}


x86 assembly (clang, -O0):
<ll_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1130 <ll_destroy+0x20>
jmp    115c <ll_destroy+0x4c>
jmp    1135 <ll_destroy+0x25>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     115c <ll_destroy+0x4c>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <ll_delete@plt>
jmp    1135 <ll_destroy+0x25>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ll_destroy>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1135 <ll_destroy+0x25>
mov    %rsi,%r14
mov    %rdi,%rbx
nop
mov    (%rbx),%rsi
test   %rsi,%rsi
je     1135 <ll_destroy+0x25>
mov    %rbx,%rdi
mov    %r14,%rdx
call   1030 <ll_delete@plt>
jmp    1120 <ll_destroy+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @ll_destroy(i8** %0, void (i8*)* %1) {
%3 = icmp eq i8** %0, null
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = load i8*, i8** %0
%6 = icmp eq i8* %5, null
br i1 %6, label %12, label %7
7: ; preds = %4, %7
%8 = phi i8* [ %10, %7 ], [ %5, %4 ]
%9 = tail call i32 @ll_delete(i8** %0, i8* %8, void (i8*)* %1)
%10 = load i8*, i8** %0
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %7
12: ; preds = %7, %4, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int /*<<< orphan*/ sigsuspend(int /*<<< orphan*/ *);
void sig_pause(void) {
  sigset_t ss;
  sigemptyset(&ss);
  sigsuspend(&ss);
}


x86 assembly (clang, -O0):
<sig_pause>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1030 <sigemptyset@plt>
lea    -0x4(%rbp),%rdi
call   1040 <sigsuspend@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_pause>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <sigemptyset@plt>
mov    %rbx,%rdi
call   1040 <sigsuspend@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @sig_pause() {
%1 = alloca i32
%2 = call i32 @sigemptyset(i32* %1)
%3 = call i32 @sigsuspend(i32* %1)
ret void
}

LLVM IR (-O2):
define void @sig_pause() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @sigemptyset(i32* %1)
%4 = call i32 @sigsuspend(i32* %1)
ret void
}
/* Type definitions */
struct statvfs {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int statvfs(const char *path, struct statvfs *buf) {
  ;
  errno = ENOSYS;
  return -1;
  ;
}


x86 assembly (clang, -O0):
<statvfs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed5(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebc(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.statvfs = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @statvfs(i8* %0, %struct.statvfs* %1) {
%3 = alloca i8*
%4 = alloca %struct.statvfs*
store i8* %0, i8** %3
store %struct.statvfs* %1, %struct.statvfs** %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct.statvfs = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @statvfs(i8* nocapture readnone %0, %struct.statvfs* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main(void) {
  int f = 27;
  float c;
  c = (f - 32) / 1.8;
  printf("»ªÊÏ27¶ÈÎªÉãÊÏ¶È %f ¶È", c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1b,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x20,%eax
cvtsi2sd %eax,%xmm0
movsd  0xec8(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [39 x i8] c"\C2\BB\C2\AA\C3\8A\C3\8F27\C2\B6\C3\88\C3\8E\C2\AA\C3\89\C3\A3\C3\8A\C3\8F\C2\B6\C3\88 %f \C2\B6\C3\88\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
store i32 0, i32* %1
store i32 27, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 32
%6 = sitofp i32 %5 to double
%7 = fdiv double %6, 1.800000e+00
%8 = fptrunc double %7 to float
store float %8, float* %3
%9 = load float, float* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), float %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [39 x i8] c"\C2\BB\C2\AA\C3\8A\C3\8F27\C2\B6\C3\88\C3\8E\C2\AA\C3\89\C3\A3\C3\8A\C3\8F\C2\B6\C3\88 %f \C2\B6\C3\88\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), float 0xC00638E380000000)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cs2spcb(void *, void *);
void cs2spcb_(void *pcbfn, void *data) { cs2spcb(pcbfn, data); }


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

x86 assembly (clang, -O2):
<cs2spcb_>:
jmp    1030 <cs2spcb@plt>

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

LLVM IR (-O2):
define void @cs2spcb_(i8* %0, i8* %1) {
%3 = tail call i32 @cs2spcb(i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int foo();
int main() {
  if (foo() != 1)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <foo@plt>
cmp    $0x1,%eax
je     1156 <main+0x26>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <foo@plt>
cmp    $0x1,%eax
jne    1144 <main+0x14>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @foo()
%3 = icmp ne i32 %2, 1
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = icmp eq i32 %1, 1
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @exit(i32 0)
unreachable
}
int dbg_debugfs_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @dbg_debugfs_init() {
ret i32 0
}
void display(void) {}


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

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

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

LLVM IR (-O2):
define void @display() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ kernel_dgetrf_nn_4x4_vs_lib4(int, int, int, double *,
                                                double *, int, int, double *,
                                                double *, double *);
void kernel_dgetrf_nn_4x4_lib4(int kmax, double *A, double *B, int sdb, int alg,
                               double *C, double *D, double *inv_diag_D) {
  kernel_dgetrf_nn_4x4_vs_lib4(4, 4, kmax, A, B, sdb, alg, C, D, inv_diag_D);
}


x86 assembly (clang, -O0):
<kernel_dgetrf_nn_4x4_lib4>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x48,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    %r8d,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x24(%rbp),%r9d
mov    -0x28(%rbp),%ebx
mov    -0x30(%rbp),%r11
mov    0x10(%rbp),%r10
mov    0x18(%rbp),%rax
mov    $0x4,%esi
mov    %esi,%edi
mov    %ebx,(%rsp)
mov    %r11,0x8(%rsp)
mov    %r10,0x10(%rsp)
mov    %rax,0x18(%rsp)
call   1030 <kernel_dgetrf_nn_4x4_vs_lib4@plt>
add    $0x48,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel_dgetrf_nn_4x4_lib4>:
sub    $0x28,%rsp
mov    %ecx,%r10d
mov    %rdx,%rax
mov    %rsi,%rcx
mov    %edi,%edx
movaps 0x30(%rsp),%xmm0
movups %xmm0,0x10(%rsp)
mov    %r9,0x8(%rsp)
mov    %r8d,(%rsp)
mov    $0x4,%edi
mov    $0x4,%esi
mov    %rax,%r8
mov    %r10d,%r9d
call   1030 <kernel_dgetrf_nn_4x4_vs_lib4@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define void @kernel_dgetrf_nn_4x4_lib4(i32 %0, double* %1, double* %2, i32 %3, i32 %4, double* %5, double* %6, double* %7) {
%9 = alloca i32
%10 = alloca double*
%11 = alloca double*
%12 = alloca i32
%13 = alloca i32
%14 = alloca double*
%15 = alloca double*
%16 = alloca double*
store i32 %0, i32* %9
store double* %1, double** %10
store double* %2, double** %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store double* %5, double** %14
store double* %6, double** %15
store double* %7, double** %16
%17 = load i32, i32* %9
%18 = load double*, double** %10
%19 = load double*, double** %11
%20 = load i32, i32* %12
%21 = load i32, i32* %13
%22 = load double*, double** %14
%23 = load double*, double** %15
%24 = load double*, double** %16
%25 = call i32 @kernel_dgetrf_nn_4x4_vs_lib4(i32 4, i32 4, i32 %17, double* %18, double* %19, i32 %20, i32 %21, double* %22, double* %23, double* %24)
ret void
}

LLVM IR (-O2):
define void @kernel_dgetrf_nn_4x4_lib4(i32 %0, double* %1, double* %2, i32 %3, i32 %4, double* %5, double* %6, double* %7) {
%9 = tail call i32 @kernel_dgetrf_nn_4x4_vs_lib4(i32 4, i32 4, i32 %0, double* %1, double* %2, i32 %3, i32 %4, double* %5, double* %6, double* %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SerialWriteChar(int);
void iRobot_SafeMode() { SerialWriteChar(131); }


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

x86 assembly (clang, -O2):
<iRobot_SafeMode>:
mov    $0x83,%edi
jmp    1030 <SerialWriteChar@plt>

LLVM IR (-O0):
define void @iRobot_SafeMode() {
%1 = call i32 @SerialWriteChar(i32 131)
ret void
}

LLVM IR (-O2):
define void @iRobot_SafeMode() {
%1 = tail call i32 @SerialWriteChar(i32 131)
ret void
}
int isleap(int year) {
  return (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0));
}


x86 assembly (clang, -O0):
<isleap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1134 <isleap+0x34>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x5(%rbp)
jne    1148 <isleap+0x48>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isleap>:
test   $0x3,%dil
jne    112c <isleap+0x2c>
movslq %edi,%rax
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x64,%eax,%ecx
mov    %edi,%edx
mov    $0x1,%eax
sub    %ecx,%edx
je     112c <isleap+0x2c>
ret
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
ror    $0x4,%ecx
xor    %eax,%eax
cmp    $0xa3d70b,%ecx
setb   %al
ret

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

LLVM IR (-O2):
define i32 @isleap(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp ne i32 %2, 0
%4 = srem i32 %0, 100
%5 = icmp eq i32 %4, 0
%6 = or i1 %3, %5
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = srem i32 %0, 400
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %1, %7
%12 = phi i32 [ %10, %7 ], [ 1, %1 ]
ret i32 %12
}
void s3c_adc_setname(char *name) {}


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

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

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

LLVM IR (-O2):
define void @s3c_adc_setname(i8* nocapture %0) {
ret void
}
/* Variables and functions */
size_t next_power_of_two(size_t v) {
  v--;
  v |= v >> 1;
  v |= v >> 2;
  v |= v >> 4;
  v |= v >> 8;
  v |= v >> 16;
  v |= v >> 32;
  v++;
  return v;
}


x86 assembly (clang, -O0):
<next_power_of_two>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x2,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x4,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x8,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x10,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x20,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_power_of_two>:
lea    -0x1(%rdi),%rax
mov    %rax,%rcx
shr    %rcx
or     %rax,%rcx
mov    %rcx,%rax
shr    $0x2,%rax
or     %rcx,%rax
mov    %rax,%rcx
shr    $0x4,%rcx
or     %rax,%rcx
mov    %rcx,%rax
shr    $0x8,%rax
or     %rcx,%rax
mov    %rax,%rcx
shr    $0x10,%rcx
or     %rax,%rcx
mov    %rcx,%rax
shr    $0x20,%rax
or     %rcx,%rax
add    $0x1,%rax
ret

LLVM IR (-O0):
define i64 @next_power_of_two(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, -1
store i64 %4, i64* %2
%5 = load i64, i64* %2
%6 = lshr i64 %5, 1
%7 = load i64, i64* %2
%8 = or i64 %7, %6
store i64 %8, i64* %2
%9 = load i64, i64* %2
%10 = lshr i64 %9, 2
%11 = load i64, i64* %2
%12 = or i64 %11, %10
store i64 %12, i64* %2
%13 = load i64, i64* %2
%14 = lshr i64 %13, 4
%15 = load i64, i64* %2
%16 = or i64 %15, %14
store i64 %16, i64* %2
%17 = load i64, i64* %2
%18 = lshr i64 %17, 8
%19 = load i64, i64* %2
%20 = or i64 %19, %18
store i64 %20, i64* %2
%21 = load i64, i64* %2
%22 = lshr i64 %21, 16
%23 = load i64, i64* %2
%24 = or i64 %23, %22
store i64 %24, i64* %2
%25 = load i64, i64* %2
%26 = lshr i64 %25, 32
%27 = load i64, i64* %2
%28 = or i64 %27, %26
store i64 %28, i64* %2
%29 = load i64, i64* %2
%30 = add i64 %29, 1
store i64 %30, i64* %2
%31 = load i64, i64* %2
ret i64 %31
}

LLVM IR (-O2):
define i64 @next_power_of_two(i64 %0) {
%2 = add i64 %0, -1
%3 = lshr i64 %2, 1
%4 = or i64 %3, %2
%5 = lshr i64 %4, 2
%6 = or i64 %5, %4
%7 = lshr i64 %6, 4
%8 = or i64 %7, %6
%9 = lshr i64 %8, 8
%10 = or i64 %9, %8
%11 = lshr i64 %10, 16
%12 = or i64 %11, %10
%13 = lshr i64 %12, 32
%14 = or i64 %13, %12
%15 = add i64 %14, 1
ret i64 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  unsigned char *pBuffer = NULL;
  printf("in vnc test main\n");
  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)
movq   $0x0,-0x18(%rbp)
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [18 x i8] c"in vnc test main\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %6
%7 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [17 x i8] c"in vnc test main\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct fc_sockaddr_list {
  int dummy;
};

/* Variables and functions */
scalar_t__ genlist_new();
struct fc_sockaddr_list *fc_sockaddr_list_new(void) {
  return (struct fc_sockaddr_list *)genlist_new();
}


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

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

LLVM IR (-O0):
%struct.fc_sockaddr_list = type { i32 }
define %struct.fc_sockaddr_list* @fc_sockaddr_list_new() {
%1 = call i64 (...) @genlist_new()
%2 = inttoptr i64 %1 to %struct.fc_sockaddr_list*
ret %struct.fc_sockaddr_list* %2
}

LLVM IR (-O2):
%struct.fc_sockaddr_list = type { i32 }
define %struct.fc_sockaddr_list* @fc_sockaddr_list_new() {
%1 = tail call i64 (...) @genlist_new()
%2 = inttoptr i64 %1 to %struct.fc_sockaddr_list*
ret %struct.fc_sockaddr_list* %2
}
unsigned xrop3_235_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = T ^ S;
  stk2 = ~stk2;
  stk1 = D | stk2;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_235_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_235_1_1>:
mov    %esi,%ecx
or     %edi,%esi
mov    %edi,%eax
shl    $0x8,%eax
shl    $0x8,%ecx
mov    %ecx,%edx
xor    %eax,%edx
or     %esi,%eax
or     %ecx,%eax
or     %edx,%eax
not    %eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_235_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %7
%23 = load i32, i32* %6
%24 = xor i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %9
%26 = xor i32 %25, -1
store i32 %26, i32* %9
%27 = load i32, i32* %5
%28 = load i32, i32* %9
%29 = or i32 %27, %28
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = load i32, i32* %6
%32 = xor i32 %31, -1
%33 = and i32 %30, %32
%34 = load i32, i32* %7
%35 = xor i32 %34, -1
%36 = and i32 %33, %35
%37 = load i32, i32* %5
%38 = load i32, i32* %6
%39 = and i32 %37, %38
%40 = or i32 %36, %39
%41 = load i32, i32* %5
%42 = load i32, i32* %7
%43 = and i32 %41, %42
%44 = or i32 %40, %43
ret i32 %44
}

LLVM IR (-O2):
define i32 @xrop3_235_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = zext i8 %1 to i32
%6 = shl nuw nsw i32 %5, 8
%7 = xor i32 %6, %4
%8 = or i8 %1, %0
%9 = zext i8 %8 to i32
%10 = or i32 %4, %9
%11 = or i32 %10, %6
%12 = or i32 %11, %7
%13 = xor i32 %12, -1
%14 = or i32 %9, %13
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int /*<<< orphan*/ foo();
int /*<<< orphan*/ foobar();
void main(int i) {
  foobar();
  if (1) {
    foo();
  }
  bar();
  foobar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <foobar@plt>
mov    $0x0,%al
call   1050 <foo@plt>
mov    $0x0,%al
call   1030 <bar@plt>
mov    $0x0,%al
call   1040 <foobar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <foobar@plt>
xor    %eax,%eax
call   1050 <foo@plt>
xor    %eax,%eax
call   1030 <bar@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <foobar@plt>

LLVM IR (-O0):
define void @main(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @foobar()
%4 = call i32 (...) @foo()
%5 = call i32 (...) @bar()
%6 = call i32 (...) @foobar()
ret void
}

LLVM IR (-O2):
define void @main(i32 %0) {
%2 = tail call i32 (...) @foobar()
%3 = tail call i32 (...) @foo()
%4 = tail call i32 (...) @bar()
%5 = tail call i32 (...) @foobar()
ret void
}
double *copy3(const double a[], double result[]) {
  result[0] = a[0];
  result[1] = a[1];
  result[2] = a[2];
  return result;
}


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

x86 assembly (clang, -O2):
<copy3>:
mov    %rsi,%rax
movsd  (%rdi),%xmm0
movsd  %xmm0,(%rsi)
movsd  0x8(%rdi),%xmm0
movsd  %xmm0,0x8(%rsi)
movsd  0x10(%rdi),%xmm0
movsd  %xmm0,0x10(%rsi)
ret

LLVM IR (-O0):
define double* @copy3(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 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %4
%9 = getelementptr inbounds double, double* %8, i64 0
store double %7, double* %9
%10 = load double*, double** %3
%11 = getelementptr inbounds double, double* %10, i64 1
%12 = load double, double* %11
%13 = load double*, double** %4
%14 = getelementptr inbounds double, double* %13, i64 1
store double %12, double* %14
%15 = load double*, double** %3
%16 = getelementptr inbounds double, double* %15, i64 2
%17 = load double, double* %16
%18 = load double*, double** %4
%19 = getelementptr inbounds double, double* %18, i64 2
store double %17, double* %19
%20 = load double*, double** %4
ret double* %20
}

LLVM IR (-O2):
define double* @copy3(double* nocapture %0, double* returned writeonly %1) {
%3 = load double, double* %0
store double %3, double* %1
%4 = getelementptr inbounds double, double* %0, i64 1
%5 = load double, double* %4
%6 = getelementptr inbounds double, double* %1, i64 1
store double %5, double* %6
%7 = getelementptr inbounds double, double* %0, i64 2
%8 = load double, double* %7
%9 = getelementptr inbounds double, double* %1, i64 2
store double %8, double* %9
ret double* %1
}
int kbhit() { return (((unsigned int volatile *)0xd4018000)[5] & 0x1) != 0; }


x86 assembly (clang, -O0):
<kbhit>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd4018000,%eax
mov    0x14(%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kbhit>:
mov    $0xd4018014,%eax
mov    (%rax),%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @kbhit() {
%1 = load volatile i32, i32* getelementptr inbounds (i32, i32* inttoptr (i64 3556868096 to i32*), i64 5)
%2 = and i32 %1, 1
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @kbhit() {
%1 = load volatile i32, i32* inttoptr (i64 3556868116 to i32*)
%2 = and i32 %1, 1
ret i32 %2
}
char *langRomTypeSfg01() { return "Yamaha SFG-01"; }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Yamaha SFG-01\00"
define i8* @langRomTypeSfg01() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [14 x i8] c"Yamaha SFG-01\00"
define i8* @langRomTypeSfg01() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void lastz_show_stats(FILE *f __attribute__((unused))) {}


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

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

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

LLVM IR (-O2):
define void @lastz_show_stats(i32* nocapture %0) {
ret void
}
char *bar(unsigned long x, char *y) {
  extern const char ext[];
  const char *a = ext;
  char *b = y;
  do
    *--b = a[x % 10];
  while ((x /= 10) != 0);
  return b;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed5(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    -0x28(%rbp),%rax
mov    (%rax,%rdx,1),%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,-0x1(%rax)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
jne    111f <bar+0x1f>
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
mov    %rdi,%rcx
mov    0x2ede(%rip),%r8
movabs $0xcccccccccccccccd,%r9
cc cc cc
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rcx,%rax
mul    %r9
shr    $0x3,%rdx
lea    (%rdx,%rdx,1),%rax
lea    (%rax,%rax,4),%rax
mov    %rcx,%rdi
sub    %rax,%rdi
movzbl (%r8,%rdi,1),%eax
mov    %al,-0x1(%rsi)
add    $0xffffffffffffffff,%rsi
cmp    $0x9,%rcx
mov    %rdx,%rcx
ja     1120 <bar+0x20>
mov    %rsi,%rax
ret

LLVM IR (-O0):
@ext = external constant [0 x i8]
define i8* @bar(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
store i8* getelementptr inbounds ([0 x i8], [0 x i8]* @ext, i64 0, i64 0), i8** %5
%7 = load i8*, i8** %4
store i8* %7, i8** %6
br label %8
8: ; preds = %16, %2
%9 = load i8*, i8** %5
%10 = load i64, i64* %3
%11 = urem i64 %10, 10
%12 = getelementptr inbounds i8, i8* %9, i64 %11
%13 = load i8, i8* %12
%14 = load i8*, i8** %6
%15 = getelementptr inbounds i8, i8* %14, i32 -1
store i8* %15, i8** %6
store i8 %13, i8* %15
br label %16
16: ; preds = %8
%17 = load i64, i64* %3
%18 = udiv i64 %17, 10
store i64 %18, i64* %3
%19 = icmp ne i64 %18, 0
br i1 %19, label %8, label %20
20: ; preds = %16
%21 = load i8*, i8** %6
ret i8* %21
}

LLVM IR (-O2):
@ext = external constant [0 x i8]
define i8* @bar(i64 %0, i8* writeonly %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %0, %2 ], [ %10, %3 ]
%5 = phi i8* [ %1, %2 ], [ %9, %3 ]
%6 = urem i64 %4, 10
%7 = getelementptr inbounds [0 x i8], [0 x i8]* @ext, i64 0, i64 %6
%8 = load i8, i8* %7
%9 = getelementptr inbounds i8, i8* %5, i64 -1
store i8 %8, i8* %9
%10 = udiv i64 %4, 10
%11 = icmp ult i64 %4, 10
br i1 %11, label %12, label %3
12: ; preds = %3
ret i8* %9
}
unsigned int_hash(const void *src) { return *(const unsigned *)src; }


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

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

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

LLVM IR (-O2):
define i32 @int_hash(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_nyuzi_write_control_reg(int, int);
void start_all_threads(void) {
  __builtin_nyuzi_write_control_reg(21, 0xffffffff);
}


x86 assembly (clang, -O0):
<start_all_threads>:
push   %rbp
mov    %rsp,%rbp
mov    $0x15,%edi
mov    $0xffffffff,%esi
call   1030 <__builtin_nyuzi_write_control_reg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<start_all_threads>:
mov    $0x15,%edi
mov    $0xffffffff,%esi
jmp    1030 <__builtin_nyuzi_write_control_reg@plt>

LLVM IR (-O0):
define void @start_all_threads() {
%1 = call i32 @__builtin_nyuzi_write_control_reg(i32 21, i32 -1)
ret void
}

LLVM IR (-O2):
define void @start_all_threads() {
%1 = tail call i32 @__builtin_nyuzi_write_control_reg(i32 21, i32 -1)
ret void
}
/* Type definitions */
struct mdoc {
  int dummy;
};
struct html {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mdoc_meta(struct mdoc const *);
int /*<<< orphan*/ mdoc_node(struct mdoc const *);
int /*<<< orphan*/ print_mdoc(int /*<<< orphan*/, int /*<<< orphan*/,
                              struct html *);
int /*<<< orphan*/ putchar(char);
void html_mdoc(void *arg, const struct mdoc *m) {
  print_mdoc(mdoc_meta(m), mdoc_node(m), (struct html *)arg);
  putchar('\n');
}


x86 assembly (clang, -O0):
<html_mdoc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <mdoc_meta@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <mdoc_node@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
mov    -0x8(%rbp),%rdx
call   1040 <print_mdoc@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<html_mdoc>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1060 <mdoc_meta@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1050 <mdoc_node@plt>
mov    %ebp,%edi
mov    %eax,%esi
mov    %r14,%rdx
call   1040 <print_mdoc@plt>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
%struct.mdoc = type { i32 }
%struct.html = type { i32 }
define void @html_mdoc(i8* %0, %struct.mdoc* %1) {
%3 = alloca i8*
%4 = alloca %struct.mdoc*
store i8* %0, i8** %3
store %struct.mdoc* %1, %struct.mdoc** %4
%5 = load %struct.mdoc*, %struct.mdoc** %4
%6 = call i32 @mdoc_meta(%struct.mdoc* %5)
%7 = load %struct.mdoc*, %struct.mdoc** %4
%8 = call i32 @mdoc_node(%struct.mdoc* %7)
%9 = load i8*, i8** %3
%10 = bitcast i8* %9 to %struct.html*
%11 = call i32 @print_mdoc(i32 %6, i32 %8, %struct.html* %10)
%12 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
%struct.mdoc = type { i32 }
%struct.html = type { i32 }
define void @html_mdoc(i8* %0, %struct.mdoc* %1) {
%3 = tail call i32 @mdoc_meta(%struct.mdoc* %1)
%4 = tail call i32 @mdoc_node(%struct.mdoc* %1)
%5 = bitcast i8* %0 to %struct.html*
%6 = tail call i32 @print_mdoc(i32 %3, i32 %4, %struct.html* %5)
%7 = tail call i32 @putchar(i8 signext 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ update();
sync() { update(); }


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

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

LLVM IR (-O0):
define i32 @sync() {
%1 = alloca i32
%2 = call i32 (...) @update()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @sync() {
%1 = tail call i32 (...) @update()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello World !\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"Hello World !\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"Hello World !\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct timeval {
  double tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double dtime() {
  double t;
  struct timeval tv;
  gettimeofday(&tv, NULL);
  t = tv.tv_sec + ((double)tv.tv_usec) / 1e6;
  return t;
}


x86 assembly (clang, -O0):
<dtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
movsd  -0x18(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xec8(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dtime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm0
divsd  0xed1(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, i64 }
define double @dtime() {
%1 = alloca double
%2 = alloca %struct.timeval
%3 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = fdiv double %8, 1.000000e+06
%10 = fadd double %5, %9
store double %10, double* %1
%11 = load double, double* %1
ret double %11
}

LLVM IR (-O2):
%struct.timeval = type { double, i64 }
define double @dtime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = fdiv double %8, 1.000000e+06
%10 = fadd double %5, %9
ret double %10
}
int axp_usb_curlim(int cur) {
  int ret = 0;
  return ret;
}


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

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

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

LLVM IR (-O2):
define i32 @axp_usb_curlim(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void infoSetStopLength(void) {
  printf("Stop after arg length word is found.%s", "\n");
}


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

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

LLVM IR (-O0):
@.str = [39 x i8] c"Stop after arg length word is found.%s\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @infoSetStopLength() {
%1 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"Stop after arg length word is found.%s\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @infoSetStopLength() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ M_PI;
float deg2rad(float deg) { return deg * (float)M_PI / 180.0f; }


x86 assembly (clang, -O0):
<deg2rad>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mov    0x2ed3(%rip),%rax
cvtsi2ssq (%rax),%xmm1
mulss  %xmm1,%xmm0
movss  0xeda(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<deg2rad>:
mov    0x2ee1(%rip),%rax
cvtsi2ssq (%rax),%xmm1
mulss  %xmm1,%xmm0
divss  0xee8(%rip),%xmm0
ret

LLVM IR (-O0):
@M_PI = global i64 0
define float @deg2rad(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load i64, i64* @M_PI
%5 = sitofp i64 %4 to float
%6 = fmul float %3, %5
%7 = fdiv float %6, 1.800000e+02
ret float %7
}

LLVM IR (-O2):
@M_PI = global i64 0
define float @deg2rad(float %0) {
%2 = load i64, i64* @M_PI
%3 = sitofp i64 %2 to float
%4 = fmul float %3, %0
%5 = fdiv float %4, 1.800000e+02
ret float %5
}
unsigned addval_358(unsigned x) { return x + 2430634248U; }


x86 assembly (clang, -O0):
<addval_358>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x90e08908,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<addval_358>:
lea    -0x6f1f76f8(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @addval_358(i32 %0) {
%2 = add i32 %0, -1864333048
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf(
      "usage: vcontrold [-x|--xmlfile xml-file] [-d|--device <device>] "
      "[-l|--logfile <logfile>] [-p|--port port] [-s|--syslog] [-n|--nodaemon] "
      "[-i|--vsim] [-g|--debug] [-4|--inet4] [-6|--inet6]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [188 x i8] c"usage: vcontrold [-x|--xmlfile xml-file] [-d|--device <device>] [-l|--logfile <logfile>] [-p|--port port] [-s|--syslog] [-n|--nodaemon] [-i|--vsim] [-g|--debug] [-4|--inet4] [-6|--inet6]\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([188 x i8], [188 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [187 x i8] c"usage: vcontrold [-x|--xmlfile xml-file] [-d|--device <device>] [-l|--logfile <logfile>] [-p|--port port] [-s|--syslog] [-n|--nodaemon] [-i|--vsim] [-g|--debug] [-4|--inet4] [-6|--inet6]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([187 x i8], [187 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
float pgm_read_float(const void *ptr) { return *(const float *)ptr; }


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

x86 assembly (clang, -O2):
<pgm_read_float>:
movss  (%rdi),%xmm0
ret

LLVM IR (-O0):
define float @pgm_read_float(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to float*
%5 = load float, float* %4
ret float %5
}

LLVM IR (-O2):
define float @pgm_read_float(i8* nocapture %0) {
%2 = bitcast i8* %0 to float*
%3 = load float, float* %2
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isxdigit(int);
void t_isxdigit_0x35() {
  Assert_real((isxdigit(53)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isxdigit.c",
              270, ("isxdigit should be 1 for 5"));
}


x86 assembly (clang, -O0):
<t_isxdigit_0x35>:
push   %rbp
mov    %rsp,%rbp
mov    $0x35,%edi
call   1030 <isxdigit@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x10e,%edx
lea    0xf66(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isxdigit_0x35>:
push   %rax
mov    $0x35,%edi
call   1030 <isxdigit@plt>
lea    0xece(%rip),%rsi
lea    0xf70(%rip),%rcx
mov    %eax,%edi
mov    $0x10e,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 1 for 5\00"
define void @t_isxdigit_0x35() {
%1 = call i32 @isxdigit(i32 53)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 270, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 1 for 5\00"
define void @t_isxdigit_0x35() {
%1 = tail call i32 @isxdigit(i32 53)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 270, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ log_fatal(char *, char *);
void die() { log_fatal("zmap", "Out of memory"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"zmap\00"
@.str.1 = [14 x i8] c"Out of memory\00"
define void @die() {
%1 = call i32 @log_fatal(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"zmap\00"
@.str.1 = [14 x i8] c"Out of memory\00"
define void @die() {
%1 = tail call i32 @log_fatal(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int determine_screen_width(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @determine_screen_width() {
ret i32 0
}