xunge/DecIR huggingface dataset:
int fallback_allows(char *typ, char *ps, char *s, int n) { return 1; }


x86 assembly (clang, -O0):
<fallback_allows>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fallback_allows(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
ret i32 1
}

LLVM IR (-O2):
define i32 @fallback_allows(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i32 %3) {
ret i32 1
}
double calc_with_for(double x) {
  int n;
  double result = 1.0;
  for (n = 1; n <= 5; n++) {
    result *= x;
  }
  return result;
}


x86 assembly (clang, -O0):
<calc_with_for>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jg     1144 <calc_with_for+0x44>
movsd  -0x8(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111d <calc_with_for+0x1d>
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_with_for>:
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @calc_with_for(double %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca double
store double %0, double* %2
store double 1.000000e+00, double* %4
store i32 1, i32* %3
br label %5
5: ; preds = %12, %1
%6 = load i32, i32* %3
%7 = icmp sle i32 %6, 5
br i1 %7, label %8, label %15
8: ; preds = %5
%9 = load double, double* %2
%10 = load double, double* %4
%11 = fmul double %10, %9
store double %11, double* %4
br label %12
12: ; preds = %8
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %5
15: ; preds = %5
%16 = load double, double* %4
ret double %16
}

LLVM IR (-O2):
define double @calc_with_for(double %0) {
%2 = fmul double %0, %0
%3 = fmul double %2, %0
%4 = fmul double %3, %0
%5 = fmul double %4, %0
ret double %5
}
void pci_acpi_crs_quirks(void) {}


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

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

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

LLVM IR (-O2):
define void @pci_acpi_crs_quirks() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ S_IRWXU;
int mkdir(char const *, int /*<<< orphan*/);
int ph_mkdir(const char *path) {
  int err = mkdir(path, S_IRWXU);
  return err;
}


x86 assembly (clang, -O0):
<ph_mkdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
call   1030 <mkdir@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ph_mkdir>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <mkdir@plt>

LLVM IR (-O0):
@S_IRWXU = global i32 0
define i32 @ph_mkdir(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i32, i32* @S_IRWXU
%6 = call i32 @mkdir(i8* %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
@S_IRWXU = global i32 0
define i32 @ph_mkdir(i8* nocapture %0) {
%2 = load i32, i32* @S_IRWXU
%3 = tail call i32 @mkdir(i8* %0, i32 %2)
ret i32 %3
}
void hostapd_ubus_notify_radar_detected(struct hostapd_iface *iface,
                                        int frequency, int chan_width, int cf1,
                                        int cf2) {}


x86 assembly (clang, -O0):
<hostapd_ubus_notify_radar_detected>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.hostapd_iface = type opaque
define void @hostapd_ubus_notify_radar_detected(%struct.hostapd_iface* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %struct.hostapd_iface*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store %struct.hostapd_iface* %0, %struct.hostapd_iface** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
ret void
}

LLVM IR (-O2):
%struct.hostapd_iface = type opaque
define void @hostapd_ubus_notify_radar_detected(%struct.hostapd_iface* nocapture %0, i32 %1, i32 %2, i32 %3, i32 %4) {
ret void
}
/* Variables and functions */
unsigned int page_end(void const *);
unsigned int page_start(void const *);
unsigned int page_len(const void *start, const void *end) {
  return (page_end(end) - page_start(start));
}


x86 assembly (clang, -O0):
<page_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <page_end@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <page_start@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
sub    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<page_len>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <page_end@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <page_start@plt>
sub    %eax,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @page_len(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @page_end(i8* %5)
%7 = load i8*, i8** %3
%8 = call i32 @page_start(i8* %7)
%9 = sub i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @page_len(i8* %0, i8* %1) {
%3 = tail call i32 @page_end(i8* %1)
%4 = tail call i32 @page_start(i8* %0)
%5 = sub i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ subunit_send_event(char *, char const *const,
                                      char const *const);
void subunit_test_error(char const *const name, char const *const error) {
  subunit_send_event("error", name, error);
}


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

x86 assembly (clang, -O2):
<subunit_test_error>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <subunit_send_event@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"error\00"
define void @subunit_test_error(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 i32 @subunit_send_event(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"error\00"
define void @subunit_test_error(i8* %0, i8* %1) {
%3 = tail call i32 @subunit_send_event(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
void key_init(void) { (*(volatile unsigned *)0x56000050) &= 0xff0; }


x86 assembly (clang, -O0):
<key_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x56000050,%eax
mov    (%rax),%ecx
and    $0xff0,%ecx
mov    $0x56000050,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<key_init>:
andl   $0xff0,0x56000050
ret

LLVM IR (-O0):
define void @key_init() {
%1 = load volatile i32, i32* inttoptr (i64 1442840656 to i32*)
%2 = and i32 %1, 4080
store volatile i32 %2, i32* inttoptr (i64 1442840656 to i32*)
ret void
}

LLVM IR (-O2):
define void @key_init() {
%1 = load volatile i32, i32* inttoptr (i64 1442840656 to i32*)
%2 = and i32 %1, 4080
store volatile i32 %2, i32* inttoptr (i64 1442840656 to i32*)
ret void
}
void test___atomic_compare_exchange_2(int *mem) {
  int expected = 1;
  int desired = 5;
  __atomic_compare_exchange(mem, &expected, &desired, 0, 4, 0);
}


x86 assembly (clang, -O0):
<test___atomic_compare_exchange_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x5,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%edx
lock cmpxchg %edx,(%rcx)
mov    %eax,%ecx
sete   %al
mov    %al,-0x19(%rbp)
mov    %ecx,-0x18(%rbp)
test   $0x1,%al
jne    113d <test___atomic_compare_exchange_2+0x3d>
mov    -0x18(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
mov    %al,-0x11(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test___atomic_compare_exchange_2>:
mov    $0x5,%ecx
mov    $0x1,%eax
lock cmpxchg %ecx,(%rdi)
ret

LLVM IR (-O0):
define void @test___atomic_compare_exchange_2(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
store i32* %0, i32** %2
store i32 1, i32* %3
store i32 5, i32* %4
%6 = load i32*, i32** %2
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = cmpxchg i32* %6, i32 %7, i32 %8 acq_rel monotonic
%10 = extractvalue { i32, i1 } %9, 0
%11 = extractvalue { i32, i1 } %9, 1
br i1 %11, label %13, label %12
12: ; preds = %1
store i32 %10, i32* %3
br label %13
13: ; preds = %12, %1
%14 = zext i1 %11 to i8
store i8 %14, i8* %5
%15 = load i8, i8* %5
%16 = trunc i8 %15 to i1
ret void
}

LLVM IR (-O2):
define void @test___atomic_compare_exchange_2(i32* nocapture %0) {
%2 = cmpxchg i32* %0, i32 1, i32 5 acq_rel monotonic
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _c_setbyte(int);
void PUSH_SS() {
  ;
  _c_setbyte(0x16);
  ;
}


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

x86 assembly (clang, -O2):
<PUSH_SS>:
mov    $0x16,%edi
jmp    1030 <_c_setbyte@plt>

LLVM IR (-O0):
define void @PUSH_SS() {
%1 = call i32 @_c_setbyte(i32 22)
ret void
}

LLVM IR (-O2):
define void @PUSH_SS() {
%1 = tail call i32 @_c_setbyte(i32 22)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void myput2(char c) {
  putchar(c);
  putchar(c);
}


x86 assembly (clang, -O0):
<myput2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myput2>:
push   %rbx
mov    %edi,%ebx
call   1030 <putchar@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @myput2(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @putchar(i8 signext %3)
%5 = load i8, i8* %2
%6 = call i32 @putchar(i8 signext %5)
ret void
}

LLVM IR (-O2):
define void @myput2(i8 signext %0) {
%2 = tail call i32 @putchar(i8 signext %0)
%3 = tail call i32 @putchar(i8 signext %0)
ret void
}
/* Type definitions */
struct disprm {
  int dummy;
};

/* Variables and functions */
int disinit(int, int, struct disprm *, int);
int disini(int alloc, int naxis, struct disprm *dis) {
  return disinit(alloc, naxis, dis, -1);
}


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

x86 assembly (clang, -O2):
<disini>:
mov    $0xffffffff,%ecx
jmp    1030 <disinit@plt>

LLVM IR (-O0):
%struct.disprm = type { i32 }
define i32 @disini(i32 %0, i32 %1, %struct.disprm* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.disprm*
store i32 %0, i32* %4
store i32 %1, i32* %5
store %struct.disprm* %2, %struct.disprm** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load %struct.disprm*, %struct.disprm** %6
%10 = call i32 @disinit(i32 %7, i32 %8, %struct.disprm* %9, i32 -1)
ret i32 %10
}

LLVM IR (-O2):
%struct.disprm = type { i32 }
define i32 @disini(i32 %0, i32 %1, %struct.disprm* %2) {
%4 = tail call i32 @disinit(i32 %0, i32 %1, %struct.disprm* %2, i32 -1)
ret i32 %4
}
/* Variables and functions */
double pow(double, int);
double get_code_freq(int code) {
  return pow(2.0, (code - 58.0) / 12.0) * 261.63;
}


x86 assembly (clang, -O0):
<get_code_freq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xef0(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xedc(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
movsd  0xec4(%rip),%xmm0
call   1030 <pow@plt>
movsd  0xeaf(%rip),%xmm1
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_code_freq>:
push   %rax
cvtsi2sd %edi,%xmm0
addsd  0xee3(%rip),%xmm0
divsd  0xee3(%rip),%xmm0
cvttsd2si %xmm0,%edi
movsd  0xedf(%rip),%xmm0
call   1030 <pow@plt>
mulsd  0xeda(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @get_code_freq(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fsub double %4, 5.800000e+01
%6 = fdiv double %5, 1.200000e+01
%7 = fptosi double %6 to i32
%8 = call double @pow(double 2.000000e+00, i32 %7)
%9 = fmul double %8, 2.616300e+02
ret double %9
}

LLVM IR (-O2):
define double @get_code_freq(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fadd double %2, -5.800000e+01
%4 = fdiv double %3, 1.200000e+01
%5 = fptosi double %4 to i32
%6 = tail call double @pow(double 2.000000e+00, i32 %5)
%7 = fmul double %6, 2.616300e+02
ret double %7
}
void testUnknownVal(int value, int mask) {
  switch (value & mask) {
  case 1:
    clang_analyzer_warnIfReached();
    break;
  case 3 ... 10:
    clang_analyzer_warnIfReached();
    break;
  default:
    clang_analyzer_warnIfReached();
  }
}


x86 assembly (clang, -O0):
<testUnknownVal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
and    %ecx,%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     114b <testUnknownVal+0x3b>
jmp    1137 <testUnknownVal+0x27>
mov    -0xc(%rbp),%eax
add    $0xfffffffd,%eax
sub    $0x8,%eax
jb     1157 <testUnknownVal+0x47>
jmp    1163 <testUnknownVal+0x53>
mov    $0x0,%al
call   1030 <clang_analyzer_warnIfReached@plt>
jmp    116a <testUnknownVal+0x5a>
mov    $0x0,%al
call   1030 <clang_analyzer_warnIfReached@plt>
jmp    116a <testUnknownVal+0x5a>
mov    $0x0,%al
call   1030 <clang_analyzer_warnIfReached@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @testUnknownVal(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 = and i32 %5, %6
switch i32 %7, label %12 [
i32 1, label %8
i32 3, label %10
i32 4, label %10
i32 5, label %10
i32 6, label %10
i32 7, label %10
i32 8, label %10
i32 9, label %10
i32 10, label %10
]
8: ; preds = %2
%9 = call i32 (...) @clang_analyzer_warnIfReached()
br label %14
10: ; preds = %2, %2, %2, %2, %2, %2, %2, %2
%11 = call i32 (...) @clang_analyzer_warnIfReached()
br label %14
12: ; preds = %2
%13 = call i32 (...) @clang_analyzer_warnIfReached()
br label %14
14: ; preds = %12, %10, %8
ret void
}

LLVM IR (-O2):
define void @testUnknownVal(i32 %0, i32 %1) {
%3 = tail call i32 (...) @clang_analyzer_warnIfReached()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ kfree(char *);
void utarray_str_dtor(void *elt) {
  char **eltc = (char **)elt;
  if (*eltc)
    kfree(*eltc);
}


x86 assembly (clang, -O0):
<utarray_str_dtor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     113e <utarray_str_dtor+0x2e>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <kfree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utarray_str_dtor>:
mov    (%rdi),%rdi
test   %rdi,%rdi
je     111d <utarray_str_dtor+0xd>
jmp    1030 <kfree@plt>
ret

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

LLVM IR (-O2):
define void @utarray_str_dtor(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @kfree(i8* %3)
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f(int *, int);
int main(int argc, char *argv[]) {
  int c[100];
  f(c, 100);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x1a0(%rbp),%rdi
mov    $0x64,%esi
call   1030 <f@plt>
xor    %eax,%eax
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x198,%rsp
mov    %rsp,%rdi
mov    $0x64,%esi
call   1030 <f@plt>
xor    %eax,%eax
add    $0x198,%rsp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [100 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = getelementptr inbounds [100 x i32], [100 x i32]* %6, i64 0, i64 0
%8 = call i32 @f(i32* %7, i32 100)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [100 x i32]
%4 = bitcast [100 x i32]* %3 to i8*
%5 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 0
%6 = call i32 @f(i32* %5, i32 100)
ret i32 0
}
void gtk_curve_get_vector() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, void *, int);
int inet6_opt_set_val(void *databuf, int offset, void *val, socklen_t vallen) {
  memcpy((uint8_t *)databuf + offset, val, vallen);
  return (offset + vallen);
}


x86 assembly (clang, -O0):
<inet6_opt_set_val>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%eax
add    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inet6_opt_set_val>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebp
movslq %esi,%rbx
lea    (%rdi,%rbx,4),%rdi
mov    %rdx,%rsi
mov    %ecx,%edx
call   1030 <memcpy@plt>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @inet6_opt_set_val(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %6
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %10, i64 %12
%14 = load i8*, i8** %7
%15 = load i32, i32* %8
%16 = call i32 @memcpy(i32* %13, i8* %14, i32 %15)
%17 = load i32, i32* %6
%18 = load i32, i32* %8
%19 = add nsw i32 %17, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @inet6_opt_set_val(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = bitcast i8* %0 to i32*
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i32, i32* %5, i64 %6
%8 = tail call i32 @memcpy(i32* %7, i8* %2, i32 %3)
%9 = add nsw i32 %3, %1
ret i32 %9
}
int bitvector_test(void *vec, long index) {
  return ((char *)vec)[index / 8] & (1 << (index & 0x7));
}


x86 assembly (clang, -O0):
<bitvector_test>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x8,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
movsbl (%rax,%rcx,1),%eax
mov    -0x10(%rbp),%rcx
and    $0x7,%rcx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitvector_test>:
mov    %rsi,%rcx
lea    0x7(%rsi),%rax
test   %rsi,%rsi
cmovns %rsi,%rax
sar    $0x3,%rax
movzbl (%rdi,%rax,1),%edx
and    $0x7,%cl
mov    $0x1,%eax
shl    %cl,%eax
and    %edx,%eax
ret

LLVM IR (-O0):
define i32 @bitvector_test(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = sdiv i64 %6, 8
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = load i64, i64* %4
%12 = and i64 %11, 7
%13 = trunc i64 %12 to i32
%14 = shl i32 1, %13
%15 = and i32 %10, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @bitvector_test(i8* nocapture %0, i64 %1) {
%3 = sdiv i64 %1, 8
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = trunc i64 %1 to i32
%8 = and i32 %7, 7
%9 = shl nuw nsw i32 1, %8
%10 = and i32 %9, %6
ret i32 %10
}
void DischargeDelay_Enable(void) {}


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

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

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

LLVM IR (-O2):
define void @DischargeDelay_Enable() {
ret void
}
void sucF(unsigned int *x) {
  int *y;
  y = x;
}


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

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

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

LLVM IR (-O2):
define void @sucF(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int *, char *);
int main(int argc, char *argv[]) {
  int a = 0xFFFFFFFF;
  char ch = 'a';
  printf("sizeof int:%zu, &a:%p, &ch:%p\n", sizeof(int), &a, &ch);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
movb   $0x61,-0x15(%rbp)
lea    0xec8(%rip),%rdi
mov    $0x4,%esi
lea    -0x14(%rbp),%rdx
lea    -0x15(%rbp),%rcx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0xffffffff,0x4(%rsp)
ff
movb   $0x61,0x3(%rsp)
lea    0xedb(%rip),%rdi
lea    0x4(%rsp),%rdx
lea    0x3(%rsp),%rcx
mov    $0x4,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"sizeof int:%zu, &a:%p, &ch:%p\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 -1, i32* %6
store i8 97, i8* %7
%8 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 4, i32* %6, i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"sizeof int:%zu, &a:%p, &ch:%p\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i8
%5 = bitcast i32* %3 to i8*
store i32 -1, i32* %3
store i8 97, i8* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 4, i32* %3, i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ TRUE;
int /*<<< orphan*/ keypad(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stdscr;
void end() { keypad(stdscr, TRUE); }


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

x86 assembly (clang, -O2):
<end>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
jmp    1030 <keypad@plt>

LLVM IR (-O0):
@stdscr = global i32 0
@TRUE = global i32 0
define void @end() {
%1 = load i32, i32* @stdscr
%2 = load i32, i32* @TRUE
%3 = call i32 @keypad(i32 %1, i32 %2)
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
@TRUE = global i32 0
define void @end() {
%1 = load i32, i32* @stdscr
%2 = load i32, i32* @TRUE
%3 = tail call i32 @keypad(i32 %1, i32 %2)
ret void
}
__attribute__((always_)) void profile_hit(int type, void *ip) { return; }


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

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

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

LLVM IR (-O2):
define void @profile_hit(i32 %0, i8* nocapture %1) {
ret void
}
float UTIL_deg2rad(float x) { return x * (3.14159265358f / 180.0f); }


x86 assembly (clang, -O0):
<UTIL_deg2rad>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define float @UTIL_deg2rad(float %0) {
%2 = fmul float %0, 0x3F91DF46A0000000
ret float %2
}
/* Type definitions */
struct mat2 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mat2_scaling(float *, float *);
__attribute__((always_)) struct mat2 *psmat2_scaling(struct mat2 *result,
                                                     struct mat2 *v) {
  mat2_scaling((float *)result, (float *)v);
  return result;
}


x86 assembly (clang, -O0):
<psmat2_scaling>:
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 <mat2_scaling@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psmat2_scaling>:
push   %rbx
mov    %rdi,%rbx
call   1030 <mat2_scaling@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.mat2 = type { i32 }
define %struct.mat2* @psmat2_scaling(%struct.mat2* %0, %struct.mat2* %1) {
%3 = alloca %struct.mat2*
%4 = alloca %struct.mat2*
store %struct.mat2* %0, %struct.mat2** %3
store %struct.mat2* %1, %struct.mat2** %4
%5 = load %struct.mat2*, %struct.mat2** %3
%6 = bitcast %struct.mat2* %5 to float*
%7 = load %struct.mat2*, %struct.mat2** %4
%8 = bitcast %struct.mat2* %7 to float*
%9 = call i32 @mat2_scaling(float* %6, float* %8)
%10 = load %struct.mat2*, %struct.mat2** %3
ret %struct.mat2* %10
}

LLVM IR (-O2):
%struct.mat2 = type { i32 }
define %struct.mat2* @psmat2_scaling(%struct.mat2* returned %0, %struct.mat2* %1) {
%3 = bitcast %struct.mat2* %0 to float*
%4 = bitcast %struct.mat2* %1 to float*
%5 = tail call i32 @mat2_scaling(float* %3, float* %4)
ret %struct.mat2* %0
}
const char *consume_nonarg(const char *fmt) {
  do {
    if (*fmt == '\0')
      return fmt;
  } while (*fmt++ != '%');
  return fmt;
}


x86 assembly (clang, -O0):
<consume_nonarg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1125 <consume_nonarg+0x25>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114d <consume_nonarg+0x4d>
jmp    112a <consume_nonarg+0x2a>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x25,%eax
jne    1108 <consume_nonarg+0x8>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<consume_nonarg>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rax),%ecx
test   %cl,%cl
je     1120 <consume_nonarg+0x20>
add    $0x1,%rax
cmp    $0x25,%cl
jne    1110 <consume_nonarg+0x10>
ret

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

LLVM IR (-O2):
define i8* @consume_nonarg(i8* %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
%8 = icmp eq i8 %4, 37
br i1 %8, label %9, label %2
9: ; preds = %6, %2
%10 = phi i8* [ %3, %2 ], [ %7, %6 ]
ret i8* %10
}
int test_imm_2Dint32_mem(int *val) {
  return ((*val) & (0x2D << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_2Dint32_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, 45
%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_2Dint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 45
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t amqp_least_significant_1_bit(uint32_t value) { return value & -value; }


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

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

LLVM IR (-O0):
define i32 @amqp_least_significant_1_bit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 0, %4
%6 = and i32 %3, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @amqp_least_significant_1_bit(i32 %0) {
%2 = sub nsw i32 0, %0
%3 = and i32 %2, %0
ret i32 %3
}
/* Variables and functions */
float atan2f(float, float);
void sAtan2_process(float bIn0, float bIn1, float *bOut) {
  *bOut = atan2f(bIn0, bIn1);
}


x86 assembly (clang, -O0):
<sAtan2_process>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <atan2f@plt>
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sAtan2_process>:
push   %rbx
mov    %rdi,%rbx
call   1030 <atan2f@plt>
movss  %xmm0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @sAtan2_process(float %0, float %1, float* %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float*
store float %0, float* %4
store float %1, float* %5
store float* %2, float** %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = call float @atan2f(float %7, float %8)
%10 = load float*, float** %6
store float %9, float* %10
ret void
}

LLVM IR (-O2):
define void @sAtan2_process(float %0, float %1, float* nocapture writeonly %2) {
%4 = tail call float @atan2f(float %0, float %1)
store float %4, float* %2
ret void
}
/* Variables and functions */
double xd();
double yd(double a) { return xd() * a; }


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

x86 assembly (clang, -O2):
<yd>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <xd@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @yd(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call double (...) @xd()
%4 = load double, double* %2
%5 = fmul double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @yd(double %0) {
%2 = tail call double (...) @xd()
%3 = fmul double %2, %0
ret double %3
}
/* Type definitions */
struct timeval {
  long tv_sec;
};

/* Variables and functions */
long tvselector_sec(const struct timeval *tv) { return tv->tv_sec; }


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

x86 assembly (clang, -O2):
<tvselector_sec>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.timeval = type { i64 }
define i64 @tvselector_sec(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load %struct.timeval*, %struct.timeval** %2
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%5 = load i64, i64* %4
ret i64 %5
}

LLVM IR (-O2):
%struct.timeval = type { i64 }
define i64 @tvselector_sec(%struct.timeval* nocapture %0) {
%2 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%3 = load i64, i64* %2
ret i64 %3
}
void fn() {
  switch (0) {
  case 0:
    if (0) {
      return;
    }
  case 1:
    if (0) {
      return;
    } else {
      return;
    }
    if (0) {
      return;
    } else if (0) {
      return;
    } else if (0) {
      return;
    } else {
      return;
    }
  default:
    return;
  }
}


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

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

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

LLVM IR (-O2):
define void @fn() {
ret void
}
void handle_names_end(char *prefix, int ncmd, char *params) {}


x86 assembly (clang, -O0):
<handle_names_end>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @handle_names_end(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @handle_names_end(i8* nocapture %0, i32 %1, i8* nocapture %2) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ vfprintf(int /*<<< orphan*/ *, char *, int /*<<< orphan*/);
void elm_io_log(char *preamble, va_list ap) {
  FILE *stream = fopen("/var/log/"
                       "elm"
                       "/elm.log",
                       "a+");
  vfprintf(stream, preamble, ap);
  fclose(stream);
}


x86 assembly (clang, -O0):
<elm_io_log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeba(%rip),%rdi
lea    0xec8(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1050 <vfprintf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<elm_io_log>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
lea    0xebf(%rip),%rdi
lea    0xecd(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbp
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1050 <vfprintf@plt>
mov    %rbp,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"/var/log/elm/elm.log\00"
@.str.1 = [3 x i8] c"a+\00"
define void @elm_io_log(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = call i32* @fopen(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %6, i32** %5
%7 = load i32*, i32** %5
%8 = load i8*, i8** %3
%9 = load i32, i32* %4
%10 = call i32 @vfprintf(i32* %7, i8* %8, i32 %9)
%11 = load i32*, i32** %5
%12 = call i32 @fclose(i32* %11)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"/var/log/elm/elm.log\00"
@.str.1 = [3 x i8] c"a+\00"
define void @elm_io_log(i8* nocapture %0, i32 %1) {
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @vfprintf(i32* %3, i8* %0, i32 %1)
%5 = tail call i32 @fclose(i32* %3)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
char dispchar(uint8_t c) { return (c >= 32 && c <= 126) ? c : '.'; }


x86 assembly (clang, -O0):
<dispchar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x20,-0x4(%rbp)
jl     1126 <dispchar+0x26>
cmpl   $0x7e,-0x4(%rbp)
jg     1126 <dispchar+0x26>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <dispchar+0x33>
mov    $0x2e,%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <dispchar+0x33>
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dispchar>:
lea    -0x20(%rdi),%eax
cmp    $0x5f,%eax
mov    $0x2e,%eax
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @dispchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 32
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 126
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = load i32, i32* %2
br label %11
10: ; preds = %5, %1
br label %11
11: ; preds = %10, %8
%12 = phi i32 [ %9, %8 ], [ 46, %10 ]
%13 = trunc i32 %12 to i8
ret i8 %13
}

LLVM IR (-O2):
define signext i8 @dispchar(i32 %0) {
%2 = add i32 %0, -32
%3 = icmp ult i32 %2, 95
%4 = trunc i32 %0 to i8
%5 = select i1 %3, i8 %4, i8 46
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ lmain(int /*<<< orphan*/);
int main() {
  lmain(0);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @lmain(i32 0)
ret i32 0
}
/* Variables and functions */
int fatfs_unlink(char const *);
int _unlink(const char *path) { return fatfs_unlink(path); }


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

x86 assembly (clang, -O2):
<_unlink>:
jmp    1030 <fatfs_unlink@plt>

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

LLVM IR (-O2):
define i32 @_unlink(i8* %0) {
%2 = tail call i32 @fatfs_unlink(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Inst_Printf(char *, char *);
void Jump_Ret(void) {
  Inst_Printf("mov", "$0,$27");
  Inst_Printf("jmp", "$31,($27),0");
}


x86 assembly (clang, -O0):
<Jump_Ret>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee2(%rip),%rsi
call   1030 <Inst_Printf@plt>
lea    0xedd(%rip),%rdi
lea    0xeda(%rip),%rsi
call   1030 <Inst_Printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Jump_Ret>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xee5(%rip),%rsi
call   1030 <Inst_Printf@plt>
lea    0xee0(%rip),%rdi
lea    0xedd(%rip),%rsi
pop    %rax
jmp    1030 <Inst_Printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"mov\00"
@.str.1 = [7 x i8] c"$0,$27\00"
@.str.2 = [4 x i8] c"jmp\00"
@.str.3 = [12 x i8] c"$31,($27),0\00"
define void @Jump_Ret() {
%1 = call i32 @Inst_Printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @Inst_Printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"mov\00"
@.str.1 = [7 x i8] c"$0,$27\00"
@.str.2 = [4 x i8] c"jmp\00"
@.str.3 = [12 x i8] c"$31,($27),0\00"
define void @Jump_Ret() {
%1 = tail call i32 @Inst_Printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @Inst_Printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int likwid_markerStartRegion(const char *regionTag) {
  fprintf(stderr, "WARNING: dummy likwid_markerStartRegion(...) called\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<likwid_markerStartRegion>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [53 x i8] c"WARNING: dummy likwid_markerStartRegion(...) called\0A\00"
define i32 @likwid_markerStartRegion(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [53 x i8] c"WARNING: dummy likwid_markerStartRegion(...) called\0A\00"
define i32 @likwid_markerStartRegion(i8* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ tty_disestablish_ppp(int);
void disestablish_ppp(int fd) { tty_disestablish_ppp(fd); }


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

x86 assembly (clang, -O2):
<disestablish_ppp>:
jmp    1030 <tty_disestablish_ppp@plt>

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

LLVM IR (-O2):
define void @disestablish_ppp(i32 %0) {
%2 = tail call i32 @tty_disestablish_ppp(i32 %0)
ret void
}
void prefetch(const void *x) { x = x; }


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

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

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

LLVM IR (-O2):
define void @prefetch(i8* nocapture %0) {
ret void
}
void crypto_hmac_final(void) { nsc_assert(0, __func__); }


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

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

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

LLVM IR (-O2):
@__func__.crypto_hmac_final = [18 x i8] c"crypto_hmac_final\00"
define void @crypto_hmac_final() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.crypto_hmac_final, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LC_ALL;
int /*<<< orphan*/ printf(char *, unsigned char, unsigned char, unsigned char);
char *setlocale(int /*<<< orphan*/, char *);
int main() {
  char *l = setlocale(LC_ALL, "");
  unsigned char c = 0;
  do {
    printf("%3d %02X %lc\n", c, c, c);
    c++;
  } while (c != 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
lea    0xece(%rip),%rsi
call   1040 <setlocale@plt>
mov    %rax,-0x10(%rbp)
movb   $0x0,-0x11(%rbp)
mov    -0x11(%rbp),%cl
mov    -0x11(%rbp),%al
lea    0xea7(%rip),%rdi
movzbl %cl,%esi
movzbl %al,%edx
movzbl -0x11(%rbp),%ecx
call   1030 <printf@plt>
mov    -0x11(%rbp),%al
add    $0x1,%al
mov    %al,-0x11(%rbp)
movzbl -0x11(%rbp),%eax
cmp    $0x0,%eax
jne    114c <main+0x2c>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xed9(%rip),%rsi
call   1040 <setlocale@plt>
xor    %ebx,%ebx
lea    0xebe(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl %bl,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
mov    %ebx,%ecx
call   1030 <printf@plt>
inc    %bl
jne    1150 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [14 x i8] c"%3d %02X %lc\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8
store i32 0, i32* %1
%4 = load i32, i32* @LC_ALL
%5 = call i8* @setlocale(i32 %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
store i8* %5, i8** %2
store i8 0, i8* %3
br label %6
6: ; preds = %13, %0
%7 = load i8, i8* %3
%8 = load i8, i8* %3
%9 = load i8, i8* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8 zeroext %7, i8 zeroext %8, i8 zeroext %9)
%11 = load i8, i8* %3
%12 = add i8 %11, 1
store i8 %12, i8* %3
br label %13
13: ; preds = %6
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = icmp ne i32 %15, 0
br i1 %16, label %6, label %17
17: ; preds = %13
ret i32 0
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [14 x i8] c"%3d %02X %lc\0A\00"
define i32 @main() {
%1 = load i32, i32* @LC_ALL
%2 = tail call i8* @setlocale(i32 %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %3, %0
%4 = phi i8 [ 0, %0 ], [ %6, %3 ]
%5 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8 zeroext %4, i8 zeroext %4, i8 zeroext %4)
%6 = add i8 %4, 1
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3
ret i32 0
}
void wifi_rsp_sme_stop_wps(const struct wifi_msg_sme_stop_wps_rsp_t *msg) {}


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

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

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

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