xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void log_direct(void *logs, int type, FILE *fp) {
  FILE **log_fp = (FILE **)logs;
  if (fp == NULL) {
    fprintf(stderr, "The file pointer given to log_direct is NULL; No messges "
                    "would be printed to the file \n");
  }
  log_fp[type] = fp;
}


x86 assembly (clang, -O0):
<log_direct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    114b <log_direct+0x3b>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
lea    0xeba(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_direct>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%ebp
mov    %rdi,%r14
test   %rdx,%rdx
jne    1136 <log_direct+0x26>
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
movslq %ebp,%rax
mov    %rbx,(%r14,%rax,8)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [88 x i8] c"The file pointer given to log_direct is NULL; No messges would be printed to the file \0A\00"
define void @log_direct(i8* %0, i32 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32**
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32**
store i32** %9, i32*** %7
%10 = load i32*, i32** %6
%11 = icmp eq i32* %10, null
br i1 %11, label %12, label %15
12: ; preds = %3
%13 = load i32, i32* @stderr
%14 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %12, %3
%16 = load i32*, i32** %6
%17 = load i32**, i32*** %7
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32*, i32** %17, i64 %19
store i32* %16, i32** %20
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [88 x i8] c"The file pointer given to log_direct is NULL; No messges would be printed to the file \0A\00"
define void @log_direct(i8* nocapture writeonly %0, i32 %1, i32* %2) {
%4 = icmp eq i32* %2, null
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %5, %3
%9 = bitcast i8* %0 to i32**
%10 = sext i32 %1 to i64
%11 = getelementptr inbounds i32*, i32** %9, i64 %10
store i32* %2, i32** %11
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int r;
  double pi = 3.14159;
  printf("Enter radius:\n");
  scanf("%d", &r);
  double area = pi * r * r;
  printf("Area is %lf \n", area);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xe98(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee1(%rip),%rdi
call   1030 <puts@plt>
lea    0xec4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
cvtsi2sdl 0x4(%rsp),%xmm1
movsd  0xea4(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
lea    0xea0(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Enter radius:\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [14 x i8] c"Area is %lf \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
store double 3.141590e+00, double* %3
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = load double, double* %3
%8 = load i32, i32* %2
%9 = sitofp i32 %8 to double
%10 = fmul double %7, %9
%11 = load i32, i32* %2
%12 = sitofp i32 %11 to double
%13 = fmul double %10, %12
store double %13, double* %4
%14 = load double, double* %4
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), double %14)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [14 x i8] c"Area is %lf \0A\00"
@str = [14 x i8] c"Enter radius:\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = sitofp i32 %5 to double
%7 = fmul double %6, 3.141590e+00
%8 = fmul double %7, %6
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), double %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void taskhead(int osvers, int osrel, int ossub) {
  printf("clones/s pexit/s  curproc curzomb    thrrun thrslpi thrslpu "
         "_procthr_");
}


x86 assembly (clang, -O0):
<taskhead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [70 x i8] c"clones/s pexit/s curproc curzomb thrrun thrslpi thrslpu _procthr_\00"
define void @taskhead(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 = call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [70 x i8] c"clones/s pexit/s curproc curzomb thrrun thrslpi thrslpu _procthr_\00"
define void @taskhead(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ f(int);
int main() {
  int b;
  b = 34;
  if (f(b)) {
    return b;
  } else {
    return b + 1;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x22,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <f@plt>
cmp    $0x0,%rax
je     1143 <main+0x33>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114c <main+0x3c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x22,%edi
call   1030 <f@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
or     $0x22,%ecx
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @f(i32 34)
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i32 35, i32 34
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ qs(int *, int /*<<< orphan*/, int);
void quicksort(int lista[], int n_elementos) { qs(lista, 0, n_elementos - 1); }


x86 assembly (clang, -O0):
<quicksort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1030 <qs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicksort>:
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <qs@plt>

LLVM IR (-O0):
define void @quicksort(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %6, 1
%8 = call i32 @qs(i32* %5, i32 0, i32 %7)
ret void
}

LLVM IR (-O2):
define void @quicksort(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @qs(i32* %0, i32 0, i32 %3)
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ wd_write(int, int, void *, int);
void wd_writew(uint16_t addr, uint16_t val, void *priv) {
  wd_write(addr, val & 0xff, priv, 2);
}


x86 assembly (clang, -O0):
<wd_writew>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
and    $0xff,%esi
mov    -0x10(%rbp),%rdx
mov    $0x2,%ecx
call   1030 <wd_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wd_writew>:
movzbl %sil,%esi
mov    $0x2,%ecx
jmp    1030 <wd_write@plt>

LLVM IR (-O0):
define void @wd_writew(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* %5
%9 = and i32 %8, 255
%10 = load i8*, i8** %6
%11 = call i32 @wd_write(i32 %7, i32 %9, i8* %10, i32 2)
ret void
}

LLVM IR (-O2):
define void @wd_writew(i32 %0, i32 %1, i8* %2) {
%4 = and i32 %1, 255
%5 = tail call i32 @wd_write(i32 %0, i32 %4, i8* %2, i32 2)
ret void
}
int next_power_of_two(int v) {
  int i;
  for (i = 0; v > 0; i++)
    v = v >> 1;
  return (1 << i);
}


x86 assembly (clang, -O0):
<next_power_of_two>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    112f <next_power_of_two+0x2f>
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <next_power_of_two+0xe>
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_power_of_two>:
xor    %ecx,%ecx
test   %edi,%edi
jle    111c <next_power_of_two+0x1c>
mov    %edi,%eax
nopl   0x0(%rax,%rax,1)
shr    %eax
add    $0x1,%ecx
cmp    $0x1,%edi
mov    %eax,%edi
ja     1110 <next_power_of_two+0x10>
mov    $0x1,%eax
shl    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @next_power_of_two(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = lshr i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
%11 = shl nuw i32 1, %10
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ sigfillset(int /*<<< orphan*/ *);
int sigtimedwait(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                 int /*<<< orphan*/ *);
int pause(void) {
  sigset_t all_signals;
  int status;
  (void)sigfillset(&all_signals);
  status = sigtimedwait(&all_signals, NULL, NULL);
  return status;
}


x86 assembly (clang, -O0):
<pause>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1040 <sigfillset@plt>
lea    -0x4(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rsi
call   1030 <sigtimedwait@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pause>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <sigfillset@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <sigtimedwait@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @pause() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @sigfillset(i32* %1)
%4 = call i32 @sigtimedwait(i32* %1, i32* null, i32* null)
store i32 %4, i32* %2
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
define i32 @pause() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @sigfillset(i32* %1)
%4 = call i32 @sigtimedwait(i32* %1, i32* null, i32* null)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ ct_lt_u64(int /*<<< orphan*/, int /*<<< orphan*/);
uint64_t ct_gt_u64(uint64_t x, uint64_t y) { return ct_lt_u64(y, x); }


x86 assembly (clang, -O0):
<ct_gt_u64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <ct_lt_u64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ct_gt_u64>:
mov    %edi,%eax
mov    %esi,%edi
mov    %eax,%esi
jmp    1030 <ct_lt_u64@plt>

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

LLVM IR (-O2):
define i32 @ct_gt_u64(i32 %0, i32 %1) {
%3 = tail call i32 @ct_lt_u64(i32 %1, i32 %0)
ret i32 %3
}
void cealtesthook_input_generate(long size) {}


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

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

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

LLVM IR (-O2):
define void @cealtesthook_input_generate(i64 %0) {
ret void
}
void strset(s1, s2) register char *s1, *s2;
{
  while ((*s1++ = *s2++) != '\0')
    ;
}


x86 assembly (clang, -O0):
<strset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     113f <strset+0x3f>
jmp    110c <strset+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strset>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strset+0x10>
ret

LLVM IR (-O0):
define void @strset(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %13, %2
%6 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %4
%8 = load i8, i8* %6
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %3
store i8 %8, i8* %9
%11 = sext i8 %8 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %5
br label %5
14: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @strset(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = phi i8* [ %1, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %7, i8* %4
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage(void) {
  printf("usage: 2048 [-cCaAiIrh] [-s SIZE] [-b RATE]\n");
}


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

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

LLVM IR (-O0):
@.str = [45 x i8] c"usage: 2048 [-cCaAiIrh] [-s SIZE] [-b RATE]\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [44 x i8] c"usage: 2048 [-cCaAiIrh] [-s SIZE] [-b RATE]\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ is_binary_operator(char);
scalar_t__ is_unary_operator(char);
int is_operator(char c) {
  return is_unary_operator(c) || is_binary_operator(c);
}


x86 assembly (clang, -O0):
<is_operator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <is_unary_operator@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    115c <is_operator+0x3c>
movsbl -0x1(%rbp),%edi
call   1040 <is_binary_operator@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_operator>:
push   %rbx
mov    %edi,%ebx
call   1030 <is_unary_operator@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <is_operator+0x17>
pop    %rbx
ret
movsbl %bl,%edi
call   1040 <is_binary_operator@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_operator(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @is_unary_operator(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = call i64 @is_binary_operator(i8 signext %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_operator(i8 signext %0) {
%2 = tail call i64 @is_unary_operator(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @is_binary_operator(i8 signext %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
int es_par(int numero) {
  int res = 1;
  if (numero % 2)
    res = 0;
  return res;
}


x86 assembly (clang, -O0):
<es_par>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1129 <es_par+0x29>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<es_par>:
mov    %edi,%eax
not    %eax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @es_par(i32 %0) {
%2 = and i32 %0, 1
%3 = xor i32 %2, 1
ret i32 %3
}
/* Variables and functions */
double log(scalar_t__);
scalar_t__ sqrt(double);
double acsch(double x) {
  double oneOverX = 1.0 / x;
  return log(oneOverX + sqrt(oneOverX * oneOverX + 1.0));
}


x86 assembly (clang, -O0):
<acsch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xecb(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xea1(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
movsd  -0x18(%rbp),%xmm0
cvtsi2sd %rax,%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
call   1030 <log@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acsch>:
push   %rax
movsd  0xed7(%rip),%xmm1
movapd %xmm1,%xmm2
divsd  %xmm0,%xmm2
movsd  %xmm2,(%rsp)
movapd %xmm2,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  (%rsp),%xmm0
cvttsd2si %xmm0,%rdi
pop    %rax
jmp    1030 <log@plt>

LLVM IR (-O0):
define double @acsch(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fdiv double 1.000000e+00, %4
store double %5, double* %3
%6 = load double, double* %3
%7 = load double, double* %3
%8 = load double, double* %3
%9 = call double @llvm.fmuladd.f64(double %7, double %8, double 1.000000e+00)
%10 = call i64 @sqrt(double %9)
%11 = sitofp i64 %10 to double
%12 = fadd double %6, %11
%13 = fptosi double %12 to i64
%14 = call double @log(i64 %13)
ret double %14
}

LLVM IR (-O2):
define double @acsch(double %0) {
%2 = fdiv double 1.000000e+00, %0
%3 = tail call double @llvm.fmuladd.f64(double %2, double %2, double 1.000000e+00)
%4 = tail call i64 @sqrt(double %3)
%5 = sitofp i64 %4 to double
%6 = fadd double %2, %5
%7 = fptosi double %6 to i64
%8 = tail call double @log(i64 %7)
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ perror(char const *);
void *ptrerror(const char *str) {
  perror(str);
  return NULL;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @ptrerror(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
ret i8* null
}
int swap(int *x, int *y) {
  int temp = *x;
  *x = *y;
  *y = temp;
  return 0;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret i32 0
}
/* Variables and functions */
int minor(unsigned long long);
unsigned os_minor(unsigned long long dev) { return minor(dev); }


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

x86 assembly (clang, -O2):
<os_minor>:
jmp    1030 <minor@plt>

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

LLVM IR (-O2):
define i32 @os_minor(i64 %0) {
%2 = tail call i32 @minor(i64 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage:\n"
         "  rls [-H <host>] [-P <port>] [-q] [--] <dirname>...\n"
         "  rls -h\n"
         "  rls -v\n"
         "Options:\n"
         "  -h     Show this screen.\n"
         "  -v     Show version.\n"
         "  -P     Remote host port (default - 6662)\n"
         "  -H     Remote host name (default - localhost)\n"
         "  -q     Disable verbose output\n");
}


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

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

LLVM IR (-O0):
@.str = [261 x i8] c"Usage:\0A rls [-H <host>] [-P <port>] [-q] [--] <dirname>...\0A rls -h\0A rls -v\0AOptions:\0A -h Show this screen.\0A -v Show version.\0A -P Remote host port (default - 6662)\0A -H Remote host name (default - localhost)\0A -q Disable verbose output\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([261 x i8], [261 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [260 x i8] c"Usage:\0A rls [-H <host>] [-P <port>] [-q] [--] <dirname>...\0A rls -h\0A rls -v\0AOptions:\0A -h Show this screen.\0A -v Show version.\0A -P Remote host port (default - 6662)\0A -H Remote host name (default - localhost)\0A -q Disable verbose output\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([260 x i8], [260 x i8]* @str, i64 0, i64 0))
ret void
}
int prime(int chislo) {
  if (chislo <= 0)
    return 0;
  int i = 2;
  for (; i <= chislo; i++) {
    if (chislo % i == 0)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     111d <prime+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1166 <prime+0x66>
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     115f <prime+0x5f>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    114c <prime+0x4c>
movl   $0x0,-0x4(%rbp)
jmp    1166 <prime+0x66>
jmp    1151 <prime+0x51>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <prime+0x24>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prime>:
xor    %r8d,%r8d
test   %edi,%edi
jle    113d <prime+0x3d>
cmp    $0x1,%edi
jne    1112 <prime+0x12>
mov    $0x1,%eax
ret
mov    %edi,%esi
neg    %esi
mov    $0x2,%ecx
nopl   0x0(%rax,%rax,1)
mov    %edi,%eax
cltd
idiv   %ecx
test   %edx,%edx
je     113d <prime+0x3d>
lea    (%rsi,%rcx,1),%eax
add    $0x1,%eax
add    $0x1,%ecx
cmp    $0x1,%eax
jne    1120 <prime+0x20>
mov    $0x1,%eax
ret
mov    %r8d,%eax
ret

LLVM IR (-O0):
define i32 @prime(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp sle i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %24
8: ; preds = %1
store i32 2, i32* %4
br label %9
9: ; preds = %20, %8
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = icmp sle i32 %10, %11
br i1 %12, label %13, label %23
13: ; preds = %9
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = srem i32 %14, %15
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %13
store i32 0, i32* %2
br label %24
19: ; preds = %13
br label %20
20: ; preds = %19
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 1
store i32 %22, i32* %4
br label %9
23: ; preds = %9
store i32 1, i32* %2
br label %24
24: ; preds = %23, %18, %7
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @prime(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = icmp eq i32 %0, 1
br i1 %4, label %12, label %8
5: ; preds = %8
%6 = add nuw i32 %9, 1
%7 = icmp eq i32 %9, %0
br i1 %7, label %12, label %8
8: ; preds = %3, %5
%9 = phi i32 [ %6, %5 ], [ 2, %3 ]
%10 = srem i32 %0, %9
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %8, %3, %1
%13 = phi i32 [ 0, %1 ], [ 1, %3 ], [ 1, %5 ], [ 0, %8 ]
ret i32 %13
}
int is_valid_triangle(unsigned s1, unsigned s2, unsigned s3) {
  if (s1 + s2 > s3 && s2 + s3 > s1 && s3 + s1 > s2)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_valid_triangle>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jbe    1146 <is_valid_triangle+0x46>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jbe    1146 <is_valid_triangle+0x46>
mov    -0x10(%rbp),%eax
add    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jbe    1146 <is_valid_triangle+0x46>
movl   $0x1,-0x4(%rbp)
jmp    114d <is_valid_triangle+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_triangle>:
lea    (%rsi,%rdi,1),%eax
cmp    %edx,%eax
seta   %al
lea    (%rdx,%rsi,1),%ecx
cmp    %edi,%ecx
seta   %cl
and    %al,%cl
add    %edi,%edx
cmp    %esi,%edx
seta   %al
and    %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @is_valid_triangle(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = add i32 %8, %9
%11 = load i32, i32* %7
%12 = icmp ugt i32 %10, %11
br i1 %12, label %13, label %26
13: ; preds = %3
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = add i32 %14, %15
%17 = load i32, i32* %5
%18 = icmp ugt i32 %16, %17
br i1 %18, label %19, label %26
19: ; preds = %13
%20 = load i32, i32* %7
%21 = load i32, i32* %5
%22 = add i32 %20, %21
%23 = load i32, i32* %6
%24 = icmp ugt i32 %22, %23
br i1 %24, label %25, label %26
25: ; preds = %19
store i32 1, i32* %4
br label %27
26: ; preds = %19, %13, %3
store i32 0, i32* %4
br label %27
27: ; preds = %26, %25
%28 = load i32, i32* %4
ret i32 %28
}

LLVM IR (-O2):
define i32 @is_valid_triangle(i32 %0, i32 %1, i32 %2) {
%4 = add i32 %1, %0
%5 = icmp ugt i32 %4, %2
%6 = add i32 %2, %1
%7 = icmp ugt i32 %6, %0
%8 = and i1 %5, %7
%9 = add i32 %2, %0
%10 = icmp ugt i32 %9, %1
%11 = and i1 %10, %8
%12 = zext i1 %11 to i32
ret i32 %12
}
void foo152() {}


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

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

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

LLVM IR (-O2):
define void @foo152() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f();
__attribute((no)) int g() {
  f();
  return 5;
}


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

x86 assembly (clang, -O2):
<g>:
push   %rax
xor    %eax,%eax
call   1030 <f@plt>
mov    $0x5,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @g() {
%1 = call i32 (...) @f()
ret i32 5
}

LLVM IR (-O2):
define i32 @g() {
%1 = tail call i32 (...) @f()
ret i32 5
}
void test56_On1_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test56_On1_targetInit__I() {
ret void
}
/* Type definitions */
struct timespec {
  unsigned long long tv_sec;
  unsigned long long tv_nsec;
};

/* Variables and functions */
struct timespec ns_to_timespec(unsigned long long _ns) {
  struct timespec ret;
  unsigned long long seconds = _ns / 1000000000L;
  _ns -= seconds * 1000000000L;
  ret.tv_sec = seconds;
  ret.tv_nsec = _ns;
  return ret;
}


x86 assembly (clang, -O0):
<ns_to_timespec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
shr    $0x9,%rax
movabs $0x44b82fa09b5a53,%rcx
mul    %rcx
shr    $0xb,%rdx
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
imul   $0x3b9aca00,%rax,%rcx
mov    -0x18(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
pop    %rbp
ret

x86 assembly (clang, -O2):
<ns_to_timespec>:
mov    %rdi,%rax
shr    $0x9,%rax
movabs $0x44b82fa09b5a53,%rcx
mul    %rcx
mov    %rdx,%rax
shr    $0xb,%rax
imul   $0xffffffffc4653600,%rax,%rdx
add    %rdi,%rdx
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define { i64, i64 } @ns_to_timespec(i64 %0) {
%2 = alloca %struct.timespec
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = udiv i64 %5, 1000000000
store i64 %6, i64* %4
%7 = load i64, i64* %4
%8 = mul i64 %7, 1000000000
%9 = load i64, i64* %3
%10 = sub i64 %9, %8
store i64 %10, i64* %3
%11 = load i64, i64* %4
%12 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
store i64 %11, i64* %12
%13 = load i64, i64* %3
%14 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 1
store i64 %13, i64* %14
%15 = bitcast %struct.timespec* %2 to { i64, i64 }*
%16 = load { i64, i64 }, { i64, i64 }* %15
ret { i64, i64 } %16
}

LLVM IR (-O2):
define { i64, i64 } @ns_to_timespec(i64 %0) {
%2 = udiv i64 %0, 1000000000
%3 = mul i64 %2, -1000000000
%4 = add i64 %3, %0
%5 = insertvalue { i64, i64 } poison, i64 %2, 0
%6 = insertvalue { i64, i64 } %5, i64 %4, 1
ret { i64, i64 } %6
}
void print_inst_IMM_RD(char *mnemonic, int im, int rd) { ; }


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

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

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

LLVM IR (-O2):
define void @print_inst_IMM_RD(i8* nocapture %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ writeAsNucleotides(int /*<<< orphan*/, unsigned long long *,
                                      unsigned int, unsigned int);
void printAsNucleotides(unsigned long long int *sequence,
                        unsigned int startNucleotidePosition,
                        unsigned int endNucleotidePosition) {
  writeAsNucleotides(stdout, sequence, startNucleotidePosition,
                     endNucleotidePosition);
}


x86 assembly (clang, -O0):
<printAsNucleotides>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    0x2eb7(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1030 <writeAsNucleotides@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printAsNucleotides>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
jmp    1030 <writeAsNucleotides@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @printAsNucleotides(i64* %0, i32 %1, i32 %2) {
%4 = alloca i64*
%5 = alloca i32
%6 = alloca i32
store i64* %0, i64** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* @stdout
%8 = load i64*, i64** %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @writeAsNucleotides(i32 %7, i64* %8, i32 %9, i32 %10)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @printAsNucleotides(i64* %0, i32 %1, i32 %2) {
%4 = load i32, i32* @stdout
%5 = tail call i32 @writeAsNucleotides(i32 %4, i64* %0, i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int arg, char *avg[]) {
  printf("Hello World !");
  return 1;
}


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
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World !\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 ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello World !\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
int fun1231() { return 1231; }


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

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

LLVM IR (-O0):
define i32 @fun1231() {
ret i32 1231
}

LLVM IR (-O2):
define i32 @fun1231() {
ret i32 1231
}
int ltq_lxfreq_state_change_enable(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ltq_lxfreq_state_change_enable() {
ret i32 0
}
int test_getByte(int x, int n) {
  unsigned char byte;
  switch (n) {
  case 0:
    byte = x;
    break;
  case 1:
    byte = x >> 8;
    break;
  case 2:
    byte = x >> 16;
    break;
  default:
    byte = x >> 24;
    break;
  }
  return (int)(unsigned)byte;
}


x86 assembly (clang, -O0):
<test_getByte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     113f <test_getByte+0x3f>
jmp    111d <test_getByte+0x1d>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     114a <test_getByte+0x4a>
jmp    112e <test_getByte+0x2e>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     1158 <test_getByte+0x58>
jmp    1166 <test_getByte+0x66>
mov    -0x4(%rbp),%eax
mov    %al,-0x9(%rbp)
jmp    116f <test_getByte+0x6f>
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
mov    %al,-0x9(%rbp)
jmp    116f <test_getByte+0x6f>
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
mov    %al,-0x9(%rbp)
jmp    116f <test_getByte+0x6f>
mov    -0x4(%rbp),%eax
sar    $0x18,%eax
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_getByte>:
test   %esi,%esi
je     1121 <test_getByte+0x21>
cmp    $0x2,%esi
je     1116 <test_getByte+0x16>
cmp    $0x1,%esi
jne    111e <test_getByte+0x1e>
sar    $0x8,%edi
movzbl %dil,%eax
ret
shr    $0x10,%edi
movzbl %dil,%eax
ret
sar    $0x18,%edi
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @test_getByte(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* %4
switch i32 %6, label %18 [
i32 0, label %7
i32 1, label %10
i32 2, label %14
]
7: ; preds = %2
%8 = load i32, i32* %3
%9 = trunc i32 %8 to i8
store i8 %9, i8* %5
br label %22
10: ; preds = %2
%11 = load i32, i32* %3
%12 = ashr i32 %11, 8
%13 = trunc i32 %12 to i8
store i8 %13, i8* %5
br label %22
14: ; preds = %2
%15 = load i32, i32* %3
%16 = ashr i32 %15, 16
%17 = trunc i32 %16 to i8
store i8 %17, i8* %5
br label %22
18: ; preds = %2
%19 = load i32, i32* %3
%20 = ashr i32 %19, 24
%21 = trunc i32 %20 to i8
store i8 %21, i8* %5
br label %22
22: ; preds = %18, %14, %10, %7
%23 = load i8, i8* %5
%24 = zext i8 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @test_getByte(i32 %0, i32 %1) {
switch i32 %1, label %7 [
i32 0, label %9
i32 1, label %3
i32 2, label %5
]
3: ; preds = %2
%4 = ashr i32 %0, 8
br label %9
5: ; preds = %2
%6 = lshr i32 %0, 16
br label %9
7: ; preds = %2
%8 = ashr i32 %0, 24
br label %9
9: ; preds = %2, %7, %5, %3
%10 = phi i32 [ %8, %7 ], [ %6, %5 ], [ %4, %3 ], [ %0, %2 ]
%11 = and i32 %10, 255
ret i32 %11
}
g(unsigned char c, int x[]) { return x[c] + *(x + c); }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl -0x1(%rbp),%ecx
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rcx
movzbl -0x1(%rbp),%edx
movslq %edx,%rdx
add    (%rcx,%rdx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
mov    %edi,%eax
mov    (%rsi,%rax,4),%eax
add    %eax,%eax
ret

LLVM IR (-O0):
define i32 @g(i8 zeroext %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 = load i8, i8* %3
%7 = zext i8 %6 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
%10 = load i32*, i32** %4
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %10, i64 %13
%15 = load i32, i32* %14
%16 = add nsw i32 %9, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @g(i8 zeroext %0, i32* nocapture %1) {
%3 = zext i8 %0 to i64
%4 = getelementptr inbounds i32, i32* %1, i64 %3
%5 = load i32, i32* %4
%6 = shl nsw i32 %5, 1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ PATH_MAX;
char *getcwd(char *, int /*<<< orphan*/);
char *getwd(char *buf) {
  ;
  return getcwd(buf, PATH_MAX);
}


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

x86 assembly (clang, -O2):
<getwd>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <getcwd@plt>

LLVM IR (-O0):
@PATH_MAX = global i32 0
define i8* @getwd(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @PATH_MAX
%5 = call i8* @getcwd(i8* %3, i32 %4)
ret i8* %5
}

LLVM IR (-O2):
@PATH_MAX = global i32 0
define i8* @getwd(i8* %0) {
%2 = load i32, i32* @PATH_MAX
%3 = tail call i8* @getcwd(i8* %0, i32 %2)
ret i8* %3
}
void __attribute__((hot)) f3(int x) {
  register float f asm("%xmm2") = x;
  asm volatile("" ::"x"(f));
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm2
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
cvtsi2ss %edi,%xmm2
ret
cs nopw 0x0(%rax,%rax,1)
nop

LLVM IR (-O0):
define void @f3(i32 %0) {
%2 = alloca i32
%3 = alloca float
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sitofp i32 %4 to float
store float %5, float* %3
%6 = load float, float* %3
ret void
}

LLVM IR (-O2):
define void @f3(i32 %0) {
%2 = sitofp i32 %0 to float
tail call void asm sideeffect "", "{xmm2},~{dirflag},~{fpsr},~{flags}"(float %2)
ret void
}
/* Variables and functions */
int ebbrt_newlib_getpid();
int getpid(void) { return ebbrt_newlib_getpid(); }


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

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

LLVM IR (-O0):
define i32 @getpid() {
%1 = call i32 (...) @ebbrt_newlib_getpid()
ret i32 %1
}

LLVM IR (-O2):
define i32 @getpid() {
%1 = tail call i32 (...) @ebbrt_newlib_getpid()
ret i32 %1
}
/* Variables and functions */
scalar_t__ malloc(int);
main() { char *p = (char *)malloc(100); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x64,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x64,%edi
call   1030 <malloc@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i8*
%2 = call i64 @malloc(i32 100)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i32 100)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(short *, short const *, int);
void SKP_Silk_resampler_private_copy(void *SS, short out[], const short in[],
                                     int inLen) {
  memcpy((out), (in), (inLen * sizeof(short)));
}


x86 assembly (clang, -O0):
<SKP_Silk_resampler_private_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
movslq -0x1c(%rbp),%rax
shl    $0x1,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SKP_Silk_resampler_private_copy>:
mov    %rsi,%rdi
lea    (%rcx,%rcx,1),%eax
mov    %rdx,%rsi
mov    %eax,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @SKP_Silk_resampler_private_copy(i8* %0, i16* %1, i16* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i16*
%7 = alloca i16*
%8 = alloca i32
store i8* %0, i8** %5
store i16* %1, i16** %6
store i16* %2, i16** %7
store i32 %3, i32* %8
%9 = load i16*, i16** %6
%10 = load i16*, i16** %7
%11 = load i32, i32* %8
%12 = sext i32 %11 to i64
%13 = mul i64 %12, 2
%14 = trunc i64 %13 to i32
%15 = call i32 @memcpy(i16* %9, i16* %10, i32 %14)
ret void
}

LLVM IR (-O2):
define void @SKP_Silk_resampler_private_copy(i8* nocapture readnone %0, i16* %1, i16* %2, i32 %3) {
%5 = shl i32 %3, 1
%6 = tail call i32 @memcpy(i16* %1, i16* %2, i32 %5)
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef int uint16_t;

/* Variables and functions */
void USBHostPwrFaultDisable(uint32_t ui32Base) {
  ;
  (*((volatile uint16_t *)(ui32Base + 0x00000400))) &= ~0x00000010;
}


x86 assembly (clang, -O0):
<USBHostPwrFaultDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x400(%rax),%ecx
and    $0xffffffef,%ecx
mov    %ecx,0x400(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBHostPwrFaultDisable>:
andl   $0xffffffef,0x400(%rdi)
ret

LLVM IR (-O0):
define void @USBHostPwrFaultDisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 1024
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, -17
store volatile i32 %7, i32* %5
ret void
}

LLVM IR (-O2):
define void @USBHostPwrFaultDisable(i64 %0) {
%2 = add nsw i64 %0, 1024
%3 = inttoptr i64 %2 to i32*
%4 = load volatile i32, i32* %3
%5 = and i32 %4, -17
store volatile i32 %5, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __console_tx_hex32(int, unsigned int);
void print_alert_hex32(unsigned int value) { __console_tx_hex32(1, value); }


x86 assembly (clang, -O0):
<print_alert_hex32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
call   1030 <__console_tx_hex32@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @print_alert_hex32(i32 %0) {
%2 = tail call i32 @__console_tx_hex32(i32 1, i32 %0)
ret void
}
/* Type definitions */
struct _sdata {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ blur(struct _sdata *);
int /*<<< orphan*/ zoom(struct _sdata *);
void blurzoomcore(struct _sdata *sdata) {
  blur(sdata);
  zoom(sdata);
}


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

x86 assembly (clang, -O2):
<blurzoomcore>:
push   %rbx
mov    %rdi,%rbx
call   1040 <blur@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <zoom@plt>

LLVM IR (-O0):
%struct._sdata = type { i32 }
define void @blurzoomcore(%struct._sdata* %0) {
%2 = alloca %struct._sdata*
store %struct._sdata* %0, %struct._sdata** %2
%3 = load %struct._sdata*, %struct._sdata** %2
%4 = call i32 @blur(%struct._sdata* %3)
%5 = load %struct._sdata*, %struct._sdata** %2
%6 = call i32 @zoom(%struct._sdata* %5)
ret void
}

LLVM IR (-O2):
%struct._sdata = type { i32 }
define void @blurzoomcore(%struct._sdata* %0) {
%2 = tail call i32 @blur(%struct._sdata* %0)
%3 = tail call i32 @zoom(%struct._sdata* %0)
ret void
}