xunge/DecIR huggingface dataset:
/* Variables and functions */
double funcAngCor_alpha1_3minus_2plus_15097_L5(double *, double *);
double sin(double);
double fitAngDist_alpha1_3minus_2plus_15097_L5(double *x, double *par) {
  double result;
  result = funcAngCor_alpha1_3minus_2plus_15097_L5(x, &par[0]) *
           sin(x[0] * 0.0174533);
  return result;
}


x86 assembly (clang, -O0):
<fitAngDist_alpha1_3minus_2plus_15097_L5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <funcAngCor_alpha1_3minus_2plus_15097_L5@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xeb2(%rip),%xmm0
mulsd  (%rax),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fitAngDist_alpha1_3minus_2plus_15097_L5>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1040 <funcAngCor_alpha1_3minus_2plus_15097_L5@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rbx),%xmm0
mulsd  0xec1(%rip),%xmm0
call   1030 <sin@plt>
mulsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @fitAngDist_alpha1_3minus_2plus_15097_L5(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%6 = load double*, double** %3
%7 = load double*, double** %4
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = call double @funcAngCor_alpha1_3minus_2plus_15097_L5(double* %6, double* %8)
%10 = load double*, double** %3
%11 = getelementptr inbounds double, double* %10, i64 0
%12 = load double, double* %11
%13 = fmul double %12, 1.745330e-02
%14 = call double @sin(double %13)
%15 = fmul double %9, %14
store double %15, double* %5
%16 = load double, double* %5
ret double %16
}

LLVM IR (-O2):
define double @fitAngDist_alpha1_3minus_2plus_15097_L5(double* %0, double* %1) {
%3 = tail call double @funcAngCor_alpha1_3minus_2plus_15097_L5(double* %0, double* %1)
%4 = load double, double* %0
%5 = fmul double %4, 1.745330e-02
%6 = tail call double @sin(double %5)
%7 = fmul double %3, %6
ret double %7
}
void glutKeyboardUpFunc(void (*func)(unsigned char key, int x, int y)) {}


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

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

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

LLVM IR (-O2):
define void @glutKeyboardUpFunc(void (i8, i32, i32)* nocapture %0) {
ret void
}
void hsa_ndv_read(void) {}


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

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

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

LLVM IR (-O2):
define void @hsa_ndv_read() {
ret void
}
int fun319() { return 319; }


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

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

LLVM IR (-O0):
define i32 @fun319() {
ret i32 319
}

