xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ test_from_stdin();
int main(int argc, char **argv) {
  (void)argc;
  (void)argv;
  test_from_stdin();
  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_from_stdin@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_from_stdin@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_from_stdin()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_from_stdin()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int change_x() {
  int x = 10;
  int *px;
  px = &x;
  x = 20;
  printf("*px = %d\n", *px);
}


x86 assembly (clang, -O0):
<change_x>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x14,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<change_x>:
lea    0xee9(%rip),%rdi
mov    $0x14,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"*px = %d\0A\00"
define i32 @change_x() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 20)
ret i32 undef
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
__attribute__((always_)) int is_dataop_coproc(uint32_t op) {
  return !((op & 0x0F000010) ^ 0x0E000000);
}


x86 assembly (clang, -O0):
<is_dataop_coproc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf000010,%eax
xor    $0xe000000,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_dataop_coproc>:
and    $0xf000010,%edi
xor    %eax,%eax
cmp    $0xe000000,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @is_dataop_coproc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 251658256
%5 = xor i32 %4, 234881024
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_dataop_coproc(i32 %0) {
%2 = and i32 %0, 251658256
%3 = icmp eq i32 %2, 234881024
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
typedef int /*<<< orphan*/ ASN1_TIME;

/* Variables and functions */
int /*<<< orphan*/ *X509_time_adj_ex(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                     long, int /*<<< orphan*/ *);
ASN1_TIME *X509_time_adj(ASN1_TIME *s, long offset_sec, time_t *in_time) {
  return X509_time_adj_ex(s, 0, offset_sec, in_time);
}


x86 assembly (clang, -O0):
<X509_time_adj>:
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),%rdx
mov    -0x18(%rbp),%rcx
xor    %esi,%esi
call   1030 <X509_time_adj_ex@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<X509_time_adj>:
mov    %rdx,%rcx
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <X509_time_adj_ex@plt>

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

LLVM IR (-O2):
define i32* @X509_time_adj(i32* %0, i64 %1, i32* %2) {
%4 = tail call i32* @X509_time_adj_ex(i32* %0, i32 0, i64 %1, i32* %2)
ret i32* %4
}
/* Variables and functions */
int /*<<< orphan*/ newline();
int /*<<< orphan*/ output_label_name(char *);
int /*<<< orphan*/ output_label_terminator();
void glabel(char *lab) {
  output_label_name(lab);
  output_label_terminator();
  newline();
}


x86 assembly (clang, -O0):
<glabel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <output_label_name@plt>
mov    $0x0,%al
call   1050 <output_label_terminator@plt>
mov    $0x0,%al
call   1030 <newline@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glabel>:
push   %rax
call   1040 <output_label_name@plt>
xor    %eax,%eax
call   1050 <output_label_terminator@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <newline@plt>

LLVM IR (-O0):
define void @glabel(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @output_label_name(i8* %3)
%5 = call i32 (...) @output_label_terminator()
%6 = call i32 (...) @newline()
ret void
}

LLVM IR (-O2):
define void @glabel(i8* %0) {
%2 = tail call i32 @output_label_name(i8* %0)
%3 = tail call i32 (...) @output_label_terminator()
%4 = tail call i32 (...) @newline()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
int x28_setup() {
  char cmd[256];
  sprintf(cmd,
          "iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags "
          "SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d",
          1);
  system(cmd);
  return 0;
}


x86 assembly (clang, -O0):
<x28_setup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x1,%edx
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x28_setup>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [106 x i8] c"iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x28_setup() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @system(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [106 x i8] c"iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x28_setup() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @system(i8* %2)
ret i32 0
}
/* Variables and functions */
int errno;
int idrnet_errno() { return errno; }


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

