xunge/DecIR huggingface dataset:
/* Type definitions */
struct termios {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ EINVAL;
scalar_t__ TCSETS;
int /*<<< orphan*/ errno;
int ioctl(int, scalar_t__, struct termios const *);
int tcsetattr(int fd, int act, const struct termios *tio) {
  if (act < 0 || act > 2) {
    errno = EINVAL;
    return -1;
  }
  return ioctl(fd, TCSETS + act, tio);
}


x86 assembly (clang, -O0):
<tcsetattr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1136 <tcsetattr+0x26>
cmpl   $0x2,-0xc(%rbp)
jle    1154 <tcsetattr+0x44>
mov    0x2e9b(%rip),%rax
mov    (%rax),%ecx
mov    0x2e9a(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    1174 <tcsetattr+0x64>
mov    -0x8(%rbp),%edi
mov    0x2e72(%rip),%rax
mov    (%rax),%rsi
movslq -0xc(%rbp),%rax
add    %rax,%rsi
mov    -0x18(%rbp),%rdx
call   1030 <ioctl@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcsetattr>:
cmp    $0x3,%esi
jb     112d <tcsetattr+0x1d>
mov    0x2ebc(%rip),%rax
mov    (%rax),%eax
mov    0x2ebb(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret
mov    0x2e9c(%rip),%rax
mov    %esi,%esi
add    (%rax),%rsi
jmp    1030 <ioctl@plt>

LLVM IR (-O0):
%struct.termios = type { i32 }
@EINVAL = global i32 0
@errno = global i32 0
@TCSETS = global i64 0
define i32 @tcsetattr(i32 %0, i32 %1, %struct.termios* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.termios*
store i32 %0, i32* %5
store i32 %1, i32* %6
store %struct.termios* %2, %struct.termios** %7
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %3
%11 = load i32, i32* %6
%12 = icmp sgt i32 %11, 2
br i1 %12, label %13, label %15
13: ; preds = %10, %3
%14 = load i32, i32* @EINVAL
store i32 %14, i32* @errno
store i32 -1, i32* %4
br label %23
15: ; preds = %10
%16 = load i32, i32* %5
%17 = load i64, i64* @TCSETS
%18 = load i32, i32* %6
%19 = sext i32 %18 to i64
%20 = add nsw i64 %17, %19
%21 = load %struct.termios*, %struct.termios** %7
%22 = call i32 @ioctl(i32 %16, i64 %20, %struct.termios* %21)
store i32 %22, i32* %4
br label %23
23: ; preds = %15, %13
%24 = load i32, i32* %4
ret i32 %24
}

LLVM IR (-O2):
%struct.termios = type { i32 }
@EINVAL = global i32 0
@errno = global i32 0
@TCSETS = global i64 0
define i32 @tcsetattr(i32 %0, i32 %1, %struct.termios* %2) {
%4 = icmp ugt i32 %1, 2
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = load i32, i32* @EINVAL
store i32 %6, i32* @errno
br label %12
7: ; preds = %3
%8 = load i64, i64* @TCSETS
%9 = zext i32 %1 to i64
%10 = add nsw i64 %8, %9
%11 = tail call i32 @ioctl(i32 %0, i64 %10, %struct.termios* %2)
br label %12
12: ; preds = %7, %5
%13 = phi i32 [ -1, %5 ], [ %11, %7 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, unsigned short *);
void init(unsigned short int nums[], int n) {
  int i;
  for (i = 0; i < n; i++)
    scanf("%d", &nums[i]);
  return;
}


x86 assembly (clang, -O0):
<init>:
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    115b <init+0x4b>
mov    -0x8(%rbp),%rsi
movslq -0x10(%rbp),%rax
shl    $0x1,%rax
add    %rax,%rsi
lea    0xeb8(%rip),%rdi
call   1030 <scanf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <init+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1145 <init+0x35>
mov    %rdi,%rbx
mov    %esi,%r15d
lea    0xeda(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <scanf@plt>
add    $0x2,%rbx
add    $0xffffffffffffffff,%r15
jne    1130 <init+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @init(i16* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = getelementptr inbounds i16, i16* %0, i64 %7
%9 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i16* %8)
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  assert((10 ? 11 : 0) == 11);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ftruncate(int, int /*<<< orphan*/);
int /*<<< orphan*/ munmap(void *, unsigned long);
int /*<<< orphan*/ shm_unlink(char *);
void shmem_destroy(unsigned long bytes, int fd, void *ptr) {
  ftruncate(fd, 0);
  (void)shm_unlink("mmap-test.shm");
  if (ptr != NULL)
    (void)munmap(ptr, bytes);
}


x86 assembly (clang, -O0):
<shmem_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%edi
xor    %esi,%esi
call   1030 <ftruncate@plt>
lea    0xeac(%rip),%rdi
call   1050 <shm_unlink@plt>
cmpq   $0x0,-0x18(%rbp)
je     1171 <shmem_destroy+0x41>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <munmap@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shmem_destroy>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rdi,%r14
mov    %esi,%edi
xor    %esi,%esi
call   1030 <ftruncate@plt>
lea    0xeb6(%rip),%rdi
call   1050 <shm_unlink@plt>
test   %rbx,%rbx
je     1166 <shmem_destroy+0x36>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <munmap@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [14 x i8] c"mmap-test.shm\00"
define void @shmem_destroy(i64 %0, i32 %1, i8* %2) {
%4 = alloca i64
%5 = alloca i32
%6 = alloca i8*
store i64 %0, i64* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = call i32 @ftruncate(i32 %7, i32 0)
%9 = call i32 @shm_unlink(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%10 = load i8*, i8** %6
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %16
12: ; preds = %3
%13 = load i8*, i8** %6
%14 = load i64, i64* %4
%15 = call i32 @munmap(i8* %13, i64 %14)
br label %16
16: ; preds = %12, %3
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"mmap-test.shm\00"
define void @shmem_destroy(i64 %0, i32 %1, i8* %2) {
%4 = tail call i32 @ftruncate(i32 %1, i32 0)
%5 = tail call i32 @shm_unlink(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i8* %2, null
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 @munmap(i8* %2, i64 %0)
br label %9
9: ; preds = %7, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  const int myConstantAge = 25;
  int myAge = myConstantAge;
  printf("hello %d!\n", myAge);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"hello %d!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 25, i32* %2
store i32 25, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"hello %d!\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 25)
ret i32 0
}
char flipBase(char base) {
  char flip;
  if (base == 'A') {
    flip = 'G';
  }
  if (base == 'G') {
    flip = 'A';
  }
  if (base == 'T') {
    flip = 'C';
  }
  if (base == 'C') {
    flip = 'T';
  }
  return flip;
}


x86 assembly (clang, -O0):
<flipBase>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jne    111b <flipBase+0x1b>
movb   $0x47,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x47,%eax
jne    112c <flipBase+0x2c>
movb   $0x41,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x54,%eax
jne    113d <flipBase+0x3d>
movb   $0x43,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x43,%eax
jne    114e <flipBase+0x4e>
movb   $0x54,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<flipBase>:
cmp    $0x47,%dil
mov    $0x41,%eax
mov    $0x47,%ecx
cmove  %eax,%ecx
cmp    $0x54,%dil
mov    $0x43,%edx
cmovne %ecx,%edx
cmp    $0x43,%dil
mov    $0x54,%eax
cmovne %edx,%eax
ret

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

LLVM IR (-O2):
define signext i8 @flipBase(i8 signext %0) {
%2 = icmp eq i8 %0, 71
%3 = select i1 %2, i8 65, i8 71
%4 = icmp eq i8 %0, 84
%5 = select i1 %4, i8 67, i8 %3
%6 = icmp eq i8 %0, 67
%7 = select i1 %6, i8 84, i8 %5
ret i8 %7
}
/* Variables and functions */
int /*<<< orphan*/ NOEXPR;
char *nl_langinfo(int /*<<< orphan*/);
char *langinfo_noexpr() { return nl_langinfo(NOEXPR); }


x86 assembly (clang, -O0):
<langinfo_noexpr>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <nl_langinfo@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<langinfo_noexpr>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <nl_langinfo@plt>

LLVM IR (-O0):
@NOEXPR = global i32 0
define i8* @langinfo_noexpr() {
%1 = load i32, i32* @NOEXPR
%2 = call i8* @nl_langinfo(i32 %1)
ret i8* %2
}

LLVM IR (-O2):
@NOEXPR = global i32 0
define i8* @langinfo_noexpr() {
%1 = load i32, i32* @NOEXPR
%2 = tail call i8* @nl_langinfo(i32 %1)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_error();
int sum(int, int);
int main(void) {
  int a;
  int b;
  int result = sum(a, b);
  if (result == a + b) {
  ERROR:
    __VERIFIER_error();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <sum@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    -0xc(%rbp),%ecx
cmp    %ecx,%eax
jne    115a <main+0x3a>
jmp    1153 <main+0x33>
mov    $0x0,%al
call   1040 <__VERIFIER_error@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 @sum(i32 %5, i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = add nsw i32 %9, %10
%12 = icmp eq i32 %8, %11
br i1 %12, label %13, label %16
13: ; preds = %0
br label %14
14: ; preds = %13
%15 = call i32 (...) @__VERIFIER_error()
br label %16
16: ; preds = %14, %0
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @sum(i32 undef, i32 undef)
ret i32 0
}
void calibrateHR() {}


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

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

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

LLVM IR (-O2):
define void @calibrateHR() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Ungets(char *);
void ncss_Ungets(char *s) { Ungets(s); }


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

x86 assembly (clang, -O2):
<ncss_Ungets>:
jmp    1030 <Ungets@plt>

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

LLVM IR (-O2):
define void @ncss_Ungets(i8* %0) {
%2 = tail call i32 @Ungets(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
void swap(char *a, char *b) {
  char c[81];
  strcpy(c, a);
  strcpy(a, b);
  strcpy(b, c);
}


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

x86 assembly (clang, -O2):
<swap>:
push   %r15
push   %r14
push   %rbx
sub    $0x60,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%r15
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
add    $0x60,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @swap(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [81 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [81 x i8], [81 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = call i32 @strcpy(i8* %6, i8* %7)
%9 = load i8*, i8** %3
%10 = load i8*, i8** %4
%11 = call i32 @strcpy(i8* %9, i8* %10)
%12 = load i8*, i8** %4
%13 = getelementptr inbounds [81 x i8], [81 x i8]* %5, i64 0, i64 0
%14 = call i32 @strcpy(i8* %12, i8* %13)
ret void
}

LLVM IR (-O2):
define void @swap(i8* %0, i8* %1) {
%3 = alloca [81 x i8]
%4 = getelementptr inbounds [81 x i8], [81 x i8]* %3, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* %0)
%6 = call i32 @strcpy(i8* %0, i8* %1)
%7 = call i32 @strcpy(i8* %1, i8* %4)
ret void
}
int __tiger__ord(char *s) { return s[0] == '\0' ? -1 : (int)s[0]; }


x86 assembly (clang, -O0):
<__tiger__ord>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1125 <__tiger__ord+0x25>
mov    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    112f <__tiger__ord+0x2f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__tiger__ord>:
mov    (%rdi),%al
cmp    $0x1,%al
sbb    %ecx,%ecx
or     %al,%cl
movsbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @__tiger__ord(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i8 -1, i8 %2
%5 = sext i8 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void add(int a, int b) {
  assert(a + b == 5);
  int ab = a + b;
  assert(a == 2);
  assert(b == 3);
}


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
cmp    $0x5,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x2,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x3,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %edi,%ebx
lea    (%r14,%rbx,1),%eax
xor    %edi,%edi
cmp    $0x5,%eax
sete   %dil
call   1030 <assert@plt>
xor    %edi,%edi
cmp    $0x2,%ebx
sete   %dil
call   1030 <assert@plt>
xor    %edi,%edi
cmp    $0x3,%r14d
sete   %dil
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @add(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 = add nsw i32 %6, %7
%9 = icmp eq i32 %8, 5
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = add nsw i32 %12, %13
store i32 %14, i32* %5
%15 = load i32, i32* %3
%16 = icmp eq i32 %15, 2
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
%19 = load i32, i32* %4
%20 = icmp eq i32 %19, 3
%21 = zext i1 %20 to i32
%22 = call i32 @assert(i32 %21)
ret void
}

LLVM IR (-O2):
define void @add(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = icmp eq i32 %3, 5
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = icmp eq i32 %0, 2
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
%10 = icmp eq i32 %1, 3
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
ret void
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
void getnow(struct timeval *nowP, struct timeval *nowP2) {
  if (nowP != NULL)
    *nowP2 = *nowP;
  else
    (void)gettimeofday(nowP2, NULL);
}


x86 assembly (clang, -O0):
<getnow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113c <getnow+0x2c>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%ecx
mov    %ecx,(%rax)
jmp    1149 <getnow+0x39>
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getnow>:
test   %rdi,%rdi
je     111a <getnow+0xa>
mov    (%rdi),%eax
mov    %eax,(%rsi)
ret
mov    %rsi,%rdi
xor    %esi,%esi
jmp    1030 <gettimeofday@plt>

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

LLVM IR (-O2):
%struct.timeval = type { i32 }
define void @getnow(%struct.timeval* %0, %struct.timeval* nocapture %1) {
%3 = icmp eq %struct.timeval* %0, null
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = getelementptr %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%6 = getelementptr %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%7 = load i32, i32* %5
store i32 %7, i32* %6
br label %10
8: ; preds = %2
%9 = tail call i32 @gettimeofday(%struct.timeval* %1, i32* null)
br label %10
10: ; preds = %8, %4
ret void
}
unsigned int f2(unsigned int x, unsigned long int y) {
  return (x << y) | (x >> (8 * 4 - y));
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x10(%rbp),%rcx
shr    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
mov    %rsi,%rcx
mov    %edi,%eax
rol    %cl,%eax
ret

LLVM IR (-O0):
define i32 @f2(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* %3
%6 = load i64, i64* %4
%7 = trunc i64 %6 to i32
%8 = shl i32 %5, %7
%9 = load i32, i32* %3
%10 = load i64, i64* %4
%11 = sub i64 32, %10
%12 = trunc i64 %11 to i32
%13 = lshr i32 %9, %12
%14 = or i32 %8, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @f2(i32 %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = shl i32 %0, %3
%5 = sub i32 32, %3
%6 = lshr i32 %0, %5
%7 = or i32 %6, %4
ret i32 %7
}
int atoi(char *p) {
  int k = 0;
  while (*p) {
    k = (k << 3) + (k << 1) + (*p) - '0';
    p++;
  }
  return k;
}


x86 assembly (clang, -O0):
<atoi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114a <atoi+0x4a>
mov    -0xc(%rbp),%eax
shl    $0x3,%eax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
sub    $0x30,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <atoi+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atoi>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <atoi+0x28>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
lea    (%rax,%rax,4),%eax
movsbl %cl,%ecx
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <atoi+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @atoi(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %12, %4 ], [ %0, %1 ]
%8 = mul i32 %6, 10
%9 = sext i8 %5 to i32
%10 = add i32 %8, -48
%11 = add i32 %10, %9
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %16
}
int is_in_rom() { return 0; }


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

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

LLVM IR (-O0):
define i32 @is_in_rom() {
ret i32 0
}

LLVM IR (-O2):
define i32 @is_in_rom() {
ret i32 0
}
unsigned normal2x_generic_output_fmts(unsigned input_fmts) {
  return input_fmts;
}


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

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

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

LLVM IR (-O2):
define i32 @normal2x_generic_output_fmts(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
struct iommu_group {
  int dummy;
};
struct iommu_domain {
  int dummy;
};

/* Variables and functions */
int ENODEV;
int iommu_attach_group(struct iommu_domain *domain, struct iommu_group *group) {
  return -ENODEV;
}


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

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

LLVM IR (-O0):
%struct.iommu_domain = type { i32 }
%struct.iommu_group = type { i32 }
@ENODEV = global i32 0
define i32 @iommu_attach_group(%struct.iommu_domain* %0, %struct.iommu_group* %1) {
%3 = alloca %struct.iommu_domain*
%4 = alloca %struct.iommu_group*
store %struct.iommu_domain* %0, %struct.iommu_domain** %3
store %struct.iommu_group* %1, %struct.iommu_group** %4
%5 = load i32, i32* @ENODEV
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
%struct.iommu_domain = type { i32 }
%struct.iommu_group = type { i32 }
@ENODEV = global i32 0
define i32 @iommu_attach_group(%struct.iommu_domain* nocapture readnone %0, %struct.iommu_group* nocapture readnone %1) {
%3 = load i32, i32* @ENODEV
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Type definitions */
struct knote {
  int dummy;
};
struct filter {
  int dummy;
};

/* Variables and functions */
int evfilt_user_knote_create(struct filter *, struct knote *);
int evfilt_user_knote_enable(struct filter *filt, struct knote *kn) {
  return evfilt_user_knote_create(filt, kn);
}


x86 assembly (clang, -O0):
<evfilt_user_knote_enable>:
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 <evfilt_user_knote_create@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<evfilt_user_knote_enable>:
jmp    1030 <evfilt_user_knote_create@plt>

LLVM IR (-O0):
%struct.filter = type { i32 }
%struct.knote = type { i32 }
define i32 @evfilt_user_knote_enable(%struct.filter* %0, %struct.knote* %1) {
%3 = alloca %struct.filter*
%4 = alloca %struct.knote*
store %struct.filter* %0, %struct.filter** %3
store %struct.knote* %1, %struct.knote** %4
%5 = load %struct.filter*, %struct.filter** %3
%6 = load %struct.knote*, %struct.knote** %4
%7 = call i32 @evfilt_user_knote_create(%struct.filter* %5, %struct.knote* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.filter = type { i32 }
%struct.knote = type { i32 }
define i32 @evfilt_user_knote_enable(%struct.filter* %0, %struct.knote* %1) {
%3 = tail call i32 @evfilt_user_knote_create(%struct.filter* %0, %struct.knote* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, unsigned char);
void sprint_addc_Rn(char *str, unsigned char n) {
  sprintf(str, "ADDC  A, R%X                     ", n);
}


x86 assembly (clang, -O0):
<sprint_addc_Rn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed3(%rip),%rsi
movzbl -0x9(%rbp),%edx
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sprint_addc_Rn>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"ADDC A, R%X \00"
define void @sprint_addc_Rn(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8*, i8** %3
%6 = load i8, i8* %4
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8 zeroext %6)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"ADDC A, R%X \00"
define void @sprint_addc_Rn(i8* nocapture writeonly %0, i8 zeroext %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8 zeroext %1)
ret void
}
int is_prime(number) {
  int counter = 2;
  for (; counter < number;) {
    if (number % counter != 0)
      counter++;
    else
      break;
  }
  if (number == counter) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1142 <is_prime+0x42>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
je     1138 <is_prime+0x38>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113d <is_prime+0x3d>
jmp    1142 <is_prime+0x42>
jmp    110e <is_prime+0xe>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    115a <is_prime+0x5a>
movl   $0x1,-0x4(%rbp)
jmp    1161 <is_prime+0x61>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
mov    $0x2,%ecx
cmp    $0x3,%edi
jl     1122 <is_prime+0x22>
mov    $0x2,%ecx
nop
mov    %edi,%eax
cltd
idiv   %ecx
test   %edx,%edx
je     1122 <is_prime+0x22>
add    $0x1,%ecx
cmp    %ecx,%edi
jne    1110 <is_prime+0x10>
mov    %edi,%ecx
xor    %eax,%eax
cmp    %edi,%ecx
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_prime(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %3, label %10
3: ; preds = %1, %7
%4 = phi i32 [ %8, %7 ], [ 2, %1 ]
%5 = srem i32 %0, %4
%6 = icmp eq i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = add nuw nsw i32 %4, 1
%9 = icmp eq i32 %8, %0
br i1 %9, label %10, label %3
10: ; preds = %7, %3, %1
%11 = phi i32 [ 2, %1 ], [ %4, %3 ], [ %0, %7 ]
%12 = icmp eq i32 %11, %0
%13 = zext i1 %12 to i32
ret i32 %13
}
const char *f(const char *p) {
  short x = *p++ << 16;
  return p;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
shl    $0x10,%eax
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
lea    0x1(%rdi),%rax
ret

LLVM IR (-O0):
define i8* @f(i8* %0) {
%2 = alloca i8*
%3 = alloca i16
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i32 1
store i8* %5, i8** %2
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
%8 = shl i32 %7, 16
%9 = trunc i32 %8 to i16
store i16 %9, i16* %3
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
define i8* @f(i8* readnone %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, double *);
int main(void) {
  double height = 0;
  printf("请输入您的身高：");
  scanf("%lf", &height);
  printf("您的标准体重是%.1f公斤。\n", (height - 100) * 0.9);
  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)
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  0xea6(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xe92(%rip),%xmm1
mulsd  %xmm1,%xmm0
lea    0xeb4(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movq   $0x0,(%rsp)
lea    0xee0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm0
addsd  0xead(%rip),%xmm0
mulsd  0xead(%rip),%xmm0
lea    0xecb(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E6\82\A8\E7\9A\84\E8\BA\AB\E9\AB\98\EF\BC\9A\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [36 x i8] c"\E6\82\A8\E7\9A\84\E6\A0\87\E5\87\86\E4\BD\93\E9\87\8D\E6\98\AF%.1f\E5\85\AC\E6\96\A4\E3\80\82\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
store double 0.000000e+00, double* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%5 = load double, double* %2
%6 = fsub double %5, 1.000000e+02
%7 = fmul double %6, 9.000000e-01
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), double %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E6\82\A8\E7\9A\84\E8\BA\AB\E9\AB\98\EF\BC\9A\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [36 x i8] c"\E6\82\A8\E7\9A\84\E6\A0\87\E5\87\86\E4\BD\93\E9\87\8D\E6\98\AF%.1f\E5\85\AC\E6\96\A4\E3\80\82\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
store double 0.000000e+00, double* %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%5 = load double, double* %1
%6 = fadd double %5, -1.000000e+02
%7 = fmul double %6, 9.000000e-01
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), double %7)
ret i32 0
}
/* Variables and functions */
double __dacosd(double);
double d_acosd(double *x) { return (__dacosd(*x)); }


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

x86 assembly (clang, -O2):
<d_acosd>:
movsd  (%rdi),%xmm0
jmp    1030 <__dacosd@plt>

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

LLVM IR (-O2):
define double @d_acosd(double* nocapture %0) {
%2 = load double, double* %0
%3 = tail call double @__dacosd(double %2)
ret double %3
}
void XSetFillRule() {}


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

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

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

LLVM IR (-O2):
define void @XSetFillRule() {
ret void
}
/* Variables and functions */
void *c1(size_t);
void *d1(size_t n) { return c1(n); }


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

x86 assembly (clang, -O2):
<d1>:
jmp    1030 <c1@plt>

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

LLVM IR (-O2):
define i8* @d1(i64 %0) {
%2 = tail call i8* @c1(i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ SendInterrupt(int, int, int, int);
void ScuSendExternalInterrupt15(void) {
  SendInterrupt(0x5F, 0x1, 0x8000, 0x80000000);
}


x86 assembly (clang, -O0):
<ScuSendExternalInterrupt15>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5f,%edi
mov    $0x1,%esi
mov    $0x8000,%edx
mov    $0x80000000,%ecx
call   1030 <SendInterrupt@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ScuSendExternalInterrupt15>:
mov    $0x5f,%edi
mov    $0x1,%esi
mov    $0x8000,%edx
mov    $0x80000000,%ecx
jmp    1030 <SendInterrupt@plt>

LLVM IR (-O0):
define void @ScuSendExternalInterrupt15() {
%1 = call i32 @SendInterrupt(i32 95, i32 1, i32 32768, i32 -2147483648)
ret void
}

LLVM IR (-O2):
define void @ScuSendExternalInterrupt15() {
%1 = tail call i32 @SendInterrupt(i32 95, i32 1, i32 32768, i32 -2147483648)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
scalar_t__ malloc(int);
int /*<<< orphan*/ mergeSort(int *, int /*<<< orphan*/, int, int *);
bool MergeSort(int a[], int n) {
  int *p = (int *)malloc(n * sizeof(int));
  if (p == NULL)
    return false;
  mergeSort(a, 0, n - 1, p);
  free(p);
  return true;
}


x86 assembly (clang, -O0):
<MergeSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1169 <MergeSort+0x39>
movl   $0x0,-0x4(%rbp)
jmp    118e <MergeSort+0x5e>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
mov    -0x20(%rbp),%rcx
xor    %esi,%esi
call   1040 <mergeSort@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MergeSort>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %rdi,%r14
lea    0x0(,%rbx,4),%edi
call   1050 <malloc@plt>
test   %rax,%rax
je     116f <MergeSort+0x3f>
mov    %rax,%r15
add    $0xffffffff,%ebx
mov    %r14,%rdi
xor    %esi,%esi
mov    %ebx,%edx
mov    %rax,%rcx
call   1040 <mergeSort@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    $0x1,%eax
jmp    1171 <MergeSort+0x41>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @MergeSort(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32*
store i32* %0, i32** %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = sext i32 %7 to i64
%9 = mul i64 %8, 4
%10 = trunc i64 %9 to i32
%11 = call i64 @malloc(i32 %10)
%12 = inttoptr i64 %11 to i32*
store i32* %12, i32** %6
%13 = load i32*, i32** %6
%14 = icmp eq i32* %13, null
br i1 %14, label %15, label %16
15: ; preds = %2
store i32 0, i32* %3
br label %24
16: ; preds = %2
%17 = load i32*, i32** %4
%18 = load i32, i32* %5
%19 = sub nsw i32 %18, 1
%20 = load i32*, i32** %6
%21 = call i32 @mergeSort(i32* %17, i32 0, i32 %19, i32* %20)
%22 = load i32*, i32** %6
%23 = call i32 @free(i32* %22)
store i32 1, i32* %3
br label %24
24: ; preds = %16, %15
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @MergeSort(i32* %0, i32 %1) {
%3 = shl i32 %1, 2
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i32*
%6 = icmp eq i64 %4, 0
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = add nsw i32 %1, -1
%9 = tail call i32 @mergeSort(i32* %0, i32 0, i32 %8, i32* %5)
%10 = tail call i32 @free(i32* %5)
br label %11
11: ; preds = %2, %7
%12 = phi i32 [ 1, %7 ], [ 0, %2 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ set_color(char *);
void color_rewind(void) { set_color("\x1B[0m"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[0m\00"
define void @color_rewind() {
%1 = call i32 @set_color(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[0m\00"
define void @color_rewind() {
%1 = tail call i32 @set_color(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int SIGPIPE;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void sigh(int sig) {
  if (sig != SIGPIPE)
    fprintf(stderr, "wgetlite: caught signal %d\n", sig);
  exit(127 + sig);
}


x86 assembly (clang, -O0):
<sigh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ea3(%rip),%rcx
cmp    (%rcx),%eax
je     1155 <sigh+0x35>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xeb0(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
add    $0x7f,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sigh>:
push   %rbx
mov    %edi,%ebx
mov    0x2eae(%rip),%rax
cmp    %edi,(%rax)
je     1145 <sigh+0x25>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
lea    0xec2(%rip),%rsi
mov    %ebx,%edx
call   1030 <fprintf@plt>
add    $0x7f,%ebx
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@SIGPIPE = global i32 0
@stderr = global i32 0
@.str = [28 x i8] c"wgetlite: caught signal %d\0A\00"
define void @sigh(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGPIPE
%5 = icmp ne i32 %3, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = load i32, i32* %2
%9 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %8)
br label %10
10: ; preds = %6, %1
%11 = load i32, i32* %2
%12 = add nsw i32 127, %11
%13 = call i32 @exit(i32 %12)
unreachable
}

LLVM IR (-O2):
@SIGPIPE = global i32 0
@stderr = global i32 0
@.str = [28 x i8] c"wgetlite: caught signal %d\0A\00"
define void @sigh(i32 %0) {
%2 = load i32, i32* @SIGPIPE
%3 = icmp eq i32 %2, %0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %7
7: ; preds = %4, %1
%8 = add nsw i32 %0, 127
%9 = tail call i32 @exit(i32 %8)
unreachable
}
unsigned int fuzzerHash(const char *z) {
  unsigned int h = 0;
  while (*z) {
    h = (h << 3) ^ (h >> 29) ^ *(z++);
  }
  return h % 4001;
}


x86 assembly (clang, -O0):
<fuzzerHash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1146 <fuzzerHash+0x46>
mov    -0xc(%rbp),%eax
shl    $0x3,%eax
mov    -0xc(%rbp),%ecx
shr    $0x1d,%ecx
xor    %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
xor    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <fuzzerHash+0xf>
mov    -0xc(%rbp),%eax
mov    $0xfa1,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fuzzerHash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1146 <fuzzerHash+0x46>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
mov    %eax,%edx
rol    $0x3,%edx
movsbl %cl,%eax
xor    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <fuzzerHash+0x10>
mov    %eax,%ecx
imul   $0x614174b,%rcx,%rcx
shr    $0x20,%rcx
mov    %eax,%edx
sub    %ecx,%edx
shr    %edx
add    %ecx,%edx
shr    $0xb,%edx
imul   $0xfa1,%edx,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @fuzzerHash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = tail call i32 @llvm.fshl.i32(i32 %6, i32 %6, i32 3)
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i32
%11 = xor i32 %8, %10
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = urem i32 %11, 4001
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 0, %1 ], [ %15, %14 ]
ret i32 %17
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                          int);
void ethernet_get_srcaddr(const uint8_t *p_ethernet, uint8_t *p_addr) {
  memcpy(p_addr, p_ethernet + 6, 6);
}


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

x86 assembly (clang, -O2):
<ethernet_get_srcaddr>:
mov    %rsi,%rax
lea    0x18(%rdi),%rsi
mov    %rax,%rdi
mov    $0x6,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @ethernet_get_srcaddr(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 6
%8 = call i32 @memcpy(i32* %5, i32* %7, i32 6)
ret void
}

LLVM IR (-O2):
define void @ethernet_get_srcaddr(i32* %0, i32* %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 6
%4 = tail call i32 @memcpy(i32* %1, i32* %3, i32 6)
ret void
}
/* Variables and functions */
void *test_malloc2(int);
void *test_malloc(int num) { return test_malloc2(num); }


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

x86 assembly (clang, -O2):
<test_malloc>:
jmp    1030 <test_malloc2@plt>

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

LLVM IR (-O2):
define i8* @test_malloc(i32 %0) {
%2 = tail call i8* @test_malloc2(i32 %0)
ret i8* %2
}
/* Variables and functions */
double DProbNormal(int /*<<< orphan*/);
int /*<<< orphan*/ DRanNormalZig32Vec();
double DRanQuanNormalZig32Vec(void) {
  return DProbNormal(DRanNormalZig32Vec());
}


x86 assembly (clang, -O0):
<DRanQuanNormalZig32Vec>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <DRanNormalZig32Vec@plt>
mov    %eax,%edi
call   1030 <DProbNormal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DRanQuanNormalZig32Vec>:
push   %rax
xor    %eax,%eax
call   1040 <DRanNormalZig32Vec@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <DProbNormal@plt>

LLVM IR (-O0):
define double @DRanQuanNormalZig32Vec() {
%1 = call i32 (...) @DRanNormalZig32Vec()
%2 = call double @DProbNormal(i32 %1)
ret double %2
}

LLVM IR (-O2):
define double @DRanQuanNormalZig32Vec() {
%1 = tail call i32 (...) @DRanNormalZig32Vec()
%2 = tail call double @DProbNormal(i32 %1)
ret double %2
}