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


x86 assembly (clang, -O0):
<my_max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1121 <my_max+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <my_max+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @my_max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
extern int subtract(const int num1, const int num2) { return num1 - num2; }


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

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

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

LLVM IR (-O2):
define i32 @subtract(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
void *PrintHello(void *threadid) {
  int tid;
  tid = (int)threadid;
  printf("Hello World! It's me, thread #%d!\n", tid);
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<PrintHello>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintHello>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"Hello World! It's me, thread #%d!\0A\00"
define i8* @PrintHello(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = ptrtoint i8* %5 to i32
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 @pthread_exit(i32* null)
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [35 x i8] c"Hello World! It's me, thread #%d!\0A\00"
define noalias i8* @PrintHello(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
}
/* Variables and functions */
int i2c_smbus_read_word_data(int, int);
int hummingboardI2CReadReg16(int fd, int reg) {
  return i2c_smbus_read_word_data(fd, reg);
}


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

x86 assembly (clang, -O2):
<hummingboardI2CReadReg16>:
jmp    1030 <i2c_smbus_read_word_data@plt>

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

LLVM IR (-O2):
define i32 @hummingboardI2CReadReg16(i32 %0, i32 %1) {
%3 = tail call i32 @i2c_smbus_read_word_data(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;
typedef int /*<<< orphan*/ locale_t;

/* Variables and functions */
int iswalpha(int /*<<< orphan*/);
int iswalpha_l(wint_t c, locale_t l) { return iswalpha(c); }


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

x86 assembly (clang, -O2):
<iswalpha_l>:
jmp    1030 <iswalpha@plt>

LLVM IR (-O0):
define i32 @iswalpha_l(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 = call i32 @iswalpha(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @iswalpha_l(i32 %0, i32 %1) {
%3 = tail call i32 @iswalpha(i32 %0)
ret i32 %3
}
/* Variables and functions */
scalar_t__ errno;
int /*<<< orphan*/ fail(char *, char const *);
float strtod(char const *, char **);
float param_to_float(const char *s) {
  errno = 0;
  char *endptr;
  float ret = strtod(s, &endptr);
  if (errno || *endptr != '\0') {
    fail("Invalid real number argument '%s'.", s);
  }
  return ret;
}


x86 assembly (clang, -O0):
<param_to_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
movq   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <strtod@plt>
movss  %xmm0,-0x14(%rbp)
mov    0x2e8d(%rip),%rax
cmpq   $0x0,(%rax)
jne    116d <param_to_float+0x4d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     117d <param_to_float+0x5d>
mov    -0x8(%rbp),%rsi
lea    0xe88(%rip),%rdi
call   1040 <fail@plt>
movss  -0x14(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<param_to_float>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
mov    0x2eaf(%rip),%r14
movq   $0x0,(%r14)
lea    0x10(%rsp),%rsi
call   1030 <strtod@plt>
cmpq   $0x0,(%r14)
jne    1152 <param_to_float+0x32>
mov    0x10(%rsp),%rax
cmpb   $0x0,(%rax)
je     116d <param_to_float+0x4d>
lea    0xea7(%rip),%rdi
mov    %rbx,%rsi
movss  %xmm0,0xc(%rsp)
call   1040 <fail@plt>
movss  0xc(%rsp),%xmm0
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@errno = global i64 0
@.str = [35 x i8] c"Invalid real number argument '%s'.\00"
define float @param_to_float(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca float
store i8* %0, i8** %2
store i64 0, i64* @errno
%5 = load i8*, i8** %2
%6 = call float @strtod(i8* %5, i8** %3)
store float %6, float* %4
%7 = load i64, i64* @errno
%8 = icmp ne i64 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %9, %1
%15 = load i8*, i8** %2
%16 = call i32 @fail(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %15)
br label %17
17: ; preds = %14, %9
%18 = load float, float* %4
ret float %18
}

LLVM IR (-O2):
@errno = global i64 0
@.str = [35 x i8] c"Invalid real number argument '%s'.\00"
define float @param_to_float(i8* %0) {
%2 = alloca i8*
store i64 0, i64* @errno
%3 = bitcast i8** %2 to i8*
%4 = call float @strtod(i8* %0, i8** %2)
%5 = load i64, i64* @errno
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %7, %1
%12 = tail call i32 @fail(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %13
13: ; preds = %11, %7
ret float %4
}
void machdep_save_float_state(void) {}


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

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

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

LLVM IR (-O2):
define void @machdep_save_float_state() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_basic_cb_comments() {
  test_parser_verify_parse(
      test_parser_sourcefile("classic_basic", " 100 REM comment"),
      "classic_basic", "", "100 REM comment", 0);
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"classic_basic\00"
@.str.1 = [17 x i8] c" 100 REM comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [16 x i8] c"100 REM comment\00"
define void @test_basic_cb_comments() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"classic_basic\00"
@.str.1 = [17 x i8] c" 100 REM comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [16 x i8] c"100 REM comment\00"
define void @test_basic_cb_comments() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int /*<<< orphan*/ recvfrom(int, void *, size_t, int, struct sockaddr *,
                            int /*<<< orphan*/ *);
__attribute__((weak)) ssize_t __real_recvfrom(int fd, void *buf, size_t len,
                                              int flags, struct sockaddr *from,
                                              socklen_t *fromlen) {
  return recvfrom(fd, buf, len, flags, from, fromlen);
}


x86 assembly (clang, -O0):
<__real_recvfrom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
call   1030 <recvfrom@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__real_recvfrom>:
jmp    1030 <recvfrom@plt>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define weak i32 @__real_recvfrom(i32 %0, i8* %1, i64 %2, i32 %3, %struct.sockaddr* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i32
%11 = alloca %struct.sockaddr*
%12 = alloca i32*
store i32 %0, i32* %7
store i8* %1, i8** %8
store i64 %2, i64* %9
store i32 %3, i32* %10
store %struct.sockaddr* %4, %struct.sockaddr** %11
store i32* %5, i32** %12
%13 = load i32, i32* %7
%14 = load i8*, i8** %8
%15 = load i64, i64* %9
%16 = load i32, i32* %10
%17 = load %struct.sockaddr*, %struct.sockaddr** %11
%18 = load i32*, i32** %12
%19 = call i32 @recvfrom(i32 %13, i8* %14, i64 %15, i32 %16, %struct.sockaddr* %17, i32* %18)
ret i32 %19
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define weak i32 @__real_recvfrom(i32 %0, i8* %1, i64 %2, i32 %3, %struct.sockaddr* %4, i32* %5) {
%7 = tail call i32 @recvfrom(i32 %0, i8* %1, i64 %2, i32 %3, %struct.sockaddr* %4, i32* %5)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
void cleanup(void) { fflush(NULL); }


x86 assembly (clang, -O0):
<cleanup>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanup>:
xor    %edi,%edi
jmp    1030 <fflush@plt>

LLVM IR (-O0):
define void @cleanup() {
%1 = call i32 @fflush(i32* null)
ret void
}

LLVM IR (-O2):
define void @cleanup() {
%1 = tail call i32 @fflush(i32* null)
ret void
}
void rtc_proc_del_device(struct rtc_device *rtc) {}


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

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

LLVM IR (-O0):
%struct.rtc_device = type opaque
define void @rtc_proc_del_device(%struct.rtc_device* %0) {
%2 = alloca %struct.rtc_device*
store %struct.rtc_device* %0, %struct.rtc_device** %2
ret void
}

LLVM IR (-O2):
%struct.rtc_device = type opaque
define void @rtc_proc_del_device(%struct.rtc_device* nocapture %0) {
ret void
}
casess() {}


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

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

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

LLVM IR (-O2):
define i32 @casess() {
ret i32 undef
}
/* Variables and functions */
double __infer_nondet_double();
double tan(double x) { return __infer_nondet_double(); }


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

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

LLVM IR (-O0):
define double @tan(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call double (...) @__infer_nondet_double()
ret double %3
}

LLVM IR (-O2):
define double @tan(double %0) {
%2 = tail call double (...) @__infer_nondet_double()
ret double %2
}
double rint(double x) {
  if (x < 0.0)
    return (double)(int)(x - 0.5);
  else
    return (double)(int)(x + 0.5);
}


x86 assembly (clang, -O0):
<rint>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    113a <rint+0x3a>
movsd  -0x10(%rbp),%xmm0
movsd  0xedc(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1154 <rint+0x54>
movsd  0xebe(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rint>:
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
lea    0xeec(%rip),%rcx
addsd  (%rcx,%rax,8),%xmm0
cvttpd2dq %xmm0,%xmm0
cvtdq2pd %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @rint(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load double, double* %3
%8 = fsub double %7, 5.000000e-01
%9 = fptosi double %8 to i32
%10 = sitofp i32 %9 to double
store double %10, double* %2
br label %16
11: ; preds = %1
%12 = load double, double* %3
%13 = fadd double %12, 5.000000e-01
%14 = fptosi double %13 to i32
%15 = sitofp i32 %14 to double
store double %15, double* %2
br label %16
16: ; preds = %11, %6
%17 = load double, double* %2
ret double %17
}

LLVM IR (-O2):
define double @rint(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = select i1 %2, double -5.000000e-01, double 5.000000e-01
%4 = fadd double %3, %0
%5 = fptosi double %4 to i32
%6 = sitofp i32 %5 to double
ret double %6
}
int string_length(char a[]) {
  int i = 0;
  while (a[i] != '\0')
    i++;
  return i;
}


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

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

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

LLVM IR (-O2):
define i32 @string_length(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*/ w_pic(int *, int *, int, int, int, int);
int display_pic(int screen[][(400 * 400)], int *pfb) {
  for (int i = 0;; i += 1) {
    w_pic(pfb, screen[i], 200, 440, 400, 400);
    if (i == 360)
      i = 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<display_pic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0x14(%rbp),%rax
imul   $0x9c400,%rax,%rax
add    %rax,%rsi
mov    $0xc8,%edx
mov    $0x1b8,%ecx
mov    $0x190,%r9d
mov    %r9d,%r8d
call   1030 <w_pic@plt>
cmpl   $0x168,-0x14(%rbp)
jne    1169 <display_pic+0x59>
movl   $0x0,-0x14(%rbp)
jmp    116e <display_pic+0x5e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <display_pic+0x17>

x86 assembly (clang, -O2):
<display_pic>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
mov    $0x1,%r15d
cs nopw 0x0(%rax,%rax,1)
nop
movslq %eax,%rbp
imul   $0x9c400,%rbp,%rsi
add    %rbx,%rsi
mov    %r14,%rdi
mov    $0xc8,%edx
mov    $0x1b8,%ecx
mov    $0x190,%r8d
mov    $0x190,%r9d
call   1030 <w_pic@plt>
lea    0x1(%rbp),%eax
cmp    $0x168,%ebp
cmove  %r15d,%eax
jmp    1130 <display_pic+0x20>

LLVM IR (-O0):
define i32 @display_pic([160000 x i32]* %0, i32* %1) {
%3 = alloca [160000 x i32]*
%4 = alloca i32*
%5 = alloca i32
store [160000 x i32]* %0, [160000 x i32]** %3
store i32* %1, i32** %4
store i32 0, i32* %5
br label %6
6: ; preds = %18, %2
%7 = load i32*, i32** %4
%8 = load [160000 x i32]*, [160000 x i32]** %3
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [160000 x i32], [160000 x i32]* %8, i64 %10
%12 = getelementptr inbounds [160000 x i32], [160000 x i32]* %11, i64 0, i64 0
%13 = call i32 @w_pic(i32* %7, i32* %12, i32 200, i32 440, i32 400, i32 400)
%14 = load i32, i32* %5
%15 = icmp eq i32 %14, 360
br i1 %15, label %16, label %17
16: ; preds = %6
store i32 0, i32* %5
br label %17
17: ; preds = %16, %6
br label %18
18: ; preds = %17
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %6
}

LLVM IR (-O2):
define i32 @display_pic([160000 x i32]* %0, i32* %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ 0, %2 ], [ %10, %3 ]
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds [160000 x i32], [160000 x i32]* %0, i64 %5, i64 0
%7 = tail call i32 @w_pic(i32* %1, i32* %6, i32 200, i32 440, i32 400, i32 400)
%8 = icmp eq i32 %4, 360
%9 = add nsw i32 %4, 1
%10 = select i1 %8, i32 1, i32 %9
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ pinza(int);
void pinzaClose() { pinza(32); }


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

x86 assembly (clang, -O2):
<pinzaClose>:
mov    $0x20,%edi
jmp    1030 <pinza@plt>

LLVM IR (-O0):
define void @pinzaClose() {
%1 = call i32 @pinza(i32 32)
ret void
}

LLVM IR (-O2):
define void @pinzaClose() {
%1 = tail call i32 @pinza(i32 32)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ helper(int *);
void test6(int *i) { helper(i); }


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

x86 assembly (clang, -O2):
<test6>:
jmp    1030 <helper@plt>

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

LLVM IR (-O2):
define void @test6(i32* %0) {
%2 = tail call i32 @helper(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void main() {
  int x = 0xffff, y = 10;
  printf("%d", x | y);
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 65535)
ret void
}
int funcC1(int a, int b) { return a + b + 1; }


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

x86 assembly (clang, -O2):
<funcC1>:
lea    (%rdi,%rsi,1),%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @funcC1(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 = add nsw i32 %5, %6
%8 = add nsw i32 %7, 1
ret i32 %8
}

LLVM IR (-O2):
define i32 @funcC1(i32 %0, i32 %1) {
%3 = add i32 %0, 1
%4 = add i32 %3, %1
ret i32 %4
}
/* Variables and functions */
scalar_t__ EOF;
double input_n(unsigned char);
int /*<<< orphan*/ printf(char *, double);
scalar_t__ scanf(char *, unsigned char *);
int main(int argc, char **argv) {
  unsigned char in;
  while (scanf("%hhu", &in) != EOF) {
    printf("%f\n", input_n(in));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
lea    -0x11(%rbp),%rsi
call   1050 <scanf@plt>
mov    0x2e8b(%rip),%rcx
cmp    (%rcx),%rax
je     1180 <main+0x50>
movzbl -0x11(%rbp),%edi
call   1030 <input_n@plt>
lea    0xe8f(%rip),%rdi
call   1040 <printf@plt>
jmp    1146 <main+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xec1(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x2e98(%rip),%r12
cmp    (%r12),%rax
je     1193 <main+0x63>
lea    0xea8(%rip),%r14
lea    0xe9c(%rip),%r15
lea    0x7(%rsp),%rbx
nopl   0x0(%rax)
movzbl 0x7(%rsp),%edi
call   1030 <input_n@plt>
mov    %r14,%rdi
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
cmp    (%r12),%rax
jne    1170 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%hhu\00"
@EOF = global i64 0
@.str.1 = [4 x i8] c"%f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %7
7: ; preds = %11, %2
%8 = call i64 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %6)
%9 = load i64, i64* @EOF
%10 = icmp ne i64 %8, %9
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i8, i8* %6
%13 = call double @input_n(i8 zeroext %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %13)
br label %7
15: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%hhu\00"
@EOF = global i64 0
@.str.1 = [4 x i8] c"%f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i8
%4 = call i64 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i64, i64* @EOF
%6 = icmp eq i64 %4, %5
br i1 %6, label %14, label %7
7: ; preds = %2, %7
%8 = load i8, i8* %3
%9 = call double @input_n(i8 zeroext %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %9)
%11 = call i64 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %3)
%12 = load i64, i64* @EOF
%13 = icmp eq i64 %11, %12
br i1 %13, label %14, label %7
14: ; preds = %7, %2
ret i32 0
}
int MIN(int X, int Y) { return ((X) < (Y)) ? (X) : (Y); }


x86 assembly (clang, -O0):
<MIN>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <MIN+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <MIN+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MIN>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @MIN(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 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @MIN(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main() {
  float prev, next;
  next = 1000;
  do {
    prev = next;
    next = (prev + 1000 / prev) / 2;
  } while (prev - next > 0.001);
  printf("sqrt(1000) = %.6f\n", next);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xed9(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xebd(%rip),%xmm1
divss  -0x8(%rbp),%xmm1
addss  %xmm1,%xmm0
movss  0xeb0(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe95(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     112c <main+0x1c>
movss  -0xc(%rbp),%xmm0
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [19 x i8] c"sqrt(1000) = %.6f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
store float 1.000000e+03, float* %3
br label %4
4: ; preds = %11, %0
%5 = load float, float* %3
store float %5, float* %2
%6 = load float, float* %2
%7 = load float, float* %2
%8 = fdiv float 1.000000e+03, %7
%9 = fadd float %6, %8
%10 = fdiv float %9, 2.000000e+00
store float %10, float* %3
br label %11
11: ; preds = %4
%12 = load float, float* %2
%13 = load float, float* %3
%14 = fsub float %12, %13
%15 = fpext float %14 to double
%16 = fcmp ogt double %15, 1.000000e-03
br i1 %16, label %4, label %17
17: ; preds = %11
%18 = load float, float* %3
%19 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), float %18)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"sqrt(1000) = %.6f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), float 0x403F9F6E40000000)
ret i32 0
}
/* Variables and functions */
void *MALLOC_PTR(size_t);
void *lrtr_malloc(size_t size) { return MALLOC_PTR(size); }


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

x86 assembly (clang, -O2):
<lrtr_malloc>:
jmp    1030 <MALLOC_PTR@plt>

LLVM IR (-O0):
define i8* @lrtr_malloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @MALLOC_PTR(i64 %3)
ret i8* %4
}

LLVM IR (-O2):
define i8* @lrtr_malloc(i64 %0) {
%2 = tail call i8* @MALLOC_PTR(i64 %0)
ret i8* %2
}
/* Variables and functions */
char const *read_string(char *, char *);
const char *get_platform_str(void) {
  return read_string("DEFAULT", "platform");
}


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

x86 assembly (clang, -O2):
<get_platform_str>:
lea    0xee9(%rip),%rdi
lea    0xeea(%rip),%rsi
jmp    1030 <read_string@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"DEFAULT\00"
@.str.1 = [9 x i8] c"platform\00"
define i8* @get_platform_str() {
%1 = call i8* @read_string(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"DEFAULT\00"
@.str.1 = [9 x i8] c"platform\00"
define i8* @get_platform_str() {
%1 = tail call i8* @read_string(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i8* %1
}
unsigned xrop3_79_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~S;
  stk2 = D | stk3;
  stk1 = T & stk2;
  stk1 = ~stk1;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_79_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_79_1_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%edx
shl    $0x8,%edx
or     %esi,%edx
not    %ecx
mov    %ecx,%eax
or     $0xff,%eax
and    %edx,%eax
not    %eax
and    %ecx,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_79_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %6
%24 = xor i32 %23, -1
store i32 %24, i32* %10
%25 = load i32, i32* %5
%26 = load i32, i32* %10
%27 = or i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %7
%29 = load i32, i32* %9
%30 = and i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
%32 = xor i32 %31, -1
store i32 %32, i32* %8
%33 = load i32, i32* %8
%34 = load i32, i32* %6
%35 = xor i32 %34, -1
%36 = and i32 %33, %35
%37 = load i32, i32* %5
%38 = load i32, i32* %6
%39 = and i32 %37, %38
%40 = or i32 %36, %39
ret i32 %40
}

LLVM IR (-O2):
define i32 @xrop3_79_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %4, -1
%8 = or i32 %7, 255
%9 = and i32 %6, %8
%10 = xor i32 %9, -1
%11 = and i32 %10, %7
%12 = or i32 %11, %3
ret i32 %12
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int syscon_clear_symbol_table(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(29, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_clear_symbol_table>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1d,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_clear_symbol_table>:
mov    $0x1d,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @syscon_clear_symbol_table() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 29, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @syscon_clear_symbol_table() {
%1 = tail call i32 @_ada_use_c2phc(i32 29, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int yywrap() {
  printf(" End of Lex\n");
  return 1;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c" End of Lex\0A\00"
define i32 @yywrap() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@str = [12 x i8] c" End of Lex\00"
define i32 @yywrap() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int check_digit(int *);
scalar_t__ check_month(int *);
int check_UCN_validity(int *UCN) {
  if (check_month(UCN))
    return 0;
  if (check_digit(UCN) != UCN[9])
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<check_UCN_validity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <check_month@plt>
cmp    $0x0,%rax
je     114b <check_UCN_validity+0x2b>
movl   $0x0,-0x4(%rbp)
jmp    1174 <check_UCN_validity+0x54>
mov    -0x10(%rbp),%rdi
call   1040 <check_digit@plt>
mov    -0x10(%rbp),%rcx
cmp    0x24(%rcx),%eax
je     116d <check_UCN_validity+0x4d>
movl   $0x0,-0x4(%rbp)
jmp    1174 <check_UCN_validity+0x54>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_UCN_validity>:
push   %rbx
mov    %rdi,%rbx
call   1030 <check_month@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1135 <check_UCN_validity+0x15>
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <check_digit@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    0x24(%rbx),%ecx
sete   %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @check_UCN_validity(i32* %0) {
%2 = tail call i64 @check_month(i32* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = tail call i32 @check_digit(i32* %0)
%6 = getelementptr inbounds i32, i32* %0, i64 9
%7 = load i32, i32* %6
%8 = icmp eq i32 %5, %7
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %4, %1
%11 = phi i32 [ 0, %1 ], [ %9, %4 ]
ret i32 %11
}
unsigned long _video_color_precision(unsigned long bits) {
  unsigned long pow = 1;
  for (long c = 0; c < (8 - (long)bits); c++) {
    pow *= 2;
  }
  return pow;
}


x86 assembly (clang, -O0):
<_video_color_precision>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    $0x8,%ecx
sub    -0x8(%rbp),%rcx
cmp    %rcx,%rax
jge    114b <_video_color_precision+0x4b>
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1118 <_video_color_precision+0x18>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_video_color_precision>:
mov    $0x1,%eax
cmp    $0x7,%rdi
jg     1169 <_video_color_precision+0x69>
mov    $0x8,%edx
sub    %rdi,%rdx
cmp    $0x2,%rdx
mov    $0x1,%eax
cmovl  %rax,%rdx
lea    -0x1(%rdx),%rsi
mov    %edx,%ecx
and    $0x7,%ecx
cmp    $0x7,%rsi
jb     115a <_video_color_precision+0x5a>
movabs $0x7ffffffffffffff8,%rax
ff ff 7f
and    %rax,%rdx
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
shl    $0x8,%rax
add    $0xfffffffffffffff8,%rdx
jne    1150 <_video_color_precision+0x50>
test   %rcx,%rcx
je     1169 <_video_color_precision+0x69>
nop
add    %rax,%rax
add    $0xffffffffffffffff,%rcx
jne    1160 <_video_color_precision+0x60>
ret

LLVM IR (-O0):
define i64 @_video_color_precision(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %2
store i64 1, i64* %3
store i64 0, i64* %4
br label %5
5: ; preds = %13, %1
%6 = load i64, i64* %4
%7 = load i64, i64* %2
%8 = sub nsw i64 8, %7
%9 = icmp slt i64 %6, %8
br i1 %9, label %10, label %16
10: ; preds = %5
%11 = load i64, i64* %3
%12 = mul i64 %11, 2
store i64 %12, i64* %3
br label %13
13: ; preds = %10
%14 = load i64, i64* %4
%15 = add nsw i64 %14, 1
store i64 %15, i64* %4
br label %5
16: ; preds = %5
%17 = load i64, i64* %3
ret i64 %17
}

LLVM IR (-O2):
define i64 @_video_color_precision(i64 %0) {
%2 = icmp slt i64 %0, 8
br i1 %2, label %3, label %21
3: ; preds = %1
%4 = sub i64 8, %0
%5 = call i64 @llvm.smax.i64(i64 %4, i64 1)
%6 = add nsw i64 %5, -1
%7 = and i64 %5, 7
%8 = icmp ult i64 %6, 7
br i1 %8, label %11, label %9
9: ; preds = %3
%10 = and i64 %5, 9223372036854775800
br label %23
11: ; preds = %23, %3
%12 = phi i64 [ undef, %3 ], [ %26, %23 ]
%13 = phi i64 [ 1, %3 ], [ %26, %23 ]
%14 = icmp eq i64 %7, 0
br i1 %14, label %21, label %15
15: ; preds = %11, %15
%16 = phi i64 [ %18, %15 ], [ %13, %11 ]
%17 = phi i64 [ %19, %15 ], [ 0, %11 ]
%18 = shl i64 %16, 1
%19 = add i64 %17, 1
%20 = icmp eq i64 %19, %7
br i1 %20, label %21, label %15
21: ; preds = %11, %15, %1
%22 = phi i64 [ 1, %1 ], [ %12, %11 ], [ %18, %15 ]
ret i64 %22
23: ; preds = %23, %9
%24 = phi i64 [ 1, %9 ], [ %26, %23 ]
%25 = phi i64 [ 0, %9 ], [ %27, %23 ]
%26 = shl i64 %24, 8
%27 = add i64 %25, 8
%28 = icmp eq i64 %27, %10
br i1 %28, label %11, label %23
}
double cart2_2d(double *x1, double *x2) {
  double out;
  double a;
  a = *(x2++) - *(x1++);
  out = a * a;
  a = *(x2++) - *(x1++);
  return (out + a * a);
}


x86 assembly (clang, -O0):
<cart2_2d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
subsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
subsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cart2_2d>:
movsd  (%rsi),%xmm1
movsd  0x8(%rsi),%xmm0
subsd  (%rdi),%xmm1
mulsd  %xmm1,%xmm1
subsd  0x8(%rdi),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @cart2_2d(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
%6 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%7 = load double*, double** %4
%8 = getelementptr inbounds double, double* %7, i32 1
store double* %8, double** %4
%9 = load double, double* %7
%10 = load double*, double** %3
%11 = getelementptr inbounds double, double* %10, i32 1
store double* %11, double** %3
%12 = load double, double* %10
%13 = fsub double %9, %12
store double %13, double* %6
%14 = load double, double* %6
%15 = load double, double* %6
%16 = fmul double %14, %15
store double %16, double* %5
%17 = load double*, double** %4
%18 = getelementptr inbounds double, double* %17, i32 1
store double* %18, double** %4
%19 = load double, double* %17
%20 = load double*, double** %3
%21 = getelementptr inbounds double, double* %20, i32 1
store double* %21, double** %3
%22 = load double, double* %20
%23 = fsub double %19, %22
store double %23, double* %6
%24 = load double, double* %5
%25 = load double, double* %6
%26 = load double, double* %6
%27 = call double @llvm.fmuladd.f64(double %25, double %26, double %24)
ret double %27
}

LLVM IR (-O2):
define double @cart2_2d(double* nocapture %0, double* nocapture %1) {
%3 = getelementptr inbounds double, double* %1, i64 1
%4 = load double, double* %1
%5 = getelementptr inbounds double, double* %0, i64 1
%6 = load double, double* %0
%7 = fsub double %4, %6
%8 = fmul double %7, %7
%9 = load double, double* %3
%10 = load double, double* %5
%11 = fsub double %9, %10
%12 = tail call double @llvm.fmuladd.f64(double %11, double %11, double %8)
ret double %12
}
void TestDynamicLoaderSymbolPointer() {}


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

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

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

LLVM IR (-O2):
define void @TestDynamicLoaderSymbolPointer() {
ret void
}
/* Variables and functions */
unsigned int xxh32(void const *, int, unsigned int);
unsigned int XXH32(const void *input, int len, unsigned int seed) {
  return xxh32(input, len, seed);
}


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

x86 assembly (clang, -O2):
<XXH32>:
jmp    1030 <xxh32@plt>

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

LLVM IR (-O2):
define i32 @XXH32(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @xxh32(i8* %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ outportw(unsigned int, unsigned int);
void outw(unsigned int port, unsigned int value) { outportw(port, value); }


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

x86 assembly (clang, -O2):
<outw>:
jmp    1030 <outportw@plt>

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

LLVM IR (-O2):
define void @outw(i32 %0, i32 %1) {
%3 = tail call i32 @outportw(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
long double __qatan2(long double, long double);
long double intr_wrap_022(long double p1, long double p2) {
  return __qatan2(p1, p2);
}


x86 assembly (clang, -O0):
<intr_wrap_022>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <__qatan2@plt>
fld    %st(0)
fstp   %st(0)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_wrap_022>:
jmp    1030 <__qatan2@plt>

LLVM IR (-O0):
define x86_fp80 @intr_wrap_022(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %4
%7 = call x86_fp80 @__qatan2(x86_fp80 %5, x86_fp80 %6)
ret x86_fp80 %7
}

LLVM IR (-O2):
define x86_fp80 @intr_wrap_022(x86_fp80 %0, x86_fp80 %1) {
%3 = tail call x86_fp80 @__qatan2(x86_fp80 %0, x86_fp80 %1)
ret x86_fp80 %3
}
/* Variables and functions */
int /*<<< orphan*/ pA(char *);
int /*<<< orphan*/ read_mem(char *, char *);
void pop_stackframe(void) {
  pA("stack_frame_stack_head--;");
  read_mem("stack_frame", "stack_frame_stack_head");
}


x86 assembly (clang, -O0):
<pop_stackframe>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <pA@plt>
lea    0xee3(%rip),%rdi
lea    0xee8(%rip),%rsi
call   1040 <read_mem@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pop_stackframe>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <pA@plt>
lea    0xee6(%rip),%rdi
lea    0xeeb(%rip),%rsi
pop    %rax
jmp    1040 <read_mem@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"stack_frame_stack_head--;\00"
@.str.1 = [12 x i8] c"stack_frame\00"
@.str.2 = [23 x i8] c"stack_frame_stack_head\00"
define void @pop_stackframe() {
%1 = call i32 @pA(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @read_mem(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"stack_frame_stack_head--;\00"
@.str.1 = [12 x i8] c"stack_frame\00"
@.str.2 = [23 x i8] c"stack_frame_stack_head\00"
define void @pop_stackframe() {
%1 = tail call i32 @pA(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @read_mem(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
ret void
}