xunge/DecIR huggingface dataset:
char *BGBDT_TagParse_EatWhiteOnly(char *s) {
  while (*s && (*s <= ' '))
    s++;
  return (s);
}


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

x86 assembly (clang, -O2):
<BGBDT_TagParse_EatWhiteOnly>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
je     1121 <BGBDT_TagParse_EatWhiteOnly+0x21>
cmp    $0x21,%cl
jl     1110 <BGBDT_TagParse_EatWhiteOnly+0x10>
ret

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

LLVM IR (-O2):
define i8* @BGBDT_TagParse_EatWhiteOnly(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %8, %2 ]
%4 = load i8, i8* %3
%5 = icmp ne i8 %4, 0
%6 = icmp slt i8 %4, 33
%7 = and i1 %5, %6
%8 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %7, label %2, label %9
9: ; preds = %2
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t le32_to_cpu(uint32_t v) { return (v); }


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

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

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

LLVM IR (-O2):
define i32 @le32_to_cpu(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ oof(char *);
int print_info(unsigned int *ip_addr) {
  int invalid = 0;
  if (ip_addr) {
    unsigned int haddr = *ip_addr;
    oof("stuff");
    if (0x0 == haddr) {
      invalid = 1;
    }
    oof("stuff2");
  } else {
    invalid = 1;
  }
  return invalid;
}


x86 assembly (clang, -O0):
<print_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1166 <print_info+0x56>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
lea    0xec2(%rip),%rdi
call   1030 <oof@plt>
xor    %eax,%eax
cmp    -0x10(%rbp),%eax
jne    1155 <print_info+0x45>
movl   $0x1,-0xc(%rbp)
lea    0xeaa(%rip),%rdi
call   1030 <oof@plt>
jmp    116d <print_info+0x5d>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_info>:
push   %rbx
test   %rdi,%rdi
je     113b <print_info+0x2b>
lea    0xee3(%rip),%rax
xor    %ebx,%ebx
cmpl   $0x0,(%rdi)
sete   %bl
mov    %rax,%rdi
call   1030 <oof@plt>
lea    0xed2(%rip),%rdi
call   1030 <oof@plt>
jmp    1140 <print_info+0x30>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"stuff\00"
@.str.1 = [7 x i8] c"stuff2\00"
define i32 @print_info(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
%5 = load i32*, i32** %2
%6 = icmp ne i32* %5, null
br i1 %6, label %7, label %16
7: ; preds = %1
%8 = load i32*, i32** %2
%9 = load i32, i32* %8
store i32 %9, i32* %4
%10 = call i32 @oof(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* %4
%12 = icmp eq i32 0, %11
br i1 %12, label %13, label %14
13: ; preds = %7
store i32 1, i32* %3
br label %14
14: ; preds = %13, %7
%15 = call i32 @oof(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %17
16: ; preds = %1
store i32 1, i32* %3
br label %17
17: ; preds = %16, %14
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@.str = [6 x i8] c"stuff\00"
@.str.1 = [7 x i8] c"stuff2\00"
define i32 @print_info(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = load i32, i32* %0
%5 = tail call i32 @oof(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i32 %4, 0
%7 = zext i1 %6 to i32
%8 = tail call i32 @oof(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %1, %3
%10 = phi i32 [ %7, %3 ], [ 1, %1 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ swap(int *, int *);
int main() {
  int num1 = 5, num2 = 10;
  swap(&num1, &num2);
  printf("Number1 = %d\n", num1);
  printf("Number2 = %d", num2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0xa,-0xc(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <swap@plt>
mov    -0x8(%rbp),%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x5,0x4(%rsp)
movl   $0xa,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <swap@plt>
mov    0x4(%rsp),%esi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    (%rsp),%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"Number1 = %d\0A\00"
@.str.1 = [13 x i8] c"Number2 = %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 5, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 10, i32* %2
%5 = call i32 @swap(i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
char *getAmaPath() { return "/usr/lib/"; }


x86 assembly (clang, -O0):
<getAmaPath>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [10 x i8] c"/usr/lib/\00"
define i8* @getAmaPath() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [10 x i8] c"/usr/lib/\00"
define i8* @getAmaPath() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}
void enable_interrupts(void) { asm volatile("sti"); }


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

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

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

LLVM IR (-O2):
define void @enable_interrupts() {
tail call void asm sideeffect "sti", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
char peek(char const **);
int accept(const char **pp, char ch) {
  return (peek(pp) == ch && *pp) ? *(*pp)++ : 0;
}


x86 assembly (clang, -O0):
<accept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <peek@plt>
movsbl %al,%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1164 <accept+0x54>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1164 <accept+0x54>
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,(%rcx)
movsbl (%rax),%eax
mov    %eax,-0x10(%rbp)
jmp    116e <accept+0x5e>
xor    %eax,%eax
mov    %eax,-0x10(%rbp)
jmp    116e <accept+0x5e>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<accept>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <peek@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %bpl,%cl
jne    1138 <accept+0x28>
mov    (%rbx),%rcx
test   %rcx,%rcx
je     1138 <accept+0x28>
lea    0x1(%rcx),%rax
mov    %rax,(%rbx)
movsbl (%rcx),%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @accept(i8** %0, i8 signext %1) {
%3 = tail call signext i8 @peek(i8** %0)
%4 = icmp eq i8 %3, %1
br i1 %4, label %5, label %12
5: ; preds = %2
%6 = load i8*, i8** %0
%7 = icmp eq i8* %6, null
br i1 %7, label %12, label %8
8: ; preds = %5
%9 = getelementptr inbounds i8, i8* %6, i64 1
store i8* %9, i8** %0
%10 = load i8, i8* %6
%11 = sext i8 %10 to i32
br label %12
12: ; preds = %2, %5, %8
%13 = phi i32 [ %11, %8 ], [ 0, %5 ], [ 0, %2 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ handle_XCPU(int /*<<< orphan*/);
int gen_XCPU() { handle_XCPU(0); }


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

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

LLVM IR (-O0):
define i32 @gen_XCPU() {
%1 = alloca i32
%2 = call i32 @handle_XCPU(i32 0)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @gen_XCPU() {
%1 = tail call i32 @handle_XCPU(i32 0)
ret i32 undef
}
void MPI_Init(int *argc, char ***argv) {}


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

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

LLVM IR (-O0):
define void @MPI_Init(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 @MPI_Init(i32* nocapture %0, i8*** nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ log_register(void (*)(int, char const *));
void lldpctl_log_callback(void (*cb)(int severity, const char *msg)) {
  log_register(cb);
}


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

x86 assembly (clang, -O2):
<lldpctl_log_callback>:
jmp    1030 <log_register@plt>

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

LLVM IR (-O2):
define void @lldpctl_log_callback(void (i32, i8*)* %0) {
%2 = tail call i32 @log_register(void (i32, i8*)* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main() {
  char num;
  for (num = 0; num < 255;) {
    num += num;
  }
  printf("The num is %d\n", num);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0xff,%eax
jge    1144 <main+0x34>
movsbl -0x5(%rbp),%ecx
movsbl -0x5(%rbp),%eax
add    %ecx,%eax
mov    %al,-0x5(%rbp)
jmp    1123 <main+0x13>
lea    0xeb5(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
@.str = [15 x i8] c"The num is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i8 0, i8* %2
br label %3
3: ; preds = %7, %0
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp slt i32 %5, 255
br i1 %6, label %7, label %14
7: ; preds = %3
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = load i8, i8* %2
%11 = sext i8 %10 to i32
%12 = add nsw i32 %11, %9
%13 = trunc i32 %12 to i8
store i8 %13, i8* %2
br label %3
14: ; preds = %3
%15 = load i8, i8* %2
%16 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8 signext %15)
ret i32 0
}

LLVM IR (-O2):
/* Variables and functions */
float log2f(float);
float logf(float x) {
  float ln2;
  return ln2 * log2f(x);
}


x86 assembly (clang, -O0):
<logf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <log2f@plt>
movaps %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
mulss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logf>:
push   %rax
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
jae    1123 <logf+0x13>
movss  0xedf(%rip),%xmm0
pop    %rax
ret
call   1030 <log2f@plt>
jmp    1119 <logf+0x9>

LLVM IR (-O0):
define float @logf(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %3
%5 = load float, float* %2
%6 = call float @log2f(float %5)
%7 = fmul float %4, %6
ret float %7
}

LLVM IR (-O2):
define float @logf(float %0) {
%2 = fcmp ugt float %0, 0.000000e+00
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call float @log2f(float %0)
br label %5
5: ; preds = %1, %3
ret float 0x7FF8000000000000
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void emit_cmpmem_indexedsr12_imm(int addr, int r, int imm) { assert(0); }


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

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

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

LLVM IR (-O2):
define void @emit_cmpmem_indexedsr12_imm(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @assert(i32 0)
ret void
}
/* Variables and functions */
char *strstr(char *, char *);
int countsubs(char *haystack, char *needle) {
  int count = 0;
  char *p;
  p = strstr(haystack, needle);
  while (p != NULL) {
    count++;
    p = strstr(p + 1, needle);
  }
  return count;
}


x86 assembly (clang, -O0):
<countsubs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strstr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1166 <countsubs+0x56>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%rdi
add    $0x1,%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strstr@plt>
mov    %rax,-0x20(%rbp)
jmp    1138 <countsubs+0x28>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<countsubs>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1030 <strstr@plt>
xor    %ebp,%ebp
test   %rax,%rax
je     1147 <countsubs+0x37>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%ebp
add    $0x1,%rax
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strstr@plt>
test   %rax,%rax
jne    1130 <countsubs+0x20>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @countsubs(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %10, %5 ], [ %3, %2 ]
%7 = phi i32 [ %8, %5 ], [ 0, %2 ]
%8 = add nuw nsw i32 %7, 1
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = tail call i8* @strstr(i8* %9, i8* dereferenceable(1) %1)
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %5
12: ; preds = %5, %2
%13 = phi i32 [ 0, %2 ], [ %8, %5 ]
ret i32 %13
}
/* Variables and functions */
scalar_t__ is_alpha(char);
scalar_t__ is_digit(char);
bool is_alpha_numeric(char c) { return is_alpha(c) || is_digit(c); }


x86 assembly (clang, -O0):
<is_alpha_numeric>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <is_alpha@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    115c <is_alpha_numeric+0x3c>
movsbl -0x1(%rbp),%edi
call   1030 <is_digit@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_alpha_numeric>:
push   %rbx
mov    %edi,%ebx
call   1040 <is_alpha@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <is_alpha_numeric+0x17>
pop    %rbx
ret
movsbl %bl,%edi
call   1030 <is_digit@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_alpha_numeric(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @is_alpha(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = call i64 @is_digit(i8 signext %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_alpha_numeric(i8 signext %0) {
%2 = tail call i64 @is_alpha(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @is_digit(i8 signext %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ umfpack_dl_solve(long, long *, long *, double *, double *,
                                    double *, void *, double *, double *);
void umf4sol(long *sys, double x[], double b[], void **Numeric,
             double Control[20], double Info[90]) {
  Control[7] = 0;
  (void)umfpack_dl_solve(*sys, (long *)0, (long *)0, (double *)0, x, b,
                         *Numeric, Control, Info);
}


x86 assembly (clang, -O0):
<umf4sol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x28(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x38(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%r8
mov    -0x18(%rbp),%r9
mov    -0x20(%rbp),%rax
mov    (%rax),%r11
mov    -0x28(%rbp),%r10
mov    -0x30(%rbp),%rax
xor    %ecx,%ecx
mov    %rcx,%rsi
mov    %rcx,%rdx
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1030 <umfpack_dl_solve@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<umf4sol>:
push   %rax
mov    %r9,%r10
mov    %r8,%rax
mov    %rcx,%r11
mov    %rdx,%r9
mov    %rsi,%r8
movq   $0x0,0x38(%rax)
mov    (%rdi),%rdi
sub    $0x8,%rsp
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
push   %r10
push   %rax
push   (%r11)
call   1030 <umfpack_dl_solve@plt>
add    $0x20,%rsp
pop    %rax
ret

LLVM IR (-O0):
define void @umf4sol(i64* %0, double* %1, double* %2, i8** %3, double* %4, double* %5) {
%7 = alloca i64*
%8 = alloca double*
%9 = alloca double*
%10 = alloca i8**
%11 = alloca double*
%12 = alloca double*
store i64* %0, i64** %7
store double* %1, double** %8
store double* %2, double** %9
store i8** %3, i8*** %10
store double* %4, double** %11
store double* %5, double** %12
%13 = load double*, double** %11
%14 = getelementptr inbounds double, double* %13, i64 7
store double 0.000000e+00, double* %14
%15 = load i64*, i64** %7
%16 = load i64, i64* %15
%17 = load double*, double** %8
%18 = load double*, double** %9
%19 = load i8**, i8*** %10
%20 = load i8*, i8** %19
%21 = load double*, double** %11
%22 = load double*, double** %12
%23 = call i32 @umfpack_dl_solve(i64 %16, i64* null, i64* null, double* null, double* %17, double* %18, i8* %20, double* %21, double* %22)
ret void
}

LLVM IR (-O2):
define void @umf4sol(i64* nocapture %0, double* %1, double* %2, i8** nocapture %3, double* %4, double* %5) {
%7 = getelementptr inbounds double, double* %4, i64 7
store double 0.000000e+00, double* %7
%8 = load i64, i64* %0
%9 = load i8*, i8** %3
%10 = tail call i32 @umfpack_dl_solve(i64 %8, i64* null, i64* null, double* null, double* %1, double* %2, i8* %9, double* %4, double* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_threaded_mainloop_set_name() {
  printf("NOT IMPLEMENTED:"
         "pa_threaded_mainloop_set_name"
         "\n");
}


x86 assembly (clang, -O0):
<pa_threaded_mainloop_set_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [47 x i8] c"NOT IMPLEMENTED:pa_threaded_mainloop_set_name\0A\00"
define i32 @pa_threaded_mainloop_set_name() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [46 x i8] c"NOT IMPLEMENTED:pa_threaded_mainloop_set_name\00"
define i32 @pa_threaded_mainloop_set_name() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int main() {
  long n = 5;
  int x[3 * n];
  return &x == x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x5,-0x10(%rbp)
mov    -0x10(%rbp),%rax
lea    (%rax,%rax,2),%rax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,%rsp
mov    %rax,-0x20(%rbp)
mov    $0x1,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i8*
%4 = alloca i64
store i32 0, i32* %1
store i64 5, i64* %2
%5 = load i64, i64* %2
%6 = mul nsw i64 3, %5
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %3
%8 = alloca i32, i64 %6
store i64 %6, i64* %4
%9 = icmp eq i32* %8, %8
%10 = zext i1 %9 to i32
store i32 %10, i32* %1
%11 = load i8*, i8** %3
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
int test_imm_B8int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xB8 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_B8int64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 184
%7 = icmp ne i64 %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_B8int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 790273982464
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int GetTile(int screenblock, int x, int y) {
  return (
      (volatile uint16_t *)(0x6000000))[(screenblock * 1024) + (y * 32) + x];
}


x86 assembly (clang, -O0):
<GetTile>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xa,%eax
mov    -0xc(%rbp),%ecx
shl    $0x5,%ecx
add    %ecx,%eax
add    -0x8(%rbp),%eax
movslq %eax,%rcx
mov    $0x6000000,%eax
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetTile>:
shl    $0xa,%edi
shl    $0x5,%edx
add    %esi,%edi
add    %edx,%edi
movslq %edi,%rax
mov    0x6000000(,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @GetTile(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = mul nsw i32 %7, 1024
%9 = load i32, i32* %6
%10 = mul nsw i32 %9, 32
%11 = add nsw i32 %8, %10
%12 = load i32, i32* %5
%13 = add nsw i32 %11, %12
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* inttoptr (i64 100663296 to i32*), i64 %14
%16 = load volatile i32, i32* %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @GetTile(i32 %0, i32 %1, i32 %2) {
%4 = shl nsw i32 %0, 10
%5 = shl nsw i32 %2, 5
%6 = add i32 %4, %1
%7 = add i32 %6, %5
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* inttoptr (i64 100663296 to i32*), i64 %8
%10 = load volatile i32, i32* %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ sh_unmap_domain_page(void *);
void unmap_shadow_page(void *p) { sh_unmap_domain_page(p); }


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

x86 assembly (clang, -O2):
<unmap_shadow_page>:
jmp    1030 <sh_unmap_domain_page@plt>

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

LLVM IR (-O2):
define void @unmap_shadow_page(i8* %0) {
%2 = tail call i32 @sh_unmap_domain_page(i8* %0)
ret void
}
int DB_ReadSortedData_Native(int *data, int index, int *value, void *db) {
  *value = data[index];
  return 0;
}


x86 assembly (clang, -O0):
<DB_ReadSortedData_Native>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<DB_ReadSortedData_Native>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%eax
mov    %eax,(%rdx)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @DB_ReadSortedData_Native(i32* nocapture %0, i32 %1, i32* nocapture writeonly %2, i8* nocapture readnone %3) {
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
store i32 %7, i32* %2
ret i32 0
}
void __DELETE_java_util_HashSet(void *me, void *client_data) {}


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

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

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

LLVM IR (-O2):
define void @__DELETE_java_util_HashSet(i8* nocapture %0, i8* nocapture %1) {
ret void
}
void whichISR(void) {
  void (*the_isr)(void);
  the_isr = (void *)(*(volatile unsigned int *)(0x71300F00));
  (*the_isr)();
  return;
}


x86 assembly (clang, -O0):
<whichISR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x71300f00,%eax
mov    (%rax),%eax
mov    %eax,%eax
mov    %rax,-0x8(%rbp)
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<whichISR>:
mov    0x71300f00,%eax
jmp    *%rax

LLVM IR (-O0):
define void @whichISR() {
%1 = alloca void ()*
%2 = load volatile i32, i32* inttoptr (i64 1898974976 to i32*)
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i8*
%5 = bitcast i8* %4 to void ()*
store void ()* %5, void ()** %1
%6 = load void ()*, void ()** %1
ret void
}

LLVM IR (-O2):
define void @whichISR() {
%1 = load volatile i32, i32* inttoptr (i64 1898974976 to i32*)
%2 = zext i32 %1 to i64
%3 = inttoptr i64 %2 to void ()*
tail call void %3()
ret void
}
/* Variables and functions */
scalar_t__ islower(int);
int toupper(int c) { return islower(c) ? (c - 32) : c; }


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     113b <toupper+0x2b>
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    1141 <toupper+0x31>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <islower@plt>
lea    -0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @islower(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 32
br label %11
9: ; preds = %1
%10 = load i32, i32* %2
br label %11
11: ; preds = %9, %6
%12 = phi i32 [ %8, %6 ], [ %10, %9 ]
ret i32 %12
}

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = tail call i64 @islower(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint16_t copy_16bit(char *ptr) { return *(uint16_t *)ptr; }


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

x86 assembly (clang, -O2):
<copy_16bit>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @copy_16bit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @copy_16bit(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
int test_imm_B2int8_reg(signed char val) {
  return ((val) & (-0xB2 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B2int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff4e,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_B2int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -178
%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_B2int8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -178
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
uint32_t __attribute__((section(".iram1")))
DPORT_SEQUENCE_REG_READ(uint32_t reg) {
  return (*(volatile uint32_t *)(reg));
}


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

x86 assembly (clang, -O2):
<DPORT_SEQUENCE_REG_READ>:
mov    %rdi,-0x8(%rsp)
mov    -0x8(%rsp),%rax
mov    (%rax),%rax
ret

LLVM IR (-O0):
define i64 @DPORT_SEQUENCE_REG_READ(i64 %0) section ".iram1" {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
ret i64 %5
}

LLVM IR (-O2):
define i64 @DPORT_SEQUENCE_REG_READ(i64 %0) section ".iram1" {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
ret i64 %5
}
void nseel_asm_notequal_end(void) {}


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

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

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

LLVM IR (-O2):
define void @nseel_asm_notequal_end() {
ret void
}
int _mpyhus(unsigned int src1, int src2) {
  return (unsigned short)(src1 >> 16) * (short)(src2 >> 16);
}


x86 assembly (clang, -O0):
<_mpyhus>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
movzwl %ax,%eax
mov    -0x8(%rbp),%ecx
sar    $0x10,%ecx
movswl %cx,%ecx
imul   %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mpyhus>:
mov    %esi,%eax
shr    $0x10,%edi
sar    $0x10,%eax
imul   %edi,%eax
ret

LLVM IR (-O0):
define i32 @_mpyhus(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 = lshr i32 %5, 16
%7 = trunc i32 %6 to i16
%8 = zext i16 %7 to i32
%9 = load i32, i32* %4
%10 = ashr i32 %9, 16
%11 = trunc i32 %10 to i16
%12 = sext i16 %11 to i32
%13 = mul nsw i32 %8, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @_mpyhus(i32 %0, i32 %1) {
%3 = lshr i32 %0, 16
%4 = ashr i32 %1, 16
%5 = mul nsw i32 %4, %3
ret i32 %5
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ getchar();
int /*<<< orphan*/ printf(char *, double);
main() {
  double nc;
  for (nc = 0; getchar() != EOF; ++nc)
    ;
  printf("%.0f\n", nc);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2ea3(%rip),%rcx
cmp    (%rcx),%rax
je     116a <main+0x4a>
jmp    1153 <main+0x33>
movsd  0xea5(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1137 <main+0x17>
movsd  -0x10(%rbp),%xmm0
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb5(%rip),%rbx
xorpd  %xmm0,%xmm0
cmp    (%rbx),%rax
je     1160 <main+0x40>
xorpd  %xmm0,%xmm0
addsd  0xeb8(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1040 <getchar@plt>
movsd  0x8(%rsp),%xmm0
cmp    (%rbx),%rax
jne    1140 <main+0x20>
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@EOF = global i64 0
@.str = [6 x i8] c"%.0f\0A\00"
define i32 @main() {
%1 = tail call i64 (...) @getchar()
%2 = load i64, i64* @EOF
%3 = icmp eq i64 %1, %2
br i1 %3, label %10, label %4
4: ; preds = %0, %4
%5 = phi double [ %6, %4 ], [ 0.000000e+00, %0 ]
%6 = fadd double %5, 1.000000e+00
%7 = tail call i64 (...) @getchar()
%8 = load i64, i64* @EOF
%9 = icmp eq i64 %7, %8
br i1 %9, label %10, label %4
10: ; preds = %4, %0
%11 = phi double [ 0.000000e+00, %0 ], [ %6, %4 ]
%12 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %11)
ret i32 0
}
void printMap() { printCGSGame(__FUNCTION__); }


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

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

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

LLVM IR (-O2):
@__FUNCTION__.printMap = [9 x i8] c"printMap\00"
define void @printMap() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @printCGSGame to i32 (i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__FUNCTION__.printMap, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello world!\n");
  getchar();
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello world!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello world!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @getchar()
ret i32 0
}
int module_param_sysfs_setup(struct module *mod, struct kernel_param *kparam,
                             unsigned int num_params) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.module = type opaque
%struct.kernel_param = type opaque
define i32 @module_param_sysfs_setup(%struct.module* %0, %struct.kernel_param* %1, i32 %2) {
%4 = alloca %struct.module*
%5 = alloca %struct.kernel_param*
%6 = alloca i32
store %struct.module* %0, %struct.module** %4
store %struct.kernel_param* %1, %struct.kernel_param** %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
%struct.module = type opaque
%struct.kernel_param = type opaque
define i32 @module_param_sysfs_setup(%struct.module* nocapture readnone %0, %struct.kernel_param* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ nonblock(int /*<<< orphan*/);
void init_keyboard() { nonblock(0); }


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

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

LLVM IR (-O0):
define void @init_keyboard() {
%1 = call i32 @nonblock(i32 0)
ret void
}

LLVM IR (-O2):
define void @init_keyboard() {
%1 = tail call i32 @nonblock(i32 0)
ret void
}
/* Variables and functions */
double sin(double);
double cos(double n) { return sin(n + 3.14159265358979323846 / 2); }


x86 assembly (clang, -O0):
<cos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cos>:
addsd  0xee8(%rip),%xmm0
jmp    1030 <sin@plt>

LLVM IR (-O0):
define double @cos(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 0x3FF921FB54442D18
%5 = call double @sin(double %4)
ret double %5
}

LLVM IR (-O2):
define double @cos(double %0) {
%2 = fadd double %0, 0x3FF921FB54442D18
%3 = tail call double @sin(double %2)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ swap(int *, int *);
int main(int argc, const char *argv[]) {
  int a = 5;
  int b = 3;
  swap(&a, &b);
  printf("a is equal to:  %i\n", a);
  printf("b is equal to: %i\n", b);
  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   $0x5,-0x14(%rbp)
movl   $0x3,-0x18(%rbp)
lea    -0x14(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <swap@plt>
mov    -0x14(%rbp),%esi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x5,0x4(%rsp)
movl   $0x3,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <swap@plt>
mov    0x4(%rsp),%esi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    (%rsp),%esi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"a is equal to: %i\0A\00"
@.str.1 = [19 x i8] c"b is equal to: %i\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 5, i32* %6
store i32 3, i32* %7
%8 = call i32 @swap(i32* %6, i32* %7)
%9 = load i32, i32* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %7
%12 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"a is equal to: %i\0A\00"
@.str.1 = [19 x i8] c"b is equal to: %i\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
store i32 5, i32* %3
%6 = bitcast i32* %4 to i8*
store i32 3, i32* %4
%7 = call i32 @swap(i32* %3, i32* %4)
%8 = load i32, i32* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}
/* Type definitions */
typedef int ssize_t;
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
int /*<<< orphan*/ puts(char *);
ssize_t __wrap_read(int fd, void *buffer, size_t count) {
  puts("PASS");
  return fd + count + sizeof(buffer);
}


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

x86 assembly (clang, -O2):
<__wrap_read>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %edi,%ebx
lea    0xee0(%rip),%rdi
call   1030 <puts@plt>
lea    (%rbx,%r14,1),%eax
add    $0x8,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"PASS\00"
define i32 @__wrap_read(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = call i32 @puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = load i64, i64* %6
%11 = add i64 %9, %10
%12 = add i64 %11, 8
%13 = trunc i64 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@.str = [5 x i8] c"PASS\00"
define i32 @__wrap_read(i32 %0, i8* nocapture readnone %1, i64 %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = trunc i64 %2 to i32
%6 = add i32 %0, 8
%7 = add i32 %6, %5
ret i32 %7
}
int c_closer__(fd)
int *fd;
{ return (close(*fd)); }


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

x86 assembly (clang, -O2):
<c_closer__>:
mov    (%rdi),%edi
xor    %eax,%eax
jmp    1030 <close@plt>

LLVM IR (-O0):
define i32 @c_closer__(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = call i32 (i32, ...) bitcast (i32 (...)* @close to i32 (i32, ...)*)(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @c_closer__(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @close to i32 (i32, ...)*)(i32 %2)
ret i32 %3
}
int long_double_compare(long double a, long double b) { return (a == b); }


x86 assembly (clang, -O0):
<long_double_compare>:
push   %rbp
mov    %rsp,%rbp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setnp  %cl
sete   %al
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<long_double_compare>:
fldt   0x18(%rsp)
fldt   0x8(%rsp)
fucomip %st(1),%st
fstp   %st(0)
setnp  %al
sete   %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @long_double_compare(x86_fp80 %0, x86_fp80 %1) {
%3 = fcmp oeq x86_fp80 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}