xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ merge(int *, int, int, int);
void mergesort(int a[], int l, int h) {
  if (l < h) {
    int m = (h + l) / 2;
    mergesort(a, l, m);
    mergesort(a, m + 1, h);
    merge(a, l, m, h);
  }
}


x86 assembly (clang, -O0):
<mergesort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1182 <mergesort+0x62>
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1040 <mergesort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <mergesort@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1030 <merge@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mergesort>:
cmp    %edx,%esi
jge    1172 <mergesort+0x52>
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%r12d
mov    %rdi,%r15
lea    (%r14,%r12,1),%eax
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
sar    %ebx
mov    %ebx,%edx
call   1040 <mergesort@plt>
lea    0x1(%rbx),%esi
mov    %r15,%rdi
mov    %r14d,%edx
call   1040 <mergesort@plt>
mov    %r15,%rdi
mov    %r12d,%esi
mov    %ebx,%edx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <merge@plt>
ret

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

LLVM IR (-O2):
define void @mergesort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %6, label %5
5: ; preds = %3, %6
ret void
6: ; preds = %3
%7 = add nsw i32 %2, %1
%8 = sdiv i32 %7, 2
tail call void @mergesort(i32* %0, i32 %1, i32 %8)
%9 = add nsw i32 %8, 1
tail call void @mergesort(i32* %0, i32 %9, i32 %2)
%10 = tail call i32 @merge(i32* %0, i32 %1, i32 %8, i32 %2)
br label %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, float, int);
void move(int y, int x) { printf("%c%c%c", 16, 'F' + y, 32 + x); }


x86 assembly (clang, -O0):
<move>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x46,%eax
cvtsi2ss %eax,%xmm0
mov    -0x8(%rbp),%edx
add    $0x20,%edx
lea    0xecb(%rip),%rdi
mov    $0x10,%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<move>:
add    $0x46,%edi
cvtsi2ss %edi,%xmm0
lea    0x20(%rsi),%edx
lea    0xedf(%rip),%rdi
mov    $0x10,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%c%c%c\00"
define void @move(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 = add nsw i32 70, %5
%7 = sitofp i32 %6 to float
%8 = load i32, i32* %4
%9 = add nsw i32 32, %8
%10 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 16, float %7, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%c%c%c\00"
define void @move(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 70
%4 = sitofp i32 %3 to float
%5 = add nsw i32 %1, 32
%6 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 16, float %4, i32 %5)
ret void
}
int rem(int x, int y) { return x % y; }


