xunge/DecIR huggingface dataset:
/* Variables and functions */
int ioctl(int, unsigned int, void *);
int ioctl1(int i, unsigned int r, void *d) { return ioctl(i, r, d); }


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

x86 assembly (clang, -O2):
<ioctl1>:
jmp    1030 <ioctl@plt>

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

LLVM IR (-O2):
define i32 @ioctl1(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 @ioctl(i32 %0, i32 %1, i8* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ limpamlc();
int /*<<< orphan*/ mostrapenter(char);
int /*<<< orphan*/ mostraplinha(char);
int /*<<< orphan*/ sprintf(char, char *);
void frasesete(char plinha, char penter) {
  limpamlc();
  sprintf(plinha, "7: Refri de cola");
  mostraplinha(plinha);
  mostrapenter(penter);
}


x86 assembly (clang, -O0):
<frasesete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    $0x0,%al
call   1030 <limpamlc@plt>
lea    0xe9e(%rip),%rsi
movsbl -0x1(%rbp),%edi
call   1040 <sprintf@plt>
movsbl -0x1(%rbp),%edi
call   1050 <mostraplinha@plt>
movsbl -0x2(%rbp),%edi
call   1060 <mostrapenter@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<frasesete>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <limpamlc@plt>
lea    0xeab(%rip),%rsi
mov    %ebp,%edi
call   1040 <sprintf@plt>
mov    %ebp,%edi
call   1050 <mostraplinha@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <mostrapenter@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"7: Refri de cola\00"
define void @frasesete(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = call i32 (...) @limpamlc()
%6 = load i8, i8* %3
%7 = call i32 @sprintf(i8 signext %6, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%8 = load i8, i8* %3
%9 = call i32 @mostraplinha(i8 signext %8)
%10 = load i8, i8* %4
%11 = call i32 @mostrapenter(i8 signext %10)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"7: Refri de cola\00"
define void @frasesete(i8 signext %0, i8 signext %1) {
%3 = tail call i32 (...) @limpamlc()
%4 = tail call i32 @sprintf(i8 signext %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @mostraplinha(i8 signext %0)
%6 = tail call i32 @mostrapenter(i8 signext %1)
ret void
}
/* Variables and functions */
int BF_match(char *, char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  char *s1 = "abcabcabcd";
  char *s2 = "abcd";
  int offset = BF_match(s1, s2);
  printf("offset is %d\n", offset);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xec5(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <BF_match@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed7(%rip),%rsi
call   1040 <BF_match@plt>
lea    0xed0(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"abcabcabcd\00"
@.str.1 = [5 x i8] c"abcd\00"
@.str.2 = [14 x i8] c"offset is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @BF_match(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ crError(char *, unsigned int);
void *malloc(unsigned int);
void *crAlloc(unsigned int nbytes) {
  void *ret = malloc(nbytes);
  if (!ret) {
    crError("Out of memory trying to allocate %d bytes!", nbytes);
    abort();
  }
  return ret;
}


x86 assembly (clang, -O0):
<crAlloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1168 <crAlloc+0x38>
mov    -0x4(%rbp),%esi
lea    0xea4(%rip),%rdi
call   1040 <crError@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crAlloc>:
push   %rbx
mov    %edi,%ebx
call   1050 <malloc@plt>
test   %rax,%rax
je     113f <crAlloc+0xf>
pop    %rbx
ret
lea    0xeba(%rip),%rdi
mov    %ebx,%esi
call   1040 <crError@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"Out of memory trying to allocate %d bytes!\00"
define i8* @crAlloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %12, label %8
8: ; preds = %1
%9 = load i32, i32* %2
%10 = call i32 @crError(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = call i32 (...) @abort()
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@.str = [43 x i8] c"Out of memory trying to allocate %d bytes!\00"
define noalias i8* @crAlloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @crError(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %0)
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %1
ret i8* %2
}
int port_in(unsigned short port) {
  unsigned char value;
  __asm__ volatile("inb %1,%0" : "=a"(value) : "d"((unsigned short)port));
  return value;
}


x86 assembly (clang, -O0):
<port_in>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%al
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<port_in>:
mov    %edi,%edx
in     (%dx),%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @port_in(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i8 asm sideeffect "inb $1,$0", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
%7 = zext i8 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @port_in(i16 zeroext %0) {
%2 = tail call i8 asm sideeffect "inb $1,$0", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
%3 = zext i8 %2 to i32
ret i32 %3
}
int test_imm_57int64_highword_reg(long long val) {
  return ((val >> 32) & (0x57 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_57int64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 87
%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_57int64_highword_reg(i64 %0) {
%2 = and i64 %0, 373662154752
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void print_test(char *name, bool result) {
  printf("%s: %s\n", name, result ? "OK" : "ERROR");
}


x86 assembly (clang, -O0):
<print_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%ecx
lea    0xede(%rip),%rdx
lea    0xed4(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdx
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_test>:
mov    %rdi,%rax
test   %esi,%esi
lea    0xeef(%rip),%rcx
lea    0xee5(%rip),%rdx
cmove  %rcx,%rdx
lea    0xed2(%rip),%rdi
mov    %rax,%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%s: %s\0A\00"
@.str.1 = [3 x i8] c"OK\00"
@.str.2 = [6 x i8] c"ERROR\00"
define void @print_test(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%10 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s: %s\0A\00"
@.str.1 = [3 x i8] c"OK\00"
@.str.2 = [6 x i8] c"ERROR\00"
define void @print_test(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init();
int /*<<< orphan*/ printBanner();
int /*<<< orphan*/ run();
int main() {
  printBanner();
  init();
  run();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @printBanner()
%2 = tail call i32 (...) @init()
%3 = tail call i32 (...) @run()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printv(int p[], int size) {
  int i;
  for (i = 0; i < size; i++)
    printf("%d ", p[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<printv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <printv+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printv+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printv>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <printv+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printv+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printv(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
void test90_Test_03_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test90_Test_03_targetInit__I() {
ret void
}
unsigned int exynos_get_frame_len(unsigned char *frm) {
  return (unsigned int)*(unsigned short *)(frm + 6);
}


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

x86 assembly (clang, -O2):
<exynos_get_frame_len>:
movzwl 0x6(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @exynos_get_frame_len(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 6
%5 = bitcast i8* %4 to i16*
%6 = load i16, i16* %5
%7 = zext i16 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @exynos_get_frame_len(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 6
%3 = bitcast i8* %2 to i16*
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void re_cfree(void *p) { free(p); }


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

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

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

LLVM IR (-O2):
define void @re_cfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void INT_Excep_USB_resume_USBR1(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_USB_resume_USBR1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errmsg(char *);
void errmsg_(char *mesg) { errmsg(mesg); }


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

x86 assembly (clang, -O2):
<errmsg_>:
jmp    1030 <errmsg@plt>

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

LLVM IR (-O2):
define void @errmsg_(i8* %0) {
%2 = tail call i32 @errmsg(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OpcodeNotDone();
void jv(void) { OpcodeNotDone(); }


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

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

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

LLVM IR (-O2):
define void @jv() {
%1 = tail call i32 (...) @OpcodeNotDone()
ret void
}
/* Variables and functions */
int rom_present(char *);
int ati18800_vga88_available(void) {
  return rom_present(L"roms/video/ati18800/vga88.bin");
}


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

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

LLVM IR (-O0):
@.str = [30 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 97, i32 116, i32 105, i32 49, i32 56, i32 56, i32 48, i32 48, i32 47, i32 118, i32 103, i32 97, i32 56, i32 56, i32 46, i32 98, i32 105, i32 110, i32 0]
define i32 @ati18800_vga88_available() {
%1 = call i32 @rom_present(i8* bitcast ([30 x i32]* @.str to i8*))
ret i32 %1
}

LLVM IR (-O2):
@.str = [30 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 97, i32 116, i32 105, i32 49, i32 56, i32 56, i32 48, i32 48, i32 47, i32 118, i32 103, i32 97, i32 56, i32 56, i32 46, i32 98, i32 105, i32 110, i32 0]
define i32 @ati18800_vga88_available() {
%1 = tail call i32 @rom_present(i8* bitcast ([30 x i32]* @.str to i8*))
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ iconv_t;

/* Variables and functions */
int /*<<< orphan*/ iconv_open(char const *, char const *);
iconv_t hs_iconv_open(const char *tocode, const char *fromcode) {
  return iconv_open(tocode, fromcode);
}


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

x86 assembly (clang, -O2):
<hs_iconv_open>:
jmp    1030 <iconv_open@plt>

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

LLVM IR (-O2):
define i32 @hs_iconv_open(i8* %0, i8* %1) {
%3 = tail call i32 @iconv_open(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(char *prgname) {
  printf("usage: %s [OPTION] FILE > IMAGE\n"
         "\n"
         "options:\n"
         "  -a <address> memory address for the loaded image in SRAM\n"
         "  -s <soc>     SoC to use (am33xx, am35xx)\n",
         prgname);
}


x86 assembly (clang, -O0):
<usage>:
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):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [145 x i8] c"usage: %s [OPTION] FILE > IMAGE\0A\0Aoptions:\0A -a <address> memory address for the loaded image in SRAM\0A -s <soc> SoC to use (am33xx, am35xx)\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [145 x i8] c"usage: %s [OPTION] FILE > IMAGE\0A\0Aoptions:\0A -a <address> memory address for the loaded image in SRAM\0A -s <soc> SoC to use (am33xx, am35xx)\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ wiznetRegReadWord(int /*<<< orphan*/, int);
uint16_t wiznetGetSocketSourcePort(uint8_t socket) {
  return wiznetRegReadWord(socket, (0x0000 + 0x0004));
}


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

x86 assembly (clang, -O2):
<wiznetGetSocketSourcePort>:
mov    $0x4,%esi
jmp    1030 <wiznetRegReadWord@plt>

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

LLVM IR (-O2):
define i32 @wiznetGetSocketSourcePort(i32 %0) {
%2 = tail call i32 @wiznetRegReadWord(i32 %0, i32 4)
ret i32 %2
}
/* Variables and functions */
void *XWBMalloc(unsigned int, char const *, unsigned int const);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, unsigned int);
void *XWBCalloc(unsigned int iNum, unsigned int iSize, const char *iFile,
                const unsigned int iLine) {
  void *result;
  unsigned int actual = (((iSize - 1) / sizeof(int)) + 1) * sizeof(int) * iNum;
  result = XWBMalloc(actual, iFile, iLine);
  memset(result, 0, actual);
  return result;
}


x86 assembly (clang, -O0):
<XWBCalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,%eax
shr    $0x2,%rax
add    $0x1,%rax
shl    $0x2,%rax
mov    -0x4(%rbp),%ecx
imul   %rcx,%rax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <XWBMalloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%edx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XWBCalloc>:
push   %r14
push   %rbx
push   %rax
lea    0x3(%rsi),%ebx
and    $0xfffffffc,%ebx
imul   %edi,%ebx
mov    %ebx,%edi
mov    %rdx,%rsi
mov    %ecx,%edx
call   1030 <XWBMalloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
xor    %esi,%esi
mov    %ebx,%edx
call   1040 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @XWBCalloc(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%11 = load i32, i32* %6
%12 = sub i32 %11, 1
%13 = zext i32 %12 to i64
%14 = udiv i64 %13, 4
%15 = add i64 %14, 1
%16 = mul i64 %15, 4
%17 = load i32, i32* %5
%18 = zext i32 %17 to i64
%19 = mul i64 %16, %18
%20 = trunc i64 %19 to i32
store i32 %20, i32* %10
%21 = load i32, i32* %10
%22 = load i8*, i8** %7
%23 = load i32, i32* %8
%24 = call i8* @XWBMalloc(i32 %21, i8* %22, i32 %23)
store i8* %24, i8** %9
%25 = load i8*, i8** %9
%26 = load i32, i32* %10
%27 = call i32 @memset(i8* %25, i32 0, i32 %26)
%28 = load i8*, i8** %9
ret i8* %28
}

LLVM IR (-O2):
define i8* @XWBCalloc(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = add i32 %1, 3
%6 = and i32 %5, -4
%7 = mul i32 %6, %0
%8 = tail call i8* @XWBMalloc(i32 %7, i8* %2, i32 %3)
%9 = tail call i32 @memset(i8* %8, i32 0, i32 %7)
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ process_get_executable(char **, char *, char *);
void process_load_executable(char **executable, char *process_name,
                             char *application_name) {
  process_get_executable(executable, process_name, application_name);
}


x86 assembly (clang, -O0):
<process_load_executable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <process_get_executable@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_load_executable>:
jmp    1030 <process_get_executable@plt>

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

LLVM IR (-O2):
define void @process_load_executable(i8** %0, i8* %1, i8* %2) {
%4 = tail call i32 @process_get_executable(i8** %0, i8* %1, i8* %2)
ret void
}
/* Variables and functions */
unsigned char *md2_buffer(unsigned char *, unsigned char const *, size_t);
unsigned char *hash_buffer_md2(unsigned char *out, const unsigned char *in,
                               size_t in_len) {
  return md2_buffer(out, in, in_len);
}


x86 assembly (clang, -O0):
<hash_buffer_md2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <md2_buffer@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_buffer_md2>:
jmp    1030 <md2_buffer@plt>

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

LLVM IR (-O2):
define i8* @hash_buffer_md2(i8* %0, i8* %1, i64 %2) {
%4 = tail call i8* @md2_buffer(i8* %0, i8* %1, i64 %2)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int __xuname(int length, void *name) {
  assert(!"NYI");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"NYI\00"
define i32 @__xuname(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = call i32 @assert(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @__xuname(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32 @assert(i32 0)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
int corrected_year_day_number(int, int);
uint8_t get_month_by_year_day_number(uint16_t y, uint16_t ydn) {
  uint8_t a;
  ydn = corrected_year_day_number(y, ydn);
  ydn *= 20;
  ydn /= 611;
  a = ydn;
  a -= 2;
  return a;
}


x86 assembly (clang, -O0):
<get_month_by_year_day_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <corrected_year_day_number@plt>
mov    %eax,-0x8(%rbp)
imul   $0x14,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x263,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_month_by_year_day_number>:
push   %rax
call   1030 <corrected_year_day_number@plt>
shl    $0x2,%eax
lea    (%rax,%rax,4),%eax
cltq
imul   $0x6b429e61,%rax,%rax
mov    %rax,%rcx
sar    $0x28,%rcx
shr    $0x3f,%rax
add    %ecx,%eax
add    $0xfffffffe,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @get_month_by_year_day_number(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @corrected_year_day_number(i32 %6, i32 %7)
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = mul nsw i32 %9, 20
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = sdiv i32 %11, 611
store i32 %12, i32* %4
%13 = load i32, i32* %4
store i32 %13, i32* %5
%14 = load i32, i32* %5
%15 = sub nsw i32 %14, 2
store i32 %15, i32* %5
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
define i32 @get_month_by_year_day_number(i32 %0, i32 %1) {
%3 = tail call i32 @corrected_year_day_number(i32 %0, i32 %1)
%4 = mul nsw i32 %3, 20
%5 = sdiv i32 %4, 611
%6 = add nsw i32 %5, -2
ret i32 %6
}
unsigned char BMP_Clamp(double val) {
  if (val < 0)
    val = 0;
  if (val > 255)
    val = 255;
  return (unsigned char)val;
}


x86 assembly (clang, -O0):
<BMP_Clamp>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    111f <BMP_Clamp+0x1f>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed4(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1143 <BMP_Clamp+0x43>
movsd  0xec2(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BMP_Clamp>:
xorpd  %xmm1,%xmm1
maxsd  %xmm0,%xmm1
movsd  0xef0(%rip),%xmm0
minsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define zeroext i8 @BMP_Clamp(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 %6
5: ; preds = %1
store double 0.000000e+00, double* %2
br label %6
6: ; preds = %5, %1
%7 = load double, double* %2
%8 = fcmp ogt double %7, 2.550000e+02
br i1 %8, label %9, label %10
9: ; preds = %6
store double 2.550000e+02, double* %2
br label %10
10: ; preds = %9, %6
%11 = load double, double* %2
%12 = fptoui double %11 to i8
ret i8 %12
}

LLVM IR (-O2):
define zeroext i8 @BMP_Clamp(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = select i1 %2, double 0.000000e+00, double %0
%4 = fcmp ogt double %3, 2.550000e+02
%5 = select i1 %4, double 2.550000e+02, double %3
%6 = fptoui double %5 to i8
ret i8 %6
}
void mlx5e_ipsec_build_netdev(struct mlx5e_priv *priv) {}


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

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

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

LLVM IR (-O2):
%struct.mlx5e_priv = type opaque
define void @mlx5e_ipsec_build_netdev(%struct.mlx5e_priv* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Lut_N(double *, double *, int);
void Lut_15(double *out, double *in) { Lut_N(out, in, 15); }


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

x86 assembly (clang, -O2):
<Lut_15>:
mov    $0xf,%edx
jmp    1030 <Lut_N@plt>

LLVM IR (-O0):
define void @Lut_15(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = load double*, double** %4
%7 = call i32 @Lut_N(double* %5, double* %6, i32 15)
ret void
}

LLVM IR (-O2):
define void @Lut_15(double* %0, double* %1) {
%3 = tail call i32 @Lut_N(double* %0, double* %1, i32 15)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ is_space_or_tab(char);
char *skip_nonspaces(char *s) {
  while (*s && !is_space_or_tab(*s))
    s++;
  return s;
}


x86 assembly (clang, -O0):
<skip_nonspaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1148 <skip_nonspaces+0x38>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <is_space_or_tab@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1158 <skip_nonspaces+0x48>
jmp    1169 <skip_nonspaces+0x59>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skip_nonspaces+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @skip_nonspaces(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %16, %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 %14
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = call i32 @is_space_or_tab(i8 signext %10)
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
br label %14
14: ; preds = %8, %3
%15 = phi i1 [ false, %3 ], [ %13, %8 ]
br i1 %15, label %16, label %19
16: ; preds = %14
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %2
br label %3
19: ; preds = %14
%20 = load i8*, i8** %2
ret i8* %20
}

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


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

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

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

LLVM IR (-O2):
define void @SEGGER_RTT_Init() {
%1 = tail call i32 (...) @_DoInit()
ret void
}
int rt2x00lib_load_firmware(struct rt2x00_dev *rt2x00dev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.rt2x00_dev = type opaque
define i32 @rt2x00lib_load_firmware(%struct.rt2x00_dev* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ tst_exit();
extern void cleanup() { tst_exit(); }


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

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

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

LLVM IR (-O2):
define void @cleanup() {
%1 = tail call i32 (...) @tst_exit()
ret void
}
int test_imm_36uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x36 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_36uint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 32
%6 = and i64 %5, 54
%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_36uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 231928233984
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int strcmp(char *a, char *b) {
  while (*a++ == *b++)
    if (*a == '\0')
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1159 <strcmp+0x59>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1154 <strcmp+0x54>
movl   $0x1,-0x4(%rbp)
jmp    1160 <strcmp+0x60>
jmp    110c <strcmp+0xc>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
mov    (%rdi),%dl
xor    %eax,%eax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
cmp    (%rsi,%rcx,1),%dl
jne    1127 <strcmp+0x27>
movzbl 0x1(%rdi,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcmp+0x10>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
br label %4
4: ; preds = %11, %2
%5 = phi i8 [ %3, %2 ], [ %13, %11 ]
%6 = phi i8* [ %0, %2 ], [ %8, %11 ]
%7 = phi i8* [ %1, %2 ], [ %12, %11 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %5, %9
br i1 %10, label %11, label %15
11: ; preds = %4
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %8
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %11
%16 = phi i32 [ 1, %11 ], [ 0, %4 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ VIM_SIF_I2cWriteByte(unsigned char, unsigned char);
void SensorSetReg_OM6802(unsigned short uAddr, unsigned short uVal) {
  VIM_SIF_I2cWriteByte((unsigned char)uAddr, (unsigned char)uVal);
}


x86 assembly (clang, -O0):
<SensorSetReg_OM6802>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x2(%rbp),%ax
mov    %al,%cl
mov    -0x4(%rbp),%ax
movzbl %cl,%edi
movzbl %al,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SensorSetReg_OM6802>:
movzbl %dil,%edi
movzbl %sil,%esi
jmp    1030 <VIM_SIF_I2cWriteByte@plt>

LLVM IR (-O0):
define void @SensorSetReg_OM6802(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = trunc i16 %5 to i8
%7 = load i16, i16* %4
%8 = trunc i16 %7 to i8
%9 = call i32 @VIM_SIF_I2cWriteByte(i8 zeroext %6, i8 zeroext %8)
ret void
}

LLVM IR (-O2):
define void @SensorSetReg_OM6802(i16 zeroext %0, i16 zeroext %1) {
%3 = trunc i16 %0 to i8
%4 = trunc i16 %1 to i8
%5 = tail call i32 @VIM_SIF_I2cWriteByte(i8 zeroext %3, i8 zeroext %4)
ret void
}
/* Variables and functions */
double sin(double);
double tosReal_sin(double x) { return sin(x); }


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

x86 assembly (clang, -O2):
<tosReal_sin>:
jmp    1030 <sin@plt>

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

LLVM IR (-O2):
define double @tosReal_sin(double %0) {
%2 = tail call double @sin(double %0)
ret double %2
}
/* Variables and functions */
int f(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ g(int);
int f2(int x) { return f(g(x + 1), g(6)); }


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1040 <g@plt>
mov    %eax,-0x8(%rbp)
mov    $0x6,%edi
call   1040 <g@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1030 <f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
push   %rbx
add    $0x1,%edi
call   1040 <g@plt>
mov    %eax,%ebx
mov    $0x6,%edi
call   1040 <g@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <f@plt>

LLVM IR (-O0):
define i32 @f2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
%5 = call i32 @g(i32 %4)
%6 = call i32 @g(i32 6)
%7 = call i32 @f(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @f2(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = tail call i32 @g(i32 %2)
%4 = tail call i32 @g(i32 6)
%5 = tail call i32 @f(i32 %3, i32 %4)
ret i32 %5
}
/* Variables and functions */
int fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int alt_putstr(const char *str) { return fputs(str, stdout); }


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

x86 assembly (clang, -O2):
<alt_putstr>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@stdout = global i32 0
define i32 @alt_putstr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @stdout
%5 = call i32 @fputs(i8* %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @alt_putstr(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fputs(i8* %0, i32 %2)
ret i32 %3
}
void __exit(exitstatus) { _exit(exitstatus); }


x86 assembly (clang, -O0):
<__exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<__exit>:
push   %rax
call   1030 <_exit@plt>

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

LLVM IR (-O2):
define void @__exit(i32 %0) {
tail call void @_exit(i32 %0)
unreachable
}
/* Type definitions */
struct ribs_context {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *ribs_malloc2(struct ribs_context *, size_t);
void *ribs_calloc2(struct ribs_context *ctx, size_t nmemb, size_t size) {
  size_t s = nmemb * size;
  void *mem = ribs_malloc2(ctx, s);
  memset(mem, 0, s);
  return mem;
}


x86 assembly (clang, -O0):
<ribs_calloc2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <ribs_malloc2@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ribs_calloc2>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
imul   %rsi,%rbx
mov    %rbx,%rsi
call   1040 <ribs_malloc2@plt>
mov    %rax,%r14
mov    %rax,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.ribs_context = type { i32 }
define i8* @ribs_calloc2(%struct.ribs_context* %0, i64 %1, i64 %2) {
%4 = alloca %struct.ribs_context*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i8*
store %struct.ribs_context* %0, %struct.ribs_context** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%9 = load i64, i64* %5
%10 = load i64, i64* %6
%11 = mul i64 %9, %10
store i64 %11, i64* %7
%12 = load %struct.ribs_context*, %struct.ribs_context** %4
%13 = load i64, i64* %7
%14 = call i8* @ribs_malloc2(%struct.ribs_context* %12, i64 %13)
store i8* %14, i8** %8
%15 = load i8*, i8** %8
%16 = load i64, i64* %7
%17 = call i32 @memset(i8* %15, i32 0, i64 %16)
%18 = load i8*, i8** %8
ret i8* %18
}

LLVM IR (-O2):
%struct.ribs_context = type { i32 }
define i8* @ribs_calloc2(%struct.ribs_context* %0, i64 %1, i64 %2) {
%4 = mul i64 %2, %1
%5 = tail call i8* @ribs_malloc2(%struct.ribs_context* %0, i64 %4)
%6 = tail call i32 @memset(i8* %5, i32 0, i64 %4)
ret i8* %5
}
/* Variables and functions */
int rom_present(char *);
int gd5440_available(void) {
  return rom_present(L"roms/video/cirruslogic/BIOS.BIN");
}


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

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

LLVM IR (-O0):
@.str = [32 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 99, i32 105, i32 114, i32 114, i32 117, i32 115, i32 108, i32 111, i32 103, i32 105, i32 99, i32 47, i32 66, i32 73, i32 79, i32 83, i32 46, i32 66, i32 73, i32 78, i32 0]
define i32 @gd5440_available() {
%1 = call i32 @rom_present(i8* bitcast ([32 x i32]* @.str to i8*))
ret i32 %1
}

LLVM IR (-O2):
@.str = [32 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 99, i32 105, i32 114, i32 114, i32 117, i32 115, i32 108, i32 111, i32 103, i32 105, i32 99, i32 47, i32 66, i32 73, i32 79, i32 83, i32 46, i32 66, i32 73, i32 78, i32 0]
define i32 @gd5440_available() {
%1 = tail call i32 @rom_present(i8* bitcast ([32 x i32]* @.str to i8*))
ret i32 %1
}