xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main() {
  int i = 37;
  float f = i;
  float f2 = *(float *)&i;
  printf("%f\n", f);
  printf("%1.80f\n", f2);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
@.str.1 = [8 x i8] c"%1.80f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float 3.700000e+01)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), float 0x36F2800000000000)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ Interpolate_3(int /*<<< orphan*/, int, int /*<<< orphan*/,
                                 int, int /*<<< orphan*/, int, int);
void Interp6(uint32_t *pc, uint32_t c1, uint32_t c2, uint32_t c3) {
  *pc = Interpolate_3(c1, 5, c2, 2, c3, 1, 3);
}


x86 assembly (clang, -O0):
<Interp6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%r8d
mov    $0x5,%esi
mov    $0x2,%ecx
mov    $0x1,%r9d
movl   $0x3,(%rsp)
call   1030 <Interpolate_3@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Interp6>:
push   %rbx
sub    $0x10,%rsp
mov    %ecx,%r8d
mov    %rdi,%rbx
movl   $0x3,(%rsp)
mov    %esi,%edi
mov    $0x5,%esi
mov    $0x2,%ecx
mov    $0x1,%r9d
call   1030 <Interpolate_3@plt>
mov    %eax,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @Interp6(i32* nocapture writeonly %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @Interpolate_3(i32 %1, i32 5, i32 %2, i32 2, i32 %3, i32 1, i32 3)
store i32 %5, i32* %0
ret void
}
/* Type definitions */
struct dbh {
  int dummy;
};
struct dbf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ dbfgetfn(struct dbf *);
struct dbh *dbfgeth(struct dbf *);
int /*<<< orphan*/ dbhgetsha(struct dbh *);
int /*<<< orphan*/ dbhsave(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ dbhsetsi(struct dbh *, int /*<<< orphan*/);
void cifilecp(struct dbf *df) {
  struct dbh *dh = dbfgeth(df);
  dbhsetsi(dh, dbhsave(dbhgetsha(dh), dbfgetfn(df)));
}


x86 assembly (clang, -O0):
<cifilecp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <dbfgeth@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <dbhgetsha@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <dbfgetfn@plt>
mov    -0x1c(%rbp),%edi
mov    %eax,%esi
call   1070 <dbhsave@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1060 <dbhsetsi@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cifilecp>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1030 <dbfgeth@plt>
mov    %rax,%r14
mov    %rax,%rdi
call   1050 <dbhgetsha@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <dbfgetfn@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1070 <dbhsave@plt>
mov    %r14,%rdi
mov    %eax,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1060 <dbhsetsi@plt>

LLVM IR (-O0):
%struct.dbf = type { i32 }
%struct.dbh = type { i32 }
define void @cifilecp(%struct.dbf* %0) {
%2 = alloca %struct.dbf*
%3 = alloca %struct.dbh*
store %struct.dbf* %0, %struct.dbf** %2
%4 = load %struct.dbf*, %struct.dbf** %2
%5 = call %struct.dbh* @dbfgeth(%struct.dbf* %4)
store %struct.dbh* %5, %struct.dbh** %3
%6 = load %struct.dbh*, %struct.dbh** %3
%7 = load %struct.dbh*, %struct.dbh** %3
%8 = call i32 @dbhgetsha(%struct.dbh* %7)
%9 = load %struct.dbf*, %struct.dbf** %2
%10 = call i32 @dbfgetfn(%struct.dbf* %9)
%11 = call i32 @dbhsave(i32 %8, i32 %10)
%12 = call i32 @dbhsetsi(%struct.dbh* %6, i32 %11)
ret void
}

LLVM IR (-O2):
%struct.dbf = type { i32 }
%struct.dbh = type { i32 }
define void @cifilecp(%struct.dbf* %0) {
%2 = tail call %struct.dbh* @dbfgeth(%struct.dbf* %0)
%3 = tail call i32 @dbhgetsha(%struct.dbh* %2)
%4 = tail call i32 @dbfgetfn(%struct.dbf* %0)
%5 = tail call i32 @dbhsave(i32 %3, i32 %4)
%6 = tail call i32 @dbhsetsi(%struct.dbh* %2, i32 %5)
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x, y;
  x = __VERIFIER_nondet_int();
  y = __VERIFIER_nondet_int();
  while (x > 0) {
    x = x + y;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    114b <main+0x3b>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <main+0x23>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int pthread_mutex_unlock(int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
void SecureUnlock(pthread_mutex_t *mutex) {
  int rc = pthread_mutex_unlock(mutex);
  if (rc) {
    fprintf(stderr, "Failed to unlock mutex\n");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<SecureUnlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <pthread_mutex_unlock@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1171 <SecureUnlock+0x41>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
lea    0xe9e(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SecureUnlock>:
push   %rax
call   1040 <pthread_mutex_unlock@plt>
test   %eax,%eax
jne    113c <SecureUnlock+0xc>
pop    %rax
ret
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
lea    0xeb4(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Failed to unlock mutex\0A\00"
define void @SecureUnlock(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @pthread_mutex_unlock(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Failed to unlock mutex\0A\00"
define void @SecureUnlock(i32* %0) {
%2 = tail call i32 @pthread_mutex_unlock(i32* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret void
}
void sig_alrm(int signo) { ; }


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

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

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

LLVM IR (-O2):
define void @sig_alrm(i32 %0) {
ret void
}
struct passwd *getpwent(void) {
  anvil_syslog(0, "%s unimplemented\n", __FUNCTION__);
  return 0;
}


x86 assembly (clang, -O0):
<getpwent>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
lea    0xeee(%rip),%rdx
mov    $0x0,%al
call   1030 <anvil_syslog@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getpwent>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0xef3(%rip),%rdx
xor    %edi,%edi
xor    %eax,%eax
call   1030 <anvil_syslog@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.passwd = type opaque
@.str = [18 x i8] c"%s unimplemented\0A\00"
@__FUNCTION__.getpwent = [9 x i8] c"getpwent\00"
define %struct.passwd* @getpwent() {
%1 = call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @anvil_syslog to i32 (i32, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__FUNCTION__.getpwent, i64 0, i64 0))
ret %struct.passwd* null
}

LLVM IR (-O2):
%struct.passwd = type opaque
@.str = [18 x i8] c"%s unimplemented\0A\00"
@__FUNCTION__.getpwent = [9 x i8] c"getpwent\00"
define %struct.passwd* @getpwent() {
%1 = tail call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @anvil_syslog to i32 (i32, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__FUNCTION__.getpwent, i64 0, i64 0))
ret %struct.passwd* null
}
__attribute__((weak)) int _read(int file, char *ptr, int len) {
  (void)file;
  (void)len;
  return 0;
}


x86 assembly (clang, -O0):
<_read>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define weak i32 @_read(i32 %0, i8* %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SetChannel(char *);
void SetNewConfig(char *confName) { SetChannel(confName); }


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

x86 assembly (clang, -O2):
<SetNewConfig>:
jmp    1030 <SetChannel@plt>

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

LLVM IR (-O2):
define void @SetNewConfig(i8* %0) {
%2 = tail call i32 @SetChannel(i8* %0)
ret void
}
/* Type definitions */
struct rlimit {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ RLIMIT_STACK;
int /*<<< orphan*/ getrlimit(int /*<<< orphan*/, struct rlimit *);
int /*<<< orphan*/ setrlimit(int /*<<< orphan*/, struct rlimit *);
int main() {
  struct rlimit rip;
  getrlimit(RLIMIT_STACK, &rip);
  setrlimit(RLIMIT_STACK, &rip);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1040 <getrlimit@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <setrlimit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2eb5(%rip),%r14
mov    (%r14),%edi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <getrlimit@plt>
mov    (%r14),%edi
mov    %rbx,%rsi
call   1030 <setrlimit@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.rlimit = type { i32 }
@RLIMIT_STACK = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.rlimit
store i32 0, i32* %1
%3 = load i32, i32* @RLIMIT_STACK
%4 = call i32 @getrlimit(i32 %3, %struct.rlimit* %2)
%5 = load i32, i32* @RLIMIT_STACK
%6 = call i32 @setrlimit(i32 %5, %struct.rlimit* %2)
ret i32 0
}

LLVM IR (-O2):
%struct.rlimit = type { i32 }
@RLIMIT_STACK = global i32 0
define i32 @main() {
%1 = alloca %struct.rlimit
%2 = bitcast %struct.rlimit* %1 to i8*
%3 = load i32, i32* @RLIMIT_STACK
%4 = call i32 @getrlimit(i32 %3, %struct.rlimit* %1)
%5 = load i32, i32* @RLIMIT_STACK
%6 = call i32 @setrlimit(i32 %5, %struct.rlimit* %1)
ret i32 0
}
int mymalloc_init() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @mymalloc_init() {
ret i32 1
}
void INT_Excep_PERIA_INTA231(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIA_INTA231() {
ret void
}
void release_fs(struct ext2_fs *f) {}


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

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

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

LLVM IR (-O2):
%struct.ext2_fs = type opaque
define void @release_fs(%struct.ext2_fs* nocapture %0) {
ret void
}
void fs_http_free(void) { return; }


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

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

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

LLVM IR (-O2):
define void @fs_http_free() {
ret void
}
/* Type definitions */
struct runlevel {
  int dummy;
};

/* Variables and functions */
char *getenv(char *);
int set_newlevel(struct runlevel *, char);
int set_newlevel_info(struct runlevel *newlevel) {
  char *env_new = getenv("RUNLEVEL");
  if (env_new == NULL)
    return 1;
  return set_newlevel(newlevel, env_new[0]);
}


x86 assembly (clang, -O0):
<set_newlevel_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1153 <set_newlevel_info+0x33>
movl   $0x1,-0x4(%rbp)
jmp    1166 <set_newlevel_info+0x46>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
movsbl (%rax),%esi
call   1040 <set_newlevel@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_newlevel_info>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     1141 <set_newlevel_info+0x21>
movsbl (%rax),%esi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <set_newlevel@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.runlevel = type { i32 }
@.str = [9 x i8] c"RUNLEVEL\00"
define i32 @set_newlevel_info(%struct.runlevel* %0) {
%2 = alloca i32
%3 = alloca %struct.runlevel*
%4 = alloca i8*
store %struct.runlevel* %0, %struct.runlevel** %3
%5 = call i8* @getenv(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
store i8* %5, i8** %4
%6 = load i8*, i8** %4
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 1, i32* %2
br label %15
9: ; preds = %1
%10 = load %struct.runlevel*, %struct.runlevel** %3
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i64 0
%13 = load i8, i8* %12
%14 = call i32 @set_newlevel(%struct.runlevel* %10, i8 signext %13)
store i32 %14, i32* %2
br label %15
15: ; preds = %9, %8
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
%struct.runlevel = type { i32 }
@.str = [9 x i8] c"RUNLEVEL\00"
define i32 @set_newlevel_info(%struct.runlevel* %0) {
%2 = tail call i8* @getenv(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = load i8, i8* %2
%6 = tail call i32 @set_newlevel(%struct.runlevel* %0, i8 signext %5)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %6, %4 ], [ 1, %1 ]
ret i32 %8
}
int write(int i, char *c, int n) {
  (void)i;
  (void)n;
  (void)c;
  return 0;
}


x86 assembly (clang, -O0):
<write>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @write(i32 %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
void cpupri_set(struct cpupri *cp, int cpu, int pri) {}


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

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

LLVM IR (-O0):
%struct.cpupri = type opaque
define void @cpupri_set(%struct.cpupri* %0, i32 %1, i32 %2) {
%4 = alloca %struct.cpupri*
%5 = alloca i32
%6 = alloca i32
store %struct.cpupri* %0, %struct.cpupri** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret void
}

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

/* Variables and functions */
int /*<<< orphan*/ const prince_m_prime_layer(int /*<<< orphan*/ const);
int /*<<< orphan*/ const prince_shift_rows(int /*<<< orphan*/ const,
                                           int /*<<< orphan*/);
uint64_t prince_m_layer(const uint64_t m_in) {
  const uint64_t m_prime_out = prince_m_prime_layer(m_in);
  const uint64_t shift_rows_out = prince_shift_rows(m_prime_out, 0);
  return shift_rows_out;
}


x86 assembly (clang, -O0):
<prince_m_layer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <prince_m_prime_layer@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
xor    %esi,%esi
call   1040 <prince_shift_rows@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prince_m_layer>:
push   %rax
call   1030 <prince_m_prime_layer@plt>
mov    %eax,%edi
xor    %esi,%esi
pop    %rax
jmp    1040 <prince_shift_rows@plt>

LLVM IR (-O0):
define i32 @prince_m_layer(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @prince_m_prime_layer(i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @prince_shift_rows(i32 %7, i32 0)
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @prince_m_layer(i32 %0) {
%2 = tail call i32 @prince_m_prime_layer(i32 %0)
%3 = tail call i32 @prince_shift_rows(i32 %2, i32 0)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fgetc(int /*<<< orphan*/ *);
int zDumpLine(FILE *fp) {
  register int c;
  while ((c = fgetc(fp)) != '\n')
    ;
  return 0;
}


x86 assembly (clang, -O0):
<zDumpLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0xc(%rbp)
cmp    $0xa,%eax
je     1136 <zDumpLine+0x26>
jmp    111c <zDumpLine+0xc>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zDumpLine>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <fgetc@plt>
cmp    $0xa,%eax
jne    1120 <zDumpLine+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @zDumpLine(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @fgetc(i32* %0)
%4 = icmp eq i32 %3, 10
br i1 %4, label %5, label %2
5: ; preds = %2
ret i32 0
}
/* Type definitions */
struct page {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ClearPageReclaim(struct page *);
int PageDirty(struct page *);
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ page_mapped(struct page *);
int tux3_set_page_dirty_bug(struct page *page) {
  ClearPageReclaim(page);
  assert(0);
  assert(!page_mapped(page));
  assert(PageDirty(page));
  return 0;
}


x86 assembly (clang, -O0):
<tux3_set_page_dirty_bug>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <ClearPageReclaim@plt>
xor    %edi,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1050 <page_mapped@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1030 <PageDirty@plt>
mov    %eax,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tux3_set_page_dirty_bug>:
push   %rbx
mov    %rdi,%rbx
call   1060 <ClearPageReclaim@plt>
xor    %edi,%edi
call   1040 <assert@plt>
mov    %rbx,%rdi
call   1050 <page_mapped@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
call   1030 <PageDirty@plt>
mov    %eax,%edi
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.page = type { i32 }
define i32 @tux3_set_page_dirty_bug(%struct.page* %0) {
%2 = alloca %struct.page*
store %struct.page* %0, %struct.page** %2
%3 = load %struct.page*, %struct.page** %2
%4 = call i32 @ClearPageReclaim(%struct.page* %3)
%5 = call i32 @assert(i32 0)
%6 = load %struct.page*, %struct.page** %2
%7 = call i32 @page_mapped(%struct.page* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load %struct.page*, %struct.page** %2
%13 = call i32 @PageDirty(%struct.page* %12)
%14 = call i32 @assert(i32 %13)
ret i32 0
}

LLVM IR (-O2):
%struct.page = type { i32 }
define i32 @tux3_set_page_dirty_bug(%struct.page* %0) {
%2 = tail call i32 @ClearPageReclaim(%struct.page* %0)
%3 = tail call i32 @assert(i32 0)
%4 = tail call i32 @page_mapped(%struct.page* %0)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = tail call i32 @PageDirty(%struct.page* %0)
%9 = tail call i32 @assert(i32 %8)
ret i32 0
}
/* Variables and functions */
double floor(double);
int /*<<< orphan*/ is_fraction_a_half(double);
double round(double);
double lr_round_half_down(double value, double rf) {
  value *= rf;
  if (!is_fraction_a_half(value))
    return round(value) / rf;
  value = floor(value) / rf;
  return value;
}


x86 assembly (clang, -O0):
<lr_round_half_down>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <is_fraction_a_half@plt>
cmp    $0x0,%eax
jne    117d <lr_round_half_down+0x4d>
movsd  -0x10(%rbp),%xmm0
call   1040 <round@plt>
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    119b <lr_round_half_down+0x6b>
movsd  -0x10(%rbp),%xmm0
call   1050 <floor@plt>
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lr_round_half_down>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
call   1030 <is_fraction_a_half@plt>
test   %eax,%eax
je     115a <lr_round_half_down+0x2a>
movsd  0x8(%rsp),%xmm0
call   1050 <floor@plt>
jmp    1165 <lr_round_half_down+0x35>
movsd  0x8(%rsp),%xmm0
call   1040 <round@plt>
divsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @lr_round_half_down(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %5
%7 = load double, double* %4
%8 = fmul double %7, %6
store double %8, double* %4
%9 = load double, double* %4
%10 = call i32 @is_fraction_a_half(double %9)
%11 = icmp ne i32 %10, 0
br i1 %11, label %17, label %12
12: ; preds = %2
%13 = load double, double* %4
%14 = call double @llvm.round.f64(double %13)
%15 = load double, double* %5
%16 = fdiv double %14, %15
store double %16, double* %3
br label %23
17: ; preds = %2
%18 = load double, double* %4
%19 = call double @llvm.floor.f64(double %18)
%20 = load double, double* %5
%21 = fdiv double %19, %20
store double %21, double* %4
%22 = load double, double* %4
store double %22, double* %3
br label %23
23: ; preds = %17, %12
%24 = load double, double* %3
ret double %24
}

LLVM IR (-O2):
define double @lr_round_half_down(double %0, double %1) {
%3 = fmul double %0, %1
%4 = tail call i32 @is_fraction_a_half(double %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call double @llvm.round.f64(double %3)
br label %10
8: ; preds = %2
%9 = tail call double @llvm.floor.f64(double %3)
br label %10
10: ; preds = %8, %6
%11 = phi double [ %9, %8 ], [ %7, %6 ]
%12 = fdiv double %11, %1
ret double %12
}
int test_imm_5Fint8_mem(signed char *val) {
  return ((*val) & (-0x5F << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_5Fint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -95
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void lms_print_frequency(struct lms_freq *f) {
  do {
    do {
    } while (0);
  } while (0);
  do {
    do {
    } while (0);
  } while (0);
  do {
    do {
    } while (0);
  } while (0);
  do {
    do {
    } while (0);
  } while (0);
  do {
    do {
    } while (0);
  } while (0);
  do {
    do {
    } while (0);
  } while (0);
  do {
    do {
    } while (0);
  } while (0);
}


x86 assembly (clang, -O0):
<lms_print_frequency>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
jmp    110d <lms_print_frequency+0xd>
jmp    1112 <lms_print_frequency+0x12>
jmp    1117 <lms_print_frequency+0x17>
jmp    111c <lms_print_frequency+0x1c>
jmp    1121 <lms_print_frequency+0x21>
jmp    1126 <lms_print_frequency+0x26>
jmp    112b <lms_print_frequency+0x2b>
jmp    1130 <lms_print_frequency+0x30>
jmp    1135 <lms_print_frequency+0x35>
jmp    113a <lms_print_frequency+0x3a>
jmp    113f <lms_print_frequency+0x3f>
jmp    1144 <lms_print_frequency+0x44>
jmp    1149 <lms_print_frequency+0x49>
jmp    114e <lms_print_frequency+0x4e>
jmp    1153 <lms_print_frequency+0x53>
jmp    1158 <lms_print_frequency+0x58>
jmp    115d <lms_print_frequency+0x5d>
jmp    1162 <lms_print_frequency+0x62>
jmp    1167 <lms_print_frequency+0x67>
jmp    116c <lms_print_frequency+0x6c>
jmp    1171 <lms_print_frequency+0x71>
jmp    1176 <lms_print_frequency+0x76>
jmp    117b <lms_print_frequency+0x7b>
jmp    1180 <lms_print_frequency+0x80>
jmp    1185 <lms_print_frequency+0x85>
jmp    118a <lms_print_frequency+0x8a>
jmp    118f <lms_print_frequency+0x8f>
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.lms_freq = type opaque
define void @lms_print_frequency(%struct.lms_freq* %0) {
%2 = alloca %struct.lms_freq*
store %struct.lms_freq* %0, %struct.lms_freq** %2
br label %3
3: ; preds = %1
br label %4
4: ; preds = %3
br label %5
5: ; preds = %4
br label %6
6: ; preds = %5
br label %7
7: ; preds = %6
br label %8
8: ; preds = %7
br label %9
9: ; preds = %8
br label %10
10: ; preds = %9
br label %11
11: ; preds = %10
br label %12
12: ; preds = %11
br label %13
13: ; preds = %12
br label %14
14: ; preds = %13
br label %15
15: ; preds = %14
br label %16
16: ; preds = %15
br label %17
17: ; preds = %16
br label %18
18: ; preds = %17
br label %19
19: ; preds = %18
br label %20
20: ; preds = %19
br label %21
21: ; preds = %20
br label %22
22: ; preds = %21
br label %23
23: ; preds = %22
br label %24
24: ; preds = %23
br label %25
25: ; preds = %24
br label %26
26: ; preds = %25
br label %27
27: ; preds = %26
br label %28
28: ; preds = %27
br label %29
29: ; preds = %28
br label %30
30: ; preds = %29
ret void
}

LLVM IR (-O2):
%struct.lms_freq = type opaque
define void @lms_print_frequency(%struct.lms_freq* nocapture %0) {
ret void
}
void X509_check_purpose(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @R_InitPointToAngle() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ decimal();
int /*<<< orphan*/ hexadecimal();
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char type;
  scanf("%c", &type);
  switch (type) {
  case 'd':
    decimal();
    break;
  case 'h':
    hexadecimal();
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1050 <scanf@plt>
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x64,%eax
je     1175 <main+0x45>
jmp    1164 <main+0x34>
mov    -0xc(%rbp),%eax
sub    $0x68,%eax
je     1181 <main+0x51>
jmp    1188 <main+0x58>
mov    $0x0,%al
call   1040 <decimal@plt>
jmp    1188 <main+0x58>
mov    $0x0,%al
call   1030 <hexadecimal@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1050 <scanf@plt>
movsbl 0x7(%rsp),%eax
cmp    $0x68,%eax
je     115a <main+0x2a>
cmp    $0x64,%eax
jne    1161 <main+0x31>
xor    %eax,%eax
call   1040 <decimal@plt>
jmp    1161 <main+0x31>
xor    %eax,%eax
call   1030 <hexadecimal@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
switch i32 %5, label %10 [
i32 100, label %6
i32 104, label %8
]
6: ; preds = %0
%7 = call i32 (...) @decimal()
br label %10
8: ; preds = %0
%9 = call i32 (...) @hexadecimal()
br label %10
10: ; preds = %0, %8, %6
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = sext i8 %3 to i32
switch i32 %4, label %9 [
i32 100, label %5
i32 104, label %7
]
5: ; preds = %0
%6 = call i32 (...) @decimal()
br label %9
7: ; preds = %0
%8 = call i32 (...) @hexadecimal()
br label %9
9: ; preds = %0, %7, %5
ret i32 0
}
float ccrandom(x)
float x;
{
  int n;
  n = x * 1048576.;
  return ((float)((1061 * n + 221589) % 1048576) / 1048576.);
}


x86 assembly (clang, -O0):
<ccrandom>:
push   %rbp
mov    %rsp,%rbp
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee2(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x8(%rbp)
imul   $0x425,-0x8(%rbp),%eax
add    $0x36195,%eax
mov    $0x100000,%ecx
cltd
idiv   %ecx
cvtsi2ss %edx,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeb3(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ccrandom>:
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xef0(%rip),%xmm0
cvttsd2si %xmm0,%eax
imul   $0x425,%eax,%eax
lea    0x36195(%rax),%ecx
lea    0x136194(%rax),%edx
test   %ecx,%ecx
cmovns %ecx,%edx
and    $0xfff00000,%edx
neg    %edx
add    %edx,%eax
add    $0x36195,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
mulss  0xebf(%rip),%xmm0
ret

LLVM IR (-O0):
define float @ccrandom(double %0) {
%2 = alloca float
%3 = alloca i32
%4 = fptrunc double %0 to float
store float %4, float* %2
%5 = load float, float* %2
%6 = fpext float %5 to double
%7 = fmul double %6, 0x4130000000000000
%8 = fptosi double %7 to i32
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = mul nsw i32 1061, %9
%11 = add nsw i32 %10, 221589
%12 = srem i32 %11, 1048576
%13 = sitofp i32 %12 to float
%14 = fpext float %13 to double
%15 = fdiv double %14, 0x4130000000000000
%16 = fptrunc double %15 to float
ret float %16
}

LLVM IR (-O2):
define float @ccrandom(double %0) {
%2 = fptrunc double %0 to float
%3 = fpext float %2 to double
%4 = fmul double %3, 0x4130000000000000
%5 = fptosi double %4 to i32
%6 = mul nsw i32 %5, 1061
%7 = add nsw i32 %6, 221589
%8 = srem i32 %7, 1048576
%9 = sitofp i32 %8 to float
%10 = fmul float %9, 0x3EB0000000000000
ret float %10
}
int alignof_float() {
  struct s {
    char x;
    float y;
  };
  return sizeof(char) + (sizeof(struct s) - (sizeof(char) + sizeof(float)));
}


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

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

LLVM IR (-O0):
define i32 @alignof_float() {
ret i32 4
}

LLVM IR (-O2):
define i32 @alignof_float() {
ret i32 4
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __futimes(int fd, const struct timeval tvp[2]) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__futimes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__futimes>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
@ENOSYS = global i32 0
define i32 @__futimes(i32 %0, %struct.timeval* %1) {
%3 = alloca i32
%4 = alloca %struct.timeval*
store i32 %0, i32* %3
store %struct.timeval* %1, %struct.timeval** %4
%5 = load i32, i32* @ENOSYS
%6 = call i32 @__set_errno(i32 %5)
ret i32 -1
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
@ENOSYS = global i32 0
define i32 @__futimes(i32 %0, %struct.timeval* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
%4 = tail call i32 @__set_errno(i32 %3)
ret i32 -1
}
__attribute__((no)) unsigned long long gen_mulx(unsigned a, unsigned b) {
  unsigned long long res;
  res = (unsigned long long)a * b;
  return res;
}


x86 assembly (clang, -O0):
<gen_mulx>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_mulx>:
mov    %edi,%ecx
mov    %esi,%eax
imul   %rcx,%rax
ret

LLVM IR (-O0):
define i64 @gen_mulx(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = zext i32 %6 to i64
%8 = load i32, i32* %4
%9 = zext i32 %8 to i64
%10 = mul i64 %7, %9
store i64 %10, i64* %5
%11 = load i64, i64* %5
ret i64 %11
}

LLVM IR (-O2):
define i64 @gen_mulx(i32 %0, i32 %1) {
%3 = zext i32 %0 to i64
%4 = zext i32 %1 to i64
%5 = mul nuw i64 %4, %3
ret i64 %5
}
void NV21ToARGBRow_SSSE3() {}


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

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

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

LLVM IR (-O2):
define void @NV21ToARGBRow_SSSE3() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setLeft(int);
int /*<<< orphan*/ setRight(int);
void turn(int pwr) {
  setLeft(pwr);
  setRight(-pwr);
}


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

x86 assembly (clang, -O2):
<turn>:
push   %rbx
mov    %edi,%ebx
call   1040 <setLeft@plt>
neg    %ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <setRight@plt>

LLVM IR (-O0):
define void @turn(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @setLeft(i32 %3)
%5 = load i32, i32* %2
%6 = sub nsw i32 0, %5
%7 = call i32 @setRight(i32 %6)
ret void
}

LLVM IR (-O2):
define void @turn(i32 %0) {
%2 = tail call i32 @setLeft(i32 %0)
%3 = sub nsw i32 0, %0
%4 = tail call i32 @setRight(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ide_set_handlers(int);
void ide_sec_enable(void) { ide_set_handlers(1); }


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

x86 assembly (clang, -O2):
<ide_sec_enable>:
mov    $0x1,%edi
jmp    1030 <ide_set_handlers@plt>

LLVM IR (-O0):
define void @ide_sec_enable() {
%1 = call i32 @ide_set_handlers(i32 1)
ret void
}

LLVM IR (-O2):
define void @ide_sec_enable() {
%1 = tail call i32 @ide_set_handlers(i32 1)
ret void
}
/* Variables and functions */
void *MA_Malloc(long, char const *, char const *, long);
void *memset(void *, int /*<<< orphan*/, long);
void *MA_Calloc(long nr_elems, long bytes_per_elem, const char *r,
                const char *fn, long ln) {
  long nr_bytes = nr_elems * bytes_per_elem;
  void *p = MA_Malloc(nr_bytes, r, fn, ln);
  return memset(p, 0, nr_bytes);
}


x86 assembly (clang, -O0):
<MA_Calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   1040 <MA_Malloc@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MA_Calloc>:
push   %rbx
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
mov    %r8,%rcx
call   1040 <MA_Malloc@plt>
mov    %rax,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
pop    %rbx
jmp    1030 <memset@plt>

LLVM IR (-O0):
define i8* @MA_Calloc(i64 %0, i64 %1, i8* %2, i8* %3, i64 %4) {
%6 = alloca i64
%7 = alloca i64
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i64
%12 = alloca i8*
store i64 %0, i64* %6
store i64 %1, i64* %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i64 %4, i64* %10
%13 = load i64, i64* %6
%14 = load i64, i64* %7
%15 = mul nsw i64 %13, %14
store i64 %15, i64* %11
%16 = load i64, i64* %11
%17 = load i8*, i8** %8
%18 = load i8*, i8** %9
%19 = load i64, i64* %10
%20 = call i8* @MA_Malloc(i64 %16, i8* %17, i8* %18, i64 %19)
store i8* %20, i8** %12
%21 = load i8*, i8** %12
%22 = load i64, i64* %11
%23 = call i8* @memset(i8* %21, i32 0, i64 %22)
ret i8* %23
}

LLVM IR (-O2):
define i8* @MA_Calloc(i64 %0, i64 %1, i8* %2, i8* %3, i64 %4) {
%6 = mul nsw i64 %1, %0
%7 = tail call i8* @MA_Malloc(i64 %6, i8* %2, i8* %3, i64 %4)
tail call void @llvm.memset.p0i8.i64(i8* align 1 %7, i8 0, i64 %6, i1 false)
ret i8* %7
}
short NoSwapShort(short num) { return num; }


x86 assembly (clang, -O0):
<NoSwapShort>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i16 @NoSwapShort(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
ret i16 %3
}

LLVM IR (-O2):
define signext i16 @NoSwapShort(i16 returned signext %0) {
ret i16 %0
}
int test_imm_39uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x39 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_39uint64_lowword_reg>:
test   $0x39,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_39uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 57
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int __gthread_active_p() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @__gthread_active_p() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void dump_label(void *lbl) { puts((char *)lbl); }


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

x86 assembly (clang, -O2):
<dump_label>:
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
define void @dump_label(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef scalar_t__ int32_t;

/* Variables and functions */
__attribute__((always_)) int32_t isign(int32_t x) {
  return (int32_t)(((uint32_t)-x >> 31) - ((uint32_t)x >> 31));
}


x86 assembly (clang, -O0):
<isign>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
sub    -0x8(%rbp),%rax
sar    $0x1f,%eax
mov    -0x8(%rbp),%rcx
sar    $0x1f,%ecx
sub    %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<isign>:
mov    %edi,%eax
neg    %eax
sar    $0x1f,%eax
shr    $0x1f,%edi
add    %eax,%edi
movslq %edi,%rax
ret

LLVM IR (-O0):
define i64 @isign(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sub nsw i64 0, %3
%5 = trunc i64 %4 to i32
%6 = ashr i32 %5, 31
%7 = load i64, i64* %2
%8 = trunc i64 %7 to i32
%9 = ashr i32 %8, 31
%10 = sub nsw i32 %6, %9
%11 = sext i32 %10 to i64
ret i64 %11
}

LLVM IR (-O2):
define i64 @isign(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = sub i32 0, %2
%4 = ashr i32 %3, 31
%5 = lshr i32 %2, 31
%6 = add nsw i32 %5, %4
%7 = sext i32 %6 to i64
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XESetFreeGC() {
  printf("XESetFreeGC called\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"XESetFreeGC called\0A\00"
define i32 @XESetFreeGC() {
%1 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [19 x i8] c"XESetFreeGC called\00"
define i32 @XESetFreeGC() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret i32 0
}