xunge/DecIR huggingface dataset:
double ABS(double number) {
  if (number >= 0) {
    return number;
  } else {
    return -1 * number;
  }
}


x86 assembly (clang, -O0):
<ABS>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     112a <ABS+0x2a>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    113c <ABS+0x3c>
movsd  0xece(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ABS>:
movapd 0xef8(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm1,%xmm1
cmpnlesd %xmm0,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @ABS(double %0) {
%2 = fcmp ult double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
/* Variables and functions */
float sqrt(int);
float circularEaseOutf(float p) { return sqrt((2 - p) * p); }


x86 assembly (clang, -O0):
<circularEaseOutf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xedb(%rip),%xmm0
subss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
cvttss2si %xmm0,%edi
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<circularEaseOutf>:
movss  0xee8(%rip),%xmm1
subss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
cvttss2si %xmm1,%edi
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define float @circularEaseOutf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fsub float 2.000000e+00, %3
%5 = load float, float* %2
%6 = fmul float %4, %5
%7 = fptosi float %6 to i32
%8 = call float @sqrt(i32 %7)
ret float %8
}

LLVM IR (-O2):
define float @circularEaseOutf(float %0) {
%2 = fsub float 2.000000e+00, %0
%3 = fmul float %2, %0
%4 = fptosi float %3 to i32
%5 = tail call float @sqrt(i32 %4)
ret float %5
}
/* Variables and functions */
int ft_strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int);
void ft_putendl(char const *s) {
  if (!s)
    return;
  write(1, s, ft_strlen(s));
  write(1, "\n", 1);
}


x86 assembly (clang, -O0):
<ft_putendl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113c <ft_putendl+0x1c>
jmp    1170 <ft_putendl+0x50>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ft_strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
mov    $0x1,%edx
lea    0xe97(%rip),%rsi
mov    %edx,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putendl>:
test   %rdi,%rdi
je     1154 <ft_putendl+0x34>
push   %rbx
mov    %rdi,%rbx
call   1040 <ft_strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
lea    0xebc(%rip),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
pop    %rbx
jmp    1030 <write@plt>
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @ft_putendl(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %6, label %5
5: ; preds = %1
br label %12
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = load i8*, i8** %2
%9 = call i32 @ft_strlen(i8* %8)
%10 = call i32 @write(i32 1, i8* %7, i32 %9)
%11 = call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
br label %12
12: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @ft_putendl(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 @ft_strlen(i8* %0)
%5 = tail call i32 @write(i32 1, i8* %0, i32 %4)
%6 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
br label %7
7: ; preds = %1, %3
ret void
}
/* Variables and functions */
int Kit_TruthWordNum(int);
int Kit_TruthIsConst1(unsigned *pIn, int nVars) {
  int w;
  for (w = Kit_TruthWordNum(nVars) - 1; w >= 0; w--)
    if (pIn[w] != ~(unsigned)0)
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<Kit_TruthIsConst1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <Kit_TruthWordNum@plt>
sub    $0x1,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jl     1168 <Kit_TruthIsConst1+0x58>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
cmpl   $0xffffffff,(%rax,%rcx,4)
je     1155 <Kit_TruthIsConst1+0x45>
movl   $0x0,-0x4(%rbp)
jmp    116f <Kit_TruthIsConst1+0x5f>
jmp    115a <Kit_TruthIsConst1+0x4a>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    112d <Kit_TruthIsConst1+0x1d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Kit_TruthIsConst1>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <Kit_TruthWordNum@plt>
mov    %eax,%eax
nopl   (%rax)
test   %eax,%eax
jle    1133 <Kit_TruthIsConst1+0x23>
cmpl   $0xffffffff,-0x4(%rbx,%rax,4)
lea    -0x1(%rax),%rax
je     1120 <Kit_TruthIsConst1+0x10>
xor    %eax,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @Kit_TruthIsConst1(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = call i32 @Kit_TruthWordNum(i32 %7)
%9 = sub nsw i32 %8, 1
store i32 %9, i32* %6
br label %10
10: ; preds = %22, %2
%11 = load i32, i32* %6
%12 = icmp sge i32 %11, 0
br i1 %12, label %13, label %25
13: ; preds = %10
%14 = load i32*, i32** %4
%15 = load i32, i32* %6
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = load i32, i32* %17
%19 = icmp ne i32 %18, -1
br i1 %19, label %20, label %21
20: ; preds = %13
store i32 0, i32* %3
br label %26
21: ; preds = %13
br label %22
22: ; preds = %21
%23 = load i32, i32* %6
%24 = add nsw i32 %23, -1
store i32 %24, i32* %6
br label %10
25: ; preds = %10
store i32 1, i32* %3
br label %26
26: ; preds = %25, %20
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @Kit_TruthIsConst1(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @Kit_TruthWordNum(i32 %1)
%4 = zext i32 %3 to i64
br label %5
5: ; preds = %10, %2
%6 = phi i64 [ %7, %10 ], [ %4, %2 ]
%7 = add nsw i64 %6, -1
%8 = trunc i64 %6 to i32
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %5
%11 = getelementptr inbounds i32, i32* %0, i64 %7
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, -1
br i1 %13, label %5, label %14
14: ; preds = %5, %10
%15 = phi i32 [ 0, %10 ], [ 1, %5 ]
ret i32 %15
}
void mcal_cpu_nop() { __asm__ volatile("nop"); }


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

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

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

LLVM IR (-O2):
define void @mcal_cpu_nop() {
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void queue_free(int id, int nprocs) {}


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

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

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

LLVM IR (-O2):
define void @queue_free(i32 %0, i32 %1) {
ret void
}
void swd_disable(void) {}


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

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

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

LLVM IR (-O2):
define void @swd_disable() {
ret void
}
void encode_artnet_uint16_lohi(unsigned short n, unsigned char *data) {
  data[0] = n & 0xFF;
  data[1] = (n >> 8) & 0xFF;
}


x86 assembly (clang, -O0):
<encode_artnet_uint16_lohi>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<encode_artnet_uint16_lohi>:
mov    %di,(%rsi)
ret

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

LLVM IR (-O2):
define void @encode_artnet_uint16_lohi(i16 zeroext %0, i8* nocapture writeonly %1) {
%3 = trunc i16 %0 to i8
store i8 %3, i8* %1
%4 = lshr i16 %0, 8
%5 = trunc i16 %4 to i8
%6 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %5, i8* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ util_read_real_time(void *);
void set_time_mark(void *mark) { util_read_real_time(mark); }


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

x86 assembly (clang, -O2):
<set_time_mark>:
jmp    1030 <util_read_real_time@plt>

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

LLVM IR (-O2):
define void @set_time_mark(i8* %0) {
%2 = tail call i32 @util_read_real_time(i8* %0)
ret void
}
/* Variables and functions */
double Map24(double);
double Map12(double hour) {
  double hour24;
  hour24 = Map24(hour);
  if (hour24 >= 12.0) {
    return (hour24 - 24.0);
  } else {
    return (hour24);
  }
}


x86 assembly (clang, -O0):
<Map12>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <Map24@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xec7(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     115e <Map12+0x4e>
movsd  -0x18(%rbp),%xmm0
movsd  0xeb8(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1168 <Map12+0x58>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Map12>:
push   %rax
call   1030 <Map24@plt>
movsd  0xee2(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xede(%rip),%xmm2
cmpnlesd %xmm0,%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm2,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @Map12(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %3
%5 = load double, double* %3
%6 = call double @Map24(double %5)
store double %6, double* %4
%7 = load double, double* %4
%8 = fcmp oge double %7, 1.200000e+01
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load double, double* %4
%11 = fsub double %10, 2.400000e+01
store double %11, double* %2
br label %14
12: ; preds = %1
%13 = load double, double* %4
store double %13, double* %2
br label %14
14: ; preds = %12, %9
%15 = load double, double* %2
ret double %15
}

LLVM IR (-O2):
define double @Map12(double %0) {
%2 = tail call double @Map24(double %0)
%3 = fcmp ult double %2, 1.200000e+01
%4 = fadd double %2, -2.400000e+01
%5 = select i1 %3, double %2, double %4
ret double %5
}
const char *ud_emit(void *ptr) { return "test userdata emit"; }


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"test userdata emit\00"
define i8* @ud_emit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [19 x i8] c"test userdata emit\00"
define i8* @ud_emit(i8* nocapture readnone %0) {
ret i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0)
}
void gtk_action_get_accel_path() {}


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

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

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

LLVM IR (-O2):
define void @gtk_action_get_accel_path() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void shmem_int_sum_to_all(int *target, int *source, int nreduce,
                                 int PE_start, int logPE_stride, int PE_size,
                                 int *pWrk, long *pSync) {
  printf("\nOpenSHMEM Analyzer\n");
}


x86 assembly (clang, -O0):
<shmem_int_sum_to_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define void @shmem_int_sum_to_all(i32* nocapture readnone %0, i32* nocapture readnone %1, i32 %2, i32 %3, i32 %4, i32 %5, i32* nocapture readnone %6, i64* nocapture readnone %7) {
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputwc(int /*<<< orphan*/, int /*<<< orphan*/ *);
void out(FILE *f, const wchar_t *s, size_t l) {
  while (l--)
    fputwc(*s++, f);
}


x86 assembly (clang, -O0):
<out>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
cmp    $0x0,%rax
je     115c <out+0x4c>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <fputwc@plt>
jmp    1124 <out+0x14>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<out>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rdx,%rdx
je     1145 <out+0x35>
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%edi
mov    %r15,%rsi
call   1030 <fputwc@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <out+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @out(i32* %0, i32* nocapture %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %13, label %5
5: ; preds = %3, %5
%6 = phi i64 [ %8, %5 ], [ %2, %3 ]
%7 = phi i32* [ %9, %5 ], [ %1, %3 ]
%8 = add i64 %6, -1
%9 = getelementptr inbounds i32, i32* %7, i64 1
%10 = load i32, i32* %7
%11 = tail call i32 @fputwc(i32 %10, i32* %0)
%12 = icmp eq i64 %8, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %3
ret void
}
double micros() { return 1.0; }


x86 assembly (clang, -O0):
<micros>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<micros>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @micros() {
ret double 1.000000e+00
}

LLVM IR (-O2):
define double @micros() {
ret double 1.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ ENOENT;
int _stub(int /*<<< orphan*/);
int __wrap_openat(int dirfd, const char *name, int flags, int mode) {
  return _stub(ENOENT);
}


x86 assembly (clang, -O0):
<__wrap_openat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1030 <_stub@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__wrap_openat>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <_stub@plt>

LLVM IR (-O0):
@ENOENT = global i32 0
define i32 @__wrap_openat(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* @ENOENT
%10 = call i32 @_stub(i32 %9)
ret i32 %10
}

LLVM IR (-O2):
@ENOENT = global i32 0
define i32 @__wrap_openat(i32 %0, i8* nocapture readnone %1, i32 %2, i32 %3) {
%5 = load i32, i32* @ENOENT
%6 = tail call i32 @_stub(i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ dump(int *, int);
int /*<<< orphan*/ quick_sort(int *, int);
void quick_sort_test() {
  int test[10] = {5, 8, 9, 23, 67, 1, 3, 7, 31, 56};
  quick_sort(test, 10);
  dump(test, 10);
}


x86 assembly (clang, -O0):
<quick_sort_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1050 <quick_sort@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1030 <dump@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick_sort_test>:
push   %rbx
sub    $0x30,%rsp
mov    0xef4(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebc(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1040 <quick_sort@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <dump@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.quick_sort_test.test = [10 x i32] [i32 5, i32 8, i32 9, i32 23, i32 67, i32 1, i32 3, i32 7, i32 31, i32 56]
define void @quick_sort_test() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @quick_sort(i32* %3, i32 10)
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%6 = call i32 @dump(i32* %5, i32 10)
ret void
}

LLVM IR (-O2):
@__const.quick_sort_test.test = [10 x i32] [i32 5, i32 8, i32 9, i32 23, i32 67, i32 1, i32 3, i32 7, i32 31, i32 56]
define void @quick_sort_test() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @quick_sort(i32* %3, i32 10)
%5 = call i32 @dump(i32* %3, i32 10)
ret void
}
void dump() {}


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

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

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

LLVM IR (-O2):
define void @dump() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init_sieve(unsigned char *, int);
int /*<<< orphan*/ strange_unique_prime_triplets(unsigned char *, int, int);
int main() {
  unsigned char sieve[3000];
  init_sieve(sieve, 3000);
  strange_unique_prime_triplets(sieve, 30, true);
  strange_unique_prime_triplets(sieve, 1000, false);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xbc0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xbc0(%rbp),%rdi
mov    $0xbb8,%esi
call   1040 <init_sieve@plt>
lea    -0xbc0(%rbp),%rdi
mov    $0x1e,%esi
mov    $0x1,%edx
call   1030 <strange_unique_prime_triplets@plt>
lea    -0xbc0(%rbp),%rdi
mov    $0x3e8,%esi
xor    %edx,%edx
call   1030 <strange_unique_prime_triplets@plt>
xor    %eax,%eax
add    $0xbc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xbc0,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xbb8,%esi
call   1040 <init_sieve@plt>
mov    %rbx,%rdi
mov    $0x1e,%esi
mov    $0x1,%edx
call   1030 <strange_unique_prime_triplets@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
xor    %edx,%edx
call   1030 <strange_unique_prime_triplets@plt>
xor    %eax,%eax
add    $0xbc0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [3000 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [3000 x i8], [3000 x i8]* %2, i64 0, i64 0
%4 = call i32 @init_sieve(i8* %3, i32 3000)
%5 = getelementptr inbounds [3000 x i8], [3000 x i8]* %2, i64 0, i64 0
%6 = call i32 @strange_unique_prime_triplets(i8* %5, i32 30, i32 1)
%7 = getelementptr inbounds [3000 x i8], [3000 x i8]* %2, i64 0, i64 0
%8 = call i32 @strange_unique_prime_triplets(i8* %7, i32 1000, i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [3000 x i8]
%2 = getelementptr inbounds [3000 x i8], [3000 x i8]* %1, i64 0, i64 0
%3 = call i32 @init_sieve(i8* %2, i32 3000)
%4 = call i32 @strange_unique_prime_triplets(i8* %2, i32 30, i32 1)
%5 = call i32 @strange_unique_prime_triplets(i8* %2, i32 1000, i32 0)
ret i32 0
}
/* Variables and functions */
int syscall(int, int, char const *, void *, size_t, int);
int fsetxattr(int filedes, const char *name, void *value, size_t size,
              int flags) {
  return syscall(190, filedes, name, value, size, flags);
}


x86 assembly (clang, -O0):
<fsetxattr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x24(%rbp),%r9d
mov    $0xbe,%edi
call   1030 <syscall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsetxattr>:
mov    %r8d,%r9d
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0xbe,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @fsetxattr(i32 %0, i8* %1, i8* %2, i64 %3, i32 %4) {
%6 = tail call i32 @syscall(i32 190, i32 %0, i8* %1, i8* %2, i64 %3, i32 %4)
ret i32 %6
}
/* Variables and functions */
int ReadInt();
int /*<<< orphan*/ fibonacci(int);
int /*<<< orphan*/ printf(char *, int, int /*<<< orphan*/);
int main(int argc, char const *argv[]) {
  int inp = ReadInt();
  printf("\nfibonacci(%i): %lu\n", inp, fibonacci(inp));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <ReadInt@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1050 <fibonacci@plt>
lea    0xeb8(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [21 x i8] c"\0Afibonacci(%i): %lu\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @ReadInt()
%4 = tail call i32 @fibonacci(i32 %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
scalar_t__ fprintf(int /*<<< orphan*/ *, char *, char *, char *);
int login(char *user, char *passwd, FILE *conn) {
  if (fprintf(conn, "%s %s\n", user, passwd) < 0) {
    return -1;
  }
  fflush(conn);
  return 0;
}


x86 assembly (clang, -O0):
<login>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xeb9(%rip),%rsi
call   1030 <fprintf@plt>
cmp    $0x0,%rax
jge    1162 <login+0x42>
movl   $0xffffffff,-0x4(%rbp)
jmp    1172 <login+0x52>
mov    -0x20(%rbp),%rdi
call   1040 <fflush@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<login>:
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xecf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <fprintf@plt>
test   %rax,%rax
js     114a <login+0x2a>
mov    %rbx,%rdi
call   1040 <fflush@plt>
xor    %eax,%eax
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%s %s\0A\00"
define i32 @login(i8* %0, i8* %1, i32* nocapture %2) {
%4 = tail call i64 @fprintf(i32* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%5 = icmp slt i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @fflush(i32* %2)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ 0, %6 ], [ -1, %3 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts("Hello, world!");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <puts@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 = [14 x i8] c"Hello, world!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, world!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void gdk_rgb_set_verbose() {}


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

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

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

LLVM IR (-O2):
define void @gdk_rgb_set_verbose() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_char;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ PACKETSZ;
int /*<<< orphan*/ fp_nquery(int /*<<< orphan*/ const *, int /*<<< orphan*/,
                             int /*<<< orphan*/ *);
void fp_query(const u_char *msg, FILE *file) { fp_nquery(msg, PACKETSZ, file); }


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

x86 assembly (clang, -O2):
<fp_query>:
mov    %rsi,%rdx
mov    0x2ece(%rip),%rax
mov    (%rax),%esi
jmp    1030 <fp_nquery@plt>

LLVM IR (-O0):
@PACKETSZ = global i32 0
define void @fp_query(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* @PACKETSZ
%7 = load i32*, i32** %4
%8 = call i32 @fp_nquery(i32* %5, i32 %6, i32* %7)
ret void
}

LLVM IR (-O2):
@PACKETSZ = global i32 0
define void @fp_query(i32* %0, i32* %1) {
%3 = load i32, i32* @PACKETSZ
%4 = tail call i32 @fp_nquery(i32* %0, i32 %3, i32* %1)
ret void
}
int f(int a) { return -(a / 10); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movslq %edi,%rax
imul   $0xffffffff99999999,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = sdiv i32 %0, -10
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
main(void) {
  printf("TWO"
         " * "
         "THREE"
         " = "
         "SIX"
         ":\n\t%d * %d = %d\n",
         2, 3, 2 * 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x6,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [34 x i8] c"TWO * THREE = SIX:\0A\09%d * %d = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 2, i32 3, i32 6)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __u_char;

/* Variables and functions */
int /*<<< orphan*/ cbmarch_parallel_burst_write(int, int /*<<< orphan*/);
void cbm_parallel_burst_write(int HandleDevice, __u_char Value) {
  ;
  cbmarch_parallel_burst_write(HandleDevice, Value);
  return;
}


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

x86 assembly (clang, -O2):
<cbm_parallel_burst_write>:
jmp    1030 <cbmarch_parallel_burst_write@plt>

LLVM IR (-O0):
define void @cbm_parallel_burst_write(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 @cbmarch_parallel_burst_write(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @cbm_parallel_burst_write(i32 %0, i32 %1) {
%3 = tail call i32 @cbmarch_parallel_burst_write(i32 %0, i32 %1)
ret void
}
int __aeabi_idiv(int num, int denom) {
  int q = 0;
  while (num >= denom) {
    num -= denom;
    q++;
  }
  return q;
}


x86 assembly (clang, -O0):
<__aeabi_idiv>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1136 <__aeabi_idiv+0x36>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <__aeabi_idiv+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__aeabi_idiv>:
xor    %eax,%eax
cmp    %esi,%edi
jl     1119 <__aeabi_idiv+0x19>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
sub    %esi,%edi
add    $0x1,%eax
cmp    %esi,%edi
jge    1110 <__aeabi_idiv+0x10>
ret

LLVM IR (-O0):
define i32 @__aeabi_idiv(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 = %10, %2
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = icmp sge i32 %7, %8
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load i32, i32* %4
%12 = load i32, i32* %3
%13 = sub nsw i32 %12, %11
store i32 %13, i32* %3
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 1
store i32 %15, i32* %5
br label %6
16: ; preds = %6
%17 = load i32, i32* %5
ret i32 %17
}

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

/* Variables and functions */
scalar_t__ iswalpha(int /*<<< orphan*/);
scalar_t__ iswdigit(int /*<<< orphan*/);
int iswalnum(wint_t wc) { return iswdigit(wc) || iswalpha(wc); }


x86 assembly (clang, -O0):
<iswalnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <iswdigit@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1157 <iswalnum+0x37>
mov    -0x4(%rbp),%edi
call   1040 <iswalpha@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @iswalnum(i32 %0) {
%2 = tail call i64 @iswdigit(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @iswalpha(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
char bin_to_char(const char *bin) {
  char c = 0x00;
  for (int i = 0; i <= 7; i++) {
    if (bin[i] == '1') {
      c |= 1 << (7 - i);
    }
  }
  return c;
}


x86 assembly (clang, -O0):
<bin_to_char>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x7,-0x10(%rbp)
jg     115f <bin_to_char+0x5f>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x31,%eax
jne    114c <bin_to_char+0x4c>
mov    $0x7,%ecx
sub    -0x10(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
movsbl -0x9(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x9(%rbp)
jmp    1151 <bin_to_char+0x51>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1113 <bin_to_char+0x13>
movsbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bin_to_char>:
cmpb   $0x31,(%rdi)
sete   %cl
shl    $0x7,%cl
cmpb   $0x31,0x1(%rdi)
sete   %dl
shl    $0x6,%dl
cmpb   $0x31,0x2(%rdi)
sete   %al
shl    $0x5,%al
movd   0x3(%rdi),%xmm0
pcmpeqb 0xed6(%rip),%xmm0
pand   0xede(%rip),%xmm0
cmpb   $0x31,0x7(%rdi)
sete   %sil
movdqa %xmm0,%xmm1
psrld  $0x10,%xmm1
por    %xmm0,%xmm1
movdqa %xmm1,%xmm0
psrlw  $0x8,%xmm0
por    %xmm1,%xmm0
movd   %xmm0,%edi
or     %dl,%al
or     %cl,%al
or     %sil,%al
or     %dil,%al
ret

LLVM IR (-O0):
define signext i8 @bin_to_char(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i32
store i8* %0, i8** %2
store i8 0, i8* %3
store i32 0, i32* %4
br label %5
5: ; preds = %25, %1
%6 = load i32, i32* %4
%7 = icmp sle i32 %6, 7
br i1 %7, label %8, label %28
8: ; preds = %5
%9 = load i8*, i8** %2
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 49
br i1 %15, label %16, label %24
16: ; preds = %8
%17 = load i32, i32* %4
%18 = sub nsw i32 7, %17
%19 = shl i32 1, %18
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = or i32 %21, %19
%23 = trunc i32 %22 to i8
store i8 %23, i8* %3
br label %24
24: ; preds = %16, %8
br label %25
25: ; preds = %24
%26 = load i32, i32* %4
%27 = add nsw i32 %26, 1
store i32 %27, i32* %4
br label %5
28: ; preds = %5
%29 = load i8, i8* %3
ret i8 %29
}

LLVM IR (-O2):
define signext i8 @bin_to_char(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 49
%4 = select i1 %3, i8 -128, i8 0
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 49
%8 = select i1 %7, i8 64, i8 0
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 49
%12 = select i1 %11, i8 32, i8 0
%13 = getelementptr inbounds i8, i8* %0, i64 3
%14 = bitcast i8* %13 to <4 x i8>*
%15 = load <4 x i8>, <4 x i8>* %14
%16 = icmp eq <4 x i8> %15, <i8 49, i8 49, i8 49, i8 49>
%17 = select <4 x i1> %16, <4 x i8> <i8 16, i8 8, i8 4, i8 2>, <4 x i8> zeroinitializer
%18 = getelementptr inbounds i8, i8* %0, i64 7
%19 = load i8, i8* %18
%20 = icmp eq i8 %19, 49
%21 = zext i1 %20 to i8
%22 = call i8 @llvm.vector.reduce.or.v4i8(<4 x i8> %17)
%23 = or i8 %22, %12
%24 = or i8 %23, %8
%25 = or i8 %24, %4
%26 = or i8 %25, %21
ret i8 %26
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num;
  int resto;
  printf("\nEntre com num:");
  scanf("%d", &num);
  resto = num % 2;
  if (resto == 0) {
    printf("\nEste numero eh par\n");
  } else {
    printf("Este numero eh impar\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1174 <main+0x54>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
jmp    1180 <main+0x60>
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
lea    0xecc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
testb  $0x1,0x4(%rsp)
lea    0xece(%rip),%rax
lea    0xeb2(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"\0AEntre com num:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [21 x i8] c"\0AEste numero eh par\0A\00"
@.str.3 = [22 x i8] c"Este numero eh impar\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = srem i32 %6, 2
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
br label %14
12: ; preds = %0
%13 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
br label %14
14: ; preds = %12, %10
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"\0AEntre com num:\00"
@.str.1 = [3 x i8] c"%d\00"
@str = [21 x i8] c"Este numero eh impar\00"
@str.4 = [20 x i8] c"\0AEste numero eh par\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = and i32 %5, 1
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @str.4, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0)
%9 = call i32 @puts(i8* dereferenceable(1) %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
void virtual_mcu_ConsolePrint_printReal__E(float f) { printf("%f", (float)f); }


x86 assembly (clang, -O0):
<virtual_mcu_ConsolePrint_printReal__E>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
define void @virtual_mcu_ConsolePrint_printReal__E(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %3)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define void @virtual_mcu_ConsolePrint_printReal__E(float %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %0)
ret void
}
int uECC_curve(void) { return 3; }


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

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

LLVM IR (-O0):
define i32 @uECC_curve() {
ret i32 3
}

LLVM IR (-O2):
define i32 @uECC_curve() {
ret i32 3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int elide_delete_cb(void *data, const char *key, void *value) {
  free(value);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @elide_delete_cb(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = call i32 @free(i8* %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @elide_delete_cb(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture %2) {
%4 = tail call i32 @free(i8* %2)
ret i32 0
}
void pbm_init(argcP, argv) int *argcP;
char *argv[];
{ pm_init(argcP, argv); }


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

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

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

LLVM IR (-O2):
define void @pbm_init(i32* %0, i8** %1) {
%3 = tail call i32 (i32*, i8**, ...) bitcast (i32 (...)* @pm_init to i32 (i32*, i8**, ...)*)(i32* %0, i8** %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vga_getpalette(int, int *, int *, int *);
void gl_getpalettecolor(int c, int *r, int *g, int *b) {
  vga_getpalette(c, r, g, b);
}


x86 assembly (clang, -O0):
<gl_getpalettecolor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <vga_getpalette@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gl_getpalettecolor>:
jmp    1030 <vga_getpalette@plt>

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

LLVM IR (-O2):
define void @gl_getpalettecolor(i32 %0, i32* %1, i32* %2, i32* %3) {
%5 = tail call i32 @vga_getpalette(i32 %0, i32* %1, i32* %2, i32* %3)
ret void
}
/* Type definitions */
struct ibe_master_keypair {
  int dummy;
};

/* Variables and functions */
int cocks_master_keygen(struct ibe_master_keypair *, size_t);
int nua_master_keygen(struct ibe_master_keypair *keypair, size_t len) {
  return cocks_master_keygen(keypair, len);
}


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

x86 assembly (clang, -O2):
<nua_master_keygen>:
jmp    1030 <cocks_master_keygen@plt>

LLVM IR (-O0):
%struct.ibe_master_keypair = type { i32 }
define i32 @nua_master_keygen(%struct.ibe_master_keypair* %0, i64 %1) {
%3 = alloca %struct.ibe_master_keypair*
%4 = alloca i64
store %struct.ibe_master_keypair* %0, %struct.ibe_master_keypair** %3
store i64 %1, i64* %4
%5 = load %struct.ibe_master_keypair*, %struct.ibe_master_keypair** %3
%6 = load i64, i64* %4
%7 = call i32 @cocks_master_keygen(%struct.ibe_master_keypair* %5, i64 %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.ibe_master_keypair = type { i32 }
define i32 @nua_master_keygen(%struct.ibe_master_keypair* %0, i64 %1) {
%3 = tail call i32 @cocks_master_keygen(%struct.ibe_master_keypair* %0, i64 %1)
ret i32 %3
}
void gtk_text_tag_event() {}


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

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

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

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