LLVM IR (-O2):
define i32 @fun319() {
ret i32 319
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void PerformanceAPI_BeginEvent(const char *inID, const char *inData,
                               uint32_t inColor) {}


x86 assembly (clang, -O0):
<PerformanceAPI_BeginEvent>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @PerformanceAPI_BeginEvent(i8* nocapture %0, i8* nocapture %1, i32 %2) {
ret void
}
/* Variables and functions */
int memcmp(void const *, void const *, int);
int fast_memcmp(const void *foo, const void *bar, int len) {
  return memcmp(foo, bar, len);
}


x86 assembly (clang, -O0):
<fast_memcmp>:
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
call   1030 <memcmp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fast_memcmp>:
jmp    1030 <memcmp@plt>

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

LLVM IR (-O2):
define i32 @fast_memcmp(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @memcmp(i8* %0, i8* %1, i32 %2)
ret i32 %4
}
/* Type definitions */
struct vink_tree {
  int dummy;
};
struct vink_epp_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void response(struct vink_epp_state *state, const char *transaction_id,
              const struct vink_tree *data) {
  fprintf(stderr, "Got response\n");
}


x86 assembly (clang, -O0):
<response>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<response>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
%struct.vink_epp_state = type { i32 }
%struct.vink_tree = type { i32 }
@stderr = global i32 0
@.str = [14 x i8] c"Got response\0A\00"
define void @response(%struct.vink_epp_state* %0, i8* %1, %struct.vink_tree* %2) {
%4 = alloca %struct.vink_epp_state*
%5 = alloca i8*
%6 = alloca %struct.vink_tree*
store %struct.vink_epp_state* %0, %struct.vink_epp_state** %4
store i8* %1, i8** %5
store %struct.vink_tree* %2, %struct.vink_tree** %6
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.vink_epp_state = type { i32 }
%struct.vink_tree = type { i32 }
@stderr = global i32 0
@.str = [14 x i8] c"Got response\0A\00"
define void @response(%struct.vink_epp_state* nocapture readnone %0, i8* nocapture readnone %1, %struct.vink_tree* nocapture readnone %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
void X509_STORE_CTX_get0_param(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_STORE_CTX_get0_param() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ wDateTimePush(char, int /*<<< orphan*/);
int /*<<< orphan*/ wStackPopDateTime();
void wBuiltinWeekdayName() { wDateTimePush('W', wStackPopDateTime()); }


x86 assembly (clang, -O0):
<wBuiltinWeekdayName>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <wStackPopDateTime@plt>
mov    %eax,%esi
mov    $0x57,%edi
call   1030 <wDateTimePush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wBuiltinWeekdayName>:
push   %rax
xor    %eax,%eax
call   1040 <wStackPopDateTime@plt>
mov    $0x57,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <wDateTimePush@plt>

LLVM IR (-O0):
define void @wBuiltinWeekdayName() {
%1 = call i32 (...) @wStackPopDateTime()
%2 = call i32 @wDateTimePush(i8 signext 87, i32 %1)
ret void
}

LLVM IR (-O2):
define void @wBuiltinWeekdayName() {
%1 = tail call i32 (...) @wStackPopDateTime()
%2 = tail call i32 @wDateTimePush(i8 signext 87, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f2();
int main() {
  f2();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f2()
ret i32 0
}
/* Variables and functions */
int yas_bma250_read_reg_byte(int);
int yas_bma250_get_cal_ready(unsigned char *calrdy) {
  int ret = 0;
  int reg_data = 0;
  reg_data = yas_bma250_read_reg_byte(0x36);
  reg_data = ((reg_data & 0x10) >> 4);
  *calrdy = reg_data;
  return ret;
}


x86 assembly (clang, -O0):
<yas_bma250_get_cal_ready>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    $0x36,%edi
call   1030 <yas_bma250_read_reg_byte@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    $0x10,%eax
sar    $0x4,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yas_bma250_get_cal_ready>:
push   %rbx
mov    %rdi,%rbx
mov    $0x36,%edi
call   1030 <yas_bma250_read_reg_byte@plt>
shr    $0x4,%al
and    $0x1,%al
mov    %al,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @yas_bma250_get_cal_ready(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
store i32 0, i32* %4
%5 = call i32 @yas_bma250_read_reg_byte(i32 54)
store i32 %5, i32* %4
%6 = load i32, i32* %4
%7 = and i32 %6, 16
%8 = ashr i32 %7, 4
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = trunc i32 %9 to i8
%11 = load i8*, i8** %2
store i8 %10, i8* %11
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @yas_bma250_get_cal_ready(i8* nocapture writeonly %0) {
%2 = tail call i32 @yas_bma250_read_reg_byte(i32 54)
%3 = trunc i32 %2 to i8
%4 = lshr i8 %3, 4
%5 = and i8 %4, 1
store i8 %5, i8* %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ print_help();
void arg_check(int argc, int expected) {
  if (argc - 2 != expected) {
    print_help();
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<arg_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x2,%eax
cmp    -0x8(%rbp),%eax
je     1152 <arg_check+0x32>
mov    $0x0,%al
call   1030 <print_help@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arg_check>:
add    $0xfffffffe,%edi
cmp    %esi,%edi
jne    1128 <arg_check+0x8>
ret
push   %rax
xor    %eax,%eax
call   1030 <print_help@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @arg_check(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 = sub nsw i32 %5, 2
%7 = load i32, i32* %4
%8 = icmp ne i32 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = call i32 (...) @print_help()
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %2
ret void
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @arg_check(i32 %0, i32 %1) {
%3 = add nsw i32 %0, -2
%4 = icmp eq i32 %3, %1
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 (...) @print_help()
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
ret void
}
float foz(int x, int y) { return x * y; }


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

x86 assembly (clang, -O2):
<foz>:
imul   %esi,%edi
cvtsi2ss %edi,%xmm0
ret

LLVM IR (-O0):
define float @foz(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 = mul nsw i32 %5, %6
%8 = sitofp i32 %7 to float
ret float %8
}

LLVM IR (-O2):
define float @foz(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = sitofp i32 %3 to float
ret float %4
}
/* Variables and functions */
char *strtok(char *, char *);
const char *remove_creturn(char *str) {
  str = strtok(str, "\r");
  return str;
}


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0D\00"
define i8* @remove_creturn(i8* %0) {
%2 = tail call i8* @strtok(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
/* Variables and functions */
unsigned int unsigned_value();
unsigned char uchar_range(unsigned min, unsigned max) {
  unsigned x = unsigned_value();
  if (x < min || max < x)
    x = min;
  return x;
}


x86 assembly (clang, -O0):
<uchar_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <unsigned_value@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jb     1140 <uchar_range+0x30>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1146 <uchar_range+0x36>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uchar_range>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <unsigned_value@plt>
cmp    %ebx,%eax
mov    %eax,%ecx
cmova  %ebp,%ecx
cmp    %ebp,%eax
cmovb  %ebp,%ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define zeroext i8 @uchar_range(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = call i32 (...) @unsigned_value()
store i32 %6, i32* %5
%7 = load i32, i32* %5
%8 = load i32, i32* %3
%9 = icmp ult i32 %7, %8
br i1 %9, label %14, label %10
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = icmp ult i32 %11, %12
br i1 %13, label %14, label %16
14: ; preds = %10, %2
%15 = load i32, i32* %3
store i32 %15, i32* %5
br label %16
16: ; preds = %14, %10
%17 = load i32, i32* %5
%18 = trunc i32 %17 to i8
ret i8 %18
}

LLVM IR (-O2):
define zeroext i8 @uchar_range(i32 %0, i32 %1) {
%3 = tail call i32 (...) @unsigned_value()
%4 = icmp ult i32 %3, %0
%5 = icmp ugt i32 %3, %1
%6 = or i1 %4, %5
%7 = select i1 %6, i32 %0, i32 %3
%8 = trunc i32 %7 to i8
ret i8 %8
}
/* Variables and functions */
int /*<<< orphan*/ DoCodeFdefault();
void DoCodeF(void) {
  { DoCodeFdefault(); }
}


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

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

LLVM IR (-O0):
define void @DoCodeF() {
%1 = call i32 (...) @DoCodeFdefault()
ret void
}

LLVM IR (-O2):
define void @DoCodeF() {
%1 = tail call i32 (...) @DoCodeFdefault()
ret void
}
void TIM4_IRQHandler() {}


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

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

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

LLVM IR (-O2):
define void @TIM4_IRQHandler() {
ret void
}
int test_imm_01uint32_mem(unsigned int *val) {
  return ((*val) & (0x01 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_01uint32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0x1,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_01uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 1
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ eeprom_write_dword(int /*<<< orphan*/ *, int /*<<< orphan*/);
void eeprom_update_dword(uint32_t *addr, uint32_t value) {
  eeprom_write_dword(addr, value);
}


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

x86 assembly (clang, -O2):
<eeprom_update_dword>:
jmp    1030 <eeprom_write_dword@plt>

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

LLVM IR (-O2):
define void @eeprom_update_dword(i32* %0, i32 %1) {
%3 = tail call i32 @eeprom_write_dword(i32* %0, i32 %1)
ret void
}
float Sleef_atanf_u10(float x) { return __builtin_atanf(x); }


x86 assembly (clang, -O0):
<Sleef_atanf_u10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <atanf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sleef_atanf_u10>:
jmp    1030 <atanf@plt>

LLVM IR (-O0):
define float @Sleef_atanf_u10(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @atanf(float %3)
ret float %4
}

LLVM IR (-O2):
define float @Sleef_atanf_u10(float %0) {
%2 = tail call float @atanf(float %0)
ret float %2
}
/* Variables and functions */
int asymbol(char);
int main() { return asymbol('a'); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x61,%edi
call   1030 <asymbol@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x61,%edi
jmp    1030 <asymbol@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @asymbol(i8 signext 97)
ret i32 %2
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @asymbol(i8 signext 97)
ret i32 %1
}
int strcmp(const char *s1, const char *s2) {
  while (*s1 && (*s1 == *s2))
    s1++, s2++;
  return *(const unsigned char *)s1 - *(const unsigned char *)s2;
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1137 <strcmp+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1147 <strcmp+0x47>
jmp    1164 <strcmp+0x64>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <strcmp+0xc>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
mov    (%rdi),%al
test   %al,%al
je     1123 <strcmp+0x23>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
cmp    (%rsi),%al
jne    1125 <strcmp+0x25>
add    $0x1,%rsi
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <strcmp+0x10>
xor    %eax,%eax
movzbl %al,%eax
movzbl (%rsi),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @strcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %20, %2
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %18
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = load i8*, i8** %4
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %13, %16
br label %18
18: ; preds = %10, %5
%19 = phi i1 [ false, %5 ], [ %17, %10 ]
br i1 %19, label %20, label %25
20: ; preds = %18
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %3
%23 = load i8*, i8** %4
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %4
br label %5
25: ; preds = %18
%26 = load i8*, i8** %3
%27 = load i8, i8* %26
%28 = zext i8 %27 to i32
%29 = load i8*, i8** %4
%30 = load i8, i8* %29
%31 = zext i8 %30 to i32
%32 = sub nsw i32 %28, %31
ret i32 %32
}

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %11
%6 = phi i8 [ %14, %11 ], [ %3, %2 ]
%7 = phi i8* [ %13, %11 ], [ %1, %2 ]
%8 = phi i8* [ %12, %11 ], [ %0, %2 ]
%9 = load i8, i8* %7
%10 = icmp eq i8 %6, %9
br i1 %10, label %11, label %16
11: ; preds = %5
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %12
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %11, %2
%17 = phi i8* [ %1, %2 ], [ %13, %11 ], [ %7, %5 ]
%18 = phi i8 [ 0, %2 ], [ 0, %11 ], [ %6, %5 ]
%19 = zext i8 %18 to i32
%20 = load i8, i8* %17
%21 = zext i8 %20 to i32
%22 = sub nsw i32 %19, %21
ret i32 %22
}
/* Type definitions */
typedef int /*<<< orphan*/ format;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int);
char *protocol_ChunkidToString(int chunk) {
  char format[5];
  static char chunkid_as_string[5];
  snprintf(format, sizeof(format), "%%0%dd", 4);
  snprintf(chunkid_as_string, 4 + 1, format, chunk);
  return chunkid_as_string;
}


x86 assembly (clang, -O0):
<protocol_ChunkidToString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x9(%rbp),%rdi
mov    $0x5,%esi
lea    0xed5(%rip),%rdx
mov    $0x4,%ecx
call   1030 <snprintf@plt>
lea    -0x9(%rbp),%rdx
mov    -0x4(%rbp),%ecx
lea    0x2ee6(%rip),%rdi
mov    $0x5,%esi
call   1030 <snprintf@plt>
lea    0x2ed5(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<protocol_ChunkidToString>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
lea    0xede(%rip),%rdx
lea    0xb(%rsp),%r14
mov    %r14,%rdi
mov    $0x5,%esi
mov    $0x4,%ecx
call   1030 <snprintf@plt>
lea    0x2ee9(%rip),%r15
mov    %r15,%rdi
mov    $0x5,%esi
mov    %r14,%rdx
mov    %ebx,%ecx
call   1030 <snprintf@plt>
mov    %r15,%rax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@protocol_ChunkidToString.chunkid_as_string = internal global [5 x i8] zeroinitializer
@.str = [7 x i8] c"%%0%dd\00"
define i8* @protocol_ChunkidToString(i32 %0) {
%2 = alloca i32
%3 = alloca [5 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 4)
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%7 = load i32, i32* %2
%8 = call i32 @snprintf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @protocol_ChunkidToString.chunkid_as_string, i64 0, i64 0), i32 5, i8* %6, i32 %7)
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @protocol_ChunkidToString.chunkid_as_string, i64 0, i64 0)
}

LLVM IR (-O2):
@protocol_ChunkidToString.chunkid_as_string = internal global [5 x i8] zeroinitializer
@.str = [7 x i8] c"%%0%dd\00"
define i8* @protocol_ChunkidToString(i32 %0) {
%2 = alloca [5 x i8]
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 4)
%5 = call i32 @snprintf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @protocol_ChunkidToString.chunkid_as_string, i64 0, i64 0), i32 5, i8* %3, i32 %0)
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @protocol_ChunkidToString.chunkid_as_string, i64 0, i64 0)
}
int isseparator(char sym) { return (sym == '&'); }


x86 assembly (clang, -O0):
<isseparator>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x26,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isseparator>:
xor    %eax,%eax
cmp    $0x26,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @isseparator(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 38
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @isseparator(i8 signext %0) {
%2 = icmp eq i8 %0, 38
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
struct _dfs {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct _dfs *);
void free_func(void *p) {
  struct _dfs *dfs = (struct _dfs *)p;
  free(dfs);
}


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

x86 assembly (clang, -O2):
<free_func>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct._dfs = type { i32 }
define void @free_func(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct._dfs*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct._dfs*
store %struct._dfs* %5, %struct._dfs** %3
%6 = load %struct._dfs*, %struct._dfs** %3
%7 = call i32 @free(%struct._dfs* %6)
ret void
}

LLVM IR (-O2):
%struct._dfs = type { i32 }
define void @free_func(i8* nocapture %0) {
%2 = bitcast i8* %0 to %struct._dfs*
%3 = tail call i32 @free(%struct._dfs* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void showTitle() {
  printf("\033[0;37m");
  printf("=================================\n");
  printf("===== CONWAY'S GAME OF LIFE =====\n");
  printf("=================================\n\n");
}


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

x86 assembly (clang, -O2):
<showTitle>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
lea    0xed4(%rip),%rdi
call   1030 <puts@plt>
lea    0xeea(%rip),%rdi
call   1030 <puts@plt>
lea    0xf00(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"\1B[0;37m\00"
@.str.1 = [35 x i8] c"=================================\0A\00"
@.str.2 = [35 x i8] c"===== CONWAY'S GAME OF LIFE =====\0A\00"
@.str.3 = [36 x i8] c"=================================\0A\0A\00"
define void @showTitle() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"\1B[0;37m\00"
@str = [34 x i8] c"=================================\00"
@str.4 = [34 x i8] c"===== CONWAY'S GAME OF LIFE =====\00"
@str.5 = [35 x i8] c"=================================\0A\00"
define void @showTitle() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.4, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.5, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef size_t int64_t;

/* Variables and functions */
size_t INT64_MAX;
void use_int64_max_Bad() {
  char arr[10];
  int64_t x = INT64_MAX;
  int64_t y = INT64_MAX - 15;
  arr[x - y] = 0;
}


x86 assembly (clang, -O0):
<use_int64_max_Bad>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    0x2ecf(%rip),%rax
mov    (%rax),%rax
sub    $0xf,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
sub    -0x20(%rbp),%rax
movb   $0x0,-0xa(%rbp,%rax,1)
pop    %rbp
ret

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

LLVM IR (-O0):
@INT64_MAX = global i64 0
define void @use_int64_max_Bad() {
%1 = alloca [10 x i8]
%2 = alloca i64
%3 = alloca i64
%4 = load i64, i64* @INT64_MAX
store i64 %4, i64* %2
%5 = load i64, i64* @INT64_MAX
%6 = sub i64 %5, 15
store i64 %6, i64* %3
%7 = load i64, i64* %2
%8 = load i64, i64* %3
%9 = sub i64 %7, %8
%10 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 %9
store i8 0, i8* %10
ret void
}

LLVM IR (-O2):
@INT64_MAX = global i64 0
define void @use_int64_max_Bad() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void _irq_stub(void) { printf("irq stub\n"); }


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

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

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

LLVM IR (-O2):
@str = [9 x i8] c"irq stub\00"
define void @_irq_stub() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
int str_equals(const char *p, const char *q) { return strcmp(p, q) == 0; }


x86 assembly (clang, -O0):
<str_equals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @str_equals(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 = load i8*, i8** %4
%7 = call i64 @strcmp(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @str_equals(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
void strip_comment(char *line) {
  while (*line && *line != ';')
    line++;
  *line = '\n';
  *(line + 1) = '\0';
}


x86 assembly (clang, -O0):
<strip_comment>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     112d <strip_comment+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3b,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113d <strip_comment+0x3d>
jmp    114e <strip_comment+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <strip_comment+0x8>
mov    -0x8(%rbp),%rax
movb   $0xa,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<strip_comment>:
movzbl (%rdi),%eax
test   %al,%al
je     1111 <strip_comment+0x11>
cmp    $0x3b,%al
je     1111 <strip_comment+0x11>
add    $0x1,%rdi
jmp    1100 <strip_comment>
movw   $0xa,(%rdi)
ret

LLVM IR (-O0):
define void @strip_comment(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %15, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 59
br label %13
13: ; preds = %8, %3
%14 = phi i1 [ false, %3 ], [ %12, %8 ]
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %2
br label %3
18: ; preds = %13
%19 = load i8*, i8** %2
store i8 10, i8* %19
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 1
store i8 0, i8* %21
ret void
}

LLVM IR (-O2):
define void @strip_comment(i8* nocapture %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %7
i8 59, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2
store i8 10, i8* %3
%8 = getelementptr inbounds i8, i8* %3, i64 1
store i8 0, i8* %8
ret void
}
/* Variables and functions */
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int getRand(int first, int last) {
  static int firstTime = 1;
  int amountOfNumbers;
  if (firstTime == 1) {
    firstTime = 0;
    srand(time(NULL));
  }
  amountOfNumbers = last - first + 1;
  return (rand() % amountOfNumbers + first);
}


x86 assembly (clang, -O0):
<getRand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x1,0x2ef3(%rip)
jne    1165 <getRand+0x35>
movl   $0x0,0x2ee3(%rip)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1050 <rand@plt>
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRand>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
cmpb   $0x0,0x2efe(%rip)
jne    1155 <getRand+0x25>
movb   $0x1,0x2ef5(%rip)
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
sub    %ebx,%ebp
add    $0x1,%ebp
xor    %eax,%eax
call   1050 <rand@plt>
cltd
idiv   %ebp
add    %edx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@getRand.firstTime = internal global i32 1
define i32 @getRand(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* @getRand.firstTime
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %11
8: ; preds = %2
store i32 0, i32* @getRand.firstTime
%9 = call i32 @time(i32* null)
%10 = call i32 @srand(i32 %9)
br label %11
11: ; preds = %8, %2
%12 = load i32, i32* %4
%13 = load i32, i32* %3
%14 = sub nsw i32 %12, %13
%15 = add nsw i32 %14, 1
store i32 %15, i32* %5
%16 = call i32 (...) @rand()
%17 = load i32, i32* %5
%18 = srem i32 %16, %17
%19 = load i32, i32* %3
%20 = add nsw i32 %18, %19
ret i32 %20
}

LLVM IR (-O2):
@getRand.firstTime = internal unnamed_addr global i1 false
define i32 @getRand(i32 %0, i32 %1) {
%3 = load i1, i1* @getRand.firstTime
br i1 %3, label %7, label %4
4: ; preds = %2
store i1 true, i1* @getRand.firstTime
%5 = tail call i32 @time(i32* null)
%6 = tail call i32 @srand(i32 %5)
br label %7
7: ; preds = %4, %2
%8 = sub i32 1, %0
%9 = add i32 %8, %1
%10 = tail call i32 (...) @rand()
%11 = srem i32 %10, %9
%12 = add nsw i32 %11, %0
ret i32 %12
}
int test_imm_BAuint8_mem(unsigned char *val) {
  return ((*val) & (0xBA << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_BAuint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0xba,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_BAuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -70
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int base2e15_encode_length(int len) { return (len * 8 + 14) / 15; }


x86 assembly (clang, -O0):
<base2e15_encode_length>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x3,%eax
add    $0xe,%eax
mov    $0xf,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<base2e15_encode_length>:
lea    0xe(,%rdi,8),%eax
cltq
imul   $0xffffffff88888889,%rax,%rax
shr    $0x20,%rax
lea    (%rax,%rdi,8),%eax
add    $0xe,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x3,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @base2e15_encode_length(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 8
%5 = add nsw i32 %4, 14
%6 = sdiv i32 %5, 15
ret i32 %6
}

LLVM IR (-O2):
define i32 @base2e15_encode_length(i32 %0) {
%2 = shl nsw i32 %0, 3
%3 = add nsw i32 %2, 14
%4 = sdiv i32 %3, 15
ret i32 %4
}
float quarticEaseOutf(float p) {
  float f = (p - 1);
  return f * f * f * (1 - p) + 1;
}


x86 assembly (clang, -O0):
<quarticEaseOutf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  0xeca(%rip),%xmm1
subss  -0x4(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  0xeb9(%rip),%xmm1
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<quarticEaseOutf>:
movss  0xef8(%rip),%xmm1
addss  %xmm0,%xmm1
movaps %xmm1,%xmm2
mulss  %xmm1,%xmm2
mulss  %xmm1,%xmm2
movss  0xee5(%rip),%xmm3
movaps %xmm3,%xmm1
subss  %xmm0,%xmm1
mulss  %xmm2,%xmm1
addss  %xmm3,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @quarticEaseOutf(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fsub float %4, 1.000000e+00
store float %5, float* %3
%6 = load float, float* %3
%7 = load float, float* %3
%8 = fmul float %6, %7
%9 = load float, float* %3
%10 = fmul float %8, %9
%11 = load float, float* %2
%12 = fsub float 1.000000e+00, %11
%13 = call float @llvm.fmuladd.f32(float %10, float %12, float 1.000000e+00)
ret float %13
}

LLVM IR (-O2):
define float @quarticEaseOutf(float %0) {
%2 = fadd float %0, -1.000000e+00
%3 = fmul float %2, %2
%4 = fmul float %2, %3
%5 = fsub float 1.000000e+00, %0
%6 = tail call float @llvm.fmuladd.f32(float %4, float %5, float 1.000000e+00)
ret float %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int pclose(int /*<<< orphan*/ *);
int pipeclose(FILE *p) { return pclose(p); }


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

x86 assembly (clang, -O2):
<pipeclose>:
jmp    1030 <pclose@plt>

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

LLVM IR (-O2):
define i32 @pipeclose(i32* nocapture %0) {
%2 = tail call i32 @pclose(i32* %0)
ret i32 %2
}
void lh_delete(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
time_t getTime() { return time(NULL); }


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

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

LLVM IR (-O0):
define i32 @getTime() {
%1 = call i32 @time(i32* null)
ret i32 %1
}

LLVM IR (-O2):
define i32 @getTime() {
%1 = tail call i32 @time(i32* null)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ nlink_t;

/* Variables and functions */
int /*<<< orphan*/ guitp(char *, int);
void g_nlink_t() { guitp("nlink_t", sizeof(nlink_t)); }


x86 assembly (clang, -O0):
<g_nlink_t>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x4,%esi
call   1030 <guitp@plt>
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"nlink_t\00"
define void @g_nlink_t() {
%1 = tail call i32 @guitp(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 4)
ret void
}
void arg_ptr(char *p) { __builtin_prefetch(p, 0, 0); }


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

x86 assembly (clang, -O2):
<arg_ptr>:
prefetchnta (%rdi)
ret

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

LLVM IR (-O2):
define void @arg_ptr(i8* nocapture %0) {
tail call void @llvm.prefetch.p0i8(i8* %0, i32 0, i32 0, i32 1)
ret void
}
char hexdig(unsigned char x) {
  if (x > 0xf)
    return 'X';
  if (x < 10)
    return '0' + x;
  else
    return 'a' + x - 10;
}


x86 assembly (clang, -O0):
<hexdig>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0xf,%eax
jle    1120 <hexdig+0x20>
movb   $0x58,-0x1(%rbp)
jmp    1149 <hexdig+0x49>
movzbl -0x2(%rbp),%eax
cmp    $0xa,%eax
jge    113c <hexdig+0x3c>
movzbl -0x2(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    1149 <hexdig+0x49>
movzbl -0x2(%rbp),%eax
add    $0x61,%eax
sub    $0xa,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexdig>:
mov    $0x58,%al
cmp    $0xf,%dil
ja     111a <hexdig+0x1a>
cmp    $0x9,%dil
ja     1114 <hexdig+0x14>
add    $0x30,%dil
jmp    1118 <hexdig+0x18>
add    $0x57,%dil
mov    %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @hexdig(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp sgt i32 %5, 15
br i1 %6, label %7, label %8
7: ; preds = %1
store i8 88, i8* %2
br label %23
8: ; preds = %1
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = icmp slt i32 %10, 10
br i1 %11, label %12, label %17
12: ; preds = %8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = add nsw i32 48, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %2
br label %23
17: ; preds = %8
%18 = load i8, i8* %3
%19 = zext i8 %18 to i32
%20 = add nsw i32 97, %19
%21 = sub nsw i32 %20, 10
%22 = trunc i32 %21 to i8
store i8 %22, i8* %2
br label %23
23: ; preds = %17, %12, %7
%24 = load i8, i8* %2
ret i8 %24
}

LLVM IR (-O2):
define signext i8 @hexdig(i8 zeroext %0) {
%2 = icmp ugt i8 %0, 15
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = icmp ult i8 %0, 10
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = add nuw nsw i8 %0, 48
br label %9
7: ; preds = %3
%8 = add nuw nsw i8 %0, 87
br label %9
9: ; preds = %1, %7, %5
%10 = phi i8 [ %6, %5 ], [ %8, %7 ], [ 88, %1 ]
ret i8 %10
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
void dispose() { endwin(); }


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

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

LLVM IR (-O0):
define void @dispose() {
%1 = call i32 (...) @endwin()
ret void
}

LLVM IR (-O2):
define void @dispose() {
%1 = tail call i32 (...) @endwin()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void writetail(char *lineptr[], int nlines, int row) {
  int i;
  for (i = nlines - row; i < nlines; i++)
    printf("%s\n", *(lineptr + i));
}


x86 assembly (clang, -O0):
<writetail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115d <writetail+0x4d>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112b <writetail+0x1b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writetail>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edx,%edx
jle    1145 <writetail+0x35>
mov    %rdi,%r15
movslq %esi,%r12
sub    %edx,%esi
movslq %esi,%rbx
lea    0xed2(%rip),%r14
xchg   %ax,%ax
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %r12,%rbx
jl     1130 <writetail+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @writetail(i8** nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %16
5: ; preds = %3
%6 = sub i32 %1, %2
%7 = sext i32 %6 to i64
%8 = sext i32 %1 to i64
br label %9
9: ; preds = %5, %9
%10 = phi i64 [ %7, %5 ], [ %14, %9 ]
%11 = getelementptr inbounds i8*, i8** %0, i64 %10
%12 = load i8*, i8** %11
%13 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = add nsw i64 %10, 1
%15 = icmp slt i64 %14, %8
br i1 %15, label %9, label %16
16: ; preds = %9, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SensorSettingsHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void SensorSettingsRequestUpdate() {
  UAVObjRequestUpdate(SensorSettingsHandle());
}


x86 assembly (clang, -O0):
<SensorSettingsRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <SensorSettingsHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SensorSettingsRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <SensorSettingsHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @SensorSettingsRequestUpdate() {
%1 = call i32 (...) @SensorSettingsHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @SensorSettingsRequestUpdate() {
%1 = tail call i32 (...) @SensorSettingsHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}