xunge/DecIR huggingface dataset:
int e100_probe(struct pci_dev *pdev, const struct pci_device_id *id) {
  return 0;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.pci_dev = type opaque
%struct.pci_device_id = type opaque
define i32 @e100_probe(%struct.pci_dev* nocapture readnone %0, %struct.pci_device_id* nocapture readnone %1) {
ret i32 0
}
void setfpu(void) {}


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

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

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

LLVM IR (-O2):
define void @setfpu() {
ret void
}
long long fib(int n) {
  long long x, y;
  if (n < 2)
    return n;
#pragma omp task untied shared(x) firstprivate(n)
  x = fib(n - 1);
#pragma omp task untied shared(y) firstprivate(n)
  y = fib(n - 2);
#pragma omp taskwait
  ;
  return x + y;
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    1132 <fib+0x22>
movslq -0xc(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115c <fib+0x4c>
mov    -0xc(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %r14
push   %rbx
push   %rax
xor    %r14d,%r14d
cmp    $0x2,%edi
jl     1135 <fib+0x25>
mov    %edi,%ebx
xchg   %ax,%ax
lea    -0x1(%rbx),%edi
call   1030 <fib@plt>
lea    -0x2(%rbx),%edi
add    %rax,%r14
cmp    $0x4,%ebx
mov    %edi,%ebx
jae    1120 <fib+0x10>
movslq %edi,%rax
add    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @fib(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %3, label %8
3: ; preds = %8, %1
%4 = phi i64 [ 0, %1 ], [ %14, %8 ]
%5 = phi i32 [ %0, %1 ], [ %13, %8 ]
%6 = sext i32 %5 to i64
%7 = add nsw i64 %4, %6
ret i64 %7
8: ; preds = %1, %8
%9 = phi i32 [ %13, %8 ], [ %0, %1 ]
%10 = phi i64 [ %14, %8 ], [ 0, %1 ]
%11 = add nsw i32 %9, -1
%12 = tail call i64 @fib(i32 %11)
%13 = add nsw i32 %9, -2
%14 = add nsw i64 %12, %10
%15 = icmp ult i32 %9, 4
br i1 %15, label %3, label %8
}
/* Variables and functions */
int __get_array_size(char const *);
int __infer_nondet_int();
int remove(const char *path) {
  int size_path;
  int success;
  size_path = __get_array_size(path);
  success = __infer_nondet_int();
  return (success > 0) ? 0 : -1;
}


x86 assembly (clang, -O0):
<remove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <__get_array_size@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_int@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edx
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmovg  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove>:
push   %rax
call   1040 <__get_array_size@plt>
xor    %eax,%eax
call   1030 <__infer_nondet_int@plt>
xor    %ecx,%ecx
test   %eax,%eax
setle  %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @remove(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @__get_array_size(i8* %5)
store i32 %6, i32* %3
%7 = call i32 (...) @__infer_nondet_int()
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp sgt i32 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 0, i32 -1
ret i32 %11
}

LLVM IR (-O2):
define i32 @remove(i8* %0) {
%2 = tail call i32 @__get_array_size(i8* %0)
%3 = tail call i32 (...) @__infer_nondet_int()
%4 = icmp slt i32 %3, 1
%5 = sext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ dalibc_linux_deinitialize();
int /*<<< orphan*/ dalibc_linux_initialize();
int main(int, char **, char **);
int dalibc_linux_enter_program(int argc, char *argv[], char *envp[]) {
  int ret;
  dalibc_linux_initialize();
  ret = main(argc, argv, envp);
  dalibc_linux_deinitialize();
  return ret;
}


x86 assembly (clang, -O0):
<dalibc_linux_enter_program>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <dalibc_linux_initialize@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <main@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1050 <dalibc_linux_deinitialize@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dalibc_linux_enter_program>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <dalibc_linux_initialize@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <main@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <dalibc_linux_deinitialize@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @dalibc_linux_enter_program(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8**
%7 = alloca i32
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
%8 = call i32 (...) @dalibc_linux_initialize()
%9 = load i32, i32* %4
%10 = load i8**, i8*** %5
%11 = load i8**, i8*** %6
%12 = call i32 @main(i32 %9, i8** %10, i8** %11)
store i32 %12, i32* %7
%13 = call i32 (...) @dalibc_linux_deinitialize()
%14 = load i32, i32* %7
ret i32 %14
}

LLVM IR (-O2):
define i32 @dalibc_linux_enter_program(i32 %0, i8** %1, i8** %2) {
%4 = tail call i32 (...) @dalibc_linux_initialize()
%5 = tail call i32 @main(i32 %0, i8** %1, i8** %2)
%6 = tail call i32 (...) @dalibc_linux_deinitialize()
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int snprintf(char *, int, char *, char *, int);
int main() {
  char str[100];
  int retVal = snprintf(str, 100, "%s %d", "this is the number: ", 1231);
  printf("%s\n", str);
  return retVal;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
mov    $0x64,%esi
lea    0xebe(%rip),%rdx
lea    0xebd(%rip),%rcx
mov    $0x4cf,%r8d
call   1040 <snprintf@plt>
mov    %eax,-0x74(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x74(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x68,%rsp
lea    0xed3(%rip),%rdx
lea    0xed2(%rip),%rcx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x64,%esi
mov    $0x4cf,%r8d
call   1040 <snprintf@plt>
mov    %eax,%ebp
lea    0xec8(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %ebp,%eax
add    $0x68,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s %d\00"
@.str.1 = [21 x i8] c"this is the number: \00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 100, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 1231)
store i32 %5, i32* %3
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %6)
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s %d\00"
@.str.1 = [21 x i8] c"this is the number: \00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @snprintf(i8* %2, i32 100, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 1231)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ gang();
int /*<<< orphan*/ seq();
int /*<<< orphan*/ vector();
void worker(void) {
  gang();
  worker();
  vector();
  seq();
}


x86 assembly (clang, -O0):
<worker>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <gang@plt>
call   1040 <worker@plt>
mov    $0x0,%al
call   1060 <vector@plt>
mov    $0x0,%al
call   1050 <seq@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<worker>:
push   %rax
xor    %eax,%eax
call   1030 <gang@plt>
call   1040 <worker@plt>
xor    %eax,%eax
call   1060 <vector@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <seq@plt>

LLVM IR (-O0):
define void @worker() {
%1 = call i32 (...) @gang()
%2 = call i32 (...) @vector()
%3 = call i32 (...) @seq()
ret void
}

LLVM IR (-O2):
define void @worker() {
%1 = tail call i32 (...) @gang()
tail call void @worker()
%2 = tail call i32 (...) @vector()
%3 = tail call i32 (...) @seq()
ret void
}
/* Variables and functions */
scalar_t__ acosh(double);
long double acoshl(long double x) { return (long double)acosh((double)x); }


x86 assembly (clang, -O0):
<acoshl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <acosh@plt>
mov    %rax,-0x18(%rbp)
fildll -0x18(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acoshl>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpl  0x8(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <acosh@plt>
mov    %rax,0x10(%rsp)
fildll 0x10(%rsp)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @acoshl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call i64 @acosh(double %4)
%6 = sitofp i64 %5 to x86_fp80
ret x86_fp80 %6
}

LLVM IR (-O2):
define x86_fp80 @acoshl(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call i64 @acosh(double %2)
%4 = sitofp i64 %3 to x86_fp80
ret x86_fp80 %4
}
void function5(void) {}


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

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

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

LLVM IR (-O2):
define void @function5() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void users_prepare_filename(
    char filename[(sizeof("/tmp/") + sizeof("XXXXXX"))]) {
  strcpy(filename, "/tmp/");
  strcat(filename, "XXXXXX");
}


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

x86 assembly (clang, -O2):
<users_prepare_filename>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
call   1030 <strcpy@plt>
lea    0xecf(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <strcat@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"/tmp/\00"
@.str.1 = [7 x i8] c"XXXXXX\00"
define void @users_prepare_filename(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = call i32 @strcat(i8* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"/tmp/\00"
@.str.1 = [7 x i8] c"XXXXXX\00"
define void @users_prepare_filename(i8* %0) {
%2 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mbus_remote_register_write(int, int, int);
int /*<<< orphan*/ set_halt_until_mbus_rx();
int /*<<< orphan*/ set_halt_until_mbus_tx();
int /*<<< orphan*/ set_pmu_sar_override(int);
void flash_turn_off() {
  set_halt_until_mbus_rx();
  mbus_remote_register_write(0x7, 0x11, 0x00003D);
  set_halt_until_mbus_tx();
  set_pmu_sar_override(47);
}


x86 assembly (clang, -O0):
<flash_turn_off>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <set_halt_until_mbus_rx@plt>
mov    $0x7,%edi
mov    $0x11,%esi
mov    $0x3d,%edx
call   1060 <mbus_remote_register_write@plt>
mov    $0x0,%al
call   1050 <set_halt_until_mbus_tx@plt>
mov    $0x2f,%edi
call   1030 <set_pmu_sar_override@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<flash_turn_off>:
push   %rax
xor    %eax,%eax
call   1040 <set_halt_until_mbus_rx@plt>
mov    $0x7,%edi
mov    $0x11,%esi
mov    $0x3d,%edx
call   1060 <mbus_remote_register_write@plt>
xor    %eax,%eax
call   1050 <set_halt_until_mbus_tx@plt>
mov    $0x2f,%edi
pop    %rax
jmp    1030 <set_pmu_sar_override@plt>

LLVM IR (-O0):
define void @flash_turn_off() {
%1 = call i32 (...) @set_halt_until_mbus_rx()
%2 = call i32 @mbus_remote_register_write(i32 7, i32 17, i32 61)
%3 = call i32 (...) @set_halt_until_mbus_tx()
%4 = call i32 @set_pmu_sar_override(i32 47)
ret void
}

LLVM IR (-O2):
define void @flash_turn_off() {
%1 = tail call i32 (...) @set_halt_until_mbus_rx()
%2 = tail call i32 @mbus_remote_register_write(i32 7, i32 17, i32 61)
%3 = tail call i32 (...) @set_halt_until_mbus_tx()
%4 = tail call i32 @set_pmu_sar_override(i32 47)
ret void
}
/* Type definitions */
struct addrinfo {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ freeaddrinfo(struct addrinfo *);
void freeaddr(struct addrinfo *addr) { freeaddrinfo(addr); }


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

x86 assembly (clang, -O2):
<freeaddr>:
jmp    1030 <freeaddrinfo@plt>

LLVM IR (-O0):
%struct.addrinfo = type { i32 }
define void @freeaddr(%struct.addrinfo* %0) {
%2 = alloca %struct.addrinfo*
store %struct.addrinfo* %0, %struct.addrinfo** %2
%3 = load %struct.addrinfo*, %struct.addrinfo** %2
%4 = call i32 @freeaddrinfo(%struct.addrinfo* %3)
ret void
}

LLVM IR (-O2):
%struct.addrinfo = type { i32 }
define void @freeaddr(%struct.addrinfo* %0) {
%2 = tail call i32 @freeaddrinfo(%struct.addrinfo* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void fatalsys(char *msg) {
  perror(msg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<fatalsys>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatalsys>:
push   %rax
call   1030 <perror@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @fatalsys(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @fatalsys(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
void fpsimd_settings_disable(void) {}


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

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

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

LLVM IR (-O2):
define void @fpsimd_settings_disable() {
ret void
}
int valid_size(int argc) {
  if (argc != 5)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<valid_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
je     111d <valid_size+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1124 <valid_size+0x24>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid_size>:
xor    %eax,%eax
cmp    $0x5,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @valid_size(i32 %0) {
%2 = icmp eq i32 %0, 5
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int ENOMEM;
char *strdup(int /*<<< orphan*/);
int /*<<< orphan*/ strempty(void *);
int specifier_string(char __attribute__((unused)) specifier, void *data,
                     void __attribute__((unused)) * userdata, char **ret) {
  char *n;
  n = strdup(strempty(data));
  if (!n)
    return -ENOMEM;
  *ret = n;
  return 0;
}


x86 assembly (clang, -O0):
<specifier_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strempty@plt>
mov    %eax,%edi
call   1030 <strdup@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    116c <specifier_string+0x4c>
xor    %eax,%eax
mov    0x2e7e(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    117e <specifier_string+0x5e>
mov    -0x28(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<specifier_string>:
push   %rbx
mov    %rcx,%rbx
mov    %rsi,%rdi
call   1040 <strempty@plt>
mov    %eax,%edi
call   1030 <strdup@plt>
test   %rax,%rax
je     113f <specifier_string+0x1f>
mov    %rax,(%rbx)
xor    %eax,%eax
pop    %rbx
ret
mov    0x2e9a(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
pop    %rbx
ret

LLVM IR (-O0):
@ENOMEM = global i32 0
define i32 @specifier_string(i8 signext %0, i8* %1, i8* %2, i8** %3) {
%5 = alloca i32
%6 = alloca i8
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8**
%10 = alloca i8*
store i8 %0, i8* %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8** %3, i8*** %9
%11 = load i8*, i8** %7
%12 = call i32 @strempty(i8* %11)
%13 = call i8* @strdup(i32 %12)
store i8* %13, i8** %10
%14 = load i8*, i8** %10
%15 = icmp ne i8* %14, null
br i1 %15, label %19, label %16
16: ; preds = %4
%17 = load i32, i32* @ENOMEM
%18 = sub nsw i32 0, %17
store i32 %18, i32* %5
br label %22
19: ; preds = %4
%20 = load i8*, i8** %10
%21 = load i8**, i8*** %9
store i8* %20, i8** %21
store i32 0, i32* %5
br label %22
22: ; preds = %19, %16
%23 = load i32, i32* %5
ret i32 %23
}

LLVM IR (-O2):
@ENOMEM = global i32 0
define i32 @specifier_string(i8 signext %0, i8* %1, i8* nocapture readnone %2, i8** nocapture writeonly %3) {
%5 = tail call i32 @strempty(i8* %1)
%6 = tail call i8* @strdup(i32 %5)
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = load i32, i32* @ENOMEM
%10 = sub nsw i32 0, %9
br label %12
11: ; preds = %4
store i8* %6, i8** %3
br label %12
12: ; preds = %11, %8
%13 = phi i32 [ 0, %11 ], [ %10, %8 ]
ret i32 %13
}
void writelines(int nlines, void (*print)(int)) { (*print)(nlines); }


x86 assembly (clang, -O0):
<writelines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%edi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writelines>:
jmp    *%rsi

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

LLVM IR (-O2):
define void @writelines(i32 %0, void (i32)* nocapture %1) {
tail call void %1(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pFmt(char *, int *);
int MprF(int nargs, int *args) {
  pFmt((char *)*args, (args + 1));
  return 0;
}


x86 assembly (clang, -O0):
<MprF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq (%rax),%rdi
mov    -0x10(%rbp),%rsi
add    $0x4,%rsi
call   1030 <pFmt@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MprF>:
push   %rax
movslq (%rsi),%rdi
add    $0x4,%rsi
call   1030 <pFmt@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @MprF(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load i32, i32* %5
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i8*
%9 = load i32*, i32** %4
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = call i32 @pFmt(i8* %8, i32* %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @MprF(i32 %0, i32* %1) {
%3 = load i32, i32* %1
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
%6 = getelementptr inbounds i32, i32* %1, i64 1
%7 = tail call i32 @pFmt(i8* %5, i32* %6)
ret i32 0
}
/* Variables and functions */
int NewClass(int);
int foo2(void) { return NewClass(2); }


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

x86 assembly (clang, -O2):
<foo2>:
mov    $0x2,%edi
jmp    1030 <NewClass@plt>

LLVM IR (-O0):
define i32 @foo2() {
%1 = call i32 @NewClass(i32 2)
ret i32 %1
}

LLVM IR (-O2):
define i32 @foo2() {
%1 = tail call i32 @NewClass(i32 2)
ret i32 %1
}
/* Variables and functions */
void port_byte_out(unsigned short port, unsigned char data) {
  __asm__("out %%al, %%dx" : : "a"(data), "d"(port));
}


x86 assembly (clang, -O0):
<port_byte_out>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    -0x2(%rbp),%dx
out    %al,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<port_byte_out>:
mov    %esi,%eax
mov    %edi,%edx
out    %al,(%dx)
ret

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

LLVM IR (-O2):
define void @port_byte_out(i16 zeroext %0, i8 zeroext %1) {
tail call void asm sideeffect "out %al, %dx", "{ax},{dx},~{dirflag},~{fpsr},~{flags}"(i8 %1, i16 %0)
ret void
}
char *_first_(void) {
  static char firststring[] = "<<<<FFFFFFFF>>>>";
  return (firststring);
}


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

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

LLVM IR (-O0):
@_first_.firststring = internal global [17 x i8] c"<<<<FFFFFFFF>>>>\00"
define i8* @_first_() {
ret i8* getelementptr inbounds ([17 x i8], [17 x i8]* @_first_.firststring, i64 0, i64 0)
}

LLVM IR (-O2):
@_first_.firststring = internal global [17 x i8] c"<<<<FFFFFFFF>>>>\00"
define i8* @_first_() {
ret i8* getelementptr inbounds ([17 x i8], [17 x i8]* @_first_.firststring, i64 0, i64 0)
}
/* Variables and functions */
double cos(double);
double el_true_anomaly(double semiMajor, double ecc, double fi) {
  return (semiMajor * (1.0 - ecc * ecc)) / (1.0 + ecc * cos(fi));
}


x86 assembly (clang, -O0):
<el_true_anomaly>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
movsd  0xea7(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <cos@plt>
movsd  -0x28(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm2,%xmm1
movsd  0xe6d(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<el_true_anomaly>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movapd %xmm1,%xmm3
mulsd  %xmm1,%xmm3
movsd  0xed6(%rip),%xmm1
subsd  %xmm3,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
movapd %xmm2,%xmm0
call   1030 <cos@plt>
mulsd  0x10(%rsp),%xmm0
addsd  0xeb1(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @el_true_anomaly(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = load double, double* %5
%10 = fneg double %8
%11 = call double @llvm.fmuladd.f64(double %10, double %9, double 1.000000e+00)
%12 = fmul double %7, %11
%13 = load double, double* %5
%14 = load double, double* %6
%15 = call double @cos(double %14)
%16 = call double @llvm.fmuladd.f64(double %13, double %15, double 1.000000e+00)
%17 = fdiv double %12, %16
ret double %17
}

LLVM IR (-O2):
define double @el_true_anomaly(double %0, double %1, double %2) {
%4 = fneg double %1
%5 = tail call double @llvm.fmuladd.f64(double %4, double %1, double 1.000000e+00)
%6 = fmul double %5, %0
%7 = tail call double @cos(double %2)
%8 = tail call double @llvm.fmuladd.f64(double %1, double %7, double 1.000000e+00)
%9 = fdiv double %6, %8
ret double %9
}
unsigned long long C_Utils_min_ulonglong(const unsigned long long item1,
                                         const unsigned long long item2) {
  return item1 > item2 ? item1 : item2;
}


x86 assembly (clang, -O0):
<C_Utils_min_ulonglong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    1127 <C_Utils_min_ulonglong+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <C_Utils_min_ulonglong+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<C_Utils_min_ulonglong>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmova  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @C_Utils_min_ulonglong(i64 %0, i64 %1) {
%3 = icmp ugt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
int LittleLong(int x) { return x; }


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

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

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

LLVM IR (-O2):
define i32 @LittleLong(i32 returned %0) {
ret i32 %0
}
void test_isalnum_macro(void) {
  int i, j;
  for (i = -127; i < 256;)
    j = i, printf("%s: %d -> %d\n", __FUNCTION__, j, isalnum(i++) ? 1 : 0);
}


x86 assembly (clang, -O0):
<test_isalnum_macro>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xffffff81,-0x4(%rbp)
cmpl   $0x100,-0x4(%rbp)
jge    1184 <test_isalnum_macro+0x64>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
call   1040 <isalnum@plt>
mov    -0xc(%rbp),%edx
mov    %eax,%esi
xor    %ecx,%ecx
mov    $0x1,%eax
cmp    $0x0,%esi
cmovne %eax,%ecx
lea    0xe8f(%rip),%rdi
lea    0xe96(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    112f <test_isalnum_macro+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_isalnum_macro>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0xffffff81,%ebx
lea    0xecd(%rip),%r14
lea    0xed4(%rip),%r15
nopw   0x0(%rax,%rax,1)
lea    0x1(%rbx),%ebp
mov    %ebx,%edi
call   1040 <isalnum@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %r14,%rdi
mov    %r15,%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebp,%ebx
cmp    $0x100,%ebp
jne    1140 <test_isalnum_macro+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"%s: %d -> %d\0A\00"
@__FUNCTION__.test_isalnum_macro = [19 x i8] c"test_isalnum_macro\00"
define void @test_isalnum_macro() {
%1 = alloca i32
%2 = alloca i32
store i32 -127, i32* %1
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 256
br i1 %5, label %6, label %16
6: ; preds = %3
%7 = load i32, i32* %1
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
%11 = call i32 @isalnum(i32 %9)
%12 = icmp ne i32 %11, 0
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 1, i32 0
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.test_isalnum_macro, i64 0, i64 0), i32 %8, i32 %14)
br label %3
16: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"%s: %d -> %d\0A\00"
@__FUNCTION__.test_isalnum_macro = [19 x i8] c"test_isalnum_macro\00"
define void @test_isalnum_macro() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ -127, %0 ], [ %3, %1 ]
%3 = add nsw i32 %2, 1
%4 = tail call i32 @isalnum(i32 %2)
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.test_isalnum_macro, i64 0, i64 0), i32 %2, i32 %6)
%8 = icmp eq i32 %3, 256
br i1 %8, label %9, label %1
9: ; preds = %1
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
int strlen(char *);
char *make_string_attach(char *pchBase, char *pchExt) {
  char *str =
      (char *)malloc(sizeof(char) * (20 + strlen(pchBase) + strlen(pchExt)));
  sprintf(str, "%s_%s", pchBase, pchExt);
  return str;
}


x86 assembly (clang, -O0):
<make_string_attach>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x14,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
add    %ecx,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe7d(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_string_attach>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
call   1030 <strlen@plt>
mov    %eax,%r15d
mov    %r14,%rdi
call   1030 <strlen@plt>
lea    (%r15,%rax,1),%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xe9c(%rip),%rsi
mov    %rax,%rdi
mov    %r12,%rdx
mov    %r14,%rcx
call   1050 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s_%s\00"
define i8* @make_string_attach(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = add nsw i32 20, %7
%9 = load i8*, i8** %4
%10 = call i32 @strlen(i8* %9)
%11 = add nsw i32 %8, %10
%12 = sext i32 %11 to i64
%13 = mul i64 1, %12
%14 = trunc i64 %13 to i32
%15 = call i64 @malloc(i32 %14)
%16 = inttoptr i64 %15 to i8*
store i8* %16, i8** %5
%17 = load i8*, i8** %5
%18 = load i8*, i8** %3
%19 = load i8*, i8** %4
%20 = call i32 @sprintf(i8* %17, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %18, i8* %19)
%21 = load i8*, i8** %5
ret i8* %21
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s_%s\00"
define i8* @make_string_attach(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = add nsw i32 %3, 20
%5 = tail call i32 @strlen(i8* %1)
%6 = add nsw i32 %4, %5
%7 = tail call i64 @malloc(i32 %6)
%8 = inttoptr i64 %7 to i8*
%9 = tail call i32 @sprintf(i8* dereferenceable(1) %8, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret i8* %8
}
int _isatty(int fd) {
  (void)fd;
  return (1);
}


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

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

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

LLVM IR (-O2):
define i32 @_isatty(i32 %0) {
ret i32 1
}
int test_imm_D5uint32_mem(unsigned int *val) {
  return ((*val) & (0xD5 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_D5uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 213
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
void usage() {
  fatal(
      "usage: hashsplit N BASENAME\n"
      "\n"
      "Split standard input containing a stream of key/value lines separated\n"
      "by a single tab into N output files named BASENAME.i according to the\n"
      "hash values of the keys. The value may be absent, either with or\n"
      "without a tab following the key. Keys and values may contain any bytes\n"
      "except zero, tab, and newline.");
}


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

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

LLVM IR (-O0):
@.str = [336 x i8] c"usage: hashsplit N BASENAME\0A\0ASplit standard input containing a stream of key/value lines separated\0Aby a single tab into N output files named BASENAME.i according to the\0Ahash values of the keys. The value may be absent, either with or\0Awithout a tab following the key. Keys and values may contain any bytes\0Aexcept zero, tab, and newline.\00"
define void @usage() {
%1 = call i32 @fatal(i8* getelementptr inbounds ([336 x i8], [336 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [336 x i8] c"usage: hashsplit N BASENAME\0A\0ASplit standard input containing a stream of key/value lines separated\0Aby a single tab into N output files named BASENAME.i according to the\0Ahash values of the keys. The value may be absent, either with or\0Awithout a tab following the key. Keys and values may contain any bytes\0Aexcept zero, tab, and newline.\00"
define void @usage() {
%1 = tail call i32 @fatal(i8* getelementptr inbounds ([336 x i8], [336 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int MCL_CURRENT;
int MCL_FUTURE;
int /*<<< orphan*/ die_perror(char *);
scalar_t__ mlockall(int);
void lock_memory(void) {
  if (mlockall(MCL_CURRENT | MCL_FUTURE))
    die_perror("lockall(MCL_CURRENT | MCL_FUTURE)");
}


x86 assembly (clang, -O0):
<lock_memory>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    0x2ebc(%rip),%rax
or     (%rax),%edi
call   1040 <mlockall@plt>
cmp    $0x0,%rax
je     1151 <lock_memory+0x31>
lea    0xeb4(%rip),%rdi
call   1030 <die_perror@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lock_memory>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    0x2ec1(%rip),%rcx
mov    (%rcx),%edi
or     (%rax),%edi
call   1040 <mlockall@plt>
test   %rax,%rax
je     114a <lock_memory+0x2a>
lea    0xebc(%rip),%rdi
pop    %rax
jmp    1030 <die_perror@plt>
pop    %rax
ret

LLVM IR (-O0):
@MCL_CURRENT = global i32 0
@MCL_FUTURE = global i32 0
@.str = [34 x i8] c"lockall(MCL_CURRENT | MCL_FUTURE)\00"
define void @lock_memory() {
%1 = load i32, i32* @MCL_CURRENT
%2 = load i32, i32* @MCL_FUTURE
%3 = or i32 %1, %2
%4 = call i64 @mlockall(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @die_perror(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
ret void
}

LLVM IR (-O2):
@MCL_CURRENT = global i32 0
@MCL_FUTURE = global i32 0
@.str = [34 x i8] c"lockall(MCL_CURRENT | MCL_FUTURE)\00"
define void @lock_memory() {
%1 = load i32, i32* @MCL_CURRENT
%2 = load i32, i32* @MCL_FUTURE
%3 = or i32 %2, %1
%4 = tail call i64 @mlockall(i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = tail call i32 @die_perror(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, int, int, int, int, int, int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(void) {
  debug("%d %d %d  %d %d %d\n", 101, 102, 103, 104, 105, 106);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x65,%esi
mov    $0x66,%edx
mov    $0x67,%ecx
mov    $0x68,%r8d
mov    $0x69,%r9d
movl   $0x6a,(%rsp)
call   1030 <debug@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x6a,(%rsp)
lea    0xed1(%rip),%rdi
mov    $0x65,%esi
mov    $0x66,%edx
mov    $0x67,%ecx
mov    $0x68,%r8d
mov    $0x69,%r9d
call   1030 <debug@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"%d %d %d %d %d %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @debug(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 101, i32 102, i32 103, i32 104, i32 105, i32 106)
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [20 x i8] c"%d %d %d %d %d %d\0A\00"
define i32 @main() {
%1 = tail call i32 @debug(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 101, i32 102, i32 103, i32 104, i32 105, i32 106)
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int pow(int, unsigned int);
void sign_n_bits(uint16_t *s, unsigned int n) {
  if (*s > pow(2, n - 1) - 1) {
    ;
    *s -= pow(2, n);
    ;
  }
}


x86 assembly (clang, -O0):
<sign_n_bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
mov    $0x2,%edi
call   1030 <pow@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
sub    $0x1,%ecx
cmp    %ecx,%eax
jle    1161 <sign_n_bits+0x51>
mov    -0xc(%rbp),%esi
mov    $0x2,%edi
call   1030 <pow@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
sub    %edx,%ecx
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign_n_bits>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %rdi,%r14
mov    (%rdi),%ebp
lea    -0x1(%rbx),%esi
mov    $0x2,%edi
call   1030 <pow@plt>
cmp    %eax,%ebp
jl     113b <sign_n_bits+0x2b>
mov    $0x2,%edi
mov    %ebx,%esi
call   1030 <pow@plt>
sub    %eax,(%r14)
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @sign_n_bits(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = add i32 %1, -1
%5 = tail call i32 @pow(i32 2, i32 %4)
%6 = icmp slt i32 %3, %5
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = tail call i32 @pow(i32 2, i32 %1)
%9 = load i32, i32* %0
%10 = sub nsw i32 %9, %8
store i32 %10, i32* %0
br label %11
11: ; preds = %7, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
void pb(int n) {
  if (n != 0) {
    pb(n / 2);
    putchar('0' + n % 2);
  }
}


x86 assembly (clang, -O0):
<pb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     115c <pb+0x3c>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <pb@plt>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x30,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pb>:
test   %edi,%edi
je     1153 <pb+0x33>
push   %r14
push   %rbx
push   %rax
mov    %edi,%r14d
mov    %edi,%ebx
shr    $0x1f,%ebx
add    %edi,%ebx
mov    %ebx,%edi
sar    %edi
call   1040 <pb@plt>
and    $0xfffffffe,%ebx
neg    %ebx
lea    (%r14,%rbx,1),%edi
add    $0x30,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putchar@plt>
ret

LLVM IR (-O0):
define void @pb(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sdiv i32 %6, 2
%8 = load i32, i32* %2
%9 = srem i32 %8, 2
%10 = add nsw i32 48, %9
%11 = call i32 @putchar(i32 %10)
br label %12
12: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @pb(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %4
3: ; preds = %1, %4
ret void
4: ; preds = %1
%5 = sdiv i32 %0, 2
tail call void @pb(i32 %5)
%6 = srem i32 %0, 2
%7 = add nsw i32 %6, 48
%8 = tail call i32 @putchar(i32 %7)
br label %3
}
int wifstopped(int stat_val) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @wifstopped(i32 %0) {
ret i32 -1
}
/* Variables and functions */
void *realloc(void *, size_t);
int /*<<< orphan*/ stSafeCErr(char *, size_t);
void *stSafeCRealloc(void *mem, size_t size) {
  if ((mem = realloc(mem, size)) == NULL) {
    stSafeCErr("can't reallocate %zd bytes of memory", size);
  }
  return mem;
}


x86 assembly (clang, -O0):
<stSafeCRealloc>:
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   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
jne    115b <stSafeCRealloc+0x3b>
mov    -0x10(%rbp),%rsi
lea    0xeaa(%rip),%rdi
call   1030 <stSafeCErr@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stSafeCRealloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <stSafeCRealloc+0x23>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
call   1030 <stSafeCErr@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [37 x i8] c"can't reallocate %zd bytes of memory\00"
define i8* @stSafeCRealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i8* @realloc(i8* %5, i64 %6)
store i8* %7, i8** %3
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i64, i64* %4
%11 = call i32 @stSafeCErr(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i64 %10)
br label %12
12: ; preds = %9, %2
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@.str = [37 x i8] c"can't reallocate %zd bytes of memory\00"
define noalias i8* @stSafeCRealloc(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 @stSafeCErr(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i64 %1)
br label %7
7: ; preds = %5, %2
ret i8* %3
}
long double longdouble_ignoring_signedlong(long double x, signed long y) {
  return x;
}


x86 assembly (clang, -O0):
<longdouble_ignoring_signedlong>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    %rdi,-0x18(%rbp)
fldt   -0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<longdouble_ignoring_signedlong>:
fldt   0x8(%rsp)
ret

LLVM IR (-O0):
define x86_fp80 @longdouble_ignoring_signedlong(x86_fp80 %0, i64 %1) {
%3 = alloca x86_fp80
%4 = alloca i64
store x86_fp80 %0, x86_fp80* %3
store i64 %1, i64* %4
%5 = load x86_fp80, x86_fp80* %3
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @longdouble_ignoring_signedlong(x86_fp80 returned %0, i64 %1) {
ret x86_fp80 %0
}
void b_system_misc(unsigned long function, void *var1, void *var2) {
  asm volatile("call *0x00100088" : : "d"(function), "a"(var1), "c"(var2));
}


x86 assembly (clang, -O0):
<b_system_misc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
call   *0x100088
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_system_misc>:
mov    %rdx,%rcx
mov    %rsi,%rax
mov    %rdi,%rdx
call   *0x100088
ret

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

LLVM IR (-O2):
define void @b_system_misc(i64 %0, i8* %1, i8* %2) {
tail call void asm sideeffect "call *0x00100088", "{dx},{ax},{cx},~{dirflag},~{fpsr},~{flags}"(i64 %0, i8* %1, i8* %2)
ret void
}