x86 assembly (clang, -O2):
<idrnet_errno>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @idrnet_errno() {
%1 = load i32, i32* @errno
ret i32 %1
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @idrnet_errno() {
%1 = load i32, i32* @errno
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, size_t, char *, float const);
bool cutils_cdar_DynamicArray_float_format(const float *i, char **b,
                                           size_t *s) {
  snprintf(*b, *s, "%ff", *i);
  return true;
}


x86 assembly (clang, -O0):
<cutils_cdar_DynamicArray_float_format>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
lea    0xebf(%rip),%rdx
call   1030 <snprintf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cutils_cdar_DynamicArray_float_format>:
push   %rax
mov    (%rsi),%rax
mov    (%rdx),%rsi
movss  (%rdi),%xmm0
lea    0xede(%rip),%rdx
mov    %rax,%rdi
call   1030 <snprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%ff\00"
define i32 @cutils_cdar_DynamicArray_float_format(float* nocapture %0, i8** nocapture %1, i64* nocapture %2) {
%4 = load i8*, i8** %1
%5 = load i64, i64* %2
%6 = load float, float* %0
%7 = tail call i32 @snprintf(i8* %4, i64 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %6)
ret i32 1
}
float gb_copy_sign(float x, float y) {
  int ix, iy;
  ix = *(int *)&x;
  iy = *(int *)&y;
  ix &= 0x7fffffff;
  ix |= iy & 0x80000000;
  return *(float *)&ix;
}


x86 assembly (clang, -O0):
<gb_copy_sign>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    $0x7fffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
and    $0x80000000,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<gb_copy_sign>:
movd   %xmm0,%eax
movmskps %xmm1,%ecx
shl    $0x1f,%ecx
and    $0x7fffffff,%eax
or     %ecx,%eax
movd   %eax,%xmm0
ret

LLVM IR (-O0):
define float @gb_copy_sign(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca i32
%6 = alloca i32
store float %0, float* %3
store float %1, float* %4
%7 = bitcast float* %3 to i32*
%8 = load i32, i32* %7
store i32 %8, i32* %5
%9 = bitcast float* %4 to i32*
%10 = load i32, i32* %9
store i32 %10, i32* %6
%11 = load i32, i32* %5
%12 = and i32 %11, 2147483647
store i32 %12, i32* %5
%13 = load i32, i32* %6
%14 = and i32 %13, -2147483648
%15 = load i32, i32* %5
%16 = or i32 %15, %14
store i32 %16, i32* %5
%17 = bitcast i32* %5 to float*
%18 = load float, float* %17
ret float %18
}

LLVM IR (-O2):
define float @gb_copy_sign(float %0, float %1) {
%3 = bitcast float %0 to i32
%4 = bitcast float %1 to i32
%5 = and i32 %3, 2147483647
%6 = and i32 %4, -2147483648
%7 = or i32 %6, %5
%8 = bitcast i32 %7 to float
ret float %8
}
/* Variables and functions */
long __strtol_internal(char const *, char **, int, int /*<<< orphan*/);
long int strtol(const char *nptr, char **endptr, int base) {
  return __strtol_internal(nptr, endptr, base, 0);
}


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

x86 assembly (clang, -O2):
<strtol>:
xor    %ecx,%ecx
jmp    1030 <__strtol_internal@plt>

LLVM IR (-O0):
define i64 @strtol(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 i64 @__strtol_internal(i8* %7, i8** %8, i32 %9, i32 0)
ret i64 %10
}

LLVM IR (-O2):
define i64 @strtol(i8* %0, i8** %1, i32 %2) {
%4 = tail call i64 @__strtol_internal(i8* %0, i8** %1, i32 %2, i32 0)
ret i64 %4
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int height;
};
typedef TYPE_1__ XConfigureRequestEvent;

/* Variables and functions */
void set_XConfigureRequestEvent_height(void *_p, int _v) {
  ((XConfigureRequestEvent *)_p)->height = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XConfigureRequestEvent_height>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XConfigureRequestEvent_height(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
f_get_my_resident_time(int *wu, int *wh, int *ws) {
  char *hostname;
  *wu = 0;
  *wh = 1800;
  *ws = 1800;
}


x86 assembly (clang, -O0):
<f_get_my_resident_time>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x708,(%rax)
mov    -0x20(%rbp),%rax
movl   $0x708,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_get_my_resident_time>:
movl   $0x0,(%rdi)
movl   $0x708,(%rsi)
movl   $0x708,(%rdx)
ret

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

LLVM IR (-O2):
define i32 @f_get_my_resident_time(i32* nocapture writeonly %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
store i32 0, i32* %0
store i32 1800, i32* %1
store i32 1800, i32* %2
ret i32 undef
}
void ff_hevc_put_hevc_uni_qpel_hv32_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_qpel_hv32_12_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ABDAY_7;
char *nl_langinfo(int /*<<< orphan*/);
char *langinfo_abday_7() { return nl_langinfo(ABDAY_7); }


x86 assembly (clang, -O0):
<langinfo_abday_7>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <nl_langinfo@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<langinfo_abday_7>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <nl_langinfo@plt>

LLVM IR (-O0):
@ABDAY_7 = global i32 0
define i8* @langinfo_abday_7() {
%1 = load i32, i32* @ABDAY_7
%2 = call i8* @nl_langinfo(i32 %1)
ret i8* %2
}

LLVM IR (-O2):
@ABDAY_7 = global i32 0
define i8* @langinfo_abday_7() {
%1 = load i32, i32* @ABDAY_7
%2 = tail call i8* @nl_langinfo(i32 %1)
ret i8* %2
}
float call_maxf(float a, float b) { return ((a) > (b) ? (a) : (b)); }


x86 assembly (clang, -O0):
<call_maxf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    112c <call_maxf+0x2c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1136 <call_maxf+0x36>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_maxf>:
maxss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @call_maxf(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void app_callback() { printf("Timeout\n"); }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"Timeout\0A\00"
define void @app_callback() {
%1 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [8 x i8] c"Timeout\00"
define void @app_callback() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}
int slen(char *s) {
  int i = 0;
  while (s[i]) {
    i++;
  }
  return i;
}


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

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

LLVM IR (-O0):
define i32 @slen(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %11, %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, 0
br i1 %10, label %11, label %14
11: ; preds = %4
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %4
14: ; preds = %4
%15 = load i32, i32* %3
ret i32 %15
}

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


x86 assembly (clang, -O0):
<monitor_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <monitor_write+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <monitor_put@plt>
jmp    111c <monitor_write+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<monitor_write>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <monitor_write+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <monitor_put@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <monitor_write+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @monitor_write(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @monitor_put(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
void ExttRadacctMonthAuxTable(void) {}


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

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

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

LLVM IR (-O2):
define void @ExttRadacctMonthAuxTable() {
ret void
}
/* Variables and functions */
int _exit() { return 0; }


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

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @_exit() {
%1 = alloca i32
store i32 0, i32* %1
unreachable
}

LLVM IR (-O2):
void gensll() {}


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

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

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

LLVM IR (-O2):
define void @gensll() {
ret void
}
/* Variables and functions */
scalar_t__ test(unsigned char *, int);
int is_gc(unsigned char *seq, int n) {
  int ndx = n * 2;
  if (test(seq, ndx) != test(seq, ndx + 1))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_gc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%esi
call   1030 <test@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%esi
add    $0x1,%esi
call   1030 <test@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
je     1163 <is_gc+0x53>
movl   $0x1,-0x4(%rbp)
jmp    116a <is_gc+0x5a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_gc>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %rdi,%r14
lea    (%rbx,%rbx,1),%esi
call   1030 <test@plt>
mov    %rax,%r15
lea    (%rbx,%rbx,1),%esi
add    $0x1,%esi
mov    %r14,%rdi
call   1030 <test@plt>
xor    %ecx,%ecx
cmp    %rax,%r15
setne  %cl
mov    %ecx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @is_gc(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = mul nsw i32 %7, 2
store i32 %8, i32* %6
%9 = load i8*, i8** %4
%10 = load i32, i32* %6
%11 = call i64 @test(i8* %9, i32 %10)
%12 = load i8*, i8** %4
%13 = load i32, i32* %6
%14 = add nsw i32 %13, 1
%15 = call i64 @test(i8* %12, i32 %14)
%16 = icmp ne i64 %11, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 1, i32* %3
br label %19
18: ; preds = %2
store i32 0, i32* %3
br label %19
19: ; preds = %18, %17
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @is_gc(i8* %0, i32 %1) {
%3 = shl nsw i32 %1, 1
%4 = tail call i64 @test(i8* %0, i32 %3)
%5 = or i32 %3, 1
%6 = tail call i64 @test(i8* %0, i32 %5)
%7 = icmp ne i64 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ insertion_sort_sub(int *, int /*<<< orphan*/, int);
void insertion_sort(register int a[], register int length) {
  insertion_sort_sub(a, 0, length);
}


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

x86 assembly (clang, -O2):
<insertion_sort>:
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <insertion_sort_sub@plt>

LLVM IR (-O0):
define void @insertion_sort(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = call i32 @insertion_sort_sub(i32* %5, i32 0, i32 %6)
ret void
}

LLVM IR (-O2):
define void @insertion_sort(i32* %0, i32 %1) {
%3 = tail call i32 @insertion_sort_sub(i32* %0, i32 0, i32 %1)
ret void
}
int ft_uporlow(int c) {
  if (c >= 'A' && c <= 'Z')
    return (1);
  else if (c >= 'a' && c <= 'z')
    return (2);
  else
    return (0);
}


x86 assembly (clang, -O0):
<ft_uporlow>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jl     1127 <ft_uporlow+0x27>
cmpl   $0x5a,-0x8(%rbp)
jg     1127 <ft_uporlow+0x27>
movl   $0x1,-0x4(%rbp)
jmp    114e <ft_uporlow+0x4e>
cmpl   $0x61,-0x8(%rbp)
jl     1147 <ft_uporlow+0x47>
cmpl   $0x7a,-0x8(%rbp)
jg     1147 <ft_uporlow+0x47>
movl   $0x2,-0x4(%rbp)
jmp    114e <ft_uporlow+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_uporlow>:
lea    -0x41(%rdi),%eax
add    $0xffffff9f,%edi
xor    %ecx,%ecx
cmp    $0x1a,%edi
setb   %cl
add    %ecx,%ecx
cmp    $0x1a,%eax
mov    $0x1,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define i32 @ft_uporlow(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 90
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %18
10: ; preds = %6, %1
%11 = load i32, i32* %3
%12 = icmp sge i32 %11, 97
br i1 %12, label %13, label %17
13: ; preds = %10
%14 = load i32, i32* %3
%15 = icmp sle i32 %14, 122
br i1 %15, label %16, label %17
16: ; preds = %13
store i32 2, i32* %2
br label %18
17: ; preds = %13, %10
store i32 0, i32* %2
br label %18
18: ; preds = %17, %16, %9
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @ft_uporlow(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add i32 %0, -97
%5 = icmp ult i32 %4, 26
%6 = select i1 %5, i32 2, i32 0
%7 = select i1 %3, i32 1, i32 %6
ret i32 %7
}
int test5(int b) { return b ?: 1; }


x86 assembly (clang, -O0):
<test5>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     1121 <test5+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    112e <test5+0x2e>
mov    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112e <test5+0x2e>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test5>:
test   %edi,%edi
mov    $0x1,%eax
cmovne %edi,%eax
ret

LLVM IR (-O0):
define i32 @test5(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %7
6: ; preds = %1
br label %7
7: ; preds = %6, %5
%8 = phi i32 [ %3, %5 ], [ 1, %6 ]
ret i32 %8
}

LLVM IR (-O2):
define i32 @test5(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i32 1, i32 %0
ret i32 %3
}
/* Variables and functions */
int test_sat_parser_should_succeed(char *);
int test25(void) {
  return test_sat_parser_should_succeed("(a or -b) and (-c or -a)");
}


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"(a or -b) and (-c or -a)\00"
define i32 @test25() {
%1 = call i32 @test_sat_parser_should_succeed(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [25 x i8] c"(a or -b) and (-c or -a)\00"
define i32 @test25() {
%1 = tail call i32 @test_sat_parser_should_succeed(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
scalar_t__ f(int, int);
int main() {
  f(1, 2);
  (1 + f(1, 2));
  (f(1, 2) + 1);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <f@plt>
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <f@plt>
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <f@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i64 @f(i32 1, i32 2)
%2 = call i64 @f(i32 1, i32 2)
%3 = add nsw i64 1, %2
%4 = call i64 @f(i32 1, i32 2)
%5 = add nsw i64 %4, 1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @f(i32 1, i32 2)
%2 = tail call i64 @f(i32 1, i32 2)
%3 = tail call i64 @f(i32 1, i32 2)
ret i32 0
}
const char *filter_description(const char **long_description) {
  *long_description = "Filter used by the 'dlfilter C API' perf test";
  return "dlfilter to test v0 C API";
}


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

x86 assembly (clang, -O2):
<filter_description>:
lea    0xef9(%rip),%rax
mov    %rax,(%rdi)
lea    0xf1d(%rip),%rax
ret

LLVM IR (-O0):
@.str = [46 x i8] c"Filter used by the 'dlfilter C API' perf test\00"
@.str.1 = [26 x i8] c"dlfilter to test v0 C API\00"
define i8* @filter_description(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8** %3
ret i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [46 x i8] c"Filter used by the 'dlfilter C API' perf test\00"
@.str.1 = [26 x i8] c"dlfilter to test v0 C API\00"
define i8* @filter_description(i8** nocapture writeonly %0) {
store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8** %0
ret i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0)
}
void clearbit(int *number, int pos) { *number &= ~(1 << pos); }


x86 assembly (clang, -O0):
<clearbit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
xor    $0xffffffff,%ecx
mov    -0x8(%rbp),%rax
and    (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearbit>:
mov    %esi,%ecx
mov    $0xfffffffe,%eax
rol    %cl,%eax
and    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @clearbit(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 1, %5
%7 = xor i32 %6, -1
%8 = load i32*, i32** %3
%9 = load i32, i32* %8
%10 = and i32 %9, %7
store i32 %10, i32* %8
ret void
}

LLVM IR (-O2):
define void @clearbit(i32* nocapture %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = xor i32 %3, -1
%5 = load i32, i32* %0
%6 = and i32 %5, %4
store i32 %6, i32* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ locale_t;

/* Variables and functions */
locale_t duplocale(locale_t locale) { return (locale_t)NULL; }


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

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

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

LLVM IR (-O2):
define i32 @duplocale(i32 %0) {
ret i32 0
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ LCDPort_ClearCE();
int /*<<< orphan*/ LCDPort_ClearRS();
int LCDPort_In8();
int /*<<< orphan*/ LCDPort_SetCE();
int /*<<< orphan*/ LCDPort_SetRW();
int32_t readInstruction_8BitIntf(void) {
  int rs;
  LCDPort_ClearRS();
  LCDPort_SetRW();
  LCDPort_SetCE();
  rs = LCDPort_In8();
  LCDPort_ClearCE();
  return rs;
}


x86 assembly (clang, -O0):
<readInstruction_8BitIntf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <LCDPort_ClearRS@plt>
mov    $0x0,%al
call   1070 <LCDPort_SetRW@plt>
mov    $0x0,%al
call   1060 <LCDPort_SetCE@plt>
mov    $0x0,%al
call   1050 <LCDPort_In8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <LCDPort_ClearCE@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readInstruction_8BitIntf>:
push   %rbx
xor    %eax,%eax
call   1040 <LCDPort_ClearRS@plt>
xor    %eax,%eax
call   1070 <LCDPort_SetRW@plt>
xor    %eax,%eax
call   1060 <LCDPort_SetCE@plt>
xor    %eax,%eax
call   1050 <LCDPort_In8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <LCDPort_ClearCE@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @readInstruction_8BitIntf() {
%1 = alloca i32
%2 = call i32 (...) @LCDPort_ClearRS()
%3 = call i32 (...) @LCDPort_SetRW()
%4 = call i32 (...) @LCDPort_SetCE()
%5 = call i32 (...) @LCDPort_In8()
store i32 %5, i32* %1
%6 = call i32 (...) @LCDPort_ClearCE()
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @readInstruction_8BitIntf() {
%1 = tail call i32 (...) @LCDPort_ClearRS()
%2 = tail call i32 (...) @LCDPort_SetRW()
%3 = tail call i32 (...) @LCDPort_SetCE()
%4 = tail call i32 (...) @LCDPort_In8()
%5 = tail call i32 (...) @LCDPort_ClearCE()
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
__attribute__((noreturn)) void oom(void) {
  fprintf(stderr, "Oom. Aborting.\n");
  abort();
}


x86 assembly (clang, -O0):
<oom>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<oom>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"Oom. Aborting.\0A\00"
define void @oom() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"Oom. Aborting.\0A\00"
define void @oom() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int test2(int);
int test1(int x) {
  static int thestatic;
  int y;
  thestatic = x;
  y = test2(x - 1);
  y += thestatic;
  return y + x;
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,0x2f08(%rip)
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <test2@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ef4(%rip),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
push   %rbx
mov    %edi,%ebx
mov    %edi,0x2f13(%rip)
lea    -0x1(%rbx),%edi
call   1030 <test2@plt>
add    %ebx,%eax
add    0x2f03(%rip),%eax
pop    %rbx
ret

LLVM IR (-O0):
@test1.thestatic = internal global i32 0
define i32 @test1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
store i32 %4, i32* @test1.thestatic
%5 = load i32, i32* %2
%6 = sub nsw i32 %5, 1
%7 = call i32 @test2(i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* @test1.thestatic
%9 = load i32, i32* %3
%10 = add nsw i32 %9, %8
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = load i32, i32* %2
%13 = add nsw i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
@test1.thestatic = internal unnamed_addr global i32 0
define i32 @test1(i32 %0) {
store i32 %0, i32* @test1.thestatic
%2 = add nsw i32 %0, -1
%3 = tail call i32 @test2(i32 %2)
%4 = load i32, i32* @test1.thestatic
%5 = add i32 %3, %0
%6 = add i32 %5, %4
ret i32 %6
}
void c_vector3_add(float *result, const float *a, const float *b) {
  result[0] = a[0] + b[0];
  result[1] = a[1] + b[1];
  result[2] = a[2] + b[2];
}


x86 assembly (clang, -O0):
<c_vector3_add>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
addss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x18(%rbp),%rax
addss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
addss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_vector3_add>:
movss  (%rsi),%xmm0
addss  (%rdx),%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
addss  0x4(%rdx),%xmm0
movss  %xmm0,0x4(%rdi)
movss  0x8(%rsi),%xmm0
addss  0x8(%rdx),%xmm0
movss  %xmm0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @c_vector3_add(float* %0, float* %1, float* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float*
store float* %0, float** %4
store float* %1, float** %5
store float* %2, float** %6
%7 = load float*, float** %5
%8 = getelementptr inbounds float, float* %7, i64 0
%9 = load float, float* %8
%10 = load float*, float** %6
%11 = getelementptr inbounds float, float* %10, i64 0
%12 = load float, float* %11
%13 = fadd float %9, %12
%14 = load float*, float** %4
%15 = getelementptr inbounds float, float* %14, i64 0
store float %13, float* %15
%16 = load float*, float** %5
%17 = getelementptr inbounds float, float* %16, i64 1
%18 = load float, float* %17
%19 = load float*, float** %6
%20 = getelementptr inbounds float, float* %19, i64 1
%21 = load float, float* %20
%22 = fadd float %18, %21
%23 = load float*, float** %4
%24 = getelementptr inbounds float, float* %23, i64 1
store float %22, float* %24
%25 = load float*, float** %5
%26 = getelementptr inbounds float, float* %25, i64 2
%27 = load float, float* %26
%28 = load float*, float** %6
%29 = getelementptr inbounds float, float* %28, i64 2
%30 = load float, float* %29
%31 = fadd float %27, %30
%32 = load float*, float** %4
%33 = getelementptr inbounds float, float* %32, i64 2
store float %31, float* %33
ret void
}

LLVM IR (-O2):
define void @c_vector3_add(float* nocapture writeonly %0, float* nocapture %1, float* nocapture %2) {
%4 = load float, float* %1
%5 = load float, float* %2
%6 = fadd float %4, %5
store float %6, float* %0
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %2, i64 1
%10 = load float, float* %9
%11 = fadd float %8, %10
%12 = getelementptr inbounds float, float* %0, i64 1
store float %11, float* %12
%13 = getelementptr inbounds float, float* %1, i64 2
%14 = load float, float* %13
%15 = getelementptr inbounds float, float* %2, i64 2
%16 = load float, float* %15
%17 = fadd float %14, %16
%18 = getelementptr inbounds float, float* %0, i64 2
store float %17, float* %18
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errno;
char const *strerror(int /*<<< orphan*/);
const char *fs_error(void) { return strerror(errno); }


x86 assembly (clang, -O0):
<fs_error>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <strerror@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fs_error>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <strerror@plt>

LLVM IR (-O0):
@errno = global i32 0
define i8* @fs_error() {
%1 = load i32, i32* @errno
%2 = call i8* @strerror(i32 %1)
ret i8* %2
}

LLVM IR (-O2):
@errno = global i32 0
define i8* @fs_error() {
%1 = load i32, i32* @errno
%2 = tail call i8* @strerror(i32 %1)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ sub();
int _foo2_helper() {
  sub();
  return 0xf00;
}


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

x86 assembly (clang, -O2):
<_foo2_helper>:
push   %rax
xor    %eax,%eax
call   1030 <sub@plt>
mov    $0xf00,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @_foo2_helper() {
%1 = call i32 (...) @sub()
ret i32 3840
}

LLVM IR (-O2):
define i32 @_foo2_helper() {
%1 = tail call i32 (...) @sub()
ret i32 3840
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
void set(int m[], int c) {
  int i;
  for (i = 0; i < c; i++) {
    printf("Mark: ");
    scanf("%d", &m[i]);
  }
}


x86 assembly (clang, -O0):
<set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1177 <set+0x57>
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xea3(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <set+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    115d <set+0x3d>
mov    %rdi,%rbx
mov    %esi,%r12d
lea    0xec7(%rip),%r14
lea    0xec7(%rip),%r15
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
add    $0x4,%rbx
add    $0xffffffffffffffff,%r12
jne    1140 <set+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"Mark: \00"
@.str.1 = [3 x i8] c"%d\00"
define void @set(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%9 = getelementptr inbounds i32, i32* %0, i64 %7
%10 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
void f_setown(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<f_setown>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_setown>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.f_setown = [9 x i8] c"f_setown\00"
define void @f_setown() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__func__.f_setown, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.f_setown = [9 x i8] c"f_setown\00"
define void @f_setown() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__func__.f_setown, i64 0, i64 0))
ret void
}
int numeric_name(const char *name) {
  return (name[0] < '0' || name[0] > '9') ? 0 : 1;
}


x86 assembly (clang, -O0):
<numeric_name>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x30,%ecx
mov    %al,-0x9(%rbp)
jl     112d <numeric_name+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
setg   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%dl
mov    $0x1,%eax
xor    %ecx,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<numeric_name>:
mov    (%rdi),%cl
add    $0xd0,%cl
xor    %eax,%eax
cmp    $0xa,%cl
setb   %al
ret

LLVM IR (-O0):
define i32 @numeric_name(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp slt i32 %6, 48
br i1 %7, label %14, label %8
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp sgt i32 %12, 57
br label %14
14: ; preds = %8, %1
%15 = phi i1 [ true, %1 ], [ %13, %8 ]
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 0, i32 1
ret i32 %17
}

LLVM IR (-O2):
define i32 @numeric_name(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, -48
%4 = icmp ult i8 %3, 10
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMRA4_get(void) { return U_WMRCORENONE_get("U_WMRA4"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRA4\00"
define i32 @U_WMRA4_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRA4\00"
define i32 @U_WMRA4_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ pseudotalloc_free(void *);
int _talloc_free(void *ptr, const char *location) {
  pseudotalloc_free(ptr);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @_talloc_free(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i32 @pseudotalloc_free(i8* %5)
ret i32 0
}

LLVM IR (-O2):
define i32 @_talloc_free(i8* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @pseudotalloc_free(i8* %0)
ret i32 0
}
/* Variables and functions */
int XTL_SubVars_GetValueInt(char *);
int GetActualQuestionCount(void) {
  return XTL_SubVars_GetValueInt("XTL_SV_QuestionCount");
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"XTL_SV_QuestionCount\00"
define i32 @GetActualQuestionCount() {
%1 = call i32 @XTL_SubVars_GetValueInt(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [21 x i8] c"XTL_SV_QuestionCount\00"
define i32 @GetActualQuestionCount() {
%1 = tail call i32 @XTL_SubVars_GetValueInt(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}