xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void animation(void) {
  puts("\n\nAs a final trick, the Taco Bell dog will dance");
  puts("\tacross your monitor with this function.");
}


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

x86 assembly (clang, -O2):
<animation>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0d(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [49 x i8] c"\0A\0AAs a final trick, the Taco Bell dog will dance\00"
@.str.1 = [41 x i8] c"\09across your monitor with this function.\00"
define void @animation() {
%1 = call i32 @puts(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [49 x i8] c"\0A\0AAs a final trick, the Taco Bell dog will dance\00"
@.str.1 = [41 x i8] c"\09across your monitor with this function.\00"
define void @animation() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ VIM_HIF_SetReg8(int, unsigned char);
void VIM_JPEG_SetComponentNum(unsigned char byNum) {
  VIM_HIF_SetReg8((0x0000 + 0x01F), byNum);
}


x86 assembly (clang, -O0):
<VIM_JPEG_SetComponentNum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1f,%edi
movzbl -0x1(%rbp),%esi
call   1030 <VIM_HIF_SetReg8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VIM_JPEG_SetComponentNum>:
mov    %edi,%esi
mov    $0x1f,%edi
jmp    1030 <VIM_HIF_SetReg8@plt>

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

LLVM IR (-O2):
define void @VIM_JPEG_SetComponentNum(i8 zeroext %0) {
%2 = tail call i32 @VIM_HIF_SetReg8(i32 31, i8 zeroext %0)
ret void
}
/* Variables and functions */
char *__memrchr(char const *, int, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
char *strrchr(const char *s, int c) { return __memrchr(s, c, strlen(s)); }


x86 assembly (clang, -O0):
<strrchr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    %eax,%edx
call   1040 <__memrchr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strrchr>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <__memrchr@plt>

LLVM IR (-O0):
define i8* @strrchr(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 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = call i8* @__memrchr(i8* %5, i32 %6, i32 %8)
ret i8* %9
}

LLVM IR (-O2):
define i8* @strrchr(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i8* @__memrchr(i8* %0, i32 %1, i32 %3)
ret i8* %4
}
decimalFixer(float *x, int cnt) {
  if (cnt >= 40)
    return cnt;
  if ((float)((int)*x) == *x)
    return cnt;
  (*x) = (*x) * 10;
  return decimalFixer(x, cnt + 1);
}


x86 assembly (clang, -O0):
<decimalFixer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x28,-0x14(%rbp)
jl     1134 <decimalFixer+0x24>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1188 <decimalFixer+0x78>
mov    -0x10(%rbp),%rax
cvttss2si (%rax),%eax
cvtsi2ss %eax,%xmm0
mov    -0x10(%rbp),%rax
ucomiss (%rax),%xmm0
jne    115e <decimalFixer+0x4e>
jp     115e <decimalFixer+0x4e>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1188 <decimalFixer+0x78>
mov    -0x10(%rbp),%rax
movss  0xe96(%rip),%xmm0
mulss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
call   1030 <decimalFixer@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decimalFixer>:
mov    %esi,%eax
cmp    $0x27,%esi
jg     1143 <decimalFixer+0x43>
movss  (%rdi),%xmm0
movss  0xeed(%rip),%xmm1
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cvttps2dq %xmm0,%xmm2
cvtdq2ps %xmm2,%xmm2
ucomiss %xmm2,%xmm0
jne    112e <decimalFixer+0x2e>
jnp    1143 <decimalFixer+0x43>
mulss  %xmm1,%xmm0
movss  %xmm0,(%rdi)
add    $0x1,%eax
cmp    $0x28,%eax
jne    1120 <decimalFixer+0x20>
mov    $0x28,%eax
ret

LLVM IR (-O0):
define i32 @decimalFixer(float* %0, i32 %1) {
%3 = alloca i32
%4 = alloca float*
%5 = alloca i32
store float* %0, float** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp sge i32 %6, 40
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %5
store i32 %9, i32* %3
br label %29
10: ; preds = %2
%11 = load float*, float** %4
%12 = load float, float* %11
%13 = fptosi float %12 to i32
%14 = sitofp i32 %13 to float
%15 = load float*, float** %4
%16 = load float, float* %15
%17 = fcmp oeq float %14, %16
br i1 %17, label %18, label %20
18: ; preds = %10
%19 = load i32, i32* %5
store i32 %19, i32* %3
br label %29
20: ; preds = %10
%21 = load float*, float** %4
%22 = load float, float* %21
%23 = fmul float %22, 1.000000e+01
%24 = load float*, float** %4
store float %23, float* %24
%25 = load float*, float** %4
%26 = load i32, i32* %5
%27 = add nsw i32 %26, 1
%28 = call i32 @decimalFixer(float* %25, i32 %27)
store i32 %28, i32* %3
br label %29
29: ; preds = %20, %18, %8
%30 = load i32, i32* %3
ret i32 %30
}

LLVM IR (-O2):
define i32 @decimalFixer(float* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 39
br i1 %3, label %16, label %4
4: ; preds = %2
%5 = load float, float* %0
br label %6
6: ; preds = %4, %12
%7 = phi float [ %5, %4 ], [ %13, %12 ]
%8 = phi i32 [ %1, %4 ], [ %14, %12 ]
%9 = fptosi float %7 to i32
%10 = sitofp i32 %9 to float
%11 = fcmp oeq float %7, %10
br i1 %11, label %16, label %12
12: ; preds = %6
%13 = fmul float %7, 1.000000e+01
store float %13, float* %0
%14 = add i32 %8, 1
%15 = icmp eq i32 %14, 40
br i1 %15, label %16, label %6
16: ; preds = %12, %6, %2
%17 = phi i32 [ %1, %2 ], [ %8, %6 ], [ 40, %12 ]
ret i32 %17
}
int kd_serial_thread_worker(void *context) { return (context != 0); }


x86 assembly (clang, -O0):
<kd_serial_thread_worker>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kd_serial_thread_worker>:
xor    %eax,%eax
test   %rdi,%rdi
setne  %al
ret

LLVM IR (-O0):
define i32 @kd_serial_thread_worker(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @kd_serial_thread_worker(i8* readnone %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
ret i32 %3
}
int test_imm_D7int8_reg(signed char val) {
  return ((val) & (-0xD7 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_D7int8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -215
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: i8kctl [fan [<l> <r>] | speed | version | bios | id | temp"
         "| ac | fn]\n");
  printf("       i8kctl [-h]\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf28(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [77 x i8] c"Usage: i8kctl [fan [<l> <r>] | speed | version | bios | id | temp| ac | fn]\0A\00"
@.str.1 = [20 x i8] c" i8kctl [-h]\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [76 x i8] c"Usage: i8kctl [fan [<l> <r>] | speed | version | bios | id | temp| ac | fn]\00"
@str.2 = [19 x i8] c" i8kctl [-h]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([76 x i8], [76 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
void INC_HOST_REG_W(int host_reg) {
  addbyte(0x66);
  if (host_reg & 8)
    addbyte(0x41);
  addbyte(0xff);
  addbyte(0xc0 | (host_reg & 7));
}


x86 assembly (clang, -O0):
<INC_HOST_REG_W>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     113e <INC_HOST_REG_W+0x2e>
mov    $0x41,%edi
call   1030 <addbyte@plt>
mov    $0xff,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
and    $0x7,%edi
or     $0xc0,%edi
call   1030 <addbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<INC_HOST_REG_W>:
push   %rbx
mov    %edi,%ebx
mov    $0x66,%edi
call   1030 <addbyte@plt>
test   $0x8,%bl
je     112c <INC_HOST_REG_W+0x1c>
mov    $0x41,%edi
call   1030 <addbyte@plt>
mov    $0xff,%edi
call   1030 <addbyte@plt>
and    $0x7,%ebx
or     $0xc0,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <addbyte@plt>

LLVM IR (-O0):
define void @INC_HOST_REG_W(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @addbyte(i32 102)
%4 = load i32, i32* %2
%5 = and i32 %4, 8
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @addbyte(i32 65)
br label %9
9: ; preds = %7, %1
%10 = call i32 @addbyte(i32 255)
%11 = load i32, i32* %2
%12 = and i32 %11, 7
%13 = or i32 192, %12
%14 = call i32 @addbyte(i32 %13)
ret void
}

LLVM IR (-O2):
define void @INC_HOST_REG_W(i32 %0) {
%2 = tail call i32 @addbyte(i32 102)
%3 = and i32 %0, 8
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @addbyte(i32 65)
br label %7
7: ; preds = %5, %1
%8 = tail call i32 @addbyte(i32 255)
%9 = and i32 %0, 7
%10 = or i32 %9, 192
%11 = tail call i32 @addbyte(i32 %10)
ret void
}
/* Variables and functions */
scalar_t__ EINTR;
int close(int);
scalar_t__ errno;
int eiki_close(int fd) {
  int rv;
  while (1) {
    rv = close(fd);
    if (!rv) {
      break;
    } else if (errno != EINTR) {
      break;
    }
  }
  return rv;
}


x86 assembly (clang, -O0):
<eiki_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1135 <eiki_close+0x25>
jmp    115e <eiki_close+0x4e>
mov    0x2ea4(%rip),%rax
mov    (%rax),%rax
mov    0x2e92(%rip),%rcx
cmp    (%rcx),%rax
je     1154 <eiki_close+0x44>
jmp    115e <eiki_close+0x4e>
jmp    1159 <eiki_close+0x49>
jmp    111b <eiki_close+0xb>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eiki_close>:
push   %r15
push   %r14
push   %rbx
mov    %edi,%ebx
mov    0x2ec2(%rip),%r14
mov    0x2eb3(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%edi
call   1030 <close@plt>
test   %eax,%eax
je     1143 <eiki_close+0x33>
mov    (%r14),%rcx
cmp    (%r15),%rcx
je     1130 <eiki_close+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@errno = global i64 0
@EINTR = global i64 0
define i32 @eiki_close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
br label %4
4: ; preds = %1, %16
%5 = load i32, i32* %2
%6 = call i32 @close(i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %4
br label %17
10: ; preds = %4
%11 = load i64, i64* @errno
%12 = load i64, i64* @EINTR
%13 = icmp ne i64 %11, %12
br i1 %13, label %14, label %15
14: ; preds = %10
br label %17
15: ; preds = %10
br label %16
16: ; preds = %15
br label %4
17: ; preds = %14, %9
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@errno = global i64 0
@EINTR = global i64 0
define i32 @eiki_close(i32 %0) {
br label %2
2: ; preds = %5, %1
%3 = tail call i32 @close(i32 %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = load i64, i64* @errno
%7 = load i64, i64* @EINTR
%8 = icmp eq i64 %6, %7
br i1 %8, label %2, label %9
9: ; preds = %5, %2
ret i32 %3
}
int getType(int *entry) { return *(entry + 4); }


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

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

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

LLVM IR (-O2):
define i32 @getType(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 4
%3 = load i32, i32* %2
ret i32 %3
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
bool SHAREMIND_MAP_KEY_LESS_uint64_t(uint64_t const k1, uint64_t const k2) {
  return k1 < k2;
}


x86 assembly (clang, -O0):
<SHAREMIND_MAP_KEY_LESS_uint64_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_MAP_KEY_LESS_uint64_t>:
xor    %eax,%eax
cmp    %rsi,%rdi
setl   %al
ret

LLVM IR (-O0):
define i32 @SHAREMIND_MAP_KEY_LESS_uint64_t(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp slt i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @SHAREMIND_MAP_KEY_LESS_uint64_t(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void ADCIntEnableEx(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ASSERT((ui32Base == 0x40038000) || (ui32Base == 0x40039000));
  (*((volatile uint32_t *)(ui32Base + 0x00000008))) |= ui32IntFlags;
}


x86 assembly (clang, -O0):
<ADCIntEnableEx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x1,%al
cmpl   $0x40038000,-0x4(%rbp)
mov    %al,-0x9(%rbp)
je     113d <ADCIntEnableEx+0x2d>
cmpl   $0x40039000,-0x4(%rbp)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x8(%rbp),%edx
mov    -0x4(%rbp),%eax
add    $0x8,%eax
cltq
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCIntEnableEx>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %edi,%eax
and    $0xffffefff,%eax
xor    %edi,%edi
cmp    $0x40038000,%eax
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebp,%rax
or     %ebx,0x8(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @ADCIntEnableEx(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 1073971200
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 1073975296
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ true, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @ASSERT(i32 %12)
%14 = load i32, i32* %4
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 8
%17 = sext i32 %16 to i64
%18 = inttoptr i64 %17 to i32*
%19 = load volatile i32, i32* %18
%20 = or i32 %19, %14
store volatile i32 %20, i32* %18
ret void
}

LLVM IR (-O2):
define void @ADCIntEnableEx(i32 %0, i32 %1) {
%3 = and i32 %0, -4097
%4 = icmp eq i32 %3, 1073971200
%5 = zext i1 %4 to i32
%6 = tail call i32 @ASSERT(i32 %5)
%7 = add nsw i32 %0, 8
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
%10 = load volatile i32, i32* %9
%11 = or i32 %10, %1
store volatile i32 %11, i32* %9
ret void
}
float clampf(float src, float min, float max) {
  return src > max ? max : (src < min ? min : src);
}


x86 assembly (clang, -O0):
<clampf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1131 <clampf+0x31>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    1167 <clampf+0x67>
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1153 <clampf+0x53>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    115d <clampf+0x5d>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<clampf>:
maxss  %xmm0,%xmm1
movaps %xmm2,%xmm3
cmpltss %xmm0,%xmm3
movaps %xmm3,%xmm0
andnps %xmm1,%xmm0
andps  %xmm2,%xmm3
orps   %xmm0,%xmm3
movaps %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @clampf(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %6
%9 = fcmp ogt float %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load float, float* %6
br label %22
12: ; preds = %3
%13 = load float, float* %4
%14 = load float, float* %5
%15 = fcmp olt float %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load float, float* %5
br label %20
18: ; preds = %12
%19 = load float, float* %4
br label %20
20: ; preds = %18, %16
%21 = phi float [ %17, %16 ], [ %19, %18 ]
br label %22
22: ; preds = %20, %10
%23 = phi float [ %11, %10 ], [ %21, %20 ]
ret float %23
}

LLVM IR (-O2):
define float @clampf(float %0, float %1, float %2) {
%4 = fcmp ogt float %0, %2
%5 = fcmp olt float %0, %1
%6 = select i1 %5, float %1, float %0
%7 = select i1 %4, float %2, float %6
ret float %7
}
int xmlUCSIsGeometricShapes(int code) {
  return (((code >= 0x25A0) && (code <= 0x25FF)));
}


x86 assembly (clang, -O0):
<xmlUCSIsGeometricShapes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x25a0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsGeometricShapes+0x26>
cmpl   $0x25ff,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsGeometricShapes>:
add    $0xffffda60,%edi
xor    %eax,%eax
cmp    $0x60,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @xmlUCSIsGeometricShapes(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 9632
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 9727
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @xmlUCSIsGeometricShapes(i32 %0) {
%2 = add i32 %0, -9632
%3 = icmp ult i32 %2, 96
%4 = zext i1 %3 to i32
ret i32 %4
}
void X509_STORE_CTX_set_ex_data(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_STORE_CTX_set_ex_data() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
void display_fini(void) { endwin(); }


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

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

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

LLVM IR (-O2):
define void @display_fini() {
%1 = tail call i32 (...) @endwin()
ret void
}
int isvowel(char c) {
  return c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u';
}


x86 assembly (clang, -O0):
<isvowel>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x61,%ecx
mov    %al,-0x2(%rbp)
je     115f <isvowel+0x5f>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x65,%ecx
mov    %al,-0x2(%rbp)
je     115f <isvowel+0x5f>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x69,%ecx
mov    %al,-0x2(%rbp)
je     115f <isvowel+0x5f>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x6f,%ecx
mov    %al,-0x2(%rbp)
je     115f <isvowel+0x5f>
movsbl -0x1(%rbp),%eax
cmp    $0x75,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isvowel>:
lea    -0x61(%rdi),%eax
ror    %al
cmp    $0x8,%al
jae    111b <isvowel+0x1b>
movzbl %al,%ecx
mov    $0x1,%eax
mov    $0x95,%edx
bt     %ecx,%edx
jb     1124 <isvowel+0x24>
xor    %eax,%eax
cmp    $0x75,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @isvowel(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 97
br i1 %5, label %22, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 101
br i1 %9, label %22, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 105
br i1 %13, label %22, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 111
br i1 %17, label %22, label %18
18: ; preds = %14
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 117
br label %22
22: ; preds = %18, %14, %10, %6, %1
%23 = phi i1 [ true, %14 ], [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %21, %18 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @isvowel(i8 signext %0) {
%2 = add i8 %0, -97
%3 = tail call i8 @llvm.fshl.i8(i8 %2, i8 %2, i8 7)
%4 = icmp ult i8 %3, 8
br i1 %4, label %8, label %5
5: ; preds = %8, %1
%6 = icmp eq i8 %0, 117
%7 = zext i1 %6 to i32
br label %12
8: ; preds = %1
%9 = lshr i8 -107, %3
%10 = and i8 %9, 1
%11 = icmp eq i8 %10, 0
br i1 %11, label %5, label %12
12: ; preds = %8, %5
%13 = phi i32 [ %7, %5 ], [ 1, %8 ]
ret i32 %13
}
/* Type definitions */
struct S {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ abort();
void wrong_target(struct S *s) { abort(); }


x86 assembly (clang, -O0):
<wrong_target>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<wrong_target>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
%struct.S = type { i32 }
define void @wrong_target(%struct.S* %0) {
%2 = alloca %struct.S*
store %struct.S* %0, %struct.S** %2
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
%struct.S = type { i32 }
define void @wrong_target(%struct.S* nocapture readnone %0) {
%2 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ compute(int, int, float **);
int /*<<< orphan*/ input(int, int, float **);
int /*<<< orphan*/ output(int, int, float **);
int /*<<< orphan*/ printf(char *);
int main() {
  float a[4][5];
  printf("输入3x4个数据\n");
  input(3, 4, a);
  compute(4, 5, a);
  output(4, 5, a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1050 <printf@plt>
lea    -0x60(%rbp),%rdx
mov    $0x3,%edi
mov    $0x4,%esi
call   1030 <input@plt>
lea    -0x60(%rbp),%rdx
mov    $0x4,%edi
mov    $0x5,%esi
call   1060 <compute@plt>
lea    -0x60(%rbp),%rdx
mov    $0x4,%edi
mov    $0x5,%esi
call   1040 <output@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
lea    0xeb4(%rip),%rdi
call   1040 <puts@plt>
mov    %rsp,%rbx
mov    $0x3,%edi
mov    $0x4,%esi
mov    %rbx,%rdx
call   1030 <input@plt>
mov    $0x4,%edi
mov    $0x5,%esi
mov    %rbx,%rdx
call   1060 <compute@plt>
mov    $0x4,%edi
mov    $0x5,%esi
mov    %rbx,%rdx
call   1050 <output@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"\E8\BE\93\E5\85\A53x4\E4\B8\AA\E6\95\B0\E6\8D\AE\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x [5 x float]]
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [4 x [5 x float]], [4 x [5 x float]]* %2, i64 0, i64 0
%5 = bitcast [5 x float]* %4 to float**
%6 = call i32 @input(i32 3, i32 4, float** %5)
%7 = getelementptr inbounds [4 x [5 x float]], [4 x [5 x float]]* %2, i64 0, i64 0
%8 = bitcast [5 x float]* %7 to float**
%9 = call i32 @compute(i32 4, i32 5, float** %8)
%10 = getelementptr inbounds [4 x [5 x float]], [4 x [5 x float]]* %2, i64 0, i64 0
%11 = bitcast [5 x float]* %10 to float**
%12 = call i32 @output(i32 4, i32 5, float** %11)
ret i32 0
}

LLVM IR (-O2):
@str = [19 x i8] c"\E8\BE\93\E5\85\A53x4\E4\B8\AA\E6\95\B0\E6\8D\AE\00"
define i32 @main() {
%1 = alloca [4 x [5 x float]]
%2 = bitcast [4 x [5 x float]]* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%4 = bitcast [4 x [5 x float]]* %1 to float**
%5 = call i32 @input(i32 3, i32 4, float** %4)
%6 = call i32 @compute(i32 4, i32 5, float** %4)
%7 = call i32 @output(i32 4, i32 5, float** %4)
ret i32 0
}
/* Variables and functions */
double ceil(double);
double t1(double x) { return ceil(x); }


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

x86 assembly (clang, -O2):
<t1>:
jmp    1030 <ceil@plt>

LLVM IR (-O0):
define double @t1(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.ceil.f64(double %3)
ret double %4
}

LLVM IR (-O2):
define double @t1(double %0) {
%2 = tail call double @llvm.ceil.f64(double %0)
ret double %2
}
/* Variables and functions */
scalar_t__ foo();
int test() {
  int a = 1;
  a = 34 / 12;
  if (foo())
    return a;
  a /= 4;
  return a;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0x8(%rbp)
mov    $0x0,%al
call   1030 <foo@plt>
cmp    $0x0,%rax
je     1142 <test+0x32>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1156 <test+0x46>
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
xor    %eax,%eax
call   1030 <foo@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
add    %ecx,%ecx
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @test() {
%1 = tail call i64 (...) @foo()
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i32 0, i32 2
ret i32 %3
}
/* Variables and functions */
size_t stringLen(const char *str, size_t max) {
  size_t size = 0;
  while (*str != '\0' && size < max) {
    size++;
  }
  return size;
}


x86 assembly (clang, -O0):
<stringLen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
je     1137 <stringLen+0x37>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
setb   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1147 <stringLen+0x47>
jmp    1158 <stringLen+0x58>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <stringLen+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringLen>:
mov    (%rdi),%cl
mov    $0xffffffffffffffff,%rax
nopl   0x0(%rax)
add    $0x1,%rax
test   %cl,%cl
je     111d <stringLen+0x1d>
cmp    %rsi,%rax
jb     1110 <stringLen+0x10>
ret

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

LLVM IR (-O2):
define i64 @stringLen(i8* nocapture %0, i64 %1) {
%3 = load i8, i8* %0
%4 = icmp ne i8 %3, 0
br label %5
5: ; preds = %5, %2
%6 = phi i64 [ 0, %2 ], [ %9, %5 ]
%7 = icmp ult i64 %6, %1
%8 = select i1 %4, i1 %7, i1 false
%9 = add nuw i64 %6, 1
br i1 %8, label %5, label %10
10: ; preds = %5
ret i64 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ rnl_verror_handler(int, int /*<<< orphan*/);
void verror_handler_rnc(int erno, va_list ap) {
  rnl_verror_handler(erno | 0x01000, ap);
}


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

x86 assembly (clang, -O2):
<verror_handler_rnc>:
or     $0x1000,%edi
jmp    1030 <rnl_verror_handler@plt>

LLVM IR (-O0):
define void @verror_handler_rnc(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = or i32 %5, 4096
%7 = load i32, i32* %4
%8 = call i32 @rnl_verror_handler(i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
define void @verror_handler_rnc(i32 %0, i32 %1) {
%3 = or i32 %0, 4096
%4 = tail call i32 @rnl_verror_handler(i32 %3, i32 %1)
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
size_t snprintf(char *, size_t, char *, int);
int stat(char *, struct stat *);
int get_tmp_path_r(int pid, char *buf, size_t bufsize) {
  if (snprintf(buf, bufsize, "/proc/%d/root/tmp", pid) >= bufsize) {
    return -1;
  }
  struct stat stats;
  return stat(buf, &stats);
}


x86 assembly (clang, -O0):
<get_tmp_path_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%ecx
lea    0xebb(%rip),%rdx
call   1030 <snprintf@plt>
cmp    -0x18(%rbp),%rax
jb     1160 <get_tmp_path_r+0x40>
movl   $0xffffffff,-0x4(%rbp)
jmp    1170 <get_tmp_path_r+0x50>
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <stat@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_tmp_path_r>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %edi,%ecx
lea    0xecd(%rip),%rdx
mov    %rsi,%rdi
mov    %rbx,%rsi
call   1030 <snprintf@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
cmp    %rbx,%rcx
jae    1156 <get_tmp_path_r+0x36>
mov    %rsp,%rsi
mov    %r14,%rdi
call   1040 <stat@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [18 x i8] c"/proc/%d/root/tmp\00"
define i32 @get_tmp_path_r(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca %struct.stat
store i32 %0, i32* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
%9 = load i8*, i8** %6
%10 = load i64, i64* %7
%11 = load i32, i32* %5
%12 = call i64 @snprintf(i8* %9, i64 %10, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i64, i64* %7
%14 = icmp uge i64 %12, %13
br i1 %14, label %15, label %16
15: ; preds = %3
store i32 -1, i32* %4
br label %19
16: ; preds = %3
%17 = load i8*, i8** %6
%18 = call i32 @stat(i8* %17, %struct.stat* %8)
store i32 %18, i32* %4
br label %19
19: ; preds = %16, %15
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [18 x i8] c"/proc/%d/root/tmp\00"
define i32 @get_tmp_path_r(i32 %0, i8* %1, i64 %2) {
%4 = alloca %struct.stat
%5 = tail call i64 @snprintf(i8* %1, i64 %2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %0)
%6 = icmp ult i64 %5, %2
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = bitcast %struct.stat* %4 to i8*
%9 = call i32 @stat(i8* %1, %struct.stat* %4)
br label %10
10: ; preds = %3, %7
%11 = phi i32 [ %9, %7 ], [ -1, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ set_status_led_tir(int);
int stop_camera_tir();
bool ltr_int_pause_tir() {
  bool res = stop_camera_tir();
  set_status_led_tir(false);
  return res;
}


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

x86 assembly (clang, -O2):
<ltr_int_pause_tir>:
push   %rbx
xor    %eax,%eax
call   1030 <stop_camera_tir@plt>
mov    %eax,%ebx
xor    %edi,%edi
call   1040 <set_status_led_tir@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ltr_int_pause_tir() {
%1 = alloca i32
%2 = call i32 (...) @stop_camera_tir()
store i32 %2, i32* %1
%3 = call i32 @set_status_led_tir(i32 0)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @ltr_int_pause_tir() {
%1 = tail call i32 (...) @stop_camera_tir()
%2 = tail call i32 @set_status_led_tir(i32 0)
ret i32 %1
}
int atomicFetchAndAdd(volatile int *i, int j) {
  return __sync_fetch_and_add(i, j);
}


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

x86 assembly (clang, -O2):
<atomicFetchAndAdd>:
mov    %esi,%eax
lock xadd %eax,(%rdi)
ret

LLVM IR (-O0):
define i32 @atomicFetchAndAdd(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = atomicrmw add i32* %5, i32 %6 seq_cst
ret i32 %7
}

LLVM IR (-O2):
define i32 @atomicFetchAndAdd(i32* nocapture %0, i32 %1) {
%3 = atomicrmw add i32* %0, i32 %1 seq_cst
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ stu;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void main() {
  struct student {
  } stu;
  printf("Sizeof empty struct var is:%d,%d", sizeof(stu),
         sizeof(struct student));
}


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

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.student = type {}
@.str = [33 x i8] c"Sizeof empty struct var is:%d,%d\00"
define void @main() {
%1 = alloca %struct.student
%2 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 0, i32 0)
ret void
}

LLVM IR (-O2):
%struct.student = type {}
@.str = [33 x i8] c"Sizeof empty struct var is:%d,%d\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void DestroyPic(void) { printf("FIXME: DestroyPic isnt impelemnted\n"); }


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"FIXME: DestroyPic isnt impelemnted\0A\00"
define void @DestroyPic() {
%1 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [35 x i8] c"FIXME: DestroyPic isnt impelemnted\00"
define void @DestroyPic() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret void
}
void fb_clean_point(int row, int column, unsigned char *fb, int column_max) {
  int i;
  unsigned char word;
  i = row / 8;
  word = *(fb + i * column_max + column);
  word &= ~(0x1 << (row % 8));
  *(fb + i * column_max + column) = word;
}


x86 assembly (clang, -O0):
<fb_clean_point>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
imul   -0x14(%rbp),%ecx
movslq %ecx,%rcx
add    %rcx,%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x19(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
xor    $0xffffffff,%ecx
movzbl -0x19(%rbp),%eax
and    %ecx,%eax
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%dl
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
imul   -0x14(%rbp),%ecx
movslq %ecx,%rcx
add    %rcx,%rax
movslq -0x8(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_clean_point>:
lea    0x7(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
sar    $0x3,%eax
imul   %ecx,%eax
cltq
add    %rdx,%rax
movslq %esi,%rdx
and    $0x7,%dil
mov    $0x1,%esi
mov    %edi,%ecx
shl    %cl,%esi
not    %sil
and    %sil,(%rdx,%rax,1)
ret

LLVM IR (-O0):
define void @fb_clean_point(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%11 = load i32, i32* %5
%12 = sdiv i32 %11, 8
store i32 %12, i32* %9
%13 = load i8*, i8** %7
%14 = load i32, i32* %9
%15 = load i32, i32* %8
%16 = mul nsw i32 %14, %15
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %13, i64 %17
%19 = load i32, i32* %6
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
%22 = load i8, i8* %21
store i8 %22, i8* %10
%23 = load i32, i32* %5
%24 = srem i32 %23, 8
%25 = shl i32 1, %24
%26 = xor i32 %25, -1
%27 = load i8, i8* %10
%28 = zext i8 %27 to i32
%29 = and i32 %28, %26
%30 = trunc i32 %29 to i8
store i8 %30, i8* %10
%31 = load i8, i8* %10
%32 = load i8*, i8** %7
%33 = load i32, i32* %9
%34 = load i32, i32* %8
%35 = mul nsw i32 %33, %34
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i8, i8* %32, i64 %36
%38 = load i32, i32* %6
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds i8, i8* %37, i64 %39
store i8 %31, i8* %40
ret void
}

LLVM IR (-O2):
define void @fb_clean_point(i32 %0, i32 %1, i8* nocapture %2, i32 %3) {
%5 = sdiv i32 %0, 8
%6 = mul nsw i32 %5, %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %2, i64 %7
%9 = sext i32 %1 to i64
%10 = getelementptr inbounds i8, i8* %8, i64 %9
%11 = load i8, i8* %10
%12 = and i32 %0, 7
%13 = shl nuw nsw i32 1, %12
%14 = trunc i32 %13 to i8
%15 = xor i8 %14, -1
%16 = and i8 %11, %15
store i8 %16, i8* %10
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ system(char *);
void fin(void) {
  system("stty echo -raw");
  ;
  printf("\033[2J");
  printf("\033[%d;%dH", 1, 1);
  printf("Exit\n");
}


x86 assembly (clang, -O0):
<fin>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <system@plt>
lea    0xed8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xecf(%rip),%rdi
mov    $0x1,%edx
mov    %edx,%esi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fin>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <system@plt>
lea    0xecb(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xec2(%rip),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xeb3(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"stty echo -raw\00"
@.str.1 = [5 x i8] c"\1B[2J\00"
@.str.2 = [9 x i8] c"\1B[%d;%dH\00"
@.str.3 = [6 x i8] c"Exit\0A\00"
define void @fin() {
%1 = call i32 @system(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 1, i32 1)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"stty echo -raw\00"
@.str.1 = [5 x i8] c"\1B[2J\00"
@.str.2 = [9 x i8] c"\1B[%d;%dH\00"
@str = [5 x i8] c"Exit\00"
define void @fin() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 1, i32 1)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}
void switch_slb(struct cpu_thread *curThread, struct cpu_thread *nextThread) {
  return;
}


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

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

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

LLVM IR (-O2):
%struct.cpu_thread = type opaque
define void @switch_slb(%struct.cpu_thread* nocapture %0, %struct.cpu_thread* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Fankuch_main();
int main() {
  Fankuch_main();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @Fankuch_main()
ret i32 0
}
/* Type definitions */
struct window {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct window *);
void freeWindow(struct window *thisWindow) {
  if (thisWindow) {
    free(thisWindow);
  }
}


x86 assembly (clang, -O0):
<freeWindow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <freeWindow+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeWindow>:
test   %rdi,%rdi
je     111a <freeWindow+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.window = type { i32 }
define void @freeWindow(%struct.window* %0) {
%2 = alloca %struct.window*
store %struct.window* %0, %struct.window** %2
%3 = load %struct.window*, %struct.window** %2
%4 = icmp ne %struct.window* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load %struct.window*, %struct.window** %2
%7 = call i32 @free(%struct.window* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
%struct.window = type { i32 }
define void @freeWindow(%struct.window* %0) {
%2 = icmp eq %struct.window* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.window* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int u_int32_t;

/* Variables and functions */
int htons(int);
u_int32_t wrapsum(u_int32_t sum) {
  sum = ~sum & 0xFFFF;
  return htons(sum);
}


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

x86 assembly (clang, -O2):
<wrapsum>:
not    %edi
movzwl %di,%edi
jmp    1030 <htons@plt>

LLVM IR (-O0):
define i32 @wrapsum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = xor i32 %3, -1
%5 = and i32 %4, 65535
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @htons(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @wrapsum(i32 %0) {
%2 = and i32 %0, 65535
%3 = xor i32 %2, 65535
%4 = tail call i32 @htons(i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void show_value_clear(void *val) { printf("> %s\n", (char *)val); }


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

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

LLVM IR (-O2):
@.str = [6 x i8] c"> %s\0A\00"
define void @show_value_clear(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
double addd(double a, double b) { return a + b; }


x86 assembly (clang, -O0):
<addd>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<addd>:
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @addd(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 = fadd double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @addd(double %0, double %1) {
%3 = fadd double %0, %1
ret double %3
}
int c017(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @c017() {
ret i32 0
}