xunge/DecIR huggingface dataset:
unsigned long long gcd(unsigned long long u, unsigned long long v) {
  return (v != 0) ? gcd(v, u % v) : u;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114c <gcd+0x3c>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rdx,%rsi
call   1030 <gcd@plt>
mov    %rax,-0x18(%rbp)
jmp    1154 <gcd+0x44>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %rdi,%rax
test   %rsi,%rsi
je     1135 <gcd+0x35>
mov    %rsi,%rdx
jmp    111d <gcd+0x1d>
nopl   (%rax)
xor    %edx,%edx
div    %rcx
mov    %rcx,%rax
test   %rdx,%rdx
je     1132 <gcd+0x32>
mov    %rdx,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
jne    1110 <gcd+0x10>
xor    %edx,%edx
div    %ecx
jmp    1115 <gcd+0x15>
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @gcd(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %7, %4 ], [ %1, %2 ]
%6 = phi i64 [ %5, %4 ], [ %0, %2 ]
%7 = urem i64 %6, %5
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i64 [ %0, %2 ], [ %5, %4 ]
ret i64 %10
}
/* Variables and functions */
scalar_t__ SDL_imageFilterMMXdetect();
int SDL_imageFilterSobelX(unsigned char *Src, unsigned char *Dest, int rows,
                          int columns) {
  if ((columns < 8) || (rows < 3))
    return (-1);
  if ((SDL_imageFilterMMXdetect())) {
    return (0);
  } else {
    return (-1);
  }
}