x86 assembly (clang, -O0):
<rem>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rem>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @rem(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 = srem i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @rem(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
ret i32 %3
}
void GFX_SetTargetSurface(int surface) {}


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

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

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

LLVM IR (-O2):
define void @GFX_SetTargetSurface(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Fatal_OutOfMemory();
void *calloc(int, size_t);
void *Allocate(size_t p_size) {
  void *t_ptr;
  t_ptr = calloc(1, p_size);
  if (t_ptr == NULL)
    Fatal_OutOfMemory();
  return t_ptr;
}


x86 assembly (clang, -O0):
<Allocate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <Allocate+0x30>
mov    $0x0,%al
call   1040 <Fatal_OutOfMemory@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Allocate>:
push   %rbx
mov    %rdi,%rsi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113d <Allocate+0x1d>
xor    %eax,%eax
call   1040 <Fatal_OutOfMemory@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @Allocate(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @calloc(i32 1, i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @Fatal_OutOfMemory()
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @Allocate(i64 %0) {
%2 = tail call i8* @calloc(i32 1, i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @Fatal_OutOfMemory()
br label %6
6: ; preds = %4, %1
ret i8* %2
}
const char *SttyType() { return "none"; }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"none\00"
define i8* @SttyType() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [5 x i8] c"none\00"
define i8* @SttyType() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
int _is_greater_than(int cmpResult) { return (cmpResult > 0); }


x86 assembly (clang, -O0):
<_is_greater_than>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_is_greater_than>:
xor    %eax,%eax
test   %edi,%edi
setg   %al
ret

LLVM IR (-O0):
define i32 @_is_greater_than(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @_is_greater_than(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
long pci_config_read_byte(unsigned char bus, unsigned char dev, int func,
                          unsigned cmd) {
  printf("pci_config_read_byte: generic function call\n");
  return 0;
}


x86 assembly (clang, -O0):
<pci_config_read_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    %edx,-0x8(%rbp)
mov    %ecx,-0xc(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pci_config_read_byte>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [44 x i8] c"pci_config_read_byte: generic function call\00"
define i64 @pci_config_read_byte(i8 zeroext %0, i8 zeroext %1, i32 %2, i32 %3) {
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
ret i64 0
}
/* Variables and functions */
double atan_rd(double);
double atan_ru(double);
extern double atan_rz(double x) {
  if (x > 0)
    return atan_rd(x);
  else
    return atan_ru(x);
}


x86 assembly (clang, -O0):
<atan_rz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1153 <atan_rz+0x33>
movsd  -0x10(%rbp),%xmm0
call   1040 <atan_rd@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    1162 <atan_rz+0x42>
movsd  -0x10(%rbp),%xmm0
call   1030 <atan_ru@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atan_rz>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    112f <atan_rz+0xf>
jmp    1040 <atan_rd@plt>
jmp    1030 <atan_ru@plt>

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

LLVM IR (-O2):
define double @atan_rz(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call double @atan_rd(double %0)
br label %7
5: ; preds = %1
%6 = tail call double @atan_ru(double %0)
br label %7
7: ; preds = %5, %3
%8 = phi double [ %4, %3 ], [ %6, %5 ]
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, float, char *);
void imc_fits_mkfloat(char *line, char *key, float val, char *com) {
  sprintf(line, "%-8.8s= %20E / %-47.47s", key, val, com);
}


x86 assembly (clang, -O0):
<imc_fits_mkfloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
movss  -0x14(%rbp),%xmm0
mov    -0x20(%rbp),%rcx
lea    0xebf(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imc_fits_mkfloat>:
mov    %rdx,%rcx
mov    %rsi,%rdx
lea    0xee3(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"%-8.8s= %20E / %-47.47s\00"
define void @imc_fits_mkfloat(i8* %0, i8* %1, float %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca float
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store float %2, float* %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load float, float* %7
%12 = load i8*, i8** %8
%13 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %10, float %11, i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"%-8.8s= %20E / %-47.47s\00"
define void @imc_fits_mkfloat(i8* nocapture writeonly %0, i8* %1, float %2, i8* %3) {
%5 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %1, float %2, i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
void int_handler(short arg) {
  printf("sigint process...\n");
  sleep(4);
}


x86 assembly (clang, -O0):
<int_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0x4,%edi
call   1040 <sleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_handler>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x4,%edi
pop    %rax
jmp    1040 <sleep@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"sigint process...\0A\00"
define void @int_handler(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @sleep(i32 4)
ret void
}

LLVM IR (-O2):
@str = [18 x i8] c"sigint process...\00"
define void @int_handler(i16 signext %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @sleep(i32 4)
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t byte2_to_uint(uint8_t *bytes) {
  return (((uint16_t)bytes[0] << 8) & 0xFF00) | (((uint16_t)bytes[1]) & 0x00FF);
}


x86 assembly (clang, -O0):
<byte2_to_uint>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
shl    $0x8,%eax
and    $0xff00,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rcx
and    $0xff,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<byte2_to_uint>:
mov    (%rdi),%eax
shl    $0x8,%eax
movzwl %ax,%ecx
movzbl 0x8(%rdi),%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @byte2_to_uint(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = getelementptr inbounds i64, i64* %3, i64 0
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 8
%8 = and i32 %7, 65280
%9 = load i64*, i64** %2
%10 = getelementptr inbounds i64, i64* %9, i64 1
%11 = load i64, i64* %10
%12 = trunc i64 %11 to i32
%13 = and i32 %12, 255
%14 = or i32 %8, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @byte2_to_uint(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = trunc i64 %2 to i32
%4 = shl i32 %3, 8
%5 = and i32 %4, 65280
%6 = getelementptr inbounds i64, i64* %0, i64 1
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
%9 = and i32 %8, 255
%10 = or i32 %5, %9
ret i32 %10
}
/* Type definitions */
struct SN_env {
  int dummy;
};

/* Variables and functions */
struct SN_env *SN_create_env(int /*<<< orphan*/, int, int);
extern struct SN_env *porter_UTF_8_create_env(void) {
  return SN_create_env(0, 2, 1);
}


x86 assembly (clang, -O0):
<porter_UTF_8_create_env>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <SN_create_env@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<porter_UTF_8_create_env>:
xor    %edi,%edi
mov    $0x2,%esi
mov    $0x1,%edx
jmp    1030 <SN_create_env@plt>

LLVM IR (-O0):
%struct.SN_env = type { i32 }
define %struct.SN_env* @porter_UTF_8_create_env() {
%1 = call %struct.SN_env* @SN_create_env(i32 0, i32 2, i32 1)
ret %struct.SN_env* %1
}

LLVM IR (-O2):
%struct.SN_env = type { i32 }
define %struct.SN_env* @porter_UTF_8_create_env() {
%1 = tail call %struct.SN_env* @SN_create_env(i32 0, i32 2, i32 1)
ret %struct.SN_env* %1
}
int SacarDato(int ind_c) {
  extern double buffer[100];
  return buffer[ind_c];
}


x86 assembly (clang, -O0):
<SacarDato>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rcx
mov    0x2ece(%rip),%rax
cvttsd2si (%rax,%rcx,8),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SacarDato>:
movslq %edi,%rax
mov    0x2ed6(%rip),%rcx
cvttsd2si (%rcx,%rax,8),%eax
ret

LLVM IR (-O0):
@buffer = external global [100 x double]
define i32 @SacarDato(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [100 x double], [100 x double]* @buffer, i64 0, i64 %4
%6 = load double, double* %5
%7 = fptosi double %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@buffer = external global [100 x double]
define i32 @SacarDato(i32 %0) {
%2 = sext i32 %0 to i64
%3 = getelementptr inbounds [100 x double], [100 x double]* @buffer, i64 0, i64 %2
%4 = load double, double* %3
%5 = fptosi double %4 to i32
ret i32 %5
}
void foo(struct S *x) { struct S *a = x; }


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

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

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

LLVM IR (-O2):
%struct.S = type opaque
define void @foo(%struct.S* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clar_report_all();
int /*<<< orphan*/ printf(char *);
void clar_print_shutdown(int test_count, int suite_count, int error_count) {
  (void)test_count;
  (void)suite_count;
  (void)error_count;
  printf("\n\n");
  clar_report_all();
}


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

x86 assembly (clang, -O2):
<clar_print_shutdown>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <clar_report_all@plt>

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

LLVM IR (-O2):
@str = [2 x i8] c"\0A\00"
define void @clar_print_shutdown(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 (...) @clar_report_all()
ret void
}
int test_imm_89int64_lowword_mem(long long *val) {
  return ((*val) & (0x89 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_89int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 137
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, size_t, char *, int);
int expand_num(char buf[], size_t buf_len, int val) {
  snprintf(buf, buf_len, "%d", val);
  return (val == 0);
}


x86 assembly (clang, -O0):
<expand_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%ecx
lea    0xecb(%rip),%rdx
call   1030 <snprintf@plt>
cmpl   $0x0,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expand_num>:
push   %rbx
mov    %edx,%ebx
lea    0xee6(%rip),%rdx
mov    %ebx,%ecx
call   1030 <snprintf@plt>
xor    %eax,%eax
test   %ebx,%ebx
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @expand_num(i8* %0, i64 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = load i32, i32* %6
%10 = call i32 @snprintf(i8* %7, i64 %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %6
%12 = icmp eq i32 %11, 0
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @expand_num(i8* %0, i64 %1, i32 %2) {
%4 = tail call i32 @snprintf(i8* %0, i64 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %2)
%5 = icmp eq i32 %2, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
long put_symbol(string)
char *string[];
{
  char *pstr;
  pstr = *string;
  for (; (*pstr == ' ') && (*pstr != '\0'); pstr++) {
  }
  if (!char_putsym(pstr))
    return (0);
  return (1);
}


x86 assembly (clang, -O0):
<put_symbol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0x19(%rbp)
jne    114c <put_symbol+0x3c>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    115c <put_symbol+0x4c>
jmp    1172 <put_symbol+0x62>
jmp    1161 <put_symbol+0x51>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1127 <put_symbol+0x17>
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1030 <char_putsym@plt>
cmp    $0x0,%eax
jne    1193 <put_symbol+0x83>
movq   $0x0,-0x8(%rbp)
jmp    119b <put_symbol+0x8b>
movq   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_symbol>:
push   %rax
mov    (%rdi),%rdi
add    $0xffffffffffffffff,%rdi
nopl   0x0(%rax,%rax,1)
cmpb   $0x20,0x1(%rdi)
lea    0x1(%rdi),%rdi
je     1120 <put_symbol+0x10>
xor    %eax,%eax
call   1030 <char_putsym@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @put_symbol(i8** %0) {
%2 = alloca i64
%3 = alloca i8**
%4 = alloca i8*
store i8** %0, i8*** %3
%5 = load i8**, i8*** %3
%6 = load i8*, i8** %5
store i8* %6, i8** %4
br label %7
7: ; preds = %20, %1
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 32
br i1 %11, label %12, label %17
12: ; preds = %7
%13 = load i8*, i8** %4
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp ne i32 %15, 0
br label %17
17: ; preds = %12, %7
%18 = phi i1 [ false, %7 ], [ %16, %12 ]
br i1 %18, label %19, label %23
19: ; preds = %17
br label %20
20: ; preds = %19
%21 = load i8*, i8** %4
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %4
br label %7
23: ; preds = %17
%24 = load i8*, i8** %4
%25 = call i32 (i8*, ...) bitcast (i32 (...)* @char_putsym to i32 (i8*, ...)*)(i8* %24)
%26 = icmp ne i32 %25, 0
br i1 %26, label %28, label %27
27: ; preds = %23
store i64 0, i64* %2
br label %29
28: ; preds = %23
store i64 1, i64* %2
br label %29
29: ; preds = %28, %27
%30 = load i64, i64* %2
ret i64 %30
}

LLVM IR (-O2):
define i64 @put_symbol(i8** nocapture %0) {
%2 = load i8*, i8** %0
br label %3
3: ; preds = %3, %1
%4 = phi i8* [ %2, %1 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 32
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %3, label %8
8: ; preds = %3
%9 = tail call i32 (i8*, ...) bitcast (i32 (...)* @char_putsym to i32 (i8*, ...)*)(i8* %4)
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i64
ret i64 %11
}
segment(sg) {
  newline(2, 0, 2);
  word(sg);
  endline();
}


x86 assembly (clang, -O0):
<segment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x2,%edx
xor    %esi,%esi
mov    %edx,%edi
mov    $0x0,%al
call   1030 <newline@plt>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1040 <word@plt>
mov    $0x0,%al
call   1050 <endline@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<segment>:
push   %rbx
mov    %edi,%ebx
mov    $0x2,%edi
xor    %esi,%esi
mov    $0x2,%edx
xor    %eax,%eax
call   1030 <newline@plt>
mov    %ebx,%edi
xor    %eax,%eax
call   1040 <word@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <endline@plt>

LLVM IR (-O0):
define i32 @segment(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @newline to i32 (i32, i32, i32, ...)*)(i32 2, i32 0, i32 2)
%5 = load i32, i32* %3
%6 = call i32 (i32, ...) bitcast (i32 (...)* @word to i32 (i32, ...)*)(i32 %5)
%7 = call i32 (...) @endline()
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @segment(i32 %0) {
%2 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @newline to i32 (i32, i32, i32, ...)*)(i32 2, i32 0, i32 2)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @word to i32 (i32, ...)*)(i32 %0)
%4 = tail call i32 (...) @endline()
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
const uint8_t *
hci_event_command_complete_get_return_parameters(const uint8_t *event) {
  return &event[5];
}


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

x86 assembly (clang, -O2):
<hci_event_command_complete_get_return_parameters>:
lea    0x14(%rdi),%rax
ret

LLVM IR (-O0):
define i32* @hci_event_command_complete_get_return_parameters(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 5
ret i32* %4
}

LLVM IR (-O2):
define i32* @hci_event_command_complete_get_return_parameters(i32* readnone %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 5
ret i32* %2
}
int liballoc_unlock() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @liballoc_unlock() {
ret i32 0
}
int test_imm_D1int32_reg(int val) { return ((val) & (0xD1 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_D1int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xd1,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_D1int32_reg>:
test   $0xd1,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_D1int32_reg(i32 %0) {
%2 = and i32 %0, 209
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void current_on() {}


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

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

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

LLVM IR (-O2):
define void @current_on() {
ret void
}
double f_x2_612(double x) { return x * x - 612.0; }


x86 assembly (clang, -O0):
<f_x2_612>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xee1(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_x2_612>:
mulsd  %xmm0,%xmm0
addsd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @f_x2_612(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = call double @llvm.fmuladd.f64(double %3, double %4, double -6.120000e+02)
ret double %5
}

LLVM IR (-O2):
define double @f_x2_612(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double %0, double -6.120000e+02)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("BYE!\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [5 x i8] c"BYE!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void defOnDomainList(char *domain) {
  FILE *fp;
  if ((fp = fopen("/tmp/ez-ipupd.domainls", "a")) != 0) {
    fprintf(fp, "%s\n", domain);
    fclose(fp);
  }
}


x86 assembly (clang, -O0):
<defOnDomainList>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
lea    0xecd(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     117a <defOnDomainList+0x4a>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xead(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<defOnDomainList>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xec2(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     1173 <defOnDomainList+0x43>
mov    %rax,%rbx
lea    0xec0(%rip),%rsi
mov    %rax,%rdi
mov    %r14,%rdx
call   1040 <fprintf@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fclose@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [23 x i8] c"/tmp/ez-ipupd.domainls\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define void @defOnDomainList(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = call i32* @fopen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %4, i32** %3
%5 = icmp ne i32* %4, null
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32*, i32** %3
%8 = load i8*, i8** %2
%9 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %8)
%10 = load i32*, i32** %3
%11 = call i32 @fclose(i32* %10)
br label %12
12: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"/tmp/ez-ipupd.domainls\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define void @defOnDomainList(i8* %0) {
%2 = tail call i32* @fopen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @fprintf(i32* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%6 = tail call i32 @fclose(i32* %2)
br label %7
7: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int32_t;

/* Variables and functions */
int /*<<< orphan*/ Interpolate_2(int /*<<< orphan*/, int, int /*<<< orphan*/,
                                 int, int);
u_int32_t Interp1(u_int32_t c1, u_int32_t c2) {
  return Interpolate_2(c1, 3, c2, 1, 2);
}


x86 assembly (clang, -O0):
<Interp1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    $0x3,%esi
mov    $0x1,%ecx
mov    $0x2,%r8d
call   1030 <Interpolate_2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Interp1>:
mov    %esi,%edx
mov    $0x3,%esi
mov    $0x1,%ecx
mov    $0x2,%r8d
jmp    1030 <Interpolate_2@plt>

LLVM IR (-O0):
define i32 @Interp1(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 = call i32 @Interpolate_2(i32 %5, i32 3, i32 %6, i32 1, i32 2)
ret i32 %7
}

LLVM IR (-O2):
define i32 @Interp1(i32 %0, i32 %1) {
%3 = tail call i32 @Interpolate_2(i32 %0, i32 3, i32 %1, i32 1, i32 2)
ret i32 %3
}
int s_hval(char *s) {
  int h = 0;
  while (*s)
    h = h * 31 + *(s++);
  return h;
}


x86 assembly (clang, -O0):
<s_hval>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113c <s_hval+0x3c>
imul   $0x1f,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <s_hval+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_hval>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <s_hval+0x28>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
mov    %eax,%edx
shl    $0x5,%edx
sub    %eax,%edx
movsbl %cl,%eax
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <s_hval+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @s_hval(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = mul nsw i32 %6, 31
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i32
%11 = add nsw i32 %8, %10
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %15
}
void ft_add_test_case(char **data, char *s1, char *s2, char *n) {
  data[0] = s1;
  data[1] = s2;
  data[2] = n;
}


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

x86 assembly (clang, -O2):
<ft_add_test_case>:
mov    %rsi,(%rdi)
mov    %rdx,0x8(%rdi)
mov    %rcx,0x10(%rdi)
ret

LLVM IR (-O0):
define void @ft_add_test_case(i8** %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8** %0, i8*** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %6
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 0
store i8* %9, i8** %11
%12 = load i8*, i8** %7
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
store i8* %12, i8** %14
%15 = load i8*, i8** %8
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 2
store i8* %15, i8** %17
ret void
}

LLVM IR (-O2):
define void @ft_add_test_case(i8** nocapture writeonly %0, i8* %1, i8* %2, i8* %3) {
store i8* %1, i8** %0
%5 = getelementptr inbounds i8*, i8** %0, i64 1
store i8* %2, i8** %5
%6 = getelementptr inbounds i8*, i8** %0, i64 2
store i8* %3, i8** %6
ret void
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
scalar_t__ INT16_MAX;
scalar_t__ INT16_MIN;
scalar_t__ __stdfix_sat_r(scalar_t__);
int32_t __stdfix_smul_r(int32_t x, int32_t y) {
  if (x == INT16_MIN && y == INT16_MIN)
    return (INT16_MAX);
  return ((int32_t)__stdfix_sat_r(((int32_t)x * (int32_t)y) >> 15));
}


x86 assembly (clang, -O0):
<__stdfix_smul_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2ead(%rip),%rcx
cmp    (%rcx),%rax
jne    115b <__stdfix_smul_r+0x4b>
mov    -0x18(%rbp),%rax
mov    0x2e99(%rip),%rcx
cmp    (%rcx),%rax
jne    115b <__stdfix_smul_r+0x4b>
mov    0x2e91(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1171 <__stdfix_smul_r+0x61>
mov    -0x10(%rbp),%rdi
imul   -0x18(%rbp),%rdi
sar    $0xf,%rdi
call   1030 <__stdfix_sat_r@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__stdfix_smul_r>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%rax
cmp    %rdi,%rax
jne    112f <__stdfix_smul_r+0x1f>
cmp    %rsi,%rax
jne    112f <__stdfix_smul_r+0x1f>
mov    0x2eb5(%rip),%rax
mov    (%rax),%rax
ret
imul   %rdi,%rsi
sar    $0xf,%rsi
mov    %rsi,%rdi
jmp    1030 <__stdfix_sat_r@plt>

LLVM IR (-O0):
@INT16_MIN = global i64 0
@INT16_MAX = global i64 0
define i64 @__stdfix_smul_r(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = load i64, i64* @INT16_MIN
%8 = icmp eq i64 %6, %7
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = load i64, i64* %5
%11 = load i64, i64* @INT16_MIN
%12 = icmp eq i64 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = load i64, i64* @INT16_MAX
store i64 %14, i64* %3
br label %21
15: ; preds = %9, %2
%16 = load i64, i64* %4
%17 = load i64, i64* %5
%18 = mul nsw i64 %16, %17
%19 = ashr i64 %18, 15
%20 = call i64 @__stdfix_sat_r(i64 %19)
store i64 %20, i64* %3
br label %21
21: ; preds = %15, %13
%22 = load i64, i64* %3
ret i64 %22
}

LLVM IR (-O2):
@INT16_MIN = global i64 0
@INT16_MAX = global i64 0
define i64 @__stdfix_smul_r(i64 %0, i64 %1) {
%3 = load i64, i64* @INT16_MIN
%4 = icmp eq i64 %3, %0
%5 = icmp eq i64 %3, %1
%6 = and i1 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = load i64, i64* @INT16_MAX
br label %13
9: ; preds = %2
%10 = mul nsw i64 %1, %0
%11 = ashr i64 %10, 15
%12 = tail call i64 @__stdfix_sat_r(i64 %11)
br label %13
13: ; preds = %9, %7
%14 = phi i64 [ %8, %7 ], [ %12, %9 ]
ret i64 %14
}
/* Type definitions */
struct S_ELEMENT {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ constructors_ops_solver(struct S_ELEMENT *const);
void constructors_ops(struct S_ELEMENT *const ELEMENT) {
  constructors_ops_solver(ELEMENT);
}


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

x86 assembly (clang, -O2):
<constructors_ops>:
jmp    1030 <constructors_ops_solver@plt>

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

LLVM IR (-O2):
%struct.S_ELEMENT = type { i32 }
define void @constructors_ops(%struct.S_ELEMENT* %0) {
%2 = tail call i32 @constructors_ops_solver(%struct.S_ELEMENT* %0)
ret void
}
/* Variables and functions */
int particiona(int *, int, int);
int rand();
int /*<<< orphan*/ troca(int *, int, int);
int particiona_random(int *vet, int inicio, int fim) {
  int pivo_indice = (rand() % (fim - inicio + 1)) + inicio;
  troca(vet, pivo_indice, fim);
  return particiona(vet, inicio, fim);
}


x86 assembly (clang, -O0):
<particiona_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    $0x0,%al
call   1050 <rand@plt>
mov    -0x10(%rbp),%ecx
sub    -0xc(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
add    -0xc(%rbp),%edx
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <troca@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <particiona@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<particiona_random>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %esi,%ebx
mov    %rdi,%r14
xor    %eax,%eax
call   1050 <rand@plt>
mov    %ebp,%ecx
sub    %ebx,%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
lea    (%rdx,%rbx,1),%esi
mov    %r14,%rdi
mov    %ebp,%edx
call   1040 <troca@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <particiona@plt>

LLVM IR (-O0):
define i32 @particiona_random(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = call i32 (...) @rand()
%9 = load i32, i32* %6
%10 = load i32, i32* %5
%11 = sub nsw i32 %9, %10
%12 = add nsw i32 %11, 1
%13 = srem i32 %8, %12
%14 = load i32, i32* %5
%15 = add nsw i32 %13, %14
store i32 %15, i32* %7
%16 = load i32*, i32** %4
%17 = load i32, i32* %7
%18 = load i32, i32* %6
%19 = call i32 @troca(i32* %16, i32 %17, i32 %18)
%20 = load i32*, i32** %4
%21 = load i32, i32* %5
%22 = load i32, i32* %6
%23 = call i32 @particiona(i32* %20, i32 %21, i32 %22)
ret i32 %23
}

LLVM IR (-O2):
define i32 @particiona_random(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 (...) @rand()
%5 = sub i32 1, %1
%6 = add i32 %5, %2
%7 = srem i32 %4, %6
%8 = add nsw i32 %7, %1
%9 = tail call i32 @troca(i32* %0, i32 %8, i32 %2)
%10 = tail call i32 @particiona(i32* %0, i32 %1, i32 %2)
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ lignePleine();
int /*<<< orphan*/ ligneVide();
void margeBas() {
  ligneVide();
  ligneVide();
  lignePleine();
}


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

x86 assembly (clang, -O2):
<margeBas>:
push   %rax
xor    %eax,%eax
call   1040 <ligneVide@plt>
xor    %eax,%eax
call   1040 <ligneVide@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <lignePleine@plt>

LLVM IR (-O0):
define void @margeBas() {
%1 = call i32 (...) @ligneVide()
%2 = call i32 (...) @ligneVide()
%3 = call i32 (...) @lignePleine()
ret void
}

LLVM IR (-O2):
define void @margeBas() {
%1 = tail call i32 (...) @ligneVide()
%2 = tail call i32 (...) @ligneVide()
%3 = tail call i32 (...) @lignePleine()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ system(char *);
int rp_app_exit(void) {
  fprintf(stderr, "Stopping SDR transceiver server.\n");
  system("/opt/redpitaya/www/apps/sdr_transceiver/stop.sh");
  return 0;
}


x86 assembly (clang, -O0):
<rp_app_exit>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
lea    0xee2(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rp_app_exit>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
lea    0xee5(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [34 x i8] c"Stopping SDR transceiver server.\0A\00"
@.str.1 = [48 x i8] c"/opt/redpitaya/www/apps/sdr_transceiver/stop.sh\00"
define i32 @rp_app_exit() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @system(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"Stopping SDR transceiver server.\0A\00"
@.str.1 = [48 x i8] c"/opt/redpitaya/www/apps/sdr_transceiver/stop.sh\00"
define i32 @rp_app_exit() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @system(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ getcwd(char *, int);
int /*<<< orphan*/ puts(char *);
int main() {
  char buf[256];
  getcwd(buf, 256);
  puts(buf);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x110(%rbp),%rdi
mov    $0x100,%esi
call   1040 <getcwd@plt>
lea    -0x110(%rbp),%rdi
call   1030 <puts@plt>
mov    0x2e8a(%rip),%rax
mov    (%rax),%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x100,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x100,%esi
call   1040 <getcwd@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [256 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = call i32 @getcwd(i8* %3, i32 256)
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%6 = call i32 @puts(i8* %5)
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @getcwd(i8* %2, i32 256)
%4 = call i32 @puts(i8* %2)
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}