xunge/DecIR huggingface dataset:
double pmax(double a, double b) {
  if (a > b) {
    return a;
  } else {
    return b;
  }
}


x86 assembly (clang, -O0):
<pmax>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    112d <pmax+0x2d>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1137 <pmax+0x37>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmax>:
maxsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @pmax(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
void func2(
    struct SS { int a; } x, struct SS y) {}


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

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

LLVM IR (-O0):
%struct.SS = type { i32 }
define void @func2(i32 %0, i32 %1) {
%3 = alloca %struct.SS
%4 = alloca %struct.SS
%5 = getelementptr inbounds %struct.SS, %struct.SS* %3, i32 0, i32 0
store i32 %0, i32* %5
%6 = getelementptr inbounds %struct.SS, %struct.SS* %4, i32 0, i32 0
store i32 %1, i32* %6
ret void
}

LLVM IR (-O2):
define void @func2(i32 %0, i32 %1) {
ret void
}
float test(float x, int Y) { return Y != 0 ?: x; }


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
mov    %al,%cl
and    $0x1,%cl
movzbl %cl,%ecx
mov    %ecx,-0xc(%rbp)
test   $0x1,%al
jne    112b <test+0x2b>
jmp    113c <test+0x3c>
mov    -0xc(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    1146 <test+0x46>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
test   %edi,%edi
je     110c <test+0xc>
movss  0xef4(%rip),%xmm0
ret

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

LLVM IR (-O2):
define float @test(float %0, i32 %1) {
%3 = icmp ne i32 %1, 0
%4 = uitofp i1 %3 to float
%5 = select i1 %3, float %4, float %0
ret float %5
}
/* Variables and functions */
float __rmod(float, float);
float tanf(float);
float __rtand(float x) {
  float circle = 360.0F;
  return tanf(.017453292519943295F * __rmod(x, circle));
}


x86 assembly (clang, -O0):
<__rtand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xecf(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1040 <__rmod@plt>
movaps %xmm0,%xmm1
movss  0xeac(%rip),%xmm0
mulss  %xmm1,%xmm0
call   1030 <tanf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__rtand>:
push   %rax
movss  0xed7(%rip),%xmm1
call   1040 <__rmod@plt>
mulss  0xece(%rip),%xmm0
pop    %rax
jmp    1030 <tanf@plt>

LLVM IR (-O0):
define float @__rtand(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
store float 3.600000e+02, float* %3
%4 = load float, float* %2
%5 = load float, float* %3
%6 = call float @__rmod(float %4, float %5)
%7 = fmul float 0x3F91DF46A0000000, %6
%8 = call float @tanf(float %7)
ret float %8
}

LLVM IR (-O2):
define float @__rtand(float %0) {
%2 = tail call float @__rmod(float %0, float 3.600000e+02)
%3 = fmul float %2, 0x3F91DF46A0000000
%4 = tail call float @tanf(float %3)
ret float %4
}
void rec(int *p) {
  int i;
  if (*p)
    return;
  else {
    (*p)++;
    i = (*p);
    p = &i;
    rec(p);
    return;
  }
}


x86 assembly (clang, -O0):
<rec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
je     112e <rec+0x1e>
jmp    1153 <rec+0x43>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <rec@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rec>:
push   %rax
cmpl   $0x0,(%rdi)
je     1118 <rec+0x8>
pop    %rax
ret
movl   $0x1,(%rdi)
movl   $0x1,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <rec@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @rec(i32* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* %0
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %0
store i32 1, i32* %2
br label %7
7: ; preds = %1, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ demostration();
int /*<<< orphan*/ endSettings();
int /*<<< orphan*/ init();
int main() {
  init();
  demostration();
  endSettings();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <init@plt>
mov    $0x0,%al
call   1050 <demostration@plt>
mov    $0x0,%al
call   1040 <endSettings@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <init@plt>
xor    %eax,%eax
call   1050 <demostration@plt>
xor    %eax,%eax
call   1040 <endSettings@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @init()
%3 = call i32 (...) @demostration()
%4 = call i32 (...) @endSettings()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @init()
%2 = tail call i32 (...) @demostration()
%3 = tail call i32 (...) @endSettings()
ret i32 0
}
const char *db_list_jelines_report_sql(void) {
  static const char *query = "SELECT"
                             "  id AS 'ID',"
                             "  je AS 'JE',"
                             "  account AS 'Account Number',"
                             "  amount AS 'Amount'"
                             "  FROM jelines"
                             "  ORDER BY id";
  return query;
}


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

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

LLVM IR (-O0):
@db_list_jelines_report_sql.query = internal global i8* getelementptr inbounds ([110 x i8], [110 x i8]* @.str, i32 0, i32 0)
@.str = [110 x i8] c"SELECT id AS 'ID', je AS 'JE', account AS 'Account Number', amount AS 'Amount' FROM jelines ORDER BY id\00"
define i8* @db_list_jelines_report_sql() {
%1 = load i8*, i8** @db_list_jelines_report_sql.query
ret i8* %1
}

LLVM IR (-O2):
@.str = [110 x i8] c"SELECT id AS 'ID', je AS 'JE', account AS 'Account Number', amount AS 'Amount' FROM jelines ORDER BY id\00"
define i8* @db_list_jelines_report_sql() {
ret i8* getelementptr inbounds ([110 x i8], [110 x i8]* @.str, i64 0, i64 0)
}
void gtk_file_selection_set_filename() {}


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

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

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

LLVM IR (-O2):
define void @gtk_file_selection_set_filename() {
ret void
}
/* Variables and functions */
double cos(double);
__attribute__((__weak__, __always___)) double softboundmpx_cos(double x) {
  return cos(x);
}


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

x86 assembly (clang, -O2):
<softboundmpx_cos>:
jmp    1030 <cos@plt>

LLVM IR (-O0):
define weak double @softboundmpx_cos(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @cos(double %3)
ret double %4
}

LLVM IR (-O2):
define weak double @softboundmpx_cos(double %0) {
%2 = tail call double @cos(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ byte_copy(char *, size_t, char const *);
size_t fmt_copybytes(char *dest, const char *src, size_t n) {
  byte_copy(dest, n, src);
  return n;
}


x86 assembly (clang, -O0):
<fmt_copybytes>:
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    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <byte_copy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmt_copybytes>:
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%rdx
mov    %rbx,%rsi
call   1030 <byte_copy@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @fmt_copybytes(i8* %0, i8* %1, i64 returned %2) {
%4 = tail call i32 @byte_copy(i8* %0, i64 %2, i8* %1)
ret i64 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
ssize_t __attribute__((always_))
trace_write(const char *buf __attribute__((unused)),
            size_t nbyte __attribute__((unused))) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @trace_write(i8* nocapture readnone %0, i64 %1) {
ret i32 0
}
void fc2b(x) _Atomic int x;
{}


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

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

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

LLVM IR (-O2):
define void @fc2b(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void isofield_free(void *input) {
  if (input) {
    free(input);
  }
}


x86 assembly (clang, -O0):
<isofield_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <isofield_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isofield_free>:
test   %rdi,%rdi
je     111a <isofield_free+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @isofield_free(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 %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @isofield_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int mputs(char **z) {
  for (int i = 0; z[i]; i++) {
    fputs(z[i], stdout);
  }
  return 0;
}


x86 assembly (clang, -O0):
<mputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     115e <mputs+0x4e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    0x2e97(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <mputs+0x13>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mputs>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1144 <mputs+0x34>
add    $0x8,%rbx
mov    0x2eb6(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    (%r14),%esi
call   1030 <fputs@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <mputs+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@stdout = global i32 0
define i32 @mputs(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %5
4: ; preds = %5, %1
ret i32 0
5: ; preds = %1, %5
%6 = phi i64 [ %10, %5 ], [ 0, %1 ]
%7 = phi i8* [ %12, %5 ], [ %2, %1 ]
%8 = load i32, i32* @stdout
%9 = tail call i32 @fputs(i8* %7, i32 %8)
%10 = add nuw i64 %6, 1
%11 = getelementptr inbounds i8*, i8** %0, i64 %10
%12 = load i8*, i8** %11
%13 = icmp eq i8* %12, null
br i1 %13, label %4, label %5
}
unsigned char setBit(unsigned char c, int n) { return c = c | (1 << n); }


x86 assembly (clang, -O0):
<setBit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %al,-0x1(%rbp)
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setBit>:
mov    %edi,%eax
bts    %esi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @setBit(i8 zeroext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i32, i32* %4
%8 = shl i32 1, %7
%9 = or i32 %6, %8
%10 = trunc i32 %9 to i8
store i8 %10, i8* %3
ret i8 %10
}

LLVM IR (-O2):
define zeroext i8 @setBit(i8 zeroext %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = trunc i32 %3 to i8
%5 = or i8 %4, %0
ret i8 %5
}
/* Variables and functions */
int partition(int *, int, int);
void quick_sort_internal(int *array, int low, int high) {
  if (low < high) {
    int mid = partition(array, low, high);
    quick_sort_internal(array, low, mid - 1);
    quick_sort_internal(array, mid + 1, high);
  }
}


x86 assembly (clang, -O0):
<quick_sort_internal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <quick_sort_internal+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1030 <quick_sort_internal@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1030 <quick_sort_internal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick_sort_internal>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quick_sort_internal+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1040 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1030 <quick_sort_internal@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quick_sort_internal+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quick_sort_internal(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quick_sort_internal(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
int test_imm_2Aint64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x2A << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_2Aint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 180388626432
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int _evbuffer_testing_use_mmap(void) {
  int ok = 0;
  return ok;
}


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

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

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

LLVM IR (-O2):
define i32 @_evbuffer_testing_use_mmap() {
ret i32 0
}
int theproblem_set_myid(void) {
  int group_by_node_set_myid(int n1tile, int n2tile, int n3tile);
  int retval;
  retval = 0;
  return (retval);
}


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

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

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

LLVM IR (-O2):
define i32 @theproblem_set_myid() {
ret i32 0
}
void _infix_operator_minus_i16_i16(signed short lhs, signed short rhs,
                                   signed short *__rval_1) {
  *__rval_1 = lhs - rhs;
}


x86 assembly (clang, -O0):
<_infix_operator_minus_i16_i16>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    %rdx,-0x10(%rbp)
movswl -0x2(%rbp),%eax
movswl -0x4(%rbp),%ecx
sub    %ecx,%eax
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_infix_operator_minus_i16_i16>:
sub    %esi,%edi
mov    %di,(%rdx)
ret

LLVM IR (-O0):
define void @_infix_operator_minus_i16_i16(i16 signext %0, i16 signext %1, i16* %2) {
%4 = alloca i16
%5 = alloca i16
%6 = alloca i16*
store i16 %0, i16* %4
store i16 %1, i16* %5
store i16* %2, i16** %6
%7 = load i16, i16* %4
%8 = sext i16 %7 to i32
%9 = load i16, i16* %5
%10 = sext i16 %9 to i32
%11 = sub nsw i32 %8, %10
%12 = trunc i32 %11 to i16
%13 = load i16*, i16** %6
store i16 %12, i16* %13
ret void
}

LLVM IR (-O2):
define void @_infix_operator_minus_i16_i16(i16 signext %0, i16 signext %1, i16* nocapture writeonly %2) {
%4 = sub i16 %0, %1
store i16 %4, i16* %2
ret void
}
/* Type definitions */
struct option {
  int dummy;
};

/* Variables and functions */
int _getopt_internal(int, char **, char const *, struct option const *, int *,
                     int);
int my_getopt_long_only(int argc, char *argv[], const char *shortopts,
                        const struct option *longopts, int *longind) {
  return _getopt_internal(argc, argv, shortopts, longopts, longind, 1);
}


x86 assembly (clang, -O0):
<my_getopt_long_only>:
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    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    $0x1,%r9d
call   1030 <_getopt_internal@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_getopt_long_only>:
mov    $0x1,%r9d
jmp    1030 <_getopt_internal@plt>

LLVM IR (-O0):
%struct.option = type { i32 }
define i32 @my_getopt_long_only(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8*
%9 = alloca %struct.option*
%10 = alloca i32*
store i32 %0, i32* %6
store i8** %1, i8*** %7
store i8* %2, i8** %8
store %struct.option* %3, %struct.option** %9
store i32* %4, i32** %10
%11 = load i32, i32* %6
%12 = load i8**, i8*** %7
%13 = load i8*, i8** %8
%14 = load %struct.option*, %struct.option** %9
%15 = load i32*, i32** %10
%16 = call i32 @_getopt_internal(i32 %11, i8** %12, i8* %13, %struct.option* %14, i32* %15, i32 1)
ret i32 %16
}

LLVM IR (-O2):
%struct.option = type { i32 }
define i32 @my_getopt_long_only(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4) {
%6 = tail call i32 @_getopt_internal(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4, i32 1)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ *strstr(char *, char *);
int GprsStateIsReceived(const unsigned char *rcvbuf) {
  if (strstr((char *)rcvbuf, "$MYURCREAD:") != NULL) {
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<GprsStateIsReceived>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strstr@plt>
cmp    $0x0,%rax
je     1142 <GprsStateIsReceived+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1149 <GprsStateIsReceived+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GprsStateIsReceived>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strstr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"$MYURCREAD:\00"
define i32 @GprsStateIsReceived(i8* %0) {
%2 = tail call i32* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i32* %2, null
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ my_strcpy(char *, char const *);
int my_strlen(char *);
char *my_strcat(char *restrict dest, const char *restrict src) {
  my_strcpy(dest + my_strlen(dest), src);
  return dest;
}


x86 assembly (clang, -O0):
<my_strcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <my_strlen@plt>
mov    -0x18(%rbp),%rdi
cltq
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
call   1040 <my_strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strcat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <my_strlen@plt>
movslq %eax,%rdi
add    %rbx,%rdi
mov    %r14,%rsi
call   1040 <my_strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @my_strcat(i8* noalias %0, i8* noalias %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @my_strlen(i8* %6)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = load i8*, i8** %4
%11 = call i32 @my_strcpy(i8* %9, i8* %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define i8* @my_strcat(i8* noalias returned %0, i8* noalias %1) {
%3 = tail call i32 @my_strlen(i8* %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = tail call i32 @my_strcpy(i8* %5, i8* %1)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *, char *);
int /*<<< orphan*/ stdout;
char *strerror(int /*<<< orphan*/);
void perror_exit(const char *str) {
  printf("%s: %s\n", str, strerror(errno));
  fflush(stdout);
  exit(1);
}


x86 assembly (clang, -O0):
<perror_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
mov    -0x10(%rbp),%rsi
mov    %rax,%rdx
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e5c(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<perror_exit>:
push   %rbx
mov    %rdi,%rbx
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
lea    0xea7(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1030 <printf@plt>
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
@stdout = global i32 0
define void @perror_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @errno
%5 = call i8* @strerror(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %5)
%7 = load i32, i32* @stdout
%8 = call i32 @fflush(i32 %7)
%9 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
@stdout = global i32 0
define void @perror_exit(i8* %0) {
%2 = load i32, i32* @errno
%3 = tail call i8* @strerror(i32 %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %3)
%5 = load i32, i32* @stdout
%6 = tail call i32 @fflush(i32 %5)
%7 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int64_t;

/* Variables and functions */
int /*<<< orphan*/ kore_accesslog_gather(void *, int /*<<< orphan*/, int);
void kore_accesslog_run(void *arg, u_int64_t now) {
  static int ticks = 0;
  kore_accesslog_gather(arg, now, ticks++ % 100 ? 0 : 1);
}


x86 assembly (clang, -O0):
<kore_accesslog_run>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    0x2f00(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2ef5(%rip)
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    $0x1,%edx
xor    %eax,%eax
cmp    $0x0,%ecx
cmovne %eax,%edx
call   1030 <kore_accesslog_gather@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kore_accesslog_run>:
mov    0x2f16(%rip),%eax
lea    0x1(%rax),%ecx
imul   $0xc28f5c29,%eax,%eax
add    $0x51eb850,%eax
ror    $0x2,%eax
mov    %ecx,0x2eff(%rip)
xor    %edx,%edx
cmp    $0x28f5c29,%eax
setb   %dl
jmp    1030 <kore_accesslog_gather@plt>

LLVM IR (-O0):
@kore_accesslog_run.ticks = internal global i32 0
define void @kore_accesslog_run(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = load i32, i32* @kore_accesslog_run.ticks
%8 = add nsw i32 %7, 1
store i32 %8, i32* @kore_accesslog_run.ticks
%9 = srem i32 %7, 100
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i64
%12 = select i1 %10, i32 0, i32 1
%13 = call i32 @kore_accesslog_gather(i8* %5, i32 %6, i32 %12)
ret void
}

LLVM IR (-O2):
@kore_accesslog_run.ticks = internal unnamed_addr global i32 0
define void @kore_accesslog_run(i8* %0, i32 %1) {
%3 = load i32, i32* @kore_accesslog_run.ticks
%4 = add nsw i32 %3, 1
store i32 %4, i32* @kore_accesslog_run.ticks
%5 = srem i32 %3, 100
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
%8 = tail call i32 @kore_accesslog_gather(i8* %0, i32 %1, i32 %7)
ret void
}
vdrpxi() {}


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

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

LLVM IR (-O0):
define i32 @vdrpxi() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @vdrpxi() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
void testElemRegion2(int **pp) {
  int *p = malloc(12);
  *pp = p;
  free(pp[0]);
}


x86 assembly (clang, -O0):
<testElemRegion2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xc,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testElemRegion2>:
push   %rbx
mov    %rdi,%rbx
mov    $0xc,%edi
call   1040 <malloc@plt>
mov    %rax,(%rbx)
mov    %rax,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @testElemRegion2(i32** %0) {
%2 = alloca i32**
%3 = alloca i32*
store i32** %0, i32*** %2
%4 = call i32* @malloc(i32 12)
store i32* %4, i32** %3
%5 = load i32*, i32** %3
%6 = load i32**, i32*** %2
store i32* %5, i32** %6
%7 = load i32**, i32*** %2
%8 = getelementptr inbounds i32*, i32** %7, i64 0
%9 = load i32*, i32** %8
%10 = call i32 @free(i32* %9)
ret void
}

LLVM IR (-O2):
define void @testElemRegion2(i32** nocapture writeonly %0) {
%2 = tail call i32* @malloc(i32 12)
store i32* %2, i32** %0
%3 = tail call i32 @free(i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_case();
int main(int argc, char *argv[]) {
  (void)argc;
  (void)argv;
  test_case();
  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)
mov    $0x0,%al
call   1030 <test_case@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 (...) @test_case()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_case()
ret i32 0
}
/* Variables and functions */
scalar_t__ getenv(char *);
const char *CONFIG_prefix(void) { return getenv("CONFIG_") ?: "CONFIG_"; }


x86 assembly (clang, -O0):
<CONFIG_prefix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
je     113f <CONFIG_prefix+0x2f>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    114f <CONFIG_prefix+0x3f>
lea    0xeba(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    114f <CONFIG_prefix+0x3f>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CONFIG_prefix>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <getenv@plt>
test   %rax,%rax
cmove  %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"CONFIG_\00"
define i8* @CONFIG_prefix() {
%1 = call i64 @getenv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = inttoptr i64 %1 to i8*
br label %6
5: ; preds = %0
br label %6
6: ; preds = %5, %3
%7 = phi i8* [ %4, %3 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), %5 ]
ret i8* %7
}

LLVM IR (-O2):
@.str = [8 x i8] c"CONFIG_\00"
define i8* @CONFIG_prefix() {
%1 = tail call i64 @getenv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
%3 = inttoptr i64 %1 to i8*
%4 = select i1 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int skip2thingamy(int /*<<< orphan*/ *, char *);
int skip2fontheader(FILE *pcl) { return (skip2thingamy(pcl, ")s")); }


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

x86 assembly (clang, -O2):
<skip2fontheader>:
lea    0xee9(%rip),%rsi
jmp    1030 <skip2thingamy@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c")s\00"
define i32 @skip2fontheader(i32* %0) {
%2 = tail call i32 @skip2thingamy(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
void sanb_smp_load_memory_barrier(void) { asm volatile("lfence" ::: "memory"); }


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

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

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

LLVM IR (-O2):
define void @sanb_smp_load_memory_barrier() {
tail call void asm sideeffect "lfence", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ interpret(int);
void interpret_resume() { interpret(-1); }


x86 assembly (clang, -O0):
<interpret_resume>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%edi
call   1030 <interpret@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<interpret_resume>:
mov    $0xffffffff,%edi
jmp    1030 <interpret@plt>

LLVM IR (-O0):
define void @interpret_resume() {
%1 = call i32 @interpret(i32 -1)
ret void
}

LLVM IR (-O2):
define void @interpret_resume() {
%1 = tail call i32 @interpret(i32 -1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __NR_fdatasync;
int syscall(int /*<<< orphan*/, int);
int fdatasync(int fd) { return syscall(__NR_fdatasync, fd); }


x86 assembly (clang, -O0):
<fdatasync>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdatasync>:
mov    %edi,%esi
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@__NR_fdatasync = global i32 0
define i32 @fdatasync(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @__NR_fdatasync
%4 = load i32, i32* %2
%5 = call i32 @syscall(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@__NR_fdatasync = global i32 0
define i32 @fdatasync(i32 %0) {
%2 = load i32, i32* @__NR_fdatasync
%3 = tail call i32 @syscall(i32 %2, i32 %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main() { printf("\nHello World!"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"\0AHello World!\00"
define void @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"\0AHello World!\00"
define void @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
int ia_end_record(struct iarchive *ia, const char *tag) { return 0; }


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

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

LLVM IR (-O0):
%struct.iarchive = type opaque
define i32 @ia_end_record(%struct.iarchive* %0, i8* %1) {
%3 = alloca %struct.iarchive*
%4 = alloca i8*
store %struct.iarchive* %0, %struct.iarchive** %3
store i8* %1, i8** %4
ret i32 0
}

LLVM IR (-O2):
%struct.iarchive = type opaque
define i32 @ia_end_record(%struct.iarchive* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ ch;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(unsigned short *, int, int, int /*<<< orphan*/ *);
void gen_cjk(FILE *fp) {
  unsigned short ch = 0;
  for (ch = 0x4E00; ch <= 0x9FA5; ch++) {
    fwrite(&ch, sizeof(ch), 1, fp);
  }
  return;
}


x86 assembly (clang, -O0):
<gen_cjk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movw   $0x0,-0xa(%rbp)
movw   $0x4e00,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
cmp    $0x9fa5,%eax
jg     115f <gen_cjk+0x4f>
mov    -0x8(%rbp),%rcx
lea    -0xa(%rbp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
mov    -0xa(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0xa(%rbp)
jmp    1128 <gen_cjk+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_cjk>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movw   $0x4e00,0x6(%rsp)
lea    0x6(%rsp),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
movzwl 0x6(%rsp),%eax
add    $0x1,%eax
mov    %ax,0x6(%rsp)
movzwl %ax,%eax
cmp    $0x9fa6,%eax
jb     1130 <gen_cjk+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @gen_cjk(i32* %0) {
%2 = alloca i32*
%3 = alloca i16
store i32* %0, i32** %2
store i16 0, i16* %3
store i16 19968, i16* %3
br label %4
4: ; preds = %11, %1
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = icmp sle i32 %6, 40869
br i1 %7, label %8, label %14
8: ; preds = %4
%9 = load i32*, i32** %2
%10 = call i32 @fwrite(i16* %3, i32 2, i32 1, i32* %9)
br label %11
11: ; preds = %8
%12 = load i16, i16* %3
%13 = add i16 %12, 1
store i16 %13, i16* %3
br label %4
14: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @gen_cjk(i32* nocapture %0) {
%2 = alloca i16
%3 = bitcast i16* %2 to i8*
store i16 19968, i16* %2
br label %4
4: ; preds = %1, %4
%5 = call i32 @fwrite(i16* %2, i32 2, i32 1, i32* %0)
%6 = load i16, i16* %2
%7 = add i16 %6, 1
store i16 %7, i16* %2
%8 = icmp ult i16 %7, -24666
br i1 %8, label %4, label %9
9: ; preds = %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ nasm_error(int, char *, char const *, char const *, int);
void __attribute__((noreturn))
nasm_assert_failed(const char *file, int line, const char *msg) {
  nasm_error(0x00000002, "assertion %s failed at %s:%d", msg, file, line);
  exit(1);
}


x86 assembly (clang, -O0):
<nasm_assert_failed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%r8d
mov    $0x2,%edi
lea    0xeb5(%rip),%rsi
call   1030 <nasm_error@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<nasm_assert_failed>:
push   %rax
mov    %esi,%r8d
mov    %rdi,%rcx
lea    0xed2(%rip),%rsi
mov    $0x2,%edi
call   1030 <nasm_error@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"assertion %s failed at %s:%d\00"
define void @nasm_assert_failed(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = call i32 @nasm_error(i32 2, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8, i32 %9)
%11 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [29 x i8] c"assertion %s failed at %s:%d\00"
define void @nasm_assert_failed(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @nasm_error(i32 2, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %0, i32 %1)
%5 = tail call i32 @exit(i32 1)
unreachable
}
void I422ToRGB24Row_Any_NEON() {}


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

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

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

LLVM IR (-O2):
define void @I422ToRGB24Row_Any_NEON() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(int);
void ft_putnbr(int nb) {
  if (nb >= 10)
    ft_putnbr(nb / 10);
  ft_putchar((nb % 10) + '0');
}


x86 assembly (clang, -O0):
<ft_putnbr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jl     1147 <ft_putnbr+0x27>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <ft_putnbr@plt>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x30,%edi
call   1030 <ft_putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putnbr>:
push   %rbx
mov    %edi,%ebx
cmp    $0xa,%edi
jl     113c <ft_putnbr+0x1c>
mov    %ebx,%eax
mov    $0xcccccccd,%edi
imul   %rax,%rdi
shr    $0x23,%rdi
call   1040 <ft_putnbr@plt>
movslq %ebx,%rax
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
neg    %eax
lea    (%rbx,%rax,1),%edi
add    $0x30,%edi
pop    %rbx
jmp    1030 <ft_putchar@plt>

LLVM IR (-O0):
define void @ft_putnbr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 10
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sdiv i32 %6, 10
br label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = srem i32 %9, 10
%11 = add nsw i32 %10, 48
%12 = call i32 @ft_putchar(i32 %11)
ret void
}

LLVM IR (-O2):
define void @ft_putnbr(i32 %0) {
%2 = icmp sgt i32 %0, 9
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = udiv i32 %0, 10
tail call void @ft_putnbr(i32 %4)
br label %5
5: ; preds = %3, %1
%6 = srem i32 %0, 10
%7 = add nsw i32 %6, 48
%8 = tail call i32 @ft_putchar(i32 %7)
ret void
}
reply(ok) {
  if (!ok)
    _halt_(0xbad);
}


x86 assembly (clang, -O0):
<reply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <reply+0x21>
mov    $0xbad,%edi
mov    $0x0,%al
call   1030 <_halt_@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reply>:
test   %edi,%edi
je     1115 <reply+0x5>
ret
push   %rax
mov    $0xbad,%edi
xor    %eax,%eax
call   1030 <_halt_@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @reply(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @_halt_ to i32 (i32, ...)*)(i32 2989)
br label %5
5: ; preds = %3, %1
ret i32 undef
}
double Mega(double a_fVal) { return a_fVal * 1.0e6; }


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

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

LLVM IR (-O0):
define double @Mega(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 1.000000e+06
ret double %4
}

LLVM IR (-O2):
define double @Mega(double %0) {
%2 = fmul double %0, 1.000000e+06
ret double %2
}
int ml_lcm(int n1, int n2) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ml_lcm(i32 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
scalar_t__ nrf_drv_usbd_errata_type_52840_proto1();
bool nrf_drv_usbd_errata_104(void) {
  return 1 && nrf_drv_usbd_errata_type_52840_proto1();
}


x86 assembly (clang, -O0):
<nrf_drv_usbd_errata_104>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <nrf_drv_usbd_errata_type_52840_proto1@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrf_drv_usbd_errata_104>:
push   %rax
xor    %eax,%eax
call   1030 <nrf_drv_usbd_errata_type_52840_proto1@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @nrf_drv_usbd_errata_104() {
%1 = call i64 (...) @nrf_drv_usbd_errata_type_52840_proto1()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @nrf_drv_usbd_errata_104() {
%1 = tail call i64 (...) @nrf_drv_usbd_errata_type_52840_proto1()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}