xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
size_t strlen(char *);
void print_reverse(char *s) {
  size_t len = strlen(s);
  char *t = s + len - 1;
  while (t >= s) {
    printf("%c", *t);
    t = t - 1;
  }
}


x86 assembly (clang, -O0):
<print_reverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jb     117b <print_reverse+0x5b>
mov    -0x18(%rbp),%rax
lea    0xe9e(%rip),%rdi
movsbl (%rax),%esi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
jmp    1149 <print_reverse+0x29>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_reverse>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
call   1030 <strlen@plt>
lea    (%r15,%rax,1),%rbx
add    $0xffffffffffffffff,%rbx
cmp    %r15,%rbx
jb     1164 <print_reverse+0x44>
lea    0xebf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%rbx),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
add    $0xffffffffffffffff,%rbx
cmp    %r15,%rbx
jae    1150 <print_reverse+0x30>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @print_reverse(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = getelementptr inbounds i8, i8* %0, i64 %2
%4 = getelementptr inbounds i8, i8* %3, i64 -1
%5 = icmp ult i8* %4, %0
br i1 %5, label %12, label %6
6: ; preds = %1, %6
%7 = phi i8* [ %10, %6 ], [ %4, %1 ]
%8 = load i8, i8* %7
%9 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %8)
%10 = getelementptr inbounds i8, i8* %7, i64 -1
%11 = icmp ult i8* %10, %0
br i1 %11, label %12, label %6
12: ; preds = %6, %1
ret void
}
void INT_Excep_PERIB_INTB141(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIB_INTB141() {
ret void
}
int script_init_for_python(char *py_pathname) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @script_init_for_python(i8* nocapture readnone %0) {
ret i32 -1
}
unsigned int build_rfdc(int dcoff_i_rxfe, int dcoff_q_rxfe) {
  return (dcoff_i_rxfe + dcoff_q_rxfe << 8);
}


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

x86 assembly (clang, -O2):
<build_rfdc>:
lea    (%rdi,%rsi,1),%eax
shl    $0x8,%eax
ret

LLVM IR (-O0):
define i32 @build_rfdc(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 = shl i32 %7, 8
ret i32 %8
}

LLVM IR (-O2):
define i32 @build_rfdc(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = shl i32 %3, 8
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts("Libcoap compiled!");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"Libcoap compiled!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"Libcoap compiled!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
unsigned xrop3_34_0_1(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;
  stk2 = ~S;
  stk1 = D & stk2;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_34_0_1>:
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,-0x18(%rbp)
mov    -0x8(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @xrop3_34_0_1(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 = xor i32 %3, 255
%9 = xor i32 %6, -1
%10 = and i32 %8, %9
%11 = and i32 %7, %5
%12 = or i32 %10, %11
ret i32 %12
}
/* Variables and functions */
scalar_t__ toupper(char);
char *strupper(char *str) {
  char *cp;
  for (cp = str; *cp; ++cp)
    *cp = (char)toupper(*cp);
  return (cp);
}


x86 assembly (clang, -O0):
<strupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <strupper+0x46>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <strupper+0x14>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strupper>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <strupper+0x26>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,(%rbx)
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <strupper+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @strupper(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = tail call i64 @toupper(i8 signext %5)
%8 = trunc i64 %7 to i8
store i8 %8, i8* %6
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
%13 = phi i8* [ %0, %1 ], [ %9, %4 ]
ret i8* %13
}
void gtk_action_group_translate_string() {}


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

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

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

LLVM IR (-O2):
define void @gtk_action_group_translate_string() {
ret void
}
/* Variables and functions */
size_t size_t_unit(void) {
  size_t res = 0;
  unsigned char c = ~0;
  for (; c; res++, c >>= 1)
    ;
  return res;
}


x86 assembly (clang, -O0):
<size_t_unit>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
movb   $0xff,-0x9(%rbp)
cmpb   $0x0,-0x9(%rbp)
je     113a <size_t_unit+0x3a>
jmp    111f <size_t_unit+0x1f>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
movzbl -0x9(%rbp),%eax
sar    $0x1,%eax
mov    %al,-0x9(%rbp)
jmp    1110 <size_t_unit+0x10>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @size_t_unit() {
ret i64 8
}
int test_imm_ECuint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0xEC << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_ECuint64_highword_reg>:
movabs $0xec00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_ECuint64_highword_reg(i64 %0) {
%2 = and i64 %0, 1013612281856
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ pal_pmu_cycle_counter_stop();
void val_measurement_stop() { pal_pmu_cycle_counter_stop(); }


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

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

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

LLVM IR (-O2):
define void @val_measurement_stop() {
%1 = tail call i32 (...) @pal_pmu_cycle_counter_stop()
ret void
}
void __attribute__((weak)) tim4_isr() { debug_handler(__FUNCTION__); }


x86 assembly (clang, -O0):
<tim4_isr>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <debug_handler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tim4_isr>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <debug_handler@plt>

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

LLVM IR (-O2):
@__FUNCTION__.tim4_isr = [9 x i8] c"tim4_isr\00"
define weak void @tim4_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__FUNCTION__.tim4_isr, i64 0, i64 0))
ret void
}
void ff_hevc_put_hevc_bi_w_qpel_v4_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_qpel_v4_10_sse4() {
ret void
}
int _strlen(char *s) {
  int n = 0;
  int m = 0;
  while (*(s + m) != '\0') {
    ++n;
    m++;
  }
  return (n);
}


x86 assembly (clang, -O0):
<_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1142 <_strlen+0x42>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <_strlen+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_strlen>:
cmpb   $0x0,(%rdi)
je     111c <_strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <_strlen+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @_strlen(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
br label %5
5: ; preds = %13, %1
%6 = load i8*, i8** %2
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %5
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
%16 = load i32, i32* %4
%17 = add nsw i32 %16, 1
store i32 %17, i32* %4
br label %5
18: ; preds = %5
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @_strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %6, %4 ], [ 0, %1 ]
%6 = add nuw nsw i64 %5, 1
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
br i1 %9, label %10, label %4
10: ; preds = %4
%11 = trunc i64 %6 to i32
br label %12
12: ; preds = %10, %1
%13 = phi i32 [ 0, %1 ], [ %11, %10 ]
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ Interpolate_2(int /*<<< orphan*/, int, int /*<<< orphan*/,
                                 int, int);
uint32_t Interp1(uint32_t c1, uint32_t c2) {
  return Interpolate_2(c1, 3, c2, 1, 2);
}


x86 assembly (clang, -O0):
<Interp1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    $0x3,%esi
mov    $0x1,%ecx
mov    $0x2,%r8d
call   1030 <Interpolate_2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Interp1>:
mov    %esi,%edx
mov    $0x3,%esi
mov    $0x1,%ecx
mov    $0x2,%r8d
jmp    1030 <Interpolate_2@plt>

LLVM IR (-O0):
define i32 @Interp1(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 @Interpolate_2(i32 %5, i32 3, i32 %6, i32 1, i32 2)
ret i32 %7
}

LLVM IR (-O2):
define i32 @Interp1(i32 %0, i32 %1) {
%3 = tail call i32 @Interpolate_2(i32 %0, i32 3, i32 %1, i32 1, i32 2)
ret i32 %3
}
int commandB(char *inBuf, char *outBuf) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @commandB(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
int fun136() { return 136; }


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

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

LLVM IR (-O0):
define i32 @fun136() {
ret i32 136
}

LLVM IR (-O2):
define i32 @fun136() {
ret i32 136
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void ComparatorIntEnable(uint32_t ui32Base, uint32_t ui32Comp) {
  ASSERT(ui32Base == 0x4003C000);
  ASSERT(ui32Comp < 3);
  (*((volatile uint32_t *)(ui32Base + 0x00000008))) |= 1 << ui32Comp;
}


x86 assembly (clang, -O0):
<ComparatorIntEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x4003c000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
cmpl   $0x3,-0x8(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    -0x4(%rbp),%eax
add    $0x8,%eax
cltq
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ComparatorIntEnable>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
cmp    $0x4003c000,%ebp
sete   %dil
call   1030 <ASSERT@plt>
xor    %edi,%edi
cmp    $0x3,%ebx
setl   %dil
call   1030 <ASSERT@plt>
mov    $0x1,%eax
mov    %ebx,%ecx
shl    %cl,%eax
movslq %ebp,%rcx
or     %eax,0x8(%rcx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @ComparatorIntEnable(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 = icmp eq i32 %5, 1073987584
%7 = zext i1 %6 to i32
%8 = call i32 @ASSERT(i32 %7)
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 3
%11 = zext i1 %10 to i32
%12 = call i32 @ASSERT(i32 %11)
%13 = load i32, i32* %4
%14 = shl i32 1, %13
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 8
%17 = sext i32 %16 to i64
%18 = inttoptr i64 %17 to i32*
%19 = load volatile i32, i32* %18
%20 = or i32 %19, %14
store volatile i32 %20, i32* %18
ret void
}

LLVM IR (-O2):
define void @ComparatorIntEnable(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1073987584
%4 = zext i1 %3 to i32
%5 = tail call i32 @ASSERT(i32 %4)
%6 = icmp slt i32 %1, 3
%7 = zext i1 %6 to i32
%8 = tail call i32 @ASSERT(i32 %7)
%9 = shl nuw i32 1, %1
%10 = add nsw i32 %0, 8
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
%13 = load volatile i32, i32* %12
%14 = or i32 %13, %9
store volatile i32 %14, i32* %12
ret void
}
/* Variables and functions */
bool isInArray(int array[], int n, int value) {
  int i;
  for (i = 0; i < n; i++) {
    if (array[i] == value)
      return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<isInArray>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1154 <isInArray+0x54>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
jne    1141 <isInArray+0x41>
movl   $0x1,-0x4(%rbp)
jmp    115b <isInArray+0x5b>
jmp    1146 <isInArray+0x46>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <isInArray+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isInArray>:
test   %esi,%esi
jle    111e <isInArray+0x1e>
mov    %esi,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmp    %edx,(%rdi,%rcx,4)
je     1121 <isInArray+0x21>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1110 <isInArray+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @isInArray(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 0, i32* %8
br label %9
9: ; preds = %23, %3
%10 = load i32, i32* %8
%11 = load i32, i32* %6
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %26
13: ; preds = %9
%14 = load i32*, i32** %5
%15 = load i32, i32* %8
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = load i32, i32* %17
%19 = load i32, i32* %7
%20 = icmp eq i32 %18, %19
br i1 %20, label %21, label %22
21: ; preds = %13
store i32 1, i32* %4
br label %27
22: ; preds = %13
br label %23
23: ; preds = %22
%24 = load i32, i32* %8
%25 = add nsw i32 %24, 1
store i32 %25, i32* %8
br label %9
26: ; preds = %9
store i32 0, i32* %4
br label %27
27: ; preds = %26, %21
%28 = load i32, i32* %4
ret i32 %28
}

LLVM IR (-O2):
define i32 @isInArray(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %14, %6
br i1 %8, label %15, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %14, %7 ]
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, %2
%14 = add nuw nsw i64 %10, 1
br i1 %13, label %15, label %7
15: ; preds = %9, %7, %3
%16 = phi i32 [ 0, %3 ], [ 0, %7 ], [ 1, %9 ]
ret i32 %16
}
int count_leading_1s(int num) {
  int out = 0;
  if (num > 255 || num < 0) {
    return -1;
  }
  while ((num & 0x80) == 0x80) {
    num <<= 1;
    num &= 0xff;
    out++;
  }
  return out;
}


x86 assembly (clang, -O0):
<count_leading_1s>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xff,-0x8(%rbp)
jg     1125 <count_leading_1s+0x25>
cmpl   $0x0,-0x8(%rbp)
jge    1131 <count_leading_1s+0x31>
movl   $0xffffffff,-0x4(%rbp)
jmp    1171 <count_leading_1s+0x71>
jmp    1136 <count_leading_1s+0x36>
mov    -0x8(%rbp),%eax
and    $0x80,%eax
cmp    $0x80,%eax
jne    116b <count_leading_1s+0x6b>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <count_leading_1s+0x36>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_leading_1s>:
mov    $0xffffffff,%eax
cmp    $0xff,%edi
ja     1131 <count_leading_1s+0x31>
xor    %eax,%eax
test   $0x80,%dil
je     1131 <count_leading_1s+0x31>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
lea    (%rdi,%rdi,1),%ecx
movzbl %cl,%ecx
add    $0x1,%eax
test   $0x40,%dil
mov    %ecx,%edi
jne    1120 <count_leading_1s+0x20>
ret

LLVM IR (-O0):
define i32 @count_leading_1s(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 0, i32* %4
%5 = load i32, i32* %3
%6 = icmp sgt i32 %5, 255
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %7, %1
store i32 -1, i32* %2
br label %25
11: ; preds = %7
br label %12
12: ; preds = %16, %11
%13 = load i32, i32* %3
%14 = and i32 %13, 128
%15 = icmp eq i32 %14, 128
br i1 %15, label %16, label %23
16: ; preds = %12
%17 = load i32, i32* %3
%18 = shl i32 %17, 1
store i32 %18, i32* %3
%19 = load i32, i32* %3
%20 = and i32 %19, 255
store i32 %20, i32* %3
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 1
store i32 %22, i32* %4
br label %12
23: ; preds = %12
%24 = load i32, i32* %4
store i32 %24, i32* %2
br label %25
25: ; preds = %23, %10
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
define i32 @count_leading_1s(i32 %0) {
%2 = icmp ugt i32 %0, 255
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = and i32 %0, 128
%5 = icmp eq i32 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %3, %6
%7 = phi i32 [ %11, %6 ], [ 0, %3 ]
%8 = phi i32 [ %10, %6 ], [ %0, %3 ]
%9 = shl i32 %8, 1
%10 = and i32 %9, 254
%11 = add nuw nsw i32 %7, 1
%12 = and i32 %8, 64
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %6
14: ; preds = %6, %3, %1
%15 = phi i32 [ -1, %1 ], [ 0, %3 ], [ %11, %6 ]
ret i32 %15
}
int Add(int a, int b) {
  asm("add %1,%0;\n" : "=m"(a) : "r"(b), "m"(a));
  return a;
}


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

x86 assembly (clang, -O2):
<Add>:
mov    %edi,-0x4(%rsp)
add    %esi,-0x4(%rsp)
mov    -0x4(%rsp),%eax
ret

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

LLVM IR (-O2):
define i32 @Add(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
ret i32 %4
}
unsigned hash(long int a, long int b) { return a * b % 1000000; }


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    $0xf4240,%ecx
cqto
idiv   %rcx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
imul   %rsi,%rdi
movabs $0x431bde82d7b634db,%rcx
de 1b 43
mov    %rdi,%rax
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
shr    $0x12,%rdx
add    %eax,%edx
imul   $0xf4240,%edx,%eax
sub    %eax,%edi
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @hash(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = mul nsw i64 %5, %6
%8 = srem i64 %7, 1000000
%9 = trunc i64 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @hash(i64 %0, i64 %1) {
%3 = mul nsw i64 %1, %0
%4 = srem i64 %3, 1000000
%5 = trunc i64 %4 to i32
ret i32 %5
}
void __aeabi_unwind_cpp_pr1() {}


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

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

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

LLVM IR (-O2):
define void @__aeabi_unwind_cpp_pr1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ad_get_buff_addr(int, int, int /*<<< orphan*/);
int /*<<< orphan*/ ad_get_date(int, int);
int /*<<< orphan*/ ad_get_info(int, int);
int /*<<< orphan*/ ad_get_regs(int, int);
int /*<<< orphan*/ ad_get_token_bound(int, int, int /*<<< orphan*/);
int cmd_param_dev(int dev) {
  ad_get_info(1, dev);
  ad_get_token_bound(1, dev, 0);
  ad_get_buff_addr(1, dev, 0);
  ad_get_regs(1, dev);
  ad_get_date(1, dev);
  return 1;
}


x86 assembly (clang, -O0):
<cmd_param_dev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
call   1070 <ad_get_info@plt>
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
xor    %edx,%edx
call   1050 <ad_get_token_bound@plt>
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
xor    %edx,%edx
call   1030 <ad_get_buff_addr@plt>
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
call   1060 <ad_get_regs@plt>
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
call   1040 <ad_get_date@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_param_dev>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%edi
mov    %ebx,%esi
call   1070 <ad_get_info@plt>
mov    $0x1,%edi
mov    %ebx,%esi
xor    %edx,%edx
call   1050 <ad_get_token_bound@plt>
mov    $0x1,%edi
mov    %ebx,%esi
xor    %edx,%edx
call   1030 <ad_get_buff_addr@plt>
mov    $0x1,%edi
mov    %ebx,%esi
call   1060 <ad_get_regs@plt>
mov    $0x1,%edi
mov    %ebx,%esi
call   1040 <ad_get_date@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @cmd_param_dev(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ad_get_info(i32 1, i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @ad_get_token_bound(i32 1, i32 %5, i32 0)
%7 = load i32, i32* %2
%8 = call i32 @ad_get_buff_addr(i32 1, i32 %7, i32 0)
%9 = load i32, i32* %2
%10 = call i32 @ad_get_regs(i32 1, i32 %9)
%11 = load i32, i32* %2
%12 = call i32 @ad_get_date(i32 1, i32 %11)
ret i32 1
}

LLVM IR (-O2):
define i32 @cmd_param_dev(i32 %0) {
%2 = tail call i32 @ad_get_info(i32 1, i32 %0)
%3 = tail call i32 @ad_get_token_bound(i32 1, i32 %0, i32 0)
%4 = tail call i32 @ad_get_buff_addr(i32 1, i32 %0, i32 0)
%5 = tail call i32 @ad_get_regs(i32 1, i32 %0)
%6 = tail call i32 @ad_get_date(i32 1, i32 %0)
ret i32 1
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ read_unixtstamp(char *, int *);
void test_empty() {
  char *str = "";
  uint64_t dest;
  read_unixtstamp(str, &dest);
  assert((dest / 1000000000) == 0 && (dest % 1000000000) == 0);
}


x86 assembly (clang, -O0):
<test_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <read_unixtstamp@plt>
mov    -0xc(%rbp),%eax
mov    $0x3b9aca00,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
jne    116f <test_empty+0x4f>
mov    -0xc(%rbp),%eax
mov    $0x3b9aca00,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_empty>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <read_unixtstamp@plt>
mov    0x4(%rsp),%eax
lea    0x3b9ac9ff(%rax),%ecx
xor    %edi,%edi
cmp    $0x773593fe,%ecx
ja     115d <test_empty+0x3d>
imul   $0x3a2e9c6d,%eax,%eax
add    $0x400,%eax
ror    $0x9,%eax
xor    %edi,%edi
cmp    $0x5,%eax
setb   %dil
call   1030 <assert@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @test_empty() {
%1 = alloca i8*
%2 = alloca i32
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @read_unixtstamp(i8* %3, i32* %2)
%5 = load i32, i32* %2
%6 = sdiv i32 %5, 1000000000
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %0
%9 = load i32, i32* %2
%10 = srem i32 %9, 1000000000
%11 = icmp eq i32 %10, 0
br label %12
12: ; preds = %8, %0
%13 = phi i1 [ false, %0 ], [ %11, %8 ]
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @test_empty() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @read_unixtstamp(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = add i32 %4, 999999999
%6 = icmp ult i32 %5, 1999999999
br i1 %6, label %7, label %11
7: ; preds = %0
%8 = srem i32 %4, 1000000000
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %0
%12 = phi i32 [ 0, %0 ], [ %10, %7 ]
%13 = call i32 @assert(i32 %12)
ret void
}
int do_382() { return 382; }


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

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

LLVM IR (-O0):
define i32 @do_382() {
ret i32 382
}

LLVM IR (-O2):
define i32 @do_382() {
ret i32 382
}
/* Variables and functions */
char *strdup(char *);
int parse_string(char *str, char **string) {
  if (str == NULL || str[0] == '\0' || str[0] == '\n')
    return 0;
  *string = strdup(str);
  return 1;
}


x86 assembly (clang, -O0):
<parse_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114b <parse_string+0x3b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114b <parse_string+0x3b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1157 <parse_string+0x47>
movl   $0x0,-0x4(%rbp)
jmp    1171 <parse_string+0x61>
mov    -0x10(%rbp),%rdi
call   1030 <strdup@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_string>:
push   %rbx
xor    %eax,%eax
test   %rdi,%rdi
je     1123 <parse_string+0x13>
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <parse_string+0x13>
cmp    $0xa,%cl
jne    1125 <parse_string+0x15>
pop    %rbx
ret
mov    %rsi,%rbx
call   1030 <strdup@plt>
mov    %rax,(%rbx)
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @parse_string(i8* %0, i8** nocapture writeonly %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = load i8, i8* %0
switch i8 %5, label %6 [
i8 0, label %8
i8 10, label %8
]
6: ; preds = %4
%7 = tail call i8* @strdup(i8* %0)
store i8* %7, i8** %1
br label %8
8: ; preds = %2, %4, %4, %6
%9 = phi i32 [ 1, %6 ], [ 0, %4 ], [ 0, %4 ], [ 0, %2 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t tswap32(uint32_t s) { return s; }


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

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

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

LLVM IR (-O2):
define i32 @tswap32(i32 returned %0) {
ret i32 %0
}
void RTFileClose(void) {}


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

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

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

LLVM IR (-O2):
define void @RTFileClose() {
ret void
}
int silent(int level) {
  static int silent_level = 0;
  if (level >= 0) {
    silent_level = level;
  }
  return (silent_level);
}


x86 assembly (clang, -O0):
<silent>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     111a <silent+0x1a>
mov    -0x4(%rbp),%eax
mov    %eax,0x2f0a(%rip)
mov    0x2f04(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<silent>:
test   %edi,%edi
js     110d <silent+0xd>
mov    %edi,%eax
mov    %edi,0x2f18(%rip)
ret
mov    0x2f11(%rip),%eax
ret

LLVM IR (-O0):
@silent.silent_level = internal global i32 0
define i32 @silent(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i32, i32* %2
store i32 %6, i32* @silent.silent_level
br label %7
7: ; preds = %5, %1
%8 = load i32, i32* @silent.silent_level
ret i32 %8
}

LLVM IR (-O2):
@silent.silent_level = internal unnamed_addr global i32 0
define i32 @silent(i32 %0) {
%2 = icmp sgt i32 %0, -1
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = load i32, i32* @silent.silent_level
br label %6
5: ; preds = %1
store i32 %0, i32* @silent.silent_level
br label %6
6: ; preds = %3, %5
%7 = phi i32 [ %4, %3 ], [ %0, %5 ]
ret i32 %7
}
void long_enc(void *buf, long long val) { *((long long *)buf) = val; }


x86 assembly (clang, -O0):
<long_enc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<long_enc>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
define void @long_enc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i64*
store i64 %5, i64* %7
ret void
}

LLVM IR (-O2):
define void @long_enc(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void print_error(const char *reason) {
  fprintf(stderr, "\n    Return from BOBYQA because %s.\n", reason);
}


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

x86 assembly (clang, -O2):
<print_error>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"\0A Return from BOBYQA because %s.\0A\00"
define void @print_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"\0A Return from BOBYQA because %s.\0A\00"
define void @print_error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int do_715() { return 715; }


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

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

LLVM IR (-O0):
define i32 @do_715() {
ret i32 715
}

LLVM IR (-O2):
define i32 @do_715() {
ret i32 715
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
extern int runprog_close(FILE *pp) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @runprog_close(i32* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ w5100_writeSn_byte(unsigned int, int, unsigned int);
void w5100_writeSnPORT(unsigned sock, unsigned data) {
  w5100_writeSn_byte(sock, 0x0004, data >> 8);
  w5100_writeSn_byte(sock, 0x0004 + 1, data & 0xFF);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
shr    $0x8,%edx
mov    $0x4,%esi
call   1030 <w5100_writeSn_byte@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
and    $0xff,%edx
mov    $0x5,%esi
call   1030 <w5100_writeSn_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %esi,%edx
shr    $0x8,%edx
mov    $0x4,%esi
call   1030 <w5100_writeSn_byte@plt>
movzbl %bl,%edx
mov    %ebp,%edi
mov    $0x5,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <w5100_writeSn_byte@plt>

LLVM IR (-O0):
define void @w5100_writeSnPORT(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 = lshr i32 %6, 8
%8 = call i32 @w5100_writeSn_byte(i32 %5, i32 4, i32 %7)
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = and i32 %10, 255
%12 = call i32 @w5100_writeSn_byte(i32 %9, i32 5, i32 %11)
ret void
}

LLVM IR (-O2):
define void @w5100_writeSnPORT(i32 %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = tail call i32 @w5100_writeSn_byte(i32 %0, i32 4, i32 %3)
%5 = and i32 %1, 255
%6 = tail call i32 @w5100_writeSn_byte(i32 %0, i32 5, i32 %5)
ret void
}
/* Variables and functions */
double sqrt(float);
float fint(float x) { return 2.0 * sqrt(x); }


x86 assembly (clang, -O0):
<fint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xece(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fint>:
push   %rax
call   1030 <sqrt@plt>
addsd  %xmm0,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @fint(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call double @sqrt(float %3)
%5 = fmul double 2.000000e+00, %4
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @fint(float %0) {
%2 = tail call double @sqrt(float %0)
%3 = fmul double %2, 2.000000e+00
%4 = fptrunc double %3 to float
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int startup(int check) {
  int yesno = 1;
  if (check < 2) {
    printf("No arguments.  New environment.\n\n");
    yesno = 0;
  }
  return (yesno);
}


x86 assembly (clang, -O0):
<startup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    113f <startup+0x2f>
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<startup>:
mov    $0x1,%eax
cmp    $0x1,%edi
jg     112d <startup+0x1d>
push   %rax
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [34 x i8] c"No arguments. New environment.\0A\0A\00"
define i32 @startup(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 2
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %8
8: ; preds = %6, %1
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
@str = [33 x i8] c"No arguments. New environment.\0A\00"
define i32 @startup(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
%6 = phi i32 [ 0, %3 ], [ 1, %1 ]
ret i32 %6
}
int test_02(double a, double b) { return a <= b; }


x86 assembly (clang, -O0):
<test_02>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_02>:
xor    %eax,%eax
ucomisd %xmm0,%xmm1
setae  %al
ret

LLVM IR (-O0):
define i32 @test_02(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp ole double %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_02(double %0, double %1) {
%3 = fcmp ole double %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
void test54_Junk_targetInit__I() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
int /*<<< orphan*/ waitpid(int, int *, int /*<<< orphan*/);
void handle_sigchld(int signo) {
  int status = 0;
  pid_t chld = 0;
  chld = waitpid(-1, &status, WNOHANG);
  return;
}


x86 assembly (clang, -O0):
<handle_sigchld>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    0x2eb8(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
lea    -0x8(%rbp),%rsi
call   1030 <waitpid@plt>
mov    %eax,-0xc(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_sigchld>:
push   %rax
movl   $0x0,0x4(%rsp)
mov    0x2ec8(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rsi
mov    $0xffffffff,%edi
call   1030 <waitpid@plt>
pop    %rax
ret

LLVM IR (-O0):
@WNOHANG = global i32 0
define void @handle_sigchld(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
%5 = load i32, i32* @WNOHANG
%6 = call i32 @waitpid(i32 -1, i32* %3, i32 %5)
store i32 %6, i32* %4
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
define void @handle_sigchld(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = load i32, i32* @WNOHANG
%5 = call i32 @waitpid(i32 -1, i32* %2, i32 %4)
ret void
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMRC6_get(void) { return U_WMRCORENONE_get("U_WMRC6"); }


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

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

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

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