x86 assembly (clang, -O0):
<SDL_imageFilterSobelX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
cmpl   $0x8,-0x20(%rbp)
jl     113a <SDL_imageFilterSobelX+0x2a>
cmpl   $0x3,-0x1c(%rbp)
jge    1146 <SDL_imageFilterSobelX+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    116a <SDL_imageFilterSobelX+0x5a>
mov    $0x0,%al
call   1030 <SDL_imageFilterMMXdetect@plt>
cmp    $0x0,%rax
je     1163 <SDL_imageFilterSobelX+0x53>
movl   $0x0,-0x4(%rbp)
jmp    116a <SDL_imageFilterSobelX+0x5a>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SDL_imageFilterSobelX>:
mov    $0xffffffff,%eax
cmp    $0x3,%edx
jl     1131 <SDL_imageFilterSobelX+0x21>
cmp    $0x8,%ecx
jl     1131 <SDL_imageFilterSobelX+0x21>
push   %rax
xor    %eax,%eax
call   1030 <SDL_imageFilterMMXdetect@plt>
cmp    $0x1,%rax
sbb    %eax,%eax
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @SDL_imageFilterSobelX(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i32 %3) {
%5 = icmp slt i32 %3, 8
%6 = icmp slt i32 %2, 3
%7 = or i1 %6, %5
br i1 %7, label %12, label %8
8: ; preds = %4
%9 = tail call i64 (...) @SDL_imageFilterMMXdetect()
%10 = icmp eq i64 %9, 0
%11 = sext i1 %10 to i32
br label %12
12: ; preds = %8, %4
%13 = phi i32 [ -1, %4 ], [ %11, %8 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ foobar();
int /*<<< orphan*/ leak();
int /*<<< orphan*/ leakFoo();
int /*<<< orphan*/ leakFooSupp();
int main() {
  foobar();
  leak();
  leakFoo();
  leakFooSupp();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <foobar@plt>
mov    $0x0,%al
call   1040 <leak@plt>
mov    $0x0,%al
call   1060 <leakFoo@plt>
mov    $0x0,%al
call   1050 <leakFooSupp@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <foobar@plt>
xor    %eax,%eax
call   1040 <leak@plt>
xor    %eax,%eax
call   1060 <leakFoo@plt>
xor    %eax,%eax
call   1050 <leakFooSupp@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @foobar()
%3 = call i32 (...) @leak()
%4 = call i32 (...) @leakFoo()
%5 = call i32 (...) @leakFooSupp()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foobar()
%2 = tail call i32 (...) @leak()
%3 = tail call i32 (...) @leakFoo()
%4 = tail call i32 (...) @leakFooSupp()
ret i32 0
}
double map(int dim_in, int dim_out, int pos) {
  return (pos + 0.5) * ((double)dim_in / dim_out) - 0.5;
}


x86 assembly (clang, -O0):
<map>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  0xeee(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
cvtsi2sdl -0x8(%rbp),%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xec8(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<map>:
cvtsi2sd %edx,%xmm1
addsd  0xef4(%rip),%xmm1
cvtsi2sd %edi,%xmm0
cvtsi2sd %esi,%xmm2
divsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm0
addsd  0xee4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @map(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* %6
%8 = sitofp i32 %7 to double
%9 = fadd double %8, 5.000000e-01
%10 = load i32, i32* %4
%11 = sitofp i32 %10 to double
%12 = load i32, i32* %5
%13 = sitofp i32 %12 to double
%14 = fdiv double %11, %13
%15 = call double @llvm.fmuladd.f64(double %9, double %14, double -5.000000e-01)
ret double %15
}

LLVM IR (-O2):
define double @map(i32 %0, i32 %1, i32 %2) {
%4 = sitofp i32 %2 to double
%5 = fadd double %4, 5.000000e-01
%6 = sitofp i32 %0 to double
%7 = sitofp i32 %1 to double
%8 = fdiv double %6, %7
%9 = tail call double @llvm.fmuladd.f64(double %5, double %8, double -5.000000e-01)
ret double %9
}
/* Type definitions */
struct shmid_ds {
  int dummy;
};

/* Variables and functions */
int syscall(int, int, int, int, struct shmid_ds *);
int shmctl(int id, int cmd, struct shmid_ds *buf) {
  return syscall(117, 24, id, cmd | 0x100, buf);
}


x86 assembly (clang, -O0):
<shmctl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
or     $0x100,%ecx
mov    -0x10(%rbp),%r8
mov    $0x75,%edi
mov    $0x18,%esi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shmctl>:
mov    %rdx,%r8
mov    %esi,%ecx
mov    %edi,%edx
or     $0x100,%ecx
mov    $0x75,%edi
mov    $0x18,%esi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.shmid_ds = type { i32 }
define i32 @shmctl(i32 %0, i32 %1, %struct.shmid_ds* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.shmid_ds*
store i32 %0, i32* %4
store i32 %1, i32* %5
store %struct.shmid_ds* %2, %struct.shmid_ds** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = or i32 %8, 256
%10 = load %struct.shmid_ds*, %struct.shmid_ds** %6
%11 = call i32 @syscall(i32 117, i32 24, i32 %7, i32 %9, %struct.shmid_ds* %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.shmid_ds = type { i32 }
define i32 @shmctl(i32 %0, i32 %1, %struct.shmid_ds* %2) {
%4 = or i32 %1, 256
%5 = tail call i32 @syscall(i32 117, i32 24, i32 %0, i32 %4, %struct.shmid_ds* %2)
ret i32 %5
}
void rt2x00debug_update_crypto(struct rt2x00_dev *rt2x00dev,
                               struct rxdone_entry_desc *rxdesc) {}


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

x86 assembly (clang, -O2):
ret

LLVM IR (-O0):
%struct.rt2x00_dev = type opaque
%struct.rxdone_entry_desc = type opaque
define void @rt2x00debug_update_crypto(%struct.rt2x00_dev* %0, %struct.rxdone_entry_desc* %1) {
%3 = alloca %struct.rt2x00_dev*
%4 = alloca %struct.rxdone_entry_desc*
store %struct.rt2x00_dev* %0, %struct.rt2x00_dev** %3
store %struct.rxdone_entry_desc* %1, %struct.rxdone_entry_desc** %4
ret void
}

LLVM IR (-O2):
%struct.rt2x00_dev = type opaque
%struct.rxdone_entry_desc = type opaque
define void @rt2x00debug_update_crypto(%struct.rt2x00_dev* nocapture %0, %struct.rxdone_entry_desc* nocapture %1) {
ret void
}
int is_valid_version(float version) {
  if (version == 1.0) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_valid_version>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1136 <is_valid_version+0x36>
jp     1136 <is_valid_version+0x36>
movl   $0x1,-0x4(%rbp)
jmp    113d <is_valid_version+0x3d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_version>:
cmpeqss 0xef7(%rip),%xmm0
movd   %xmm0,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @is_valid_version(float %0) {
%2 = alloca i32
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fpext float %4 to double
%6 = fcmp oeq double %5, 1.000000e+00
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @is_valid_version(float %0) {
%2 = fcmp oeq float %0, 1.000000e+00
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
unsigned char strtoul(char *, int /*<<< orphan*/ *, int);
unsigned char chars_to_byte(char a, char b) {
  char tmp[] = {a, b, '\0'};
  return strtoul(tmp, NULL, 16);
}


x86 assembly (clang, -O0):
<chars_to_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x2(%rbp),%al
mov    %al,-0x4(%rbp)
movb   $0x0,-0x3(%rbp)
lea    -0x5(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x10,%edx
call   1030 <strtoul@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chars_to_byte>:
push   %rax
mov    %dil,0x5(%rsp)
mov    %sil,0x6(%rsp)
movb   $0x0,0x7(%rsp)
lea    0x5(%rsp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <strtoul@plt>
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @chars_to_byte(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca [3 x i8]
store i8 %0, i8* %3
store i8 %1, i8* %4
%6 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 0
%7 = load i8, i8* %3
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %4
store i8 %9, i8* %8
%10 = getelementptr inbounds i8, i8* %8, i64 1
store i8 0, i8* %10
%11 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 0
%12 = call zeroext i8 @strtoul(i8* %11, i32* null, i32 16)
ret i8 %12
}

LLVM IR (-O2):
define zeroext i8 @chars_to_byte(i8 signext %0, i8 signext %1) {
%3 = alloca [3 x i8]
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
store i8 %0, i8* %4
%5 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 1
store i8 %1, i8* %5
%6 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 2
store i8 0, i8* %6
%7 = call zeroext i8 @strtoul(i8* nocapture %4, i32* null, i32 16)
ret i8 %7
}
/* Type definitions */
struct exp {
  int dummy;
};

/* Variables and functions */
struct exp *parseOrExp();
struct exp *nextExp() {
  return parseOrExp();
}


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

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

LLVM IR (-O0):
%struct.exp = type { i32 }
define %struct.exp* @nextExp() {
%1 = call %struct.exp* (...) @parseOrExp()
ret %struct.exp* %1
}

LLVM IR (-O2):
%struct.exp = type { i32 }
define %struct.exp* @nextExp() {
%1 = tail call %struct.exp* (...) @parseOrExp()
ret %struct.exp* %1
}
/* Variables and functions */
int /*<<< orphan*/ clear_screen();
int /*<<< orphan*/ draw(char **, int, int);
char **init_table(int, int);
char **update(char **, int, int);
int /*<<< orphan*/ usleep(int);
void run(int width, int height) {
  char **table = init_table(width, height);
  while (1) {
    clear_screen();
    draw(table, width, height);
    table = update(table, width, height);
    usleep(300000);
  }
}


x86 assembly (clang, -O0):
<run>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1050 <init_table@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <clear_screen@plt>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1040 <draw@plt>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1030 <update@plt>
mov    %rax,-0x10(%rbp)
mov    $0x493e0,%edi
call   1070 <usleep@plt>
jmp    116d <run+0x1d>

x86 assembly (clang, -O2):
<run>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebp
call   1050 <init_table@plt>
mov    %rax,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1060 <clear_screen@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1040 <draw@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <update@plt>
mov    %rax,%rbx
mov    $0x493e0,%edi
call   1070 <usleep@plt>
jmp    1170 <run+0x20>

LLVM IR (-O0):
define void @run(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i8** @init_table(i32 %6, i32 %7)
store i8** %8, i8*** %5
br label %9
9: ; preds = %2, %9
%10 = call i32 (...) @clear_screen()
%11 = load i8**, i8*** %5
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = call i32 @draw(i8** %11, i32 %12, i32 %13)
%15 = load i8**, i8*** %5
%16 = load i32, i32* %3
%17 = load i32, i32* %4
%18 = call i8** @update(i8** %15, i32 %16, i32 %17)
store i8** %18, i8*** %5
%19 = call i32 @usleep(i32 300000)
br label %9
}

LLVM IR (-O2):
define void @run(i32 %0, i32 %1) {
%3 = tail call i8** @init_table(i32 %0, i32 %1)
br label %4
4: ; preds = %4, %2
%5 = phi i8** [ %3, %2 ], [ %8, %4 ]
%6 = tail call i32 (...) @clear_screen()
%7 = tail call i32 @draw(i8** %5, i32 %0, i32 %1)
%8 = tail call i8** @update(i8** %5, i32 %0, i32 %1)
%9 = tail call i32 @usleep(i32 300000)
br label %4
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint8_t tlm_encode_wspr_vsol(uint16_t voltage) {
  if (voltage > 1999) {
    return 9;
  }
  return voltage / 200;
}


x86 assembly (clang, -O0):
<tlm_encode_wspr_vsol>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x7cf,-0x8(%rbp)
jle    1120 <tlm_encode_wspr_vsol+0x20>
movl   $0x9,-0x4(%rbp)
jmp    112e <tlm_encode_wspr_vsol+0x2e>
mov    -0x8(%rbp),%eax
mov    $0xc8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tlm_encode_wspr_vsol>:
mov    $0x9,%eax
cmp    $0x7cf,%edi
jg     1124 <tlm_encode_wspr_vsol+0x24>
movslq %edi,%rax
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @tlm_encode_wspr_vsol(i32 %0) {
%2 = icmp sgt i32 %0, 1999
%3 = sdiv i32 %0, 200
%4 = select i1 %2, i32 9, i32 %3
ret i32 %4
}
/* Variables and functions */
#define EALREADY 131
#define EINPROGRESS 130
#define EINTR 129
#define EWOULDBLOCK 128
int ignoreErrno(int ierrno) {
  switch (ierrno) {
  case EINPROGRESS:
  case EWOULDBLOCK:
  case EALREADY:
  case EINTR:
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<ignoreErrno>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffff80,%eax
sub    $0x3,%eax
ja     1127 <ignoreErrno+0x27>
jmp    111b <ignoreErrno+0x1b>
movl   $0x1,-0x4(%rbp)
jmp    112e <ignoreErrno+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ignoreErrno>:
and    $0xfffffffc,%edi
xor    %eax,%eax
cmp    $0x80,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @ignoreErrno(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 130, label %5
i32 128, label %5
i32 131, label %5
i32 129, label %5
]
5: ; preds = %1, %1, %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @ignoreErrno(i32 %0) {
%2 = and i32 %0, -4
%3 = icmp eq i32 %2, 128
%4 = zext i1 %3 to i32
ret i32 %4
}
void scale2x_generic_output(void *data, unsigned *out_width,
                            unsigned *out_height, unsigned width,
                            unsigned height) {
  *out_width = width << 1;
  *out_height = height << 1;
}


x86 assembly (clang, -O0):
<scale2x_generic_output>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x1c(%rbp),%ecx
shl    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%ecx
shl    $0x1,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<scale2x_generic_output>:
add    %ecx,%ecx
mov    %ecx,(%rsi)
add    %r8d,%r8d
mov    %r8d,(%rdx)
ret

LLVM IR (-O0):
define void @scale2x_generic_output(i8* %0, i32* %1, i32* %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %9
%12 = shl i32 %11, 1
%13 = load i32*, i32** %7
store i32 %12, i32* %13
%14 = load i32, i32* %10
%15 = shl i32 %14, 1
%16 = load i32*, i32** %8
store i32 %15, i32* %16
ret void
}

LLVM IR (-O2):
define void @scale2x_generic_output(i8* nocapture readnone %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32 %3, i32 %4) {
%6 = shl i32 %3, 1
store i32 %6, i32* %1
%7 = shl i32 %4, 1
store i32 %7, i32* %2
ret void
}
/* Variables and functions */
void Reserved_Handler32(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<Reserved_Handler32>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <Reserved_Handler32+0x9>
jmp    1109 <Reserved_Handler32+0x9>

x86 assembly (clang, -O2):
<Reserved_Handler32>:
jmp    1100 <Reserved_Handler32>

LLVM IR (-O0):
define void @Reserved_Handler32() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @Reserved_Handler32() {
br label %1
1: ; preds = %0, %1
br label %1
}
void Pattern5(struct PatternGen_Params *P, struct PatternGen_Settings *S,
              struct PatternGen_Random *R,
              struct PatternGen_PatternFuncSpecific *PS, int I,
              struct PatternGen_Tick *Output) {}


x86 assembly (clang, -O0):
<Pattern5>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9,-0x30(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.PatternGen_Params = type opaque
%struct.PatternGen_Settings = type opaque
%struct.PatternGen_Random = type opaque
%struct.PatternGen_PatternFuncSpecific = type opaque
%struct.PatternGen_Tick = type opaque
define void @Pattern5(%struct.PatternGen_Params* %0, %struct.PatternGen_Settings* %1, %struct.PatternGen_Random* %2, %struct.PatternGen_PatternFuncSpecific* %3, i32 %4, %struct.PatternGen_Tick* %5) {
%7 = alloca %struct.PatternGen_Params*
%8 = alloca %struct.PatternGen_Settings*
%9 = alloca %struct.PatternGen_Random*
%10 = alloca %struct.PatternGen_PatternFuncSpecific*
%11 = alloca i32
%12 = alloca %struct.PatternGen_Tick*
store %struct.PatternGen_Params* %0, %struct.PatternGen_Params** %7
store %struct.PatternGen_Settings* %1, %struct.PatternGen_Settings** %8
store %struct.PatternGen_Random* %2, %struct.PatternGen_Random** %9
store %struct.PatternGen_PatternFuncSpecific* %3, %struct.PatternGen_PatternFuncSpecific** %10
store i32 %4, i32* %11
store %struct.PatternGen_Tick* %5, %struct.PatternGen_Tick** %12
ret void
}

LLVM IR (-O2):
%struct.PatternGen_Params = type opaque
%struct.PatternGen_Settings = type opaque
%struct.PatternGen_Random = type opaque
%struct.PatternGen_PatternFuncSpecific = type opaque
%struct.PatternGen_Tick = type opaque
define void @Pattern5(%struct.PatternGen_Params* nocapture %0, %struct.PatternGen_Settings* nocapture %1, %struct.PatternGen_Random* nocapture %2, %struct.PatternGen_PatternFuncSpecific* nocapture %3, i32 %4, %struct.PatternGen_Tick* nocapture %5) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ getuid();
int /*<<< orphan*/ perror(char *);
scalar_t__ setuid(int /*<<< orphan*/);
void drop_capabilities(void) {
  if (setuid(getuid()) < 0) {
    perror("arping: setuid");
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<drop_capabilities>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %eax,%edi
call   1060 <setuid@plt>
cmp    $0x0,%rax
jge    1172 <drop_capabilities+0x32>
lea    0xe9d(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<drop_capabilities>:
push   %rax
xor    %eax,%eax
call   1030 <getuid@plt>
mov    %eax,%edi
call   1060 <setuid@plt>
test   %rax,%rax
js     1156 <drop_capabilities+0x16>
pop    %rax
ret
lea    0xea3(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"arping: setuid\00"
define void @drop_capabilities() {
%1 = call i32 (...) @getuid()
%2 = call i64 @setuid(i32 %1)
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @exit(i32 -1)
unreachable
7: ; preds = %0
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"arping: setuid\00"
define void @drop_capabilities() {
%1 = tail call i32 (...) @getuid()
%2 = tail call i64 @setuid(i32 %1)
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = tail call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 -1)
unreachable
7: ; preds = %0
ret void
}
int f4(int v) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @f4(i32 %0) {
ret i32 0
}
int required(int want, double save) {
  int norders = (int)(want * save);
  if (norders < want * save)
    ++norders;
  return norders;
}


x86 assembly (clang, -O0):
<required>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x14(%rbp)
cvtsi2sdl -0x14(%rbp),%xmm1
cvtsi2sdl -0x4(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    113f <required+0x3f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<required>:
cvtsi2sd %edi,%xmm1
mulsd  %xmm0,%xmm1
cvttsd2si %xmm1,%ecx
cvttpd2dq %xmm1,%xmm0
cvtdq2pd %xmm0,%xmm0
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @required(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca i32
store i32 %0, i32* %3
store double %1, double* %4
%6 = load i32, i32* %3
%7 = sitofp i32 %6 to double
%8 = load double, double* %4
%9 = fmul double %7, %8
%10 = fptosi double %9 to i32
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = sitofp i32 %11 to double
%13 = load i32, i32* %3
%14 = sitofp i32 %13 to double
%15 = load double, double* %4
%16 = fmul double %14, %15
%17 = fcmp olt double %12, %16
br i1 %17, label %18, label %21
18: ; preds = %2
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %21
21: ; preds = %18, %2
%22 = load i32, i32* %5
ret i32 %22
}

LLVM IR (-O2):
define i32 @required(i32 %0, double %1) {
%3 = sitofp i32 %0 to double
%4 = fmul double %3, %1
%5 = fptosi double %4 to i32
%6 = sitofp i32 %5 to double
%7 = fcmp ogt double %4, %6
%8 = zext i1 %7 to i32
%9 = add nsw i32 %8, %5
ret i32 %9
}
/* Variables and functions */
scalar_t__ isVerified(char *);
int /*<<< orphan*/ login();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char **);
int main(void) {
  char str[100];
  scanf("%s", &str);
  if (isVerified(str))
    login();
  else
    printf("Incorrect password!");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xea6(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x70(%rbp),%rdi
call   1060 <isVerified@plt>
cmp    $0x0,%rax
je     117e <main+0x3e>
mov    $0x0,%al
call   1040 <login@plt>
jmp    118a <main+0x4a>
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
lea    0xeb4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1060 <isVerified@plt>
test   %rax,%rax
je     116d <main+0x2d>
xor    %eax,%eax
call   1040 <login@plt>
jmp    1179 <main+0x39>
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [20 x i8] c"Incorrect password!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
store i32 0, i32* %1
%3 = bitcast [100 x i8]* %2 to i8**
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %3)
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%6 = call i64 @isVerified(i8* %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 (...) @login()
br label %12
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [20 x i8] c"Incorrect password!\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = bitcast [100 x i8]* %1 to i8**
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %3)
%5 = call i64 @isVerified(i8* %2)
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %0
%8 = call i32 (...) @login()
br label %11
9: ; preds = %0
%10 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
ret i32 0
}
int test06(int a, int b, int c, int d) {
  int x = a == b;
  int y = c == 0;
  return x ^ y;
}


x86 assembly (clang, -O0):
<test06>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
xor    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test06>:
cmp    %esi,%edi
sete   %al
test   %edx,%edx
sete   %cl
xor    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @test06(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = icmp eq i32 %11, %12
%14 = zext i1 %13 to i32
store i32 %14, i32* %9
%15 = load i32, i32* %7
%16 = icmp eq i32 %15, 0
%17 = zext i1 %16 to i32
store i32 %17, i32* %10
%18 = load i32, i32* %9
%19 = load i32, i32* %10
%20 = xor i32 %18, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @test06(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %0, %1
%6 = icmp eq i32 %2, 0
%7 = xor i1 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
scalar_t__ wcsncpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *, size_t);
int wcsncpy_s(wchar_t *str, size_t size, const wchar_t *src, size_t len) {
  return wcsncpy(str, src, size < len ? size : len) ? 0 : -1;
}


x86 assembly (clang, -O0):
<wcsncpy_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    1153 <wcsncpy_s+0x43>
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
jmp    115b <wcsncpy_s+0x4b>
mov    -0x20(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rdx
call   1030 <wcsncpy@plt>
mov    %rax,%rdx
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcsncpy_s>:
push   %rax
cmp    %rcx,%rsi
cmovb  %rsi,%rcx
mov    %rdx,%rsi
mov    %rcx,%rdx
call   1030 <wcsncpy@plt>
cmp    $0x1,%rax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @wcsncpy_s(i32* %0, i64 %1, i32* %2, i64 %3) {
%5 = alloca i32*
%6 = alloca i64
%7 = alloca i32*
%8 = alloca i64
store i32* %0, i32** %5
store i64 %1, i64* %6
store i32* %2, i32** %7
store i64 %3, i64* %8
%9 = load i32*, i32** %5
%10 = load i32*, i32** %7
%11 = load i64, i64* %6
%12 = load i64, i64* %8
%13 = icmp ult i64 %11, %12
br i1 %13, label %14, label %16
14: ; preds = %4
%15 = load i64, i64* %6
br label %18
16: ; preds = %4
%17 = load i64, i64* %8
br label %18
18: ; preds = %16, %14
%19 = phi i64 [ %15, %14 ], [ %17, %16 ]
%20 = call i64 @wcsncpy(i32* %9, i32* %10, i64 %19)
%21 = icmp ne i64 %20, 0
%22 = zext i1 %21 to i64
%23 = select i1 %21, i32 0, i32 -1
ret i32 %23
}

LLVM IR (-O2):
define i32 @wcsncpy_s(i32* %0, i64 %1, i32* %2, i64 %3) {
%5 = icmp ult i64 %1, %3
%6 = select i1 %5, i64 %1, i64 %3
%7 = tail call i64 @wcsncpy(i32* %0, i32* %2, i64 %6)
%8 = icmp eq i64 %7, 0
%9 = sext i1 %8 to i32
ret i32 %9
}
void GPIOPinIntEnable(unsigned long ulPort, unsigned char ucPins) {
  ;
  (*((volatile unsigned long *)(ulPort + 0x00000410))) |= ucPins;
}


x86 assembly (clang, -O0):
<GPIOPinIntEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
mov    %eax,%edx
mov    -0x8(%rbp),%rax
mov    0x410(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0x410(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOPinIntEnable>:
mov    %esi,%eax
or     %rax,0x410(%rdi)
ret

LLVM IR (-O0):
define void @GPIOPinIntEnable(i64 %0, i8 zeroext %1) {
%3 = alloca i64
%4 = alloca i8
store i64 %0, i64* %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = zext i8 %5 to i64
%7 = load i64, i64* %3
%8 = add i64 %7, 1040
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = or i64 %10, %6
store volatile i64 %11, i64* %9
ret void
}

LLVM IR (-O2):
define void @GPIOPinIntEnable(i64 %0, i8 zeroext %1) {
%3 = zext i8 %1 to i64
%4 = add i64 %0, 1040
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = or i64 %6, %3
store volatile i64 %7, i64* %5
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ werase(int /*<<< orphan*/ *);
void curses_clear(void *ui) {
  WINDOW *win = ui;
  werase(win);
}


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

x86 assembly (clang, -O2):
<curses_clear>:
jmp    1030 <werase@plt>

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

LLVM IR (-O2):
define void @curses_clear(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @werase(i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GLUT_ELAPSED_TIME;
int glutGet(int /*<<< orphan*/);
int /*<<< orphan*/ glutPostRedisplay();
void Wait() {
  int nWaitUntil = glutGet(GLUT_ELAPSED_TIME);
  int nTimer = glutGet(GLUT_ELAPSED_TIME);
  if (nTimer >= nWaitUntil) {
    glutPostRedisplay();
    nWaitUntil = nTimer + (1000 / 5);
  }
}


x86 assembly (clang, -O0):
<Wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
call   1030 <glutGet@plt>
mov    %eax,-0x4(%rbp)
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
call   1030 <glutGet@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jl     1168 <Wait+0x48>
mov    $0x0,%al
call   1040 <glutPostRedisplay@plt>
mov    -0x8(%rbp),%eax
add    $0xc8,%eax
mov    %eax,-0x4(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Wait>:
push   %r14
push   %rbx
push   %rax
mov    0x2eb5(%rip),%r14
mov    (%r14),%edi
call   1030 <glutGet@plt>
mov    %eax,%ebx
mov    (%r14),%edi
call   1030 <glutGet@plt>
cmp    %ebx,%eax
jge    1149 <Wait+0x29>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <glutPostRedisplay@plt>

LLVM IR (-O0):
@GLUT_ELAPSED_TIME = global i32 0
define void @Wait() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @GLUT_ELAPSED_TIME
%4 = call i32 @glutGet(i32 %3)
store i32 %4, i32* %1
%5 = load i32, i32* @GLUT_ELAPSED_TIME
%6 = call i32 @glutGet(i32 %5)
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = load i32, i32* %1
%9 = icmp sge i32 %7, %8
br i1 %9, label %10, label %14
10: ; preds = %0
%11 = call i32 (...) @glutPostRedisplay()
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 200
store i32 %13, i32* %1
br label %14
14: ; preds = %10, %0
ret void
}

LLVM IR (-O2):
@GLUT_ELAPSED_TIME = global i32 0
define void @Wait() {
%1 = load i32, i32* @GLUT_ELAPSED_TIME
%2 = tail call i32 @glutGet(i32 %1)
%3 = load i32, i32* @GLUT_ELAPSED_TIME
%4 = tail call i32 @glutGet(i32 %3)
%5 = icmp slt i32 %4, %2
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = tail call i32 (...) @glutPostRedisplay()
br label %8
8: ; preds = %6, %0
ret void
}
void ff_hevc_put_hevc_uni_w_epel_v6_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_epel_v6_12_sse4() {
ret void
}
/* Type definitions */
struct timeval {
  long tv_sec;
  long tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ select(int /*<<< orphan*/, int /*<<< orphan*/,
                          int /*<<< orphan*/, int /*<<< orphan*/,
                          struct timeval *);
extern void msleep(long ms) {
  struct timeval tv;
  tv.tv_sec = ms / 1000;
  tv.tv_usec = ms % 1000 * 1000;
  select(0, 0, 0, 0, &tv);
}


x86 assembly (clang, -O0):
<msleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
imul   $0x3e8,%rdx,%rax
mov    %rax,-0x10(%rbp)
xor    %ecx,%ecx
lea    -0x18(%rbp),%r8
mov    %ecx,%edi
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <select@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msleep>:
sub    $0x18,%rsp
movabs $0x20c49ba5e353f7cf,%rcx
9b c4 20
mov    %rdi,%rax
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x7,%rdx
add    %rax,%rdx
mov    %rdx,0x8(%rsp)
imul   $0x3e8,%rdx,%rax
sub    %rax,%rdi
imul   $0x3e8,%rdi,%rax
mov    %rax,0x10(%rsp)
lea    0x8(%rsp),%r8
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <select@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define void @msleep(i64 %0) {
%2 = alloca i64
%3 = alloca %struct.timeval
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = sdiv i64 %4, 1000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
store i64 %5, i64* %6
%7 = load i64, i64* %2
%8 = srem i64 %7, 1000
%9 = mul nsw i64 %8, 1000
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
store i64 %9, i64* %10
%11 = call i32 @select(i32 0, i32 0, i32 0, i32 0, %struct.timeval* %3)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define void @msleep(i64 %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = sdiv i64 %0, 1000
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
store i64 %4, i64* %5
%6 = srem i64 %0, 1000
%7 = mul nsw i64 %6, 1000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
store i64 %7, i64* %8
%9 = call i32 @select(i32 0, i32 0, i32 0, i32 0, %struct.timeval* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ranged_random_mult_lazycheckpower2(int /*<<< orphan*/);
void loop_mult_lazycheckpower2(size_t count, uint32_t range, uint32_t *output) {
  for (size_t i = 0; i < count; i++) {
    *output++ = ranged_random_mult_lazycheckpower2(range);
  }
}


x86 assembly (clang, -O0):
<loop_mult_lazycheckpower2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    1165 <loop_mult_lazycheckpower2+0x55>
mov    -0xc(%rbp),%edi
call   1030 <ranged_random_mult_lazycheckpower2@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x18(%rbp)
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112b <loop_mult_lazycheckpower2+0x1b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loop_mult_lazycheckpower2>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1145 <loop_mult_lazycheckpower2+0x35>
mov    %rdx,%r14
mov    %esi,%r15d
mov    %rdi,%rbx
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
mov    %r15d,%edi
call   1030 <ranged_random_mult_lazycheckpower2@plt>
mov    %eax,(%r14,%rbp,4)
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1130 <loop_mult_lazycheckpower2+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @loop_mult_lazycheckpower2(i64 %0, i32 %1, i32* %2) {
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i64
store i64 %0, i64* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
store i64 0, i64* %7
br label %8
8: ; preds = %17, %3
%9 = load i64, i64* %7
%10 = load i64, i64* %4
%11 = icmp ult i64 %9, %10
br i1 %11, label %12, label %20
12: ; preds = %8
%13 = load i32, i32* %5
%14 = call i32 @ranged_random_mult_lazycheckpower2(i32 %13)
%15 = load i32*, i32** %6
%16 = getelementptr inbounds i32, i32* %15, i32 1
store i32* %16, i32** %6
store i32 %14, i32* %15
br label %17
17: ; preds = %12
%18 = load i64, i64* %7
%19 = add i64 %18, 1
store i64 %19, i64* %7
br label %8
20: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @loop_mult_lazycheckpower2(i64 %0, i32 %1, i32* nocapture writeonly %2) {
%4 = icmp eq i64 %0, 0
br i1 %4, label %5, label %6
5: ; preds = %6, %3
ret void
6: ; preds = %3, %6
%7 = phi i64 [ %11, %6 ], [ 0, %3 ]
%8 = phi i32* [ %10, %6 ], [ %2, %3 ]
%9 = tail call i32 @ranged_random_mult_lazycheckpower2(i32 %1)
%10 = getelementptr inbounds i32, i32* %8, i64 1
store i32 %9, i32* %8
%11 = add nuw i64 %7, 1
%12 = icmp eq i64 %11, %0
br i1 %12, label %5, label %6
}
double solvefunc(double (*funcpt)(double *, int), double *x, int N) {
  double result;
  result = funcpt(x, N);
  return result;
}


x86 assembly (clang, -O0):
<solvefunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   *%rax
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solvefunc>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %edx,%esi
jmp    *%rax

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

LLVM IR (-O2):
define double @solvefunc(double (double*, i32)* nocapture %0, double* %1, i32 %2) {
%4 = tail call double %0(double* %1, i32 %2)
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;
typedef int /*<<< orphan*/ __ptr_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ MAP_FAILED;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
__ptr_t __mmap(__ptr_t addr, size_t len, int prot, int flags, int fd,
               off_t offset) {
  __set_errno(ENOSYS);
  return MAP_FAILED;
}


x86 assembly (clang, -O0):
<__mmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    0x2eb4(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@ENOSYS = global i32 0
@MAP_FAILED = global i32 0
define i32 @__mmap(i32 %0, i64 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i64
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %7
store i64 %1, i64* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i32, i32* @ENOSYS
%14 = call i32 @__set_errno(i32 %13)
%15 = load i32, i32* @MAP_FAILED
ret i32 %15
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@MAP_FAILED = global i32 0
define i32 @__mmap(i32 %0, i64 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = load i32, i32* @ENOSYS
%8 = tail call i32 @__set_errno(i32 %7)
%9 = load i32, i32* @MAP_FAILED
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ TransformCounterC__1__CounterFrom__overflow();
void Atm128CounterC__1__Counter__overflow(void) {
  TransformCounterC__1__CounterFrom__overflow();
}


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

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

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

LLVM IR (-O2):
define void @Atm128CounterC__1__Counter__overflow() {
%1 = tail call i32 (...) @TransformCounterC__1__CounterFrom__overflow()
ret void
}
/* Type definitions */
struct genlist {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct genlist *);
void genlist_free(struct genlist *list) {
  if (list != NULL) {
    free(list);
  }
}


x86 assembly (clang, -O0):
<genlist_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <genlist_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.genlist = type { i32 }
define void @genlist_free(%struct.genlist* %0) {
%2 = icmp eq %struct.genlist* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.genlist* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HoldKey(int);
int /*<<< orphan*/ ReleaseKey(int);
void PressKey(int vk) {
  HoldKey(vk);
  ReleaseKey(vk);
}


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

x86 assembly (clang, -O2):
<PressKey>:
push   %rbx
mov    %edi,%ebx
call   1030 <HoldKey@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <ReleaseKey@plt>

LLVM IR (-O0):
define void @PressKey(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @HoldKey(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @ReleaseKey(i32 %5)
ret void
}

LLVM IR (-O2):
define void @PressKey(i32 %0) {
%2 = tail call i32 @HoldKey(i32 %0)
%3 = tail call i32 @ReleaseKey(i32 %0)
ret void
}