xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ SIG_DFL;
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
void ouch(int sig) {
  printf("OUCH - I got a signal %d\n", sig);
  (void)signal(SIGINT, SIG_DFL);
}


x86 assembly (clang, -O0):
<ouch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
mov    0x2e8e(%rip),%rax
mov    (%rax),%esi
call   1040 <signal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ouch>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
pop    %rax
jmp    1040 <signal@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"OUCH - I got a signal %d\0A\00"
@SIGINT = global i32 0
@SIG_DFL = global i32 0
define void @ouch(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @SIGINT
%6 = load i32, i32* @SIG_DFL
%7 = call i32 @signal(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"OUCH - I got a signal %d\0A\00"
@SIGINT = global i32 0
@SIG_DFL = global i32 0
define void @ouch(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = load i32, i32* @SIGINT
%4 = load i32, i32* @SIG_DFL
%5 = tail call i32 @signal(i32 %3, i32 %4)
ret void
}
/* Variables and functions */
int sparsebit(long);
int msbbit(long i) {
  long i2;
  if (i < 0)
    return (31);
  while ((i2 = (i & (i - 1))))
    i = i2;
  return (sparsebit(i));
}


x86 assembly (clang, -O0):
<msbbit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    1133 <msbbit+0x23>
movl   $0x1f,-0x4(%rbp)
jmp    116e <msbbit+0x5e>
jmp    1138 <msbbit+0x28>
mov    -0x10(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
and    %rcx,%rax
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1162 <msbbit+0x52>
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1138 <msbbit+0x28>
mov    -0x10(%rbp),%rdi
call   1030 <sparsebit@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msbbit>:
test   %rdi,%rdi
js     1134 <msbbit+0x24>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rdi,%rax
add    $0xffffffffffffffff,%rdi
and    %rax,%rdi
jne    1120 <msbbit+0x10>
mov    %rax,%rdi
jmp    1030 <sparsebit@plt>
mov    $0x1f,%eax
ret

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

LLVM IR (-O2):
define i32 @msbbit(i64 %0) {
%2 = icmp slt i64 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %6, %3 ], [ %0, %1 ]
%5 = add nsw i64 %4, -1
%6 = and i64 %5, %4
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3
%9 = tail call i32 @sparsebit(i64 %4)
br label %10
10: ; preds = %1, %8
%11 = phi i32 [ %9, %8 ], [ 31, %1 ]
ret i32 %11
}
/* Type definitions */
struct token {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct token *);
void token_destroy(struct token *t) {
  if (t == NULL)
    return;
  free(t);
}


x86 assembly (clang, -O0):
<token_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <token_destroy+0x1c>
jmp    1135 <token_destroy+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<token_destroy>:
test   %rdi,%rdi
je     111a <token_destroy+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.token = type { i32 }
define void @token_destroy(%struct.token* %0) {
%2 = alloca %struct.token*
store %struct.token* %0, %struct.token** %2
%3 = load %struct.token*, %struct.token** %2
%4 = icmp eq %struct.token* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load %struct.token*, %struct.token** %2
%8 = call i32 @free(%struct.token* %7)
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
%struct.token = type { i32 }
define void @token_destroy(%struct.token* %0) {
%2 = icmp eq %struct.token* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.token* %0)
br label %5
5: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ get_percent(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  get_percent(atoi(argv[1]));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
call   1030 <get_percent@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @atoi(i8* %8)
%10 = call i32 @get_percent(i32 %9)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = tail call i32 @get_percent(i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free4(void ****);
void free4int(int ****p) { free4((void ****)p); }


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

x86 assembly (clang, -O2):
<free4int>:
jmp    1030 <free4@plt>

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

LLVM IR (-O2):
define void @free4int(i32**** %0) {
%2 = bitcast i32**** %0 to i8****
%3 = tail call i32 @free4(i8**** %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int i;
  for (i = 0; i <= 255; i++) {
    printf("%c - %d \n", i, i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xff,-0x8(%rbp)
jg     1153 <main+0x43>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%c - %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %10, %0
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 255
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
br label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %3
13: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"%c - %d \0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 256
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  printf("%d", 42);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 42)
ret i32 0
}
int int_size_is_at_least_32(void) {
  int t = 0x80000000;
  return t;
}


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

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

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

LLVM IR (-O2):
define i32 @int_size_is_at_least_32() {
ret i32 -2147483648
}
/* Variables and functions */
int /*<<< orphan*/ brakbot_(double *, int *, double *, int *, int *);
void brakbot(double aa, int *ia, double a[], int n, int l) {
  brakbot_(&aa, ia, a, &n, &l);
}


x86 assembly (clang, -O0):
<brakbot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    -0x8(%rbp),%rdi
lea    -0x1c(%rbp),%rcx
lea    -0x20(%rbp),%r8
call   1030 <brakbot_@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<brakbot>:
sub    $0x18,%rsp
mov    %rsi,%rax
mov    %rdi,%rsi
movsd  %xmm0,0x10(%rsp)
mov    %edx,0xc(%rsp)
mov    %ecx,0x8(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
mov    %rax,%rdx
call   1030 <brakbot_@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define void @brakbot(double %0, i32* %1, double* %2, i32 %3, i32 %4) {
%6 = alloca double
%7 = alloca i32
%8 = alloca i32
store double %0, double* %6
store i32 %3, i32* %7
store i32 %4, i32* %8
%9 = call i32 @brakbot_(double* %6, i32* %1, double* %2, i32* %7, i32* %8)
ret void
}
/* Type definitions */
typedef scalar_t__ time_t;

/* Variables and functions */
int time___TimeT_to_i___impl(time_t recv) { return (int)recv; }


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

x86 assembly (clang, -O2):
<time___TimeT_to_i___impl>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i32 @time___TimeT_to_i___impl(i64 %0) {
%2 = trunc i64 %0 to i32
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ unlink(char const *);
void freePid(int *pid_file, int *pid, const char *pid_path) {
  if (*pid_file != -1) {
    close(*pid_file);
    *pid_file = -1;
  }
  if (*pid >= 0) {
    unlink(pid_path);
    *pid = -1;
  }
}


x86 assembly (clang, -O0):
<freePid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0xffffffff,(%rax)
je     1156 <freePid+0x36>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1040 <close@plt>
mov    -0x8(%rbp),%rax
movl   $0xffffffff,(%rax)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
jl     1176 <freePid+0x56>
mov    -0x18(%rbp),%rdi
call   1030 <unlink@plt>
mov    -0x10(%rbp),%rax
movl   $0xffffffff,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freePid>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
mov    (%rdi),%edi
cmp    $0xffffffff,%edi
je     1140 <freePid+0x20>
call   1040 <close@plt>
movl   $0xffffffff,(%rbx)
cmpl   $0x0,(%r15)
js     1155 <freePid+0x35>
mov    %r14,%rdi
call   1030 <unlink@plt>
movl   $0xffffffff,(%r15)
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @freePid(i32* nocapture %0, i32* nocapture %1, i8* nocapture %2) {
%4 = load i32, i32* %0
%5 = icmp eq i32 %4, -1
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @close(i32 %4)
store i32 -1, i32* %0
br label %8
8: ; preds = %6, %3
%9 = load i32, i32* %1
%10 = icmp sgt i32 %9, -1
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = tail call i32 @unlink(i8* %2)
store i32 -1, i32* %1
br label %13
13: ; preds = %11, %8
ret void
}
int test_imm_79uint32_mem(unsigned int *val) {
  return ((*val) & (0x79 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_79uint32_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, 121
%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_79uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 121
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void RTTarFileGetOwner(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTarFileGetOwner() {
ret void
}
unsigned long long read_tsc() {
  unsigned int l, h;
  unsigned long long result;
  asm volatile("rdtsc  \n" : "=a"(l), "=d"(h));
  result = (unsigned long long)l | ((unsigned long long)h << 32);
  return result;
}


x86 assembly (clang, -O0):
<read_tsc>:
push   %rbp
mov    %rsp,%rbp
rdtsc
mov    %eax,-0x4(%rbp)
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x20,%rcx
or     %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_tsc>:
rdtsc
mov    %eax,%eax
shl    $0x20,%rdx
or     %rdx,%rax
ret

LLVM IR (-O0):
define i64 @read_tsc() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
%4 = call { i32, i32 } asm sideeffect "rdtsc \0A", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%5 = extractvalue { i32, i32 } %4, 0
%6 = extractvalue { i32, i32 } %4, 1
store i32 %5, i32* %1
store i32 %6, i32* %2
%7 = load i32, i32* %1
%8 = zext i32 %7 to i64
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
%11 = shl i64 %10, 32
%12 = or i64 %8, %11
store i64 %12, i64* %3
%13 = load i64, i64* %3
ret i64 %13
}

LLVM IR (-O2):
define i64 @read_tsc() {
%1 = tail call { i32, i32 } asm sideeffect "rdtsc \0A", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%2 = extractvalue { i32, i32 } %1, 0
%3 = extractvalue { i32, i32 } %1, 1
%4 = zext i32 %2 to i64
%5 = zext i32 %3 to i64
%6 = shl nuw i64 %5, 32
%7 = or i64 %6, %4
ret i64 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ ASN1_UTF8STRING;

/* Variables and functions */
int /*<<< orphan*/ ASN1_UTF8STRING_it;
scalar_t__ ASN1_item_new(int /*<<< orphan*/ *);
ASN1_UTF8STRING *ASN1_UTF8STRING_new(void) {
  return (ASN1_UTF8STRING *)ASN1_item_new(&ASN1_UTF8STRING_it);
}


x86 assembly (clang, -O0):
<ASN1_UTF8STRING_new>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rdi
call   1030 <ASN1_item_new@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ASN1_UTF8STRING_new>:
mov    0x2ec9(%rip),%rdi
jmp    1030 <ASN1_item_new@plt>

LLVM IR (-O0):
@ASN1_UTF8STRING_it = global i32 0
define i32* @ASN1_UTF8STRING_new() {
%1 = call i64 @ASN1_item_new(i32* @ASN1_UTF8STRING_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}

LLVM IR (-O2):
@ASN1_UTF8STRING_it = global i32 0
define i32* @ASN1_UTF8STRING_new() {
%1 = tail call i64 @ASN1_item_new(i32* @ASN1_UTF8STRING_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int mem_stack_unit_destructor(void *a) {
  free(a);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @mem_stack_unit_destructor(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i32 0
}
int initramfs_putch(struct riku_devfs_node *self, char c) { return 0; }


x86 assembly (clang, -O0):
<initramfs_putch>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.riku_devfs_node = type opaque
define i32 @initramfs_putch(%struct.riku_devfs_node* %0, i8 signext %1) {
%3 = alloca %struct.riku_devfs_node*
%4 = alloca i8
store %struct.riku_devfs_node* %0, %struct.riku_devfs_node** %3
store i8 %1, i8* %4
ret i32 0
}

LLVM IR (-O2):
%struct.riku_devfs_node = type opaque
define i32 @initramfs_putch(%struct.riku_devfs_node* nocapture readnone %0, i8 signext %1) {
ret i32 0
}
/* Variables and functions */
char *allocate_general_path(char *, char *, char *);
char *allocate_path(char *parent, char *file) {
  return allocate_general_path(parent, file, "/");
}


x86 assembly (clang, -O0):
<allocate_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    0xed1(%rip),%rdx
call   1030 <allocate_general_path@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocate_path>:
lea    0xee9(%rip),%rdx
jmp    1030 <allocate_general_path@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
define i8* @allocate_path(i8* %0, i8* %1) {
%3 = tail call i8* @allocate_general_path(i8* %0, i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int x = 011;
  printf("%d\n", x);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 9)
ret i32 0
}
int isfullpath(const char *filename) { return (filename[0] == '/'); }


x86 assembly (clang, -O0):
<isfullpath>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isfullpath>:
xor    %eax,%eax
cmpb   $0x2f,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @isfullpath(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 47
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @isfullpath(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 47
%4 = zext i1 %3 to i32
ret i32 %4
}
void cfg80211_debugfs_drv_del(struct cfg80211_registered_device *drv) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
FILE *open_procnetdev(void) {
  FILE *fd;
  char buf[161];
  fd = fopen("/proc/net/dev", "r");
  if (fd != NULL) {
    fgets(buf, 160, fd);
    fgets(buf, 160, fd);
  }
  return fd;
}


x86 assembly (clang, -O0):
<open_procnetdev>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
lea    0xece(%rip),%rdi
lea    0xed5(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1177 <open_procnetdev+0x57>
lea    -0xb0(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0xa0,%esi
call   1030 <fgets@plt>
lea    -0xb0(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0xa0,%esi
call   1030 <fgets@plt>
mov    -0x8(%rbp),%rax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_procnetdev>:
push   %r14
push   %rbx
sub    $0xa8,%rsp
lea    0xecf(%rip),%rdi
lea    0xed6(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1168 <open_procnetdev+0x48>
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0xa0,%esi
mov    %rbx,%rdx
call   1030 <fgets@plt>
mov    %r14,%rdi
mov    $0xa0,%esi
mov    %rbx,%rdx
call   1030 <fgets@plt>
mov    %rbx,%rax
add    $0xa8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [14 x i8] c"/proc/net/dev\00"
@.str.1 = [2 x i8] c"r\00"
define i32* @open_procnetdev() {
%1 = alloca i32*
%2 = alloca [161 x i8]
%3 = call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = icmp ne i32* %4, null
br i1 %5, label %6, label %13
6: ; preds = %0
%7 = getelementptr inbounds [161 x i8], [161 x i8]* %2, i64 0, i64 0
%8 = load i32*, i32** %1
%9 = call i32 @fgets(i8* %7, i32 160, i32* %8)
%10 = getelementptr inbounds [161 x i8], [161 x i8]* %2, i64 0, i64 0
%11 = load i32*, i32** %1
%12 = call i32 @fgets(i8* %10, i32 160, i32* %11)
br label %13
13: ; preds = %6, %0
%14 = load i32*, i32** %1
ret i32* %14
}

LLVM IR (-O2):
@.str = [14 x i8] c"/proc/net/dev\00"
@.str.1 = [2 x i8] c"r\00"
define noalias i32* @open_procnetdev() {
%1 = alloca [161 x i8]
%2 = getelementptr inbounds [161 x i8], [161 x i8]* %1, i64 0, i64 0
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp eq i32* %3, null
br i1 %4, label %8, label %5
5: ; preds = %0
%6 = call i32 @fgets(i8* %2, i32 160, i32* %3)
%7 = call i32 @fgets(i8* %2, i32 160, i32* %3)
br label %8
8: ; preds = %5, %0
ret i32* %3
}
/* Variables and functions */
float fabsf(float);
float G(float x) { return (x / (1.f + fabsf(x))); }


x86 assembly (clang, -O0):
<G>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movaps 0xef6(%rip),%xmm1
pand   %xmm1,%xmm2
movss  0xeda(%rip),%xmm1
addss  %xmm2,%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<G>:
movaps 0xef9(%rip),%xmm1
andps  %xmm0,%xmm1
addss  0xefe(%rip),%xmm1
divss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @G(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = call float @llvm.fabs.f32(float %4)
%6 = fadd float 1.000000e+00, %5
%7 = fdiv float %3, %6
ret float %7
}

LLVM IR (-O2):
define float @G(float %0) {
%2 = tail call float @llvm.fabs.f32(float %0)
%3 = fadd float %2, 1.000000e+00
%4 = fdiv float %0, %3
ret float %4
}
double factorial(double d) {
  double result = 1;
  for (; d > 1; d--)
    result *= d;
  return result;
}


x86 assembly (clang, -O0):
<factorial>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xedd(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1153 <factorial+0x53>
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xec4(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1116 <factorial+0x16>
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<factorial>:
movsd  0xef8(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    113e <factorial+0x3e>
movsd  0xeea(%rip),%xmm2
movsd  0xeea(%rip),%xmm3
movapd %xmm2,%xmm1
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mulsd  %xmm0,%xmm1
addsd  %xmm3,%xmm0
ucomisd %xmm2,%xmm0
ja     1130 <factorial+0x30>
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @factorial(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
store double 1.000000e+00, double* %3
br label %4
4: ; preds = %11, %1
%5 = load double, double* %2
%6 = fcmp ogt double %5, 1.000000e+00
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load double, double* %2
%9 = load double, double* %3
%10 = fmul double %9, %8
store double %10, double* %3
br label %11
11: ; preds = %7
%12 = load double, double* %2
%13 = fadd double %12, -1.000000e+00
store double %13, double* %2
br label %4
14: ; preds = %4
%15 = load double, double* %3
ret double %15
}

LLVM IR (-O2):
define double @factorial(double %0) {
%2 = fcmp ogt double %0, 1.000000e+00
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi double [ %6, %3 ], [ 1.000000e+00, %1 ]
%5 = phi double [ %7, %3 ], [ %0, %1 ]
%6 = fmul double %5, %4
%7 = fadd double %5, -1.000000e+00
%8 = fcmp ogt double %7, 1.000000e+00
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi double [ 1.000000e+00, %1 ], [ %6, %3 ]
ret double %10
}
signed int tolower(signed int __c) {
  signed int tmp_if_expr$2;
  const signed int **return_value___ctype_tolower_loc$1;
  if (__c >= -128) {
    if (!(__c < 256))
      goto __CPROVER_DUMP_L1;
    return_value___ctype_tolower_loc$1 = __ctype_tolower_loc();
    tmp_if_expr$2 = (*return_value___ctype_tolower_loc$1)[(signed long int)__c];
  } else {
  __CPROVER_DUMP_L1:;
    tmp_if_expr$2 = __c;
  }
  return tmp_if_expr$2;
}


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffff80,-0x4(%rbp)
jl     115a <tolower+0x4a>
cmpl   $0x100,-0x4(%rbp)
jl     1137 <tolower+0x27>
jmp    115f <tolower+0x4f>
mov    $0x0,%al
call   1030 <__ctype_tolower_loc@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x8(%rbp)
jmp    1165 <tolower+0x55>
jmp    115f <tolower+0x4f>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
push   %rbx
mov    %edi,%ebx
lea    0x80(%rbx),%eax
cmp    $0x17f,%eax
ja     1132 <tolower+0x22>
xor    %eax,%eax
call   1030 <__ctype_tolower_loc@plt>
cltq
mov    (%rax),%rax
movslq %ebx,%rcx
mov    (%rax,%rcx,4),%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @tolower(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32**
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = icmp sge i32 %5, -128
br i1 %6, label %7, label %21
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 256
br i1 %9, label %11, label %10
10: ; preds = %7
br label %22
11: ; preds = %7
%12 = call i32 (...) @__ctype_tolower_loc()
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i32**
store i32** %14, i32*** %4
%15 = load i32**, i32*** %4
%16 = load i32*, i32** %15
%17 = load i32, i32* %2
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %16, i64 %18
%20 = load i32, i32* %19
store i32 %20, i32* %3
br label %24
21: ; preds = %1
br label %22
22: ; preds = %21, %10
%23 = load i32, i32* %2
store i32 %23, i32* %3
br label %24
24: ; preds = %22, %11
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = add i32 %0, 128
%3 = icmp ult i32 %2, 384
br i1 %3, label %4, label %12
4: ; preds = %1
%5 = tail call i32 (...) @__ctype_tolower_loc()
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32**
%8 = load i32*, i32** %7
%9 = sext i32 %0 to i64
%10 = getelementptr inbounds i32, i32* %8, i64 %9
%11 = load i32, i32* %10
br label %12
12: ; preds = %1, %4
%13 = phi i32 [ %11, %4 ], [ %0, %1 ]
ret i32 %13
}
int ishex(char c) {
  return (((c >= '0') && (c <= '9')) || ((c >= 'A') && (c <= 'F')) ||
          ((c >= 'a') && (c <= 'f')));
}


x86 assembly (clang, -O0):
<ishex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     1129 <ishex+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x39,%ecx
mov    %al,-0x2(%rbp)
jle    116d <ishex+0x6d>
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1148 <ishex+0x48>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x46,%ecx
mov    %al,-0x2(%rbp)
jle    116d <ishex+0x6d>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x61,%ecx
mov    %al,-0x3(%rbp)
jl     1167 <ishex+0x67>
movsbl -0x1(%rbp),%eax
cmp    $0x66,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ishex>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%al
setb   %al
and    $0xdf,%dil
add    $0xbf,%dil
cmp    $0x6,%dil
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @ishex(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = and i8 %0, -33
%5 = add i8 %4, -65
%6 = icmp ult i8 %5, 6
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
void TagsH36(double *T, double *q, double *L, double *addl, double mass) {}


x86 assembly (clang, -O0):
<TagsH36>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movsd  %xmm0,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @TagsH36(double* %0, double* %1, double* %2, double* %3, double %4) {
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
%9 = alloca double*
%10 = alloca double
store double* %0, double** %6
store double* %1, double** %7
store double* %2, double** %8
store double* %3, double** %9
store double %4, double* %10
ret void
}

LLVM IR (-O2):
define void @TagsH36(double* nocapture %0, double* nocapture %1, double* nocapture %2, double* nocapture %3, double %4) {
ret void
}
void setbit(char *p, int n) { p[n / 8] |= 01 << ((8 - 1) - n % 8); }


x86 assembly (clang, -O0):
<setbit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    $0x7,%ecx
sub    %edx,%ecx
mov    $0x1,%esi
shl    %cl,%esi
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edx
or     %esi,%edx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setbit>:
lea    0x7(%rsi),%eax
test   %esi,%esi
cmovns %esi,%eax
mov    %eax,%ecx
and    $0xfffffff8,%ecx
sub    %ecx,%esi
mov    $0x7,%cl
sub    %sil,%cl
mov    $0x1,%edx
shl    %cl,%edx
sar    $0x3,%eax
cltq
or     %dl,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @setbit(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = srem i32 %5, 8
%7 = sub nsw i32 7, %6
%8 = shl i32 1, %7
%9 = load i8*, i8** %3
%10 = load i32, i32* %4
%11 = sdiv i32 %10, 8
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %9, i64 %12
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = or i32 %15, %8
%17 = trunc i32 %16 to i8
store i8 %17, i8* %13
ret void
}

LLVM IR (-O2):
define void @setbit(i8* nocapture %0, i32 %1) {
%3 = srem i32 %1, 8
%4 = sub nsw i32 7, %3
%5 = shl nuw nsw i32 1, %4
%6 = sdiv i32 %1, 8
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = trunc i32 %5 to i8
%11 = or i8 %9, %10
store i8 %11, i8* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ grab(void *, int);
void grab2(void *p) { grab(p, 2); }


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

x86 assembly (clang, -O2):
<grab2>:
mov    $0x2,%esi
jmp    1030 <grab@plt>

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

LLVM IR (-O2):
define void @grab2(i8* %0) {
%2 = tail call i32 @grab(i8* %0, i32 2)
ret void
}
/* Variables and functions */
scalar_t__ os_random();
void __attribute__(()) arc4random_buf(unsigned char *b, int len) {
  int i;
  for (i = 0; i < len; i++) {
    b[i] = (unsigned char)os_random() % 255;
  }
}


x86 assembly (clang, -O0):
<arc4random_buf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115d <arc4random_buf+0x4d>
mov    $0x0,%al
call   1030 <os_random@plt>
movzbl %al,%eax
mov    $0xff,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <arc4random_buf+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arc4random_buf>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    114a <arc4random_buf+0x3a>
mov    %rdi,%r14
mov    %esi,%r12d
xor    %r15d,%r15d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <os_random@plt>
cmp    $0xff,%al
cmove  %r15d,%eax
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <arc4random_buf+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @arc4random_buf(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %15
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %13, %6 ]
%8 = tail call i64 (...) @os_random()
%9 = trunc i64 %8 to i8
%10 = icmp eq i8 %9, -1
%11 = select i1 %10, i8 0, i8 %9
%12 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %11, i8* %12
%13 = add nuw nsw i64 %7, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %15, label %6
15: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int kvadrat, kub, a;
  scanf("%d", &a);
  kvadrat = a * a;
  printf("%d\n", kvadrat);
  kub = a * a * a;
  printf("%d\n", kub);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x10(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
imul   -0x10(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
imul   %esi,%esi
lea    0xebf(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0xc(%rsp),%eax
mov    %eax,%esi
imul   %eax,%esi
imul   %eax,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%6 = load i32, i32* %4
%7 = load i32, i32* %4
%8 = mul nsw i32 %6, %7
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %4
%12 = load i32, i32* %4
%13 = mul nsw i32 %11, %12
%14 = load i32, i32* %4
%15 = mul nsw i32 %13, %14
store i32 %15, i32* %3
%16 = load i32, i32* %3
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %1
%8 = mul nsw i32 %7, %7
%9 = mul nsw i32 %8, %7
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}
void yaml_get_version(int *major, int *minor, int *patch) {
  *major = 0;
  *minor = 1;
  *patch = 3;
}


x86 assembly (clang, -O0):
<yaml_get_version>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x3,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<yaml_get_version>:
movl   $0x0,(%rdi)
movl   $0x1,(%rsi)
movl   $0x3,(%rdx)
ret

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

LLVM IR (-O2):
define void @yaml_get_version(i32* nocapture writeonly %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
store i32 0, i32* %0
store i32 1, i32* %1
store i32 3, i32* %2
ret void
}
/* Variables and functions */
scalar_t__ sin(double);
float sinf(float s) { return (float)sin((double)s); }


x86 assembly (clang, -O0):
<sinf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <sin@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinf>:
push   %rax
cvtss2sd %xmm0,%xmm0
call   1030 <sin@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @sinf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call i64 @sin(double %4)
%6 = sitofp i64 %5 to float
ret float %6
}

LLVM IR (-O2):
define float @sinf(float %0) {
%2 = fpext float %0 to double
%3 = tail call i64 @sin(double %2)
%4 = sitofp i64 %3 to float
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ GenPrintInstr1Operand(int, int /*<<< orphan*/, int, int);
void GenJumpUncond(int label) { GenPrintInstr1Operand(0x22, 0, 0x0F, label); }


x86 assembly (clang, -O0):
<GenJumpUncond>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x22,%edi
xor    %esi,%esi
mov    $0xf,%edx
call   1030 <GenPrintInstr1Operand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GenJumpUncond>:
mov    %edi,%ecx
mov    $0x22,%edi
xor    %esi,%esi
mov    $0xf,%edx
jmp    1030 <GenPrintInstr1Operand@plt>

LLVM IR (-O0):
define void @GenJumpUncond(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @GenPrintInstr1Operand(i32 34, i32 0, i32 15, i32 %3)
ret void
}

LLVM IR (-O2):
define void @GenJumpUncond(i32 %0) {
%2 = tail call i32 @GenPrintInstr1Operand(i32 34, i32 0, i32 15, i32 %0)
ret void
}
int cmp(const void *pa, const void *pb, void *a) {
  int *arg = (int *)a;
  return (*arg++ % 3) - 1;
}


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x20(%rbp)
mov    (%rax),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
movslq (%rdx),%rcx
imul   $0x55555556,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rax
add    %edx,%eax
lea    (%rax,%rax,2),%eax
not    %eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmp(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = bitcast i8* %8 to i32*
store i32* %9, i32** %7
%10 = load i32*, i32** %7
%11 = getelementptr inbounds i32, i32* %10, i32 1
store i32* %11, i32** %7
%12 = load i32, i32* %10
%13 = srem i32 %12, 3
%14 = sub nsw i32 %13, 1
ret i32 %14
}

LLVM IR (-O2):
define i32 @cmp(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture %2) {
%4 = bitcast i8* %2 to i32*
%5 = load i32, i32* %4
%6 = srem i32 %5, 3
%7 = add nsw i32 %6, -1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ ui();
int main(int varc, char *charv[]) {
  ui();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <ui@plt>
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <ui@plt>
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @ui()
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @ui()
%4 = tail call i32 @exit(i32 0)
unreachable
}