xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void showmsg(char *szMsg) { printf("%s\n", szMsg); }


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

x86 assembly (clang, -O2):
<showmsg>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @showmsg(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
float adapt_pix_per_usec(float value, int pixels, float usec) {
  float pix_usec_ratio = (float)pixels / usec;
  return 0.95 * value + 0.05 * pix_usec_ratio;
}


x86 assembly (clang, -O0):
<adapt_pix_per_usec>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
divss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x10(%rbp),%xmm1
cvtss2sd %xmm1,%xmm2
movsd  0xece(%rip),%xmm1
mulsd  %xmm2,%xmm1
movsd  0xeba(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<adapt_pix_per_usec>:
cvtsi2ss %edi,%xmm2
divss  %xmm1,%xmm2
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm2,%xmm1
mulsd  0xee5(%rip),%xmm1
mulsd  0xee5(%rip),%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @adapt_pix_per_usec(float %0, i32 %1, float %2) {
%4 = alloca float
%5 = alloca i32
%6 = alloca float
%7 = alloca float
store float %0, float* %4
store i32 %1, i32* %5
store float %2, float* %6
%8 = load i32, i32* %5
%9 = sitofp i32 %8 to float
%10 = load float, float* %6
%11 = fdiv float %9, %10
store float %11, float* %7
%12 = load float, float* %4
%13 = fpext float %12 to double
%14 = load float, float* %7
%15 = fpext float %14 to double
%16 = fmul double 5.000000e-02, %15
%17 = call double @llvm.fmuladd.f64(double 0x3FEE666666666666, double %13, double %16)
%18 = fptrunc double %17 to float
ret float %18
}

LLVM IR (-O2):
define float @adapt_pix_per_usec(float %0, i32 %1, float %2) {
%4 = sitofp i32 %1 to float
%5 = fdiv float %4, %2
%6 = fpext float %0 to double
%7 = fpext float %5 to double
%8 = fmul double %7, 5.000000e-02
%9 = tail call double @llvm.fmuladd.f64(double %6, double 0x3FEE666666666666, double %8)
%10 = fptrunc double %9 to float
ret float %10
}
void update_rect(int x1, int y1, int x2, int y2) {}


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

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

LLVM IR (-O0):
define void @update_rect(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
ret void
}

LLVM IR (-O2):
define void @update_rect(i32 %0, i32 %1, i32 %2, i32 %3) {
ret void
}
int l_trailing_zero(long a) { return __builtin_ctzl(a); }


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

x86 assembly (clang, -O2):
<l_trailing_zero>:
bsf    %rdi,%rax
ret

LLVM IR (-O0):
define i32 @l_trailing_zero(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @llvm.cttz.i64(i64 %3, i1 true)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @l_trailing_zero(i64 %0) {
%2 = tail call i64 @llvm.cttz.i64(i64 %0, i1 true)
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_timespec_store() {
  printf("NOT IMPLEMENTED:"
         "pa_timespec_store"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"NOT IMPLEMENTED:pa_timespec_store\0A\00"
define i32 @pa_timespec_store() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [34 x i8] c"NOT IMPLEMENTED:pa_timespec_store\00"
define i32 @pa_timespec_store() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ __m256i;

/* Variables and functions */
int /*<<< orphan*/ _mm256_adds_epi16(int /*<<< orphan*/ const,
                                     int /*<<< orphan*/ const);
int /*<<< orphan*/ _mm256_srai_epi16(int /*<<< orphan*/ const, int const);
__m256i mm256_round_epi16(const __m256i *const src,
                          const __m256i *const half_depth, const int depth) {
  const __m256i nearest_src = _mm256_adds_epi16(*src, *half_depth);
  return _mm256_srai_epi16(nearest_src, depth);
}


x86 assembly (clang, -O0):
<mm256_round_epi16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
call   1040 <_mm256_adds_epi16@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <_mm256_srai_epi16@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mm256_round_epi16>:
push   %rbx
mov    %edx,%ebx
mov    (%rdi),%edi
mov    (%rsi),%esi
call   1040 <_mm256_adds_epi16@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <_mm256_srai_epi16@plt>

LLVM IR (-O0):
define i32 @mm256_round_epi16(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** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %5
%11 = load i32, i32* %10
%12 = call i32 @_mm256_adds_epi16(i32 %9, i32 %11)
store i32 %12, i32* %7
%13 = load i32, i32* %7
%14 = load i32, i32* %6
%15 = call i32 @_mm256_srai_epi16(i32 %13, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @mm256_round_epi16(i32* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %1
%6 = tail call i32 @_mm256_adds_epi16(i32 %4, i32 %5)
%7 = tail call i32 @_mm256_srai_epi16(i32 %6, i32 %2)
ret i32 %7
}
extern unsigned long get_ds() {
  unsigned short _v;
  __asm__("mov %%ds,%%ax" : "=a"(_v) :);
  return _v;
}


x86 assembly (clang, -O0):
<get_ds>:
push   %rbp
mov    %rsp,%rbp
mov    %ds,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_ds>:
mov    %ds,%ax
movzwl %ax,%eax
ret

LLVM IR (-O0):
define i64 @get_ds() {
%1 = alloca i16
%2 = call i16 asm "mov %ds,%ax", "={ax},~{dirflag},~{fpsr},~{flags}"()
store i16 %2, i16* %1
%3 = load i16, i16* %1
%4 = zext i16 %3 to i64
ret i64 %4
}

LLVM IR (-O2):
define i64 @get_ds() {
%1 = tail call i16 asm "mov %ds,%ax", "={ax},~{dirflag},~{fpsr},~{flags}"()
%2 = zext i16 %1 to i64
ret i64 %2
}
void fn1(int p1) {
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<fn1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fn1+0x7>

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

LLVM IR (-O0):
define void @fn1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %3, %1
br label %3
}

LLVM IR (-O2):
define void @fn1(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Type definitions */
struct pkt_buff {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ dissect_routinghdr_type_0(struct pkt_buff *,
                                             int /*<<< orphan*/ *,
                                             int /*<<< orphan*/);
void dissect_routinghdr_type_0_norm(struct pkt_buff *pkt, ssize_t *data_len) {
  dissect_routinghdr_type_0(pkt, data_len, 0);
}


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

x86 assembly (clang, -O2):
<dissect_routinghdr_type_0_norm>:
xor    %edx,%edx
jmp    1030 <dissect_routinghdr_type_0@plt>

LLVM IR (-O0):
%struct.pkt_buff = type { i32 }
define void @dissect_routinghdr_type_0_norm(%struct.pkt_buff* %0, i32* %1) {
%3 = alloca %struct.pkt_buff*
%4 = alloca i32*
store %struct.pkt_buff* %0, %struct.pkt_buff** %3
store i32* %1, i32** %4
%5 = load %struct.pkt_buff*, %struct.pkt_buff** %3
%6 = load i32*, i32** %4
%7 = call i32 @dissect_routinghdr_type_0(%struct.pkt_buff* %5, i32* %6, i32 0)
ret void
}

LLVM IR (-O2):
%struct.pkt_buff = type { i32 }
define void @dissect_routinghdr_type_0_norm(%struct.pkt_buff* %0, i32* %1) {
%3 = tail call i32 @dissect_routinghdr_type_0(%struct.pkt_buff* %0, i32* %1, i32 0)
ret void
}
void __attribute__((section(".after_vectors"), weak)) SVC_Handler(void) {
  while (1) {
  }
}


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

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

LLVM IR (-O0):
define weak void @SVC_Handler() section ".after_vectors" {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define weak void @SVC_Handler() section ".after_vectors" {
br label %1
1: ; preds = %0, %1
br label %1
}
void FreeMatrix(double **M, unsigned int N) {
  for (int i = 0; i < N; ++i) {
    free(M[i]);
  }
  free(M);
}


x86 assembly (clang, -O0):
<FreeMatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1151 <FreeMatrix+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <FreeMatrix+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FreeMatrix>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
je     1142 <FreeMatrix+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <FreeMatrix+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @FreeMatrix(double** nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = bitcast double** %0 to i8*
tail call void @free(i8* %7)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %13, %8 ]
%10 = getelementptr inbounds double*, double** %0, i64 %9
%11 = bitcast double** %10 to i8**
%12 = load i8*, i8** %11
tail call void @free(i8* %12)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %8
}
/* Type definitions */
typedef int __le16;

/* Variables and functions */
int __cpu_to_le16(int);
int ieee80211_is_rts(__le16 fc) {
  return (fc & __cpu_to_le16(0x000c | 0x00f0)) ==
         __cpu_to_le16(0x0004 | 0x00B0);
}


x86 assembly (clang, -O0):
<ieee80211_is_rts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0xfc,%edi
call   1030 <__cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
and    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0xb4,%edi
call   1030 <__cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ieee80211_is_rts>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0xfc,%edi
call   1030 <__cpu_to_le16@plt>
mov    %eax,%ebp
and    %ebx,%ebp
mov    $0xb4,%edi
call   1030 <__cpu_to_le16@plt>
xor    %ecx,%ecx
cmp    %eax,%ebp
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ieee80211_is_rts(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @__cpu_to_le16(i32 252)
%5 = and i32 %3, %4
%6 = call i32 @__cpu_to_le16(i32 180)
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ieee80211_is_rts(i32 %0) {
%2 = tail call i32 @__cpu_to_le16(i32 252)
%3 = and i32 %2, %0
%4 = tail call i32 @__cpu_to_le16(i32 180)
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
int main(int argc, char *argv[]) {
  printf("Hello %s\n", "world");
  __asm__ __volatile__("int %0" ::"g"(3));
  printf("Bye %s\n", "dude");
  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
lea    0xed6(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
int3
lea    0xecd(%rip),%rdi
lea    0xece(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [10 x i8] c"Hello %s\0A\00"
@.str.1 = [6 x i8] c"world\00"
@.str.2 = [8 x i8] c"Bye %s\0A\00"
@.str.3 = [5 x i8] c"dude\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 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"Hello %s\0A\00"
@.str.1 = [6 x i8] c"world\00"
@.str.2 = [8 x i8] c"Bye %s\0A\00"
@.str.3 = [5 x i8] c"dude\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
tail call void asm sideeffect "int $0", "imr,~{dirflag},~{fpsr},~{flags}"(i32 3)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}
int do_decal(int d, int s) {
  if (s)
    return d >> 1;
  else
    return d << 1;
}


x86 assembly (clang, -O0):
<do_decal>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1122 <do_decal+0x22>
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112b <do_decal+0x2b>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_decal>:
lea    (%rdi,%rdi,1),%eax
mov    %edi,%ecx
sar    %ecx
test   %esi,%esi
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @do_decal(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = ashr i32 %0, 1
%5 = shl i32 %0, 1
%6 = select i1 %3, i32 %5, i32 %4
ret i32 %6
}
/* Variables and functions */
int is_little_endian() {
  int i = 1;
  return (bool)(*(char *)&i);
}


x86 assembly (clang, -O0):
<is_little_endian>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
movsbl -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @is_little_endian() {
%1 = alloca i32
store i32 1, i32* %1
%2 = bitcast i32* %1 to i8*
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @is_little_endian() {
ret i32 1
}
void reset_buffert(void) {}


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

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

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

LLVM IR (-O2):
define void @reset_buffert() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ appendStringToArray(char const *, char ***, unsigned int *);
void addCodeLine(const char *newCodeLine, char ***codeLines,
                 unsigned *numLines) {
  appendStringToArray(newCodeLine, codeLines, numLines);
}


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

x86 assembly (clang, -O2):
<addCodeLine>:
jmp    1030 <appendStringToArray@plt>

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

LLVM IR (-O2):
define void @addCodeLine(i8* %0, i8*** %1, i32* %2) {
%4 = tail call i32 @appendStringToArray(i8* %0, i8*** %1, i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ util_alloc_file_components(char const *, char **,
                                              int /*<<< orphan*/ *,
                                              int /*<<< orphan*/ *);
char *util_split_alloc_dirname(const char *input_path) {
  char *path;
  util_alloc_file_components(input_path, &path, NULL, NULL);
  return path;
}


x86 assembly (clang, -O0):
<util_split_alloc_dirname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rdx
call   1030 <util_alloc_file_components@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_split_alloc_dirname>:
push   %rax
mov    %rsp,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <util_alloc_file_components@plt>
mov    (%rsp),%rax
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @util_split_alloc_dirname(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i32 @util_alloc_file_components(i8* %0, i8** %2, i32* null, i32* null)
%5 = load i8*, i8** %2
ret i8* %5
}
int rnd(n)
int n;
{ return (((rand() & 0x7FFF) % n)); }


x86 assembly (clang, -O0):
<rnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
and    $0x7fff,%eax
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rnd>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
and    $0x7fff,%eax
xor    %edx,%edx
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rnd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @rand()
%4 = and i32 %3, 32767
%5 = load i32, i32* %2
%6 = srem i32 %4, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @rnd(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = and i32 %2, 32767
%4 = srem i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  extern char *__progname;
  fprintf(stderr, "usage: %s [-al] [-Pprinter] [job# ...] [user ...]\n",
          __progname);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    0x2e9c(%rip),%rax
mov    (%rax),%rdx
lea    0xec2(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
mov    0x2e9f(%rip),%rax
mov    (%rax),%rdx
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [51 x i8] c"usage: %s [-al] [-Pprinter] [job# ...] [user ...]\0A\00"
@__progname = external global i8*
define void @usage() {
%1 = load i32, i32* @stderr
%2 = load i8*, i8** @__progname
%3 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [51 x i8] c"usage: %s [-al] [-Pprinter] [job# ...] [user ...]\0A\00"
@__progname = external global i8*
define void @usage() {
%1 = load i32, i32* @stderr
%2 = load i8*, i8** @__progname
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ __console_tx_hex8(int, unsigned char);
void print_warning_hex8(unsigned char value) { __console_tx_hex8(4, value); }


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

x86 assembly (clang, -O2):
<print_warning_hex8>:
mov    %edi,%esi
mov    $0x4,%edi
jmp    1030 <__console_tx_hex8@plt>

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

LLVM IR (-O2):
define void @print_warning_hex8(i8 zeroext %0) {
%2 = tail call i32 @__console_tx_hex8(i32 4, i8 zeroext %0)
ret void
}
/* Type definitions */
struct stat {
  int st_size;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void file__print_size_kb(struct stat *st) {
  printf("%4d ", (int)(st->st_size / 1024));
}


x86 assembly (clang, -O0):
<file__print_size_kb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    $0x400,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file__print_size_kb>:
mov    (%rdi),%eax
lea    0x3ff(%rax),%esi
test   %eax,%eax
cmovns %eax,%esi
sar    $0xa,%esi
lea    0xed9(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [5 x i8] c"%4d \00"
define void @file__print_size_kb(%struct.stat* %0) {
%2 = alloca %struct.stat*
store %struct.stat* %0, %struct.stat** %2
%3 = load %struct.stat*, %struct.stat** %2
%4 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = sdiv i32 %5, 1024
%7 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [5 x i8] c"%4d \00"
define void @file__print_size_kb(%struct.stat* nocapture %0) {
%2 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 1024
%5 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
int test_imm_4Bint64_midword_reg(long long val) {
  return ((val >> 16) & (0x4B << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_4Bint64_midword_reg>:
test   $0x4b0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_4Bint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 75
%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_4Bint64_midword_reg(i64 %0) {
%2 = and i64 %0, 4915200
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void f() { __builtin_types_compatible_p(int, int); }


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

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

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

LLVM IR (-O2):
define void @f() {
ret void
}
int w_quick_sort_int_compare(void *data, int index, void *b) {
  int *A = (int *)data;
  int *B = (int *)b;
  return A[index] - *B;
}


x86 assembly (clang, -O0):
<w_quick_sort_int_compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x28(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<w_quick_sort_int_compare>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%eax
sub    (%rdx),%eax
ret

LLVM IR (-O0):
define i32 @w_quick_sort_int_compare(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %7
%11 = load i8*, i8** %6
%12 = bitcast i8* %11 to i32*
store i32* %12, i32** %8
%13 = load i32*, i32** %7
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %8
%19 = load i32, i32* %18
%20 = sub nsw i32 %17, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @w_quick_sort_int_compare(i8* nocapture %0, i32 %1, i8* nocapture %2) {
%4 = bitcast i8* %0 to i32*
%5 = bitcast i8* %2 to i32*
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i32, i32* %4, i64 %6
%8 = load i32, i32* %7
%9 = load i32, i32* %5
%10 = sub nsw i32 %8, %9
ret i32 %10
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t sigma1(uint64_t x) {
  return (x >> 19 | x << 45) ^ (x >> 61 | x << 3) ^ (x >> 6);
}


x86 assembly (clang, -O0):
<sigma1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x13,%eax
mov    -0x4(%rbp),%edx
mov    $0x2d,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%edx
mov    $0x3d,%ecx
sar    %cl,%edx
mov    %edx,%ecx
mov    -0x4(%rbp),%edx
shl    $0x3,%edx
or     %edx,%ecx
xor    %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x6,%ecx
xor    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @sigma1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 19
%5 = load i32, i32* %2
%6 = shl i32 %5, 45
%7 = or i32 %4, %6
%8 = load i32, i32* %2
%9 = ashr i32 %8, 61
%10 = load i32, i32* %2
%11 = shl i32 %10, 3
%12 = or i32 %9, %11
%13 = xor i32 %7, %12
%14 = load i32, i32* %2
%15 = ashr i32 %14, 6
%16 = xor i32 %13, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @sigma1(i32 %0) {
ret i32 poison
}
/* Variables and functions */
scalar_t__ strlen(char *);
int IsDot(char *lps) {
  int flg = 0;
  int i = (int)strlen(lps);
  if (i) {
    if ((i == 1) && (*lps == '.')) {
      flg = 1;
    }
  }
  return flg;
}


x86 assembly (clang, -O0):
<IsDot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     115f <IsDot+0x4f>
cmpl   $0x1,-0x10(%rbp)
jne    115a <IsDot+0x4a>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    115a <IsDot+0x4a>
movl   $0x1,-0xc(%rbp)
jmp    115f <IsDot+0x4f>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsDot>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x1,%ecx
jne    112b <IsDot+0x1b>
xor    %eax,%eax
cmpb   $0x2e,(%rbx)
sete   %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @IsDot(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = trunc i64 %2 to i32
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i8, i8* %0
%7 = icmp eq i8 %6, 46
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %1
%10 = phi i32 [ 0, %1 ], [ %8, %5 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ tridiag_free();
int /*<<< orphan*/ tridiag_malloc(int);
int /*<<< orphan*/ tridiag_premalloc(double *, double *, double *, double *,
                                     double *, int);
void tridiag(double a[], double b[], double c[], double r[], double u[],
             int n) {
  tridiag_malloc(n);
  tridiag_premalloc(a, b, c, r, u, n);
  tridiag_free();
}


x86 assembly (clang, -O0):
<tridiag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x2c(%rbp),%edi
call   1050 <tridiag_malloc@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x2c(%rbp),%r9d
call   1030 <tridiag_premalloc@plt>
mov    $0x0,%al
call   1040 <tridiag_free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tridiag>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9d,%ebx
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdx,%r12
mov    %rsi,%r13
mov    %rdi,%rbp
mov    %r9d,%edi
call   1050 <tridiag_malloc@plt>
mov    %rbp,%rdi
mov    %r13,%rsi
mov    %r12,%rdx
mov    %r15,%rcx
mov    %r14,%r8
mov    %ebx,%r9d
call   1030 <tridiag_premalloc@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <tridiag_free@plt>

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

LLVM IR (-O2):
define void @tridiag(double* %0, double* %1, double* %2, double* %3, double* %4, i32 %5) {
%7 = tail call i32 @tridiag_malloc(i32 %5)
%8 = tail call i32 @tridiag_premalloc(double* %0, double* %1, double* %2, double* %3, double* %4, i32 %5)
%9 = tail call i32 (...) @tridiag_free()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ doit(float *, int *);
int /*<<< orphan*/ finalcostCost(float, int, float *);
int /*<<< orphan*/ second(float, int, float);
int main(int argc, char *argv[]) {
  float gallon = 0;
  int size = 0;
  float cost = 0;
  doit(&gallon, &size);
  finalcostCost(gallon, size, &cost);
  second(gallon, size, cost);
  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)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
lea    -0x14(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <doit@plt>
movss  -0x14(%rbp),%xmm0
mov    -0x18(%rbp),%edi
lea    -0x1c(%rbp),%rsi
call   1030 <finalcostCost@plt>
movss  -0x14(%rbp),%xmm0
mov    -0x18(%rbp),%edi
movss  -0x1c(%rbp),%xmm1
call   1050 <second@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movl   $0x0,0x10(%rsp)
movl   $0x0,0xc(%rsp)
movl   $0x0,0x14(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rsi
call   1040 <doit@plt>
movss  0x10(%rsp),%xmm0
mov    0xc(%rsp),%edi
lea    0x14(%rsp),%rsi
call   1030 <finalcostCost@plt>
movss  0x10(%rsp),%xmm0
mov    0xc(%rsp),%edi
movss  0x14(%rsp),%xmm1
call   1050 <second@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca float
%7 = alloca i32
%8 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store float 0.000000e+00, float* %6
store i32 0, i32* %7
store float 0.000000e+00, float* %8
%9 = call i32 @doit(float* %6, i32* %7)
%10 = load float, float* %6
%11 = load i32, i32* %7
%12 = call i32 @finalcostCost(float %10, i32 %11, float* %8)
%13 = load float, float* %6
%14 = load i32, i32* %7
%15 = load float, float* %8
%16 = call i32 @second(float %13, i32 %14, float %15)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca float
%4 = alloca i32
%5 = alloca float
%6 = bitcast float* %3 to i8*
store float 0.000000e+00, float* %3
%7 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%8 = bitcast float* %5 to i8*
store float 0.000000e+00, float* %5
%9 = call i32 @doit(float* %3, i32* %4)
%10 = load float, float* %3
%11 = load i32, i32* %4
%12 = call i32 @finalcostCost(float %10, i32 %11, float* %5)
%13 = load float, float* %3
%14 = load i32, i32* %4
%15 = load float, float* %5
%16 = call i32 @second(float %13, i32 %14, float %15)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M362_f(char *s) {
  debug("M362_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M362_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M362_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M362_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M362_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M362_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M362_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_lisp_comment() {
  test_parser_verify_parse(test_parser_sourcefile("lisp", " ;;; comment"),
                           "lisp", "", ";;; comment", 0);
}


x86 assembly (clang, -O0):
<test_lisp_comment>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed3(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xebd(%rip),%rdx
lea    0xeb8(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_lisp_comment>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xed6(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xec6(%rip),%rdx
lea    0xec1(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"lisp\00"
@.str.1 = [13 x i8] c" ;;; comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [12 x i8] c";;; comment\00"
define void @test_lisp_comment() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"lisp\00"
@.str.1 = [13 x i8] c" ;;; comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [12 x i8] c";;; comment\00"
define void @test_lisp_comment() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint64_t;

/* Variables and functions */
uint8_t BytePrefix(uint64_t sizelen) {
  uint8_t whatbyte;
  if (sizelen < 1024)
    whatbyte = 1;
  else if (sizelen < (1024 * 1024))
    whatbyte = 2;
  else if (sizelen < (1024 * 1024 * 1024))
    whatbyte = 3;
  else
    whatbyte = 4;
  return whatbyte;
}


x86 assembly (clang, -O0):
<BytePrefix>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x400,-0x4(%rbp)
jge    1120 <BytePrefix+0x20>
movl   $0x1,-0x8(%rbp)
jmp    1163 <BytePrefix+0x63>
cmpl   $0x100000,-0x4(%rbp)
jge    1139 <BytePrefix+0x39>
movl   $0x2,-0x8(%rbp)
jmp    115e <BytePrefix+0x5e>
cmpl   $0x40000000,-0x4(%rbp)
jge    1152 <BytePrefix+0x52>
movl   $0x3,-0x8(%rbp)
jmp    1159 <BytePrefix+0x59>
movl   $0x4,-0x8(%rbp)
jmp    115e <BytePrefix+0x5e>
jmp    1163 <BytePrefix+0x63>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BytePrefix>:
mov    $0x1,%eax
cmp    $0x400,%edi
jl     1128 <BytePrefix+0x28>
mov    $0x2,%eax
cmp    $0x100000,%edi
jb     1128 <BytePrefix+0x28>
cmp    $0x40000000,%edi
mov    $0x4,%eax
sbb    $0x0,%eax
ret

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

LLVM IR (-O2):
define i32 @BytePrefix(i32 %0) {
%2 = icmp slt i32 %0, 1024
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 1048576
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = icmp ult i32 %0, 1073741824
%7 = select i1 %6, i32 3, i32 4
br label %8
8: ; preds = %5, %3, %1
%9 = phi i32 [ 1, %1 ], [ 2, %3 ], [ %7, %5 ]
ret i32 %9
}
/* Variables and functions */
long generate_key(char *, int);
long int get_hash_key(char *string, int a, int b) {
  long int key = generate_key(string, 10011101);
  return (a * key + b) % 10011101;
}


x86 assembly (clang, -O0):
<get_hash_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x98c1dd,%esi
call   1030 <generate_key@plt>
mov    %rax,-0x18(%rbp)
movslq -0xc(%rbp),%rax
imul   -0x18(%rbp),%rax
movslq -0x10(%rbp),%rcx
add    %rcx,%rax
mov    $0x98c1dd,%ecx
cqto
idiv   %rcx
mov    %rdx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_hash_key>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
mov    $0x98c1dd,%esi
call   1030 <generate_key@plt>
mov    %rax,%rcx
movslq %ebp,%rax
imul   %rax,%rcx
movslq %ebx,%rax
add    %rax,%rcx
movabs $0xd6829ee41fbe8a05,%rdx
9e 82 d6
mov    %rcx,%rax
imul   %rdx
add    %rcx,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x17,%rdx
add    %rax,%rdx
imul   $0x98c1dd,%rdx,%rax
sub    %rax,%rcx
mov    %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i64 @get_hash_key(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = call i64 @generate_key(i8* %8, i32 10011101)
store i64 %9, i64* %7
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = load i64, i64* %7
%13 = mul nsw i64 %11, %12
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = add nsw i64 %13, %15
%17 = srem i64 %16, 10011101
ret i64 %17
}

LLVM IR (-O2):
define i64 @get_hash_key(i8* %0, i32 %1, i32 %2) {
%4 = tail call i64 @generate_key(i8* %0, i32 10011101)
%5 = sext i32 %1 to i64
%6 = mul nsw i64 %4, %5
%7 = sext i32 %2 to i64
%8 = add nsw i64 %6, %7
%9 = srem i64 %8, 10011101
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
char const *to_base64_ex(char const *, int /*<<< orphan*/);
const char *to_base64(const char *str) {
  return to_base64_ex(str, strlen(str));
}


x86 assembly (clang, -O0):
<to_base64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <to_base64_ex@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_base64>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <to_base64_ex@plt>

LLVM IR (-O0):
define i8* @to_base64(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i8* @to_base64_ex(i8* %3, i32 %5)
ret i8* %6
}

LLVM IR (-O2):
define i8* @to_base64(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i8* @to_base64_ex(i8* %0, i32 %2)
ret i8* %3
}
void index_to_xwy(long index, int width, int *x, int *y) {
  *x = (int)(index % width);
  *y = (int)(index / width);
}


x86 assembly (clang, -O0):
<index_to_xwy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cqto
idiv   %rcx
mov    %edx,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cqto
idiv   %rcx
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<index_to_xwy>:
mov    %rdx,%r8
mov    %rdi,%rax
movslq %esi,%rdi
mov    %rax,%rdx
or     %rdi,%rdx
shr    $0x20,%rdx
je     111c <index_to_xwy+0x1c>
cqto
idiv   %rdi
jmp    1120 <index_to_xwy+0x20>
xor    %edx,%edx
div    %esi
mov    %edx,(%r8)
mov    %eax,(%rcx)
ret

LLVM IR (-O0):
define void @index_to_xwy(i64 %0, i32 %1, i32* %2, i32* %3) {
%5 = alloca i64
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
store i64 %0, i64* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i64, i64* %5
%10 = load i32, i32* %6
%11 = sext i32 %10 to i64
%12 = srem i64 %9, %11
%13 = trunc i64 %12 to i32
%14 = load i32*, i32** %7
store i32 %13, i32* %14
%15 = load i64, i64* %5
%16 = load i32, i32* %6
%17 = sext i32 %16 to i64
%18 = sdiv i64 %15, %17
%19 = trunc i64 %18 to i32
%20 = load i32*, i32** %8
store i32 %19, i32* %20
ret void
}

LLVM IR (-O2):
define void @index_to_xwy(i64 %0, i32 %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3) {
%5 = sext i32 %1 to i64
%6 = srem i64 %0, %5
%7 = trunc i64 %6 to i32
store i32 %7, i32* %2
%8 = sdiv i64 %0, %5
%9 = trunc i64 %8 to i32
store i32 %9, i32* %3
ret void
}