xunge/DecIR huggingface dataset:
int foo(int a, int b, int (*fp)(int, int, int, int, int, int, int)) {
  return fp(a, b, a, b, a, b, a);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%r8d
mov    -0x8(%rbp),%r9d
mov    -0x4(%rbp),%r10d
mov    %r10d,(%rsp)
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
mov    %rdx,%rax
mov    %edi,(%rsp)
mov    %edi,%edx
mov    %esi,%ecx
mov    %edi,%r8d
mov    %esi,%r9d
call   *%rax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1, i32 (i32, i32, i32, i32, i32, i32, i32)* nocapture %2) {
%4 = tail call i32 %2(i32 %0, i32 %1, i32 %0, i32 %1, i32 %0, i32 %1, i32 %0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ __cmain();
int /*<<< orphan*/ __iar_init_core();
int /*<<< orphan*/ __iar_init_vfp();
void __iar_program_start(void) {
  __iar_init_core();
  __iar_init_vfp();
  __cmain();
}


x86 assembly (clang, -O0):
<__iar_program_start>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <__iar_init_core@plt>
mov    $0x0,%al
call   1050 <__iar_init_vfp@plt>
mov    $0x0,%al
call   1040 <__cmain@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__iar_program_start>:
push   %rax
xor    %eax,%eax
call   1030 <__iar_init_core@plt>
xor    %eax,%eax
call   1050 <__iar_init_vfp@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <__cmain@plt>

LLVM IR (-O0):
define void @__iar_program_start() {
%1 = call i32 (...) @__iar_init_core()
%2 = call i32 (...) @__iar_init_vfp()
%3 = call i32 (...) @__cmain()
ret void
}

LLVM IR (-O2):
define void @__iar_program_start() {
%1 = tail call i32 (...) @__iar_init_core()
%2 = tail call i32 (...) @__iar_init_vfp()
%3 = tail call i32 (...) @__cmain()
ret void
}
void SSI1_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<SSI1_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <SSI1_Handler+0x9>
jmp    1109 <SSI1_Handler+0x9>

x86 assembly (clang, -O2):
<SSI1_Handler>:
jmp    1100 <SSI1_Handler>

LLVM IR (-O0):
define void @SSI1_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @SSI1_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void uDMAEnable(uint32_t ui32Base) {
  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000004))) = 0x00000001;
}


x86 assembly (clang, -O0):
<uDMAEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x1,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uDMAEnable>:
movq   $0x1,0x4(%rdi)
ret

LLVM IR (-O0):
define void @uDMAEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 4
%5 = inttoptr i64 %4 to i64*
store volatile i64 1, i64* %5
ret void
}

LLVM IR (-O2):
define void @uDMAEnable(i64 %0) {
%2 = add nsw i64 %0, 4
%3 = inttoptr i64 %2 to i64*
store volatile i64 1, i64* %3
ret void
}
void ExttPrefixAuxTable(void) {}


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

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

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

LLVM IR (-O2):
define void @ExttPrefixAuxTable() {
ret void
}
/* Variables and functions */
double sinh_cosh(double, int);
double cosh(double x) {
  if (x < 0)
    x = -x;
  return sinh_cosh(x, 1);
}


