xunge/DecIR huggingface dataset:
/* Variables and functions */
int ceil(int);
int parent(int i) { return ceil(i / 2) - 1; }


x86 assembly (clang, -O0):
<parent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <ceil@plt>
sub    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parent>:
push   %rax
mov    %edi,%eax
shr    $0x1f,%eax
add    %eax,%edi
sar    %edi
call   1030 <ceil@plt>
add    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @parent(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 2
%5 = call i32 @ceil(i32 %4)
%6 = sub nsw i32 %5, 1
ret i32 %6
}

LLVM IR (-O2):
define i32 @parent(i32 %0) {
%2 = sdiv i32 %0, 2
%3 = tail call i32 @ceil(i32 %2)
%4 = add nsw i32 %3, -1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ closelog();
void ezcfg_log_close(void) { closelog(); }


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

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

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

LLVM IR (-O2):
define void @ezcfg_log_close() {
%1 = tail call i32 (...) @closelog()
ret void
}
struct node *rotate_left(struct node *root) {}


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

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

LLVM IR (-O0):
%struct.node = type opaque
define %struct.node* @rotate_left(%struct.node* %0) {
%2 = alloca %struct.node*
%3 = alloca %struct.node*
store %struct.node* %0, %struct.node** %3
%4 = load %struct.node*, %struct.node** %2
ret %struct.node* %4
}

LLVM IR (-O2):
%struct.node = type opaque
define noalias %struct.node* @rotate_left(%struct.node* nocapture readnone %0) {
ret %struct.node* undef
}
int my_strlen(char *string) {
  int i = 0;
  while (string[i] != 0) {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<my_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <my_strlen+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <my_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <my_strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @my_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ save(int /*<<< orphan*/, void *);
void saves(const char *c, void *p) {
  while (*c)
    save(*c++, p);
}


x86 assembly (clang, -O0):
<saves>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114d <saves+0x3d>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
mov    -0x10(%rbp),%rsi
call   1030 <save@plt>
jmp    1120 <saves+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<saves>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1146 <saves+0x36>
mov    %rsi,%r14
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %al,%edi
mov    %r14,%rsi
call   1030 <save@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <saves+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @saves(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 = %9, %2
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %3
%12 = load i8, i8* %10
%13 = sext i8 %12 to i32
%14 = load i8*, i8** %4
%15 = call i32 @save(i32 %13, i8* %14)
br label %5
16: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @saves(i8* nocapture %0, i8* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %8, %5 ], [ %0, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = sext i8 %6 to i32
%10 = tail call i32 @save(i32 %9, i8* %1)
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ max_width;
};
typedef TYPE_1__ XSizeHints;

/* Variables and functions */
int get_XSizeHints_max_width(void *_p) {
  return (int)((XSizeHints *)_p)->max_width;
}


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

x86 assembly (clang, -O2):
<get_XSizeHints_max_width>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XSizeHints_max_width(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XSizeHints_max_width(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void meChama() { printf("Chamado no encerramento do programa\n"); }


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

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

LLVM IR (-O0):
@.str = [37 x i8] c"Chamado no encerramento do programa\0A\00"
define void @meChama() {
%1 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [36 x i8] c"Chamado no encerramento do programa\00"
define void @meChama() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ output_line(char *);
gen_multiply_by_two() { output_line("sll\t$v0, 2"); }


x86 assembly (clang, -O0):
<gen_multiply_by_two>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <output_line@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [11 x i8] c"sll\09$v0, 2\00"
define i32 @gen_multiply_by_two() {
%1 = alloca i32
%2 = call i32 @output_line(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [11 x i8] c"sll\09$v0, 2\00"
define i32 @gen_multiply_by_two() {
%1 = tail call i32 @output_line(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
int dispose_server_state() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @dispose_server_state() {
ret i32 0
}
/* Variables and functions */
float expf(float);
float powf(float, int);
float wavelet_psi_ft(float f) {
  return powf(3.1415926f, -0.25f) * expf(-0.5f * powf(f - 6.0f, 2));
}


x86 assembly (clang, -O0):
<wavelet_psi_ft>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xed3(%rip),%xmm0
xor    %edi,%edi
call   1030 <powf@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeb6(%rip),%xmm1
subss  %xmm1,%xmm0
mov    $0x2,%edi
call   1030 <powf@plt>
movaps %xmm0,%xmm1
movss  0xe99(%rip),%xmm0
mulss  %xmm1,%xmm0
call   1040 <expf@plt>
movaps %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
mulss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wavelet_psi_ft>:
push   %rax
movss  %xmm0,(%rsp)
movss  0xed2(%rip),%xmm0
xor    %edi,%edi
call   1030 <powf@plt>
movss  %xmm0,0x4(%rsp)
movss  (%rsp),%xmm0
addss  0xebc(%rip),%xmm0
mov    $0x2,%edi
call   1030 <powf@plt>
mulss  0xeae(%rip),%xmm0
call   1040 <expf@plt>
mulss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @wavelet_psi_ft(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = call float @powf(float 0x400921FB40000000, i32 0)
%4 = load float, float* %2
%5 = fsub float %4, 6.000000e+00
%6 = call float @powf(float %5, i32 2)
%7 = fmul float -5.000000e-01, %6
%8 = call float @expf(float %7)
%9 = fmul float %3, %8
ret float %9
}

LLVM IR (-O2):
define float @wavelet_psi_ft(float %0) {
%2 = tail call float @powf(float 0x400921FB40000000, i32 0)
%3 = fadd float %0, -6.000000e+00
%4 = tail call float @powf(float %3, i32 2)
%5 = fmul float %4, -5.000000e-01
%6 = tail call float @expf(float %5)
%7 = fmul float %2, %6
ret float %7
}
long RoundUpTo256(long value) {
  if (value & 0xFF)
    return (value & 0xFFFFFF00) + 0x100;
  else
    return value;
}


x86 assembly (clang, -O0):
<RoundUpTo256>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0xff,%rax
cmp    $0x0,%rax
je     1139 <RoundUpTo256+0x39>
movabs $0xffffff00,%rax
and    -0x10(%rbp),%rax
add    $0x100,%rax
mov    %rax,-0x8(%rbp)
jmp    1141 <RoundUpTo256+0x41>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RoundUpTo256>:
mov    %edi,%eax
and    $0xffffff00,%eax
add    $0x100,%rax
test   %dil,%dil
cmove  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @RoundUpTo256(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = and i64 %4, 255
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i64, i64* %3
%9 = and i64 %8, 4294967040
%10 = add nsw i64 %9, 256
store i64 %10, i64* %2
br label %13
11: ; preds = %1
%12 = load i64, i64* %3
store i64 %12, i64* %2
br label %13
13: ; preds = %11, %7
%14 = load i64, i64* %2
ret i64 %14
}

LLVM IR (-O2):
define i64 @RoundUpTo256(i64 %0) {
%2 = and i64 %0, 255
%3 = icmp eq i64 %2, 0
%4 = and i64 %0, 4294967040
%5 = add nuw nsw i64 %4, 256
%6 = select i1 %3, i64 %0, i64 %5
ret i64 %6
}
int main() {
  unsigned int plus_one = 1;
  int minus_one = -1;
  if (plus_one > minus_one) {
    goto ERROR;
  }
  return (0);
ERROR:
  return (-1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jbe    112a <main+0x2a>
jmp    1136 <main+0x36>
movl   $0x0,-0x4(%rbp)
jmp    113d <main+0x3d>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
unsigned int mt_genrand_int32();
unsigned int mtrandom_uint(unsigned int range) {
  if (range == 0)
    return range;
  return mt_genrand_int32() % range;
}


x86 assembly (clang, -O0):
<mtrandom_uint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1130 <mtrandom_uint+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113f <mtrandom_uint+0x2f>
mov    $0x0,%al
call   1030 <mt_genrand_int32@plt>
xor    %edx,%edx
divl   -0x8(%rbp)
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mtrandom_uint>:
test   %edi,%edi
je     1126 <mtrandom_uint+0x16>
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <mt_genrand_int32@plt>
xor    %edx,%edx
div    %ebx
mov    %edx,%eax
pop    %rbx
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @mtrandom_uint(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 (...) @mt_genrand_int32()
%5 = urem i32 %4, %0
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ 0, %1 ]
ret i32 %7
}
void ExttAddressAuxTable(void) {}


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

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

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

LLVM IR (-O2):
define void @ExttAddressAuxTable() {
ret void
}
void set_led_2(int mode) {
  if (mode == 1) {
    (*(volatile unsigned int *)(0x7F008824)) |= 2;
  } else if (mode == 0) {
    (*(volatile unsigned int *)(0x7F008824)) &= ~2;
  }
  return;
}


x86 assembly (clang, -O0):
<set_led_2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1127 <set_led_2+0x27>
mov    $0x7f008824,%eax
mov    (%rax),%ecx
or     $0x2,%ecx
mov    $0x7f008824,%eax
mov    %ecx,(%rax)
jmp    1147 <set_led_2+0x47>
cmpl   $0x0,-0x4(%rbp)
jne    1142 <set_led_2+0x42>
mov    $0x7f008824,%eax
mov    (%rax),%ecx
and    $0xfffffffd,%ecx
mov    $0x7f008824,%eax
mov    %ecx,(%rax)
jmp    1147 <set_led_2+0x47>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_led_2>:
test   %edi,%edi
je     1115 <set_led_2+0x15>
cmp    $0x1,%edi
jne    1126 <set_led_2+0x26>
mov    0x7f008824,%eax
or     $0x2,%eax
jmp    111f <set_led_2+0x1f>
mov    0x7f008824,%eax
and    $0xfffffffd,%eax
mov    %eax,0x7f008824
ret

LLVM IR (-O0):
define void @set_led_2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load volatile i32, i32* inttoptr (i64 2130741284 to i32*)
%7 = or i32 %6, 2
store volatile i32 %7, i32* inttoptr (i64 2130741284 to i32*)
br label %15
8: ; preds = %1
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load volatile i32, i32* inttoptr (i64 2130741284 to i32*)
%13 = and i32 %12, -3
store volatile i32 %13, i32* inttoptr (i64 2130741284 to i32*)
br label %14
14: ; preds = %11, %8
br label %15
15: ; preds = %14, %5
ret void
}

LLVM IR (-O2):
define void @set_led_2(i32 %0) {
switch i32 %0, label %10 [
i32 1, label %2
i32 0, label %5
]
2: ; preds = %1
%3 = load volatile i32, i32* inttoptr (i64 2130741284 to i32*)
%4 = or i32 %3, 2
br label %8
5: ; preds = %1
%6 = load volatile i32, i32* inttoptr (i64 2130741284 to i32*)
%7 = and i32 %6, -3
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ %7, %5 ], [ %4, %2 ]
store volatile i32 %9, i32* inttoptr (i64 2130741284 to i32*)
br label %10
10: ; preds = %8, %1
ret void
}
/* Variables and functions */
int omp_get_thread_num();
int /*<<< orphan*/ printf(char *, int);
int main() {
#pragma omp parallel
  {
#pragma omp master
    printf(" master - this is thread %d\n", omp_get_thread_num());
#pragma omp single
    printf(" single - this is thread %d\n", omp_get_thread_num());
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,%esi
lea    0xed4(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [29 x i8] c" master - this is thread %d\0A\00"
@.str.1 = [29 x i8] c" single - this is thread %d\0A\00"
define i32 @main() {
%1 = call i32 (...) @omp_get_thread_num()
%2 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 (...) @omp_get_thread_num()
%4 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c" master - this is thread %d\0A\00"
@.str.1 = [29 x i8] c" single - this is thread %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @omp_get_thread_num()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @omp_get_thread_num()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
int double_cmp(const void *a, const void *b) {
  double aa = *(double *)(a);
  double bb = *(double *)(b);
  if (aa == bb)
    return 0;
  else if (aa < bb)
    return -1;
  else
    return 1;
}


x86 assembly (clang, -O0):
<double_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jne    1148 <double_cmp+0x48>
jp     1148 <double_cmp+0x48>
movl   $0x0,-0x4(%rbp)
jmp    116f <double_cmp+0x6f>
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1168 <double_cmp+0x68>
movl   $0xffffffff,-0x4(%rbp)
jmp    116f <double_cmp+0x6f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_cmp>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
setbe  %cl
xor    %eax,%eax
ucomisd %xmm1,%xmm0
lea    -0x1(%rcx,%rcx,1),%ecx
cmovne %ecx,%eax
cmovp  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @double_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp oeq double %4, %6
%8 = fcmp olt double %4, %6
%9 = select i1 %8, i32 -1, i32 1
%10 = select i1 %7, i32 0, i32 %9
ret i32 %10
}
void rfbi_exit(void) {}


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

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

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

LLVM IR (-O2):
define void @rfbi_exit() {
ret void
}
void RTNetIPv4AddDataChecksum(void) {}


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

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

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

LLVM IR (-O2):
define void @RTNetIPv4AddDataChecksum() {
ret void
}
void mp_squh_use_in1fft(int n, int radix, double inoutfft[], int out[],
                        int nfft, int ip[], double w[]) {
  void mp_mul_csqu_nt_d1(int nfft, double d1[], int ip[], double w[]);
  void mp_mul_d2i(int n, int radix, int nfft, double din[], int out[]);
  mp_mul_csqu_nt_d1(nfft, inoutfft, ip, w);
  mp_mul_d2i(n, radix, nfft, inoutfft, out);
}


x86 assembly (clang, -O0):
<mp_squh_use_in1fft>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    0x10(%rbp),%rcx
call   1030 <mp_mul_csqu_nt_d1@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
call   1040 <mp_mul_d2i@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_squh_use_in1fft>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8d,%ebp
mov    %rcx,%r14
mov    %rdx,%rbx
mov    %esi,%r15d
mov    %edi,%r12d
mov    0x30(%rsp),%rcx
mov    %r8d,%edi
mov    %rdx,%rsi
mov    %r9,%rdx
call   1030 <mp_mul_csqu_nt_d1@plt>
mov    %r12d,%edi
mov    %r15d,%esi
mov    %ebp,%edx
mov    %rbx,%rcx
mov    %r14,%r8
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <mp_mul_d2i@plt>

LLVM IR (-O0):
define void @mp_squh_use_in1fft(i32 %0, i32 %1, double* %2, i32* %3, i32 %4, i32* %5, double* %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca double*
%11 = alloca i32*
%12 = alloca i32
%13 = alloca i32*
%14 = alloca double*
store i32 %0, i32* %8
store i32 %1, i32* %9
store double* %2, double** %10
store i32* %3, i32** %11
store i32 %4, i32* %12
store i32* %5, i32** %13
store double* %6, double** %14
%15 = load i32, i32* %12
%16 = load double*, double** %10
%17 = load i32*, i32** %13
%18 = load double*, double** %14
%19 = load i32, i32* %8
%20 = load i32, i32* %9
%21 = load i32, i32* %12
%22 = load double*, double** %10
%23 = load i32*, i32** %11
ret void
}

LLVM IR (-O2):
define void @mp_squh_use_in1fft(i32 %0, i32 %1, double* %2, i32* %3, i32 %4, i32* %5, double* %6) {
tail call void @mp_mul_csqu_nt_d1(i32 %4, double* %2, i32* %5, double* %6)
tail call void @mp_mul_d2i(i32 %0, i32 %1, i32 %4, double* %2, i32* %3)
ret void
}
void _f_setword(void *ptr, unsigned short num) {
  unsigned char *sptr = (unsigned char *)ptr;
  sptr[1] = (unsigned char)(num >> 8);
  sptr[0] = (unsigned char)(num);
}


x86 assembly (clang, -O0):
<_f_setword>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movzwl -0xa(%rbp),%eax
sar    $0x8,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xa(%rbp),%ax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_f_setword>:
mov    %si,(%rdi)
ret

LLVM IR (-O0):
define void @_f_setword(i8* %0, i16 zeroext %1) {
%3 = alloca i8*
%4 = alloca i16
%5 = alloca i8*
store i8* %0, i8** %3
store i16 %1, i16* %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
%7 = load i16, i16* %4
%8 = zext i16 %7 to i32
%9 = ashr i32 %8, 8
%10 = trunc i32 %9 to i8
%11 = load i8*, i8** %5
%12 = getelementptr inbounds i8, i8* %11, i64 1
store i8 %10, i8* %12
%13 = load i16, i16* %4
%14 = trunc i16 %13 to i8
%15 = load i8*, i8** %5
%16 = getelementptr inbounds i8, i8* %15, i64 0
store i8 %14, i8* %16
ret void
}

LLVM IR (-O2):
define void @_f_setword(i8* nocapture writeonly %0, i16 zeroext %1) {
%3 = lshr i16 %1, 8
%4 = trunc i16 %3 to i8
%5 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %4, i8* %5
%6 = trunc i16 %1 to i8
store i8 %6, i8* %0
ret void
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
scalar_t__ clock_gettime(int, struct timespec *);
void tgl_my_clock_gettime(int clock_id, struct timespec *T) {
  assert(clock_gettime(clock_id, T) >= 0);
}


x86 assembly (clang, -O0):
<tgl_my_clock_gettime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
cmp    $0x0,%rax
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tgl_my_clock_gettime>:
push   %rax
call   1030 <clock_gettime@plt>
shr    $0x3f,%rax
xor    $0x1,%eax
mov    %eax,%edi
pop    %rax
jmp    1040 <assert@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
define void @tgl_my_clock_gettime(i32 %0, %struct.timespec* %1) {
%3 = alloca i32
%4 = alloca %struct.timespec*
store i32 %0, i32* %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load i32, i32* %3
%6 = load %struct.timespec*, %struct.timespec** %4
%7 = call i64 @clock_gettime(i32 %5, %struct.timespec* %6)
%8 = icmp sge i64 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
define void @tgl_my_clock_gettime(i32 %0, %struct.timespec* %1) {
%3 = tail call i64 @clock_gettime(i32 %0, %struct.timespec* %1)
%4 = lshr i64 %3, 63
%5 = trunc i64 %4 to i32
%6 = xor i32 %5, 1
%7 = tail call i32 @assert(i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ WARN_ON(int);
void gpio_free(unsigned gpio) { WARN_ON(1); }


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

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

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

LLVM IR (-O2):
define void @gpio_free(i32 %0) {
%2 = tail call i32 @WARN_ON(i32 1)
ret void
}
unsigned char answer_8(unsigned char arg0, int arg1, int arg2) { return 0; }


x86 assembly (clang, -O0):
<answer_8>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
xor    %eax,%eax
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @answer_8(i8 zeroext %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 i8 0
}

LLVM IR (-O2):
define zeroext i8 @answer_8(i8 zeroext %0, i32 %1, i32 %2) {
ret i8 0
}
void *ipmi_cb_thread(void *unused) {}


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

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

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

LLVM IR (-O2):
define noalias i8* @ipmi_cb_thread(i8* nocapture readnone %0) {
ret i8* undef
}
unsigned long long rdtsc(void) {
  unsigned long low_time, high_time;
  asm volatile("rdtsc \n\t" : "=a"(low_time), "=d"(high_time));
  return ((unsigned long long)high_time << 32) | (low_time);
}


x86 assembly (clang, -O0):
<rdtsc>:
push   %rbp
mov    %rsp,%rbp
rdtsc
mov    %rax,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x20,%rax
or     -0x8(%rbp),%rax
pop    %rbp
ret

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

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

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

/* Variables and functions */
int /*<<< orphan*/ ivory_serialize_pack_prim_4_be(int /*<<< orphan*/ *,
                                                  int /*<<< orphan*/ *);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ **, float const *, int);
void ivory_serialize_pack_float_be(uint8_t *dst, uint32_t offs,
                                   const float *src) {
  uint8_t tmp[4] = {0};
  memcpy(&tmp, src, sizeof(tmp));
  ivory_serialize_pack_prim_4_be(dst + offs, tmp);
}


x86 assembly (clang, -O0):
<ivory_serialize_pack_float_be>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
lea    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x10,%edx
call   1050 <memcpy@plt>
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
lea    -0x30(%rbp),%rsi
call   1040 <ivory_serialize_pack_prim_4_be@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ivory_serialize_pack_float_be>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
mov    %rdi,%r14
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%r15
mov    %r15,%rdi
mov    %rdx,%rsi
mov    $0x10,%edx
call   1040 <memcpy@plt>
movslq %ebx,%rax
lea    (%r14,%rax,4),%rdi
mov    %r15,%rsi
call   1030 <ivory_serialize_pack_prim_4_be@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @ivory_serialize_pack_float_be(i32* %0, i32 %1, float* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca float*
%7 = alloca [4 x i32]
store i32* %0, i32** %4
store i32 %1, i32* %5
store float* %2, float** %6
%8 = bitcast [4 x i32]* %7 to i8*
%9 = bitcast [4 x i32]* %7 to i32**
%10 = load float*, float** %6
%11 = call i32 @memcpy(i32** %9, float* %10, i32 16)
%12 = load i32*, i32** %4
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = getelementptr inbounds [4 x i32], [4 x i32]* %7, i64 0, i64 0
%17 = call i32 @ivory_serialize_pack_prim_4_be(i32* %15, i32* %16)
ret void
}

LLVM IR (-O2):
define void @ivory_serialize_pack_float_be(i32* %0, i32 %1, float* %2) {
%4 = alloca [4 x i32]
%5 = bitcast [4 x i32]* %4 to i8*
%6 = bitcast [4 x i32]* %4 to i32**
%7 = call i32 @memcpy(i32** %6, float* %2, i32 16)
%8 = sext i32 %1 to i64
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
%11 = call i32 @ivory_serialize_pack_prim_4_be(i32* %9, i32* %10)
ret void
}
int compare2(int a, int b) {
  if (a < b)
    return -1;
  if (a > b)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<compare2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1122 <compare2+0x22>
movl   $0xffffffff,-0x4(%rbp)
jmp    1141 <compare2+0x41>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    113a <compare2+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <compare2+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare2>:
xor    %ecx,%ecx
cmp    %esi,%edi
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @compare2(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = icmp sgt i32 %0, %1
%5 = zext i1 %4 to i32
%6 = select i1 %3, i32 -1, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ ast_register_file_version(char *, char *);
void __attribute__((constructor)) __register_file_version(void) {
  ast_register_file_version(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/tpenguin/solarisvoip-asterisk/refs/heads/"
      "master/alaw.c",
      "$Revision: 7221 $");
}


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

x86 assembly (clang, -O2):
<__register_file_version>:
lea    0xee9(%rip),%rdi
lea    0xf73(%rip),%rsi
jmp    1030 <ast_register_file_version@plt>

LLVM IR (-O0):
@.str = [145 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/tpenguin/solarisvoip-asterisk/refs/heads/master/alaw.c\00"
@.str.1 = [18 x i8] c"$Revision: 7221 $\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @__register_file_version, i8* null }]
define void @__register_file_version() {
%1 = call i32 @ast_register_file_version(i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [145 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/tpenguin/solarisvoip-asterisk/refs/heads/master/alaw.c\00"
@.str.1 = [18 x i8] c"$Revision: 7221 $\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @__register_file_version, i8* null }]
define void @__register_file_version() {
%1 = tail call i32 @ast_register_file_version(i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __list_del_entry(struct list_head *);
int /*<<< orphan*/ list_insert(struct list_head *, struct list_head *);
void list_move(struct list_head *list, struct list_head *head) {
  __list_del_entry(list);
  list_insert(list, head);
}


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

x86 assembly (clang, -O2):
<list_move>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <__list_del_entry@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <list_insert@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define void @list_move(%struct.list_head* %0, %struct.list_head* %1) {
%3 = alloca %struct.list_head*
%4 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %3
store %struct.list_head* %1, %struct.list_head** %4
%5 = load %struct.list_head*, %struct.list_head** %3
%6 = call i32 @__list_del_entry(%struct.list_head* %5)
%7 = load %struct.list_head*, %struct.list_head** %3
%8 = load %struct.list_head*, %struct.list_head** %4
%9 = call i32 @list_insert(%struct.list_head* %7, %struct.list_head* %8)
ret void
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @list_move(%struct.list_head* %0, %struct.list_head* %1) {
%3 = tail call i32 @__list_del_entry(%struct.list_head* %0)
%4 = tail call i32 @list_insert(%struct.list_head* %0, %struct.list_head* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ db(int);
void fptan() {
  db(0xD9);
  db(0xF2);
}


x86 assembly (clang, -O0):
<fptan>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd9,%edi
call   1030 <db@plt>
mov    $0xf2,%edi
call   1030 <db@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fptan>:
push   %rax
mov    $0xd9,%edi
call   1030 <db@plt>
mov    $0xf2,%edi
pop    %rax
jmp    1030 <db@plt>

LLVM IR (-O0):
define void @fptan() {
%1 = call i32 @db(i32 217)
%2 = call i32 @db(i32 242)
ret void
}

LLVM IR (-O2):
define void @fptan() {
%1 = tail call i32 @db(i32 217)
%2 = tail call i32 @db(i32 242)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
int ntohl(int);
void put_unaligned_u32(uint32_t *p_, uint32_t x_) {
  uint8_t *p = (uint8_t *)p_;
  uint32_t x = ntohl(x_);
  p[0] = x >> 24;
  p[1] = x >> 16;
  p[2] = x >> 8;
  p[3] = x;
}


x86 assembly (clang, -O0):
<put_unaligned_u32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <ntohl@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%ecx
sar    $0x18,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%ecx
sar    $0x10,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x1c(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0xc(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_unaligned_u32>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <ntohl@plt>
mov    %eax,%ecx
sar    $0x18,%ecx
mov    %ecx,(%rbx)
mov    %eax,%ecx
sar    $0x10,%ecx
mov    %ecx,0x4(%rbx)
mov    %eax,%ecx
sar    $0x8,%ecx
mov    %ecx,0x8(%rbx)
mov    %eax,0xc(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @put_unaligned_u32(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%7 = load i32*, i32** %3
store i32* %7, i32** %5
%8 = load i32, i32* %4
%9 = call i32 @ntohl(i32 %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = ashr i32 %10, 24
%12 = load i32*, i32** %5
%13 = getelementptr inbounds i32, i32* %12, i64 0
store i32 %11, i32* %13
%14 = load i32, i32* %6
%15 = ashr i32 %14, 16
%16 = load i32*, i32** %5
%17 = getelementptr inbounds i32, i32* %16, i64 1
store i32 %15, i32* %17
%18 = load i32, i32* %6
%19 = ashr i32 %18, 8
%20 = load i32*, i32** %5
%21 = getelementptr inbounds i32, i32* %20, i64 2
store i32 %19, i32* %21
%22 = load i32, i32* %6
%23 = load i32*, i32** %5
%24 = getelementptr inbounds i32, i32* %23, i64 3
store i32 %22, i32* %24
ret void
}

LLVM IR (-O2):
define void @put_unaligned_u32(i32* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @ntohl(i32 %1)
%4 = ashr i32 %3, 24
store i32 %4, i32* %0
%5 = ashr i32 %3, 16
%6 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %5, i32* %6
%7 = ashr i32 %3, 8
%8 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %7, i32* %8
%9 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %3, i32* %9
ret void
}
void swap(char s[], int i, int j) {
  char temp;
  temp = s[i];
  s[i] = s[j];
  s[j] = temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x11(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,1),%sil
movslq %edx,%rdx
mov    (%rdi,%rdx,1),%cl
mov    %cl,(%rdi,%rax,1)
mov    %sil,(%rdi,%rdx,1)
ret

LLVM IR (-O0):
define void @swap(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
store i8 %12, i8* %7
%13 = load i8*, i8** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = load i8*, i8** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
store i8 %17, i8* %21
%22 = load i8, i8* %7
%23 = load i8*, i8** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %23, i64 %25
store i8 %22, i8* %26
ret void
}

LLVM IR (-O2):
define void @swap(i8* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
store i8 %9, i8* %5
store i8 %6, i8* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int number;
  scanf("%d", &number);
  if (number < 0) {
    number = -number;
  }
  printf("%d", number);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
test   %esi,%esi
jns    1140 <main+0x20>
neg    %esi
mov    %esi,0x4(%rsp)
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = sub nsw i32 0, %4
store i32 %7, i32* %1
br label %8
8: ; preds = %6, %0
%9 = phi i32 [ %7, %6 ], [ %4, %0 ]
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void PrintIntArray(int _array[], int length) {
  for (int i = 0; i < length; i++) {
    printf("%d ", _array[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<PrintIntArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <PrintIntArray+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <PrintIntArray+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintIntArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <PrintIntArray+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <PrintIntArray+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @PrintIntArray(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @putchar(i32 10)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %13, %8 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void readFile(FILE fichier) {
  for (int i = 0; i < 200; i += 2) {
  }
}


x86 assembly (clang, -O0):
<readFile>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xc8,-0x8(%rbp)
jge    112e <readFile+0x2e>
jmp    1120 <readFile+0x20>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <readFile+0xe>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @readFile(i32 %0) {
ret void
}