x86 assembly (clang, -O0):
<cosh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    114c <cosh+0x3c>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%edi
call   1030 <sinh_cosh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cosh>:
movapd 0xee8(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
mov    $0x1,%edi
jmp    1030 <sinh_cosh@plt>

LLVM IR (-O0):
define double @cosh(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = fneg double %6
store double %7, double* %2
br label %8
8: ; preds = %5, %1
%9 = load double, double* %2
%10 = call double @sinh_cosh(double %9, i32 1)
ret double %10
}

LLVM IR (-O2):
define double @cosh(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
%5 = tail call double @sinh_cosh(double %4, i32 1)
ret double %5
}
int test_imm_2Eint64_midword_reg(long long val) {
  return ((val >> 16) & (0x2E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_2Eint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0x2e,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_2Eint64_midword_reg>:
test   $0x2e0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_2Eint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 46
%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_2Eint64_midword_reg(i64 %0) {
%2 = and i64 %0, 3014656
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void linux_error(const char *message) {
  fprintf(stderr, "Error: %s: %s\n", message, strerror(errno));
}


x86 assembly (clang, -O0):
<linux_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    %rax,%rcx
lea    0xea1(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<linux_error>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eb3(%rip),%rax
mov    (%rax),%ebp
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
lea    0xebc(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"Error: %s: %s\0A\00"
@errno = global i32 0
define void @linux_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = load i32, i32* @errno
%6 = call i8* @strerror(i32 %5)
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %6)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"Error: %s: %s\0A\00"
@errno = global i32 0
define void @linux_error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = load i32, i32* @errno
%4 = tail call i8* @strerror(i32 %3)
%5 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %4)
ret void
}
int wcstoutf8_octetcount(int c) {
  if (c < 0x80)
    return 1;
  if (c < 0x800)
    return 2;
  if (sizeof(c) < 3 || c < 0x10000)
    return 3;
  if (c < 0x200000)
    return 4;
  if (c < 0x4000000)
    return 5;
  return 6;
}


x86 assembly (clang, -O0):
<wcstoutf8_octetcount>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x80,-0x8(%rbp)
jge    1120 <wcstoutf8_octetcount+0x20>
movl   $0x1,-0x4(%rbp)
jmp    118b <wcstoutf8_octetcount+0x8b>
cmpl   $0x800,-0x8(%rbp)
jge    1139 <wcstoutf8_octetcount+0x39>
movl   $0x2,-0x4(%rbp)
jmp    118b <wcstoutf8_octetcount+0x8b>
cmpl   $0x10000,-0x8(%rbp)
jge    1152 <wcstoutf8_octetcount+0x52>
movl   $0x3,-0x4(%rbp)
jmp    118b <wcstoutf8_octetcount+0x8b>
cmpl   $0x200000,-0x8(%rbp)
jge    116b <wcstoutf8_octetcount+0x6b>
movl   $0x4,-0x4(%rbp)
jmp    118b <wcstoutf8_octetcount+0x8b>
cmpl   $0x4000000,-0x8(%rbp)
jge    1184 <wcstoutf8_octetcount+0x84>
movl   $0x5,-0x4(%rbp)
jmp    118b <wcstoutf8_octetcount+0x8b>
movl   $0x6,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcstoutf8_octetcount>:
mov    $0x1,%eax
cmp    $0x80,%edi
jl     1142 <wcstoutf8_octetcount+0x42>
mov    $0x2,%eax
cmp    $0x800,%edi
jb     1142 <wcstoutf8_octetcount+0x42>
mov    $0x3,%eax
cmp    $0x10000,%edi
jb     1142 <wcstoutf8_octetcount+0x42>
mov    $0x4,%eax
cmp    $0x200000,%edi
jb     1142 <wcstoutf8_octetcount+0x42>
cmp    $0x4000000,%edi
mov    $0x6,%eax
sbb    $0x0,%eax
ret

LLVM IR (-O0):
define i32 @wcstoutf8_octetcount(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 128
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %24
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 2048
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 2, i32* %2
br label %24
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp slt i32 %12, 65536
br i1 %13, label %14, label %15
14: ; preds = %11
store i32 3, i32* %2
br label %24
15: ; preds = %11
%16 = load i32, i32* %3
%17 = icmp slt i32 %16, 2097152
br i1 %17, label %18, label %19
18: ; preds = %15
store i32 4, i32* %2
br label %24
19: ; preds = %15
%20 = load i32, i32* %3
%21 = icmp slt i32 %20, 67108864
br i1 %21, label %22, label %23
22: ; preds = %19
store i32 5, i32* %2
br label %24
23: ; preds = %19
store i32 6, i32* %2
br label %24
24: ; preds = %23, %22, %18, %14, %10, %6
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @wcstoutf8_octetcount(i32 %0) {
%2 = icmp slt i32 %0, 128
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 2048
br i1 %4, label %12, label %5
5: ; preds = %3
%6 = icmp ult i32 %0, 65536
br i1 %6, label %12, label %7
7: ; preds = %5
%8 = icmp ult i32 %0, 2097152
br i1 %8, label %12, label %9
9: ; preds = %7
%10 = icmp ult i32 %0, 67108864
%11 = select i1 %10, i32 5, i32 6
br label %12
12: ; preds = %9, %7, %5, %3, %1
%13 = phi i32 [ 1, %1 ], [ 2, %3 ], [ 3, %5 ], [ 4, %7 ], [ %11, %9 ]
ret i32 %13
}
/* Variables and functions */
char ascii2nibble(char);
char ascii2byte(char *ascii) {
  char ret = 0x00;
  ret |= ascii2nibble(ascii[0]);
  ret <<= 4;
  ret |= ascii2nibble(ascii[1]);
  return ret;
}


x86 assembly (clang, -O0):
<ascii2byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <ascii2nibble@plt>
movsbl %al,%ecx
movsbl -0x9(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
shl    $0x4,%eax
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%edi
call   1030 <ascii2nibble@plt>
movsbl %al,%ecx
movsbl -0x9(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ascii2byte>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
movsbl (%rdi),%edi
call   1030 <ascii2nibble@plt>
mov    %eax,%ebx
shl    $0x4,%bl
movsbl 0x1(%r14),%edi
call   1030 <ascii2nibble@plt>
or     %bl,%al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define signext i8 @ascii2byte(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
store i8 0, i8* %3
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = call signext i8 @ascii2nibble(i8 signext %6)
%8 = sext i8 %7 to i32
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = or i32 %10, %8
%12 = trunc i32 %11 to i8
store i8 %12, i8* %3
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = shl i32 %14, 4
%16 = trunc i32 %15 to i8
store i8 %16, i8* %3
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i64 1
%19 = load i8, i8* %18
%20 = call signext i8 @ascii2nibble(i8 signext %19)
%21 = sext i8 %20 to i32
%22 = load i8, i8* %3
%23 = sext i8 %22 to i32
%24 = or i32 %23, %21
%25 = trunc i32 %24 to i8
store i8 %25, i8* %3
%26 = load i8, i8* %3
ret i8 %26
}

LLVM IR (-O2):
define signext i8 @ascii2byte(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call signext i8 @ascii2nibble(i8 signext %2)
%4 = shl i8 %3, 4
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = tail call signext i8 @ascii2nibble(i8 signext %6)
%8 = or i8 %7, %4
ret i8 %8
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
void package_erase_one_day(char *buffer, unsigned char day_back) {
  memset(buffer, 0, 17 - 1);
  buffer[0x00] = 0x5a;
  buffer[0x01] = 0x04;
  buffer[0x02] = day_back;
}


x86 assembly (clang, -O0):
<package_erase_one_day>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rax
movb   $0x5a,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x4,0x1(%rax)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<package_erase_one_day>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
movw   $0x45a,(%rbx)
mov    %bpl,0x2(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @package_erase_one_day(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8*, i8** %3
%6 = call i32 @memset(i8* %5, i32 0, i32 16)
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 0
store i8 90, i8* %8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
store i8 4, i8* %10
%11 = load i8, i8* %4
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 2
store i8 %11, i8* %13
ret void
}

LLVM IR (-O2):
define void @package_erase_one_day(i8* %0, i8 zeroext %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i32 16)
store i8 90, i8* %0
%4 = getelementptr inbounds i8, i8* %0, i64 1
store i8 4, i8* %4
%5 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %1, i8* %5
ret void
}
/* Variables and functions */
char **string_split_internal(char const *, char const *, int, int, int *, int);
char **string_split_shared(const char *string, const char *separators,
                           int keep_eol, int num_items_max, int *num_items) {
  return string_split_internal(string, separators, keep_eol, num_items_max,
                               num_items, 1);
}


x86 assembly (clang, -O0):
<string_split_shared>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    $0x1,%r9d
call   1030 <string_split_internal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_split_shared>:
mov    $0x1,%r9d
jmp    1030 <string_split_internal@plt>

LLVM IR (-O0):
define i8** @string_split_shared(i8* %0, i8* %1, i32 %2, i32 %3, i32* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32* %4, i32** %10
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load i32*, i32** %10
%16 = call i8** @string_split_internal(i8* %11, i8* %12, i32 %13, i32 %14, i32* %15, i32 1)
ret i8** %16
}

LLVM IR (-O2):
define i8** @string_split_shared(i8* %0, i8* %1, i32 %2, i32 %3, i32* %4) {
%6 = tail call i8** @string_split_internal(i8* %0, i8* %1, i32 %2, i32 %3, i32* %4, i32 1)
ret i8** %6
}
void cdrom_null_reset() {}


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

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

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

LLVM IR (-O2):
define void @cdrom_null_reset() {
ret void
}
int test_imm_6Duint8_mem(unsigned char *val) {
  return ((*val) & (-0x6D << 0)) ? -20 : -40;
}


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

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

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

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

/* Variables and functions */
uint64_t pb_int2uint(int64_t s) {
  if (s < 0)
    return (uint64_t)(~(s << 1));
  else
    return (uint64_t)(s << 1);
}


x86 assembly (clang, -O0):
<pb_int2uint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1122 <pb_int2uint+0x22>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
xor    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    112b <pb_int2uint+0x2b>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pb_int2uint>:
lea    (%rdi,%rdi,1),%eax
sar    $0x1f,%edi
xor    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @pb_int2uint(i32 %0) {
%2 = shl i32 %0, 1
%3 = ashr i32 %0, 31
%4 = xor i32 %2, %3
ret i32 %4
}
/* Variables and functions */
double atan(double);
double varphi(double xi) { return 2 * (4.0 * atan(1.0)) * xi; }


x86 assembly (clang, -O0):
<varphi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeeb(%rip),%xmm0
call   1030 <atan@plt>
movsd  0xed6(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xec2(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<varphi>:
push   %rax
movsd  %xmm0,(%rsp)
movsd  0xee2(%rip),%xmm0
call   1030 <atan@plt>
movsd  (%rsp),%xmm0
mulsd  0xed8(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @varphi(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call double @atan(double 1.000000e+00)
%4 = fmul double 4.000000e+00, %3
%5 = fmul double 2.000000e+00, %4
%6 = load double, double* %2
%7 = fmul double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @varphi(double %0) {
%2 = tail call double @atan(double 1.000000e+00)
%3 = fmul double %0, 0x401921FB54442D18
ret double %3
}
/* Variables and functions */
int rand();
int stayiter() {
  int door = rand() % 3 + 1;
  int choice = rand() % 3 + 1;
  return door == choice;
}


x86 assembly (clang, -O0):
<stayiter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x3,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x3,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stayiter>:
push   %rbx
xor    %eax,%eax
call   1030 <rand@plt>
movslq %eax,%rbx
imul   $0x55555556,%rbx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
lea    (%rax,%rax,2),%eax
sub    %eax,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
movslq %eax,%rcx
imul   $0x55555556,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rax
add    %edx,%eax
lea    (%rax,%rax,2),%eax
sub    %eax,%ecx
xor    %eax,%eax
cmp    %ecx,%ebx
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @stayiter() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @rand()
%4 = srem i32 %3, 3
%5 = add nsw i32 %4, 1
store i32 %5, i32* %1
%6 = call i32 (...) @rand()
%7 = srem i32 %6, 3
%8 = add nsw i32 %7, 1
store i32 %8, i32* %2
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = icmp eq i32 %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @stayiter() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 3
%3 = tail call i32 (...) @rand()
%4 = srem i32 %3, 3
%5 = icmp eq i32 %2, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
char *strchr(char *, char);
bool parse_section(char *buf,
                   bool (*sfunc)(const char *section, void *private_data),
                   void *private_data) {
  char *p, *q;
  p = buf + 1;
  q = strchr(p, ']');
  if (q == NULL) {
    return false;
  }
  *q = '\0';
  return sfunc(p, private_data);
}


x86 assembly (clang, -O0):
<parse_section>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    $0x5d,%esi
call   1030 <strchr@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    1159 <parse_section+0x49>
movl   $0x0,-0x4(%rbp)
jmp    1171 <parse_section+0x61>
mov    -0x30(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   *%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_section>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
add    $0x1,%rbx
mov    %rbx,%rdi
mov    $0x5d,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1147 <parse_section+0x37>
movb   $0x0,(%rax)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
jmp    *%rax
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @parse_section(i8* %0, i32 (i8*, i8*)* nocapture %1, i8* %2) {
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = tail call i8* @strchr(i8* %4, i8 signext 93)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %3
store i8 0, i8* %5
%8 = tail call i32 %1(i8* %4, i8* %2)
br label %9
9: ; preds = %3, %7
%10 = phi i32 [ %8, %7 ], [ 0, %3 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
size_t wcsnlen(int /*<<< orphan*/ const *, size_t);
int /*<<< orphan*/ wmemmove(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                            size_t);
int /*<<< orphan*/ wmemset(int /*<<< orphan*/ *, int /*<<< orphan*/, size_t);
wchar_t *wcpnmove(wchar_t *whither, const wchar_t *whence, size_t maxlen) {
  size_t n = wcsnlen(whence, maxlen);
  wmemmove(whither, whence, n);
  wmemset(whither + n, 0, maxlen - n);
  return whither + n;
}


x86 assembly (clang, -O0):
<wcpnmove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <wcsnlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <wmemmove@plt>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x18(%rbp),%rdx
sub    -0x20(%rbp),%rdx
xor    %esi,%esi
call   1030 <wmemset@plt>
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcpnmove>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1050 <wcsnlen@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rax,%rdx
call   1040 <wmemmove@plt>
lea    (%r15,%rbx,4),%r14
sub    %rbx,%r12
mov    %r14,%rdi
xor    %esi,%esi
mov    %r12,%rdx
call   1030 <wmemset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32* @wcpnmove(i32* %0, i32* %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i64
%7 = alloca i64
store i32* %0, i32** %4
store i32* %1, i32** %5
store i64 %2, i64* %6
%8 = load i32*, i32** %5
%9 = load i64, i64* %6
%10 = call i64 @wcsnlen(i32* %8, i64 %9)
store i64 %10, i64* %7
%11 = load i32*, i32** %4
%12 = load i32*, i32** %5
%13 = load i64, i64* %7
%14 = call i32 @wmemmove(i32* %11, i32* %12, i64 %13)
%15 = load i32*, i32** %4
%16 = load i64, i64* %7
%17 = getelementptr inbounds i32, i32* %15, i64 %16
%18 = load i64, i64* %6
%19 = load i64, i64* %7
%20 = sub i64 %18, %19
%21 = call i32 @wmemset(i32* %17, i32 0, i64 %20)
%22 = load i32*, i32** %4
%23 = load i64, i64* %7
%24 = getelementptr inbounds i32, i32* %22, i64 %23
ret i32* %24
}

LLVM IR (-O2):
define i32* @wcpnmove(i32* %0, i32* %1, i64 %2) {
%4 = tail call i64 @wcsnlen(i32* %1, i64 %2)
%5 = tail call i32 @wmemmove(i32* %0, i32* %1, i64 %4)
%6 = getelementptr inbounds i32, i32* %0, i64 %4
%7 = sub i64 %2, %4
%8 = tail call i32 @wmemset(i32* %6, i32 0, i64 %7)
ret i32* %6
}
/* Variables and functions */
int /*<<< orphan*/ fatserror(char *);
volatile void unterminatedString() { fatserror("unterminated string"); }


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"unterminated string\00"
define void @unterminatedString() {
%1 = call i32 @fatserror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"unterminated string\00"
define void @unterminatedString() {
%1 = tail call i32 @fatserror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
extern int64_t ReturnInt64() { return 0xFFFFFFFFFF; }


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

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

LLVM IR (-O0):
define i32 @ReturnInt64() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @ReturnInt64() {
ret i32 -1
}
unsigned bitScan_fun_ulong(unsigned long x) {
  unsigned r = 40;
  while (x) {
    --r;
    x >>= 1;
  }
  return r;
}


x86 assembly (clang, -O0):
<bitScan_fun_ulong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x28,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1134 <bitScan_fun_ulong+0x34>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <bitScan_fun_ulong+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitScan_fun_ulong>:
mov    $0x28,%eax
test   %rdi,%rdi
je     111f <bitScan_fun_ulong+0x1f>
mov    %rdi,%rcx
nopl   (%rax)
add    $0xffffffff,%eax
shr    %rcx
cmp    $0x1,%rdi
mov    %rcx,%rdi
ja     1110 <bitScan_fun_ulong+0x10>
ret

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

LLVM IR (-O2):
define i32 @bitScan_fun_ulong(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 40, %1 ]
%5 = phi i64 [ %7, %3 ], [ %0, %1 ]
%6 = add nsw i32 %4, -1
%7 = lshr i64 %5, 1
%8 = icmp ult i64 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 40, %1 ], [ %6, %3 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint16_t;

/* Variables and functions */
int has_wwn(const uint8_t *const identify) {
  uint16_t word;
  word = *((uint16_t *)identify + 108);
  return ((word & 0xf000) == 0x5000) ? 1 : 0;
}


x86 assembly (clang, -O0):
<has_wwn>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1b0(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edx
and    $0xf000,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x5000,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<has_wwn>:
mov    $0xf000,%ecx
and    0x1b0(%rdi),%ecx
xor    %eax,%eax
cmp    $0x5000,%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @has_wwn(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 108
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = and i32 %7, 61440
%9 = icmp eq i32 %8, 20480
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 1, i32 0
ret i32 %11
}

LLVM IR (-O2):
define i32 @has_wwn(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 108
%3 = load i32, i32* %2
%4 = and i32 %3, 61440
%5 = icmp eq i32 %4, 20480
%6 = zext i1 %5 to i32
ret i32 %6
}
void I420ToABGR() {}


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

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

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

LLVM IR (-O2):
define void @I420ToABGR() {
ret void
}
/* Variables and functions */
int ENXIO;
__attribute__((deprecated)) int snd_tlv_get_dB_range(unsigned int *tlv,
                                                     long rangemin,
                                                     long rangemax, long *min,
                                                     long *max) {
  return -ENXIO;
}


x86 assembly (clang, -O0):
<snd_tlv_get_dB_range>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
xor    %eax,%eax
mov    0x2ebf(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<snd_tlv_get_dB_range>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ENXIO = global i32 0
define i32 @snd_tlv_get_dB_range(i32* %0, i64 %1, i64 %2, i64* %3, i64* %4) {
%6 = alloca i32*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64*
%10 = alloca i64*
store i32* %0, i32** %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i64* %3, i64** %9
store i64* %4, i64** %10
%11 = load i32, i32* @ENXIO
%12 = sub nsw i32 0, %11
ret i32 %12
}

LLVM IR (-O2):
@ENXIO = global i32 0
define i32 @snd_tlv_get_dB_range(i32* nocapture readnone %0, i64 %1, i64 %2, i64* nocapture readnone %3, i64* nocapture readnone %4) {
%6 = load i32, i32* @ENXIO
%7 = sub nsw i32 0, %6
ret i32 %7
}
int main(int argc, char *argv[]) {
  char s[] = {"babaabbbbbaaaaabbaababbaaaaaaabbaabaabbbabbaabbbbb"};
  char p[] = {"*ba**bbbb"};
  printf("%d\n", isMatch(s, p));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x33,%edx
call   1050 <memcpy@plt>
mov    0xed8(%rip),%rax
mov    %rax,-0x5a(%rbp)
mov    0xed5(%rip),%ax
mov    %ax,-0x52(%rbp)
lea    -0x50(%rbp),%rdi
lea    -0x5a(%rbp),%rsi
mov    $0x0,%al
call   1030 <isMatch@plt>
mov    %eax,%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x626262,0x3f(%rsp)
movabs $0x6262622a2a61622a,%rax
62 62 62
mov    %rax,(%rsp)
movw   $0x62,0x8(%rsp)
lea    0x10(%rsp),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1030 <isMatch@plt>
lea    0xec2(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.main.s = [51 x i8] c"babaabbbbbaaaaabbaababbaaaaaaabbaabaabbbabbaabbbbb\00"
@__const.main.p = [10 x i8] c"*ba**bbbb\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [51 x i8]
%6 = alloca [10 x i8]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%7 = bitcast [51 x i8]* %5 to i8*
%8 = bitcast [10 x i8]* %6 to i8*
%9 = getelementptr inbounds [51 x i8], [51 x i8]* %5, i64 0, i64 0
%10 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%11 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @isMatch to i32 (i8*, i8*, ...)*)(i8* %9, i8* %10)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [51 x i8] c"babaabbbbbaaaaabbaababbaaaaaaabbaabaabbbabbaabbbbb\00"
@__const.main.p = [10 x i8] c"*ba**bbbb\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [51 x i8]
%4 = alloca [10 x i8]
%5 = getelementptr inbounds [51 x i8], [51 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%7 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @isMatch to i32 (i8*, i8*, ...)*)(i8* %5, i8* %6)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ listening();
int /*<<< orphan*/ printf(char *);
void check_recv(int recv_res) {
  if (recv_res == -1) {
    printf("Receive error!\n");
    listening();
  }
  if (recv_res == 0) {
    printf("No data received!\n");
    listening();
  }
  return;
}


x86 assembly (clang, -O0):
<check_recv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    1148 <check_recv+0x28>
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <listening@plt>
cmpl   $0x0,-0x4(%rbp)
jne    1165 <check_recv+0x45>
lea    0xeb7(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <listening@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_recv>:
cmp    $0xffffffff,%edi
je     1132 <check_recv+0x12>
test   %edi,%edi
jne    1147 <check_recv+0x27>
lea    0xed0(%rip),%rdi
jmp    1139 <check_recv+0x19>
lea    0xed9(%rip),%rdi
push   %rax
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <listening@plt>
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Receive error!\0A\00"
@.str.1 = [19 x i8] c"No data received!\0A\00"
define void @check_recv(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @listening()
br label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 (...) @listening()
br label %14
14: ; preds = %11, %8
ret void
}

LLVM IR (-O2):
@str = [18 x i8] c"No data received!\00"
@str.2 = [15 x i8] c"Receive error!\00"
define void @check_recv(i32 %0) {
switch i32 %0, label %7 [
i32 -1, label %3
i32 0, label %2
]
2: ; preds = %1
br label %3
3: ; preds = %1, %2
%4 = phi i8* [ getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0), %2 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @str.2, i64 0, i64 0), %1 ]
%5 = tail call i32 @puts(i8* dereferenceable(1) %4)
%6 = tail call i32 (...) @listening()
br label %7
7: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printSpaces(int n) {
  while (n > 0) {
    if (n >= 4) {
      printf("(tab)");
      n -= 4;
    } else {
      printf("(spc)");
      n--;
    }
  }
}


x86 assembly (clang, -O0):
<printSpaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1163 <printSpaces+0x53>
cmpl   $0x4,-0x4(%rbp)
jl     1149 <printSpaces+0x39>
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
sub    $0x4,%eax
mov    %eax,-0x4(%rbp)
jmp    115e <printSpaces+0x4e>
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    111b <printSpaces+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printSpaces>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
jle    1153 <printSpaces+0x43>
lea    0xee1(%rip),%r14
lea    0xee0(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xor    %ecx,%ecx
cmp    $0x4,%edi
setb   %cl
mov    %rbx,%rax
cmovae %r14,%rax
lea    (%rcx,%rcx,2),%ebp
add    %edi,%ebp
mov    %rax,%rdi
call   1030 <printf@plt>
add    $0xfffffffc,%ebp
mov    %ebp,%edi
jne    1130 <printSpaces+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"(tab)\00"
@.str.1 = [6 x i8] c"(spc)\00"
define void @printSpaces(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ %0, %1 ]
%5 = icmp ugt i32 %4, 3
%6 = select i1 %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0)
%7 = select i1 %5, i32 -4, i32 -1
%8 = tail call i32 @printf(i8* dereferenceable(1) %6)
%9 = add nsw i32 %4, %7
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %3
11: ; preds = %3, %1
ret void
}
/* Type definitions */
struct _Locale_time {
  int dummy;
};

/* Variables and functions */
const char *_Locale_pm_str(struct _Locale_time *ltime) { return "PM"; }


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

x86 assembly (clang, -O2):
<_Locale_pm_str>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
%struct._Locale_time = type { i32 }
@.str = [3 x i8] c"PM\00"
define i8* @_Locale_pm_str(%struct._Locale_time* %0) {
%2 = alloca %struct._Locale_time*
store %struct._Locale_time* %0, %struct._Locale_time** %2
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct._Locale_time = type { i32 }
@.str = [3 x i8] c"PM\00"
define i8* @_Locale_pm_str(%struct._Locale_time* nocapture readnone %0) {
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ doprintf();
int main(void) {
  doprintf();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @doprintf()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SEMC_DriverIRQHandler();
__attribute__((weak)) void SEMC_IRQHandler(void) { SEMC_DriverIRQHandler(); }


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

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

LLVM IR (-O0):
define weak void @SEMC_IRQHandler() {
%1 = call i32 (...) @SEMC_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @SEMC_IRQHandler() {
%1 = tail call i32 (...) @SEMC_DriverIRQHandler()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ vdp_dma_vram(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ vdp_set_autoinc(int);
void vdp_map_vline(uint16_t plan, const uint16_t *tiles, uint16_t x, uint16_t y,
                   uint16_t len) {
  vdp_set_autoinc(128);
  vdp_dma_vram((uint32_t)tiles, plan + ((x + (y << 6)) << 1), len);
  vdp_set_autoinc(2);
}


x86 assembly (clang, -O0):
<vdp_map_vline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    $0x80,%edi
call   1040 <vdp_set_autoinc@plt>
mov    -0x10(%rbp),%rax
mov    %eax,%edi
mov    -0x4(%rbp),%esi
mov    -0x14(%rbp),%eax
mov    -0x18(%rbp),%ecx
shl    $0x6,%ecx
add    %ecx,%eax
shl    $0x1,%eax
add    %eax,%esi
mov    -0x1c(%rbp),%edx
call   1030 <vdp_dma_vram@plt>
mov    $0x2,%edi
call   1040 <vdp_set_autoinc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vdp_map_vline>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8d,%r14d
mov    %ecx,%ebx
mov    %edx,%ebp
mov    %rsi,%r15
mov    %edi,%r12d
mov    $0x80,%edi
call   1040 <vdp_set_autoinc@plt>
shl    $0x6,%ebx
add    %ebp,%ebx
lea    (%r12,%rbx,2),%esi
mov    %r15d,%edi
mov    %r14d,%edx
call   1030 <vdp_dma_vram@plt>
mov    $0x2,%edi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <vdp_set_autoinc@plt>

LLVM IR (-O0):
define void @vdp_map_vline(i32 %0, i32* %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32* %1, i32** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = call i32 @vdp_set_autoinc(i32 128)
%12 = load i32*, i32** %7
%13 = ptrtoint i32* %12 to i32
%14 = load i32, i32* %6
%15 = load i32, i32* %8
%16 = load i32, i32* %9
%17 = shl i32 %16, 6
%18 = add nsw i32 %15, %17
%19 = shl i32 %18, 1
%20 = add nsw i32 %14, %19
%21 = load i32, i32* %10
%22 = call i32 @vdp_dma_vram(i32 %13, i32 %20, i32 %21)
%23 = call i32 @vdp_set_autoinc(i32 2)
ret void
}

LLVM IR (-O2):
define void @vdp_map_vline(i32 %0, i32* %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @vdp_set_autoinc(i32 128)
%7 = ptrtoint i32* %1 to i64
%8 = trunc i64 %7 to i32
%9 = shl i32 %3, 6
%10 = add nsw i32 %9, %2
%11 = shl i32 %10, 1
%12 = add nsw i32 %11, %0
%13 = tail call i32 @vdp_dma_vram(i32 %8, i32 %12, i32 %4)
%14 = tail call i32 @vdp_set_autoinc(i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void imprimirEnConsola(char *texto) {
  printf("\x1B[34m"
         "Other: "
         "\033[0m"
         "%s\n",
         texto);
}


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

x86 assembly (clang, -O2):
<imprimirEnConsola>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"\1B[34mOther: \1B[0m%s\0A\00"
define void @imprimirEnConsola(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"\1B[34mOther: \1B[0m%s\0A\00"
define void @imprimirEnConsola(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __print_int(int);
void g(int r) { __print_int(r); }


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

x86 assembly (clang, -O2):
<g>:
jmp    1030 <__print_int@plt>

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

LLVM IR (-O2):
define void @g(i32 %0) {
%2 = tail call i32 @__print_int(i32 %0)
ret void
}
int tick_device_uses_broadcast(struct clock_event_device *dev, int cpu) {
  return 0;
}


x86 assembly (clang, -O0):
<tick_device_uses_broadcast>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.clock_event_device = type opaque
define i32 @tick_device_uses_broadcast(%struct.clock_event_device* %0, i32 %1) {
%3 = alloca %struct.clock_event_device*
%4 = alloca i32
store %struct.clock_event_device* %0, %struct.clock_event_device** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
%struct.clock_event_device = type opaque
define i32 @tick_device_uses_broadcast(%struct.clock_event_device* nocapture readnone %0, i32 %1) {
ret i32 0
}