xunge/DecIR huggingface dataset:
int move_continous_servo(int angle) {}


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

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

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

LLVM IR (-O2):
define i32 @move_continous_servo(i32 %0) {
ret i32 undef
}
int leftchild(int iPos) { return 2 * iPos + 1; }


x86 assembly (clang, -O0):
<leftchild>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<leftchild>:
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @leftchild(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 2, %3
%5 = add nsw i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @leftchild(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = or i32 %2, 1
ret i32 %3
}
/* Variables and functions */
char *strtok_r(char *, char const *, char **);
char *strtok(char *restrict s1, const char *restrict delimiters) {
  static char *ssave = "";
  return strtok_r(s1, delimiters, &ssave);
}


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

x86 assembly (clang, -O2):
<strtok>:
lea    0x2f11(%rip),%rdx
jmp    1030 <strtok_r@plt>

LLVM IR (-O0):
@strtok.ssave = internal global i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i32 0, i32 0)
@.str = [1 x i8] zeroinitializer
define i8* @strtok(i8* noalias %0, i8* noalias %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 i8* @strtok_r(i8* %5, i8* %6, i8** @strtok.ssave)
ret i8* %7
}

LLVM IR (-O2):
@strtok.ssave = internal global i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
@.str = [1 x i8] zeroinitializer
define i8* @strtok(i8* noalias %0, i8* noalias nocapture %1) {
%3 = tail call i8* @strtok_r(i8* %0, i8* %1, i8** @strtok.ssave)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ ASYNC_block_pause();
int /*<<< orphan*/ ASYNC_pause_job();
int /*<<< orphan*/ ASYNC_unblock_pause();
int blockpause(void *args) {
  ASYNC_block_pause();
  ASYNC_pause_job();
  ASYNC_unblock_pause();
  ASYNC_pause_job();
  return 1;
}


x86 assembly (clang, -O0):
<blockpause>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <ASYNC_block_pause@plt>
mov    $0x0,%al
call   1040 <ASYNC_pause_job@plt>
mov    $0x0,%al
call   1030 <ASYNC_unblock_pause@plt>
mov    $0x0,%al
call   1040 <ASYNC_pause_job@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blockpause>:
push   %rax
xor    %eax,%eax
call   1050 <ASYNC_block_pause@plt>
xor    %eax,%eax
call   1040 <ASYNC_pause_job@plt>
xor    %eax,%eax
call   1030 <ASYNC_unblock_pause@plt>
xor    %eax,%eax
call   1040 <ASYNC_pause_job@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @blockpause(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @ASYNC_block_pause()
%4 = call i32 (...) @ASYNC_pause_job()
%5 = call i32 (...) @ASYNC_unblock_pause()
%6 = call i32 (...) @ASYNC_pause_job()
ret i32 1
}

LLVM IR (-O2):
define i32 @blockpause(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @ASYNC_block_pause()
%3 = tail call i32 (...) @ASYNC_pause_job()
%4 = tail call i32 (...) @ASYNC_unblock_pause()
%5 = tail call i32 (...) @ASYNC_pause_job()
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ wctype_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ iswctype(int, int /*<<< orphan*/);
int /*<<< orphan*/ wctype(char *);
int main() {
  wctype_t x;
  assert(x = wctype("lower"));
  assert(iswctype(L'o', x));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1040 <wctype@plt>
mov    %eax,%edi
mov    %edi,-0x4(%rbp)
call   1050 <assert@plt>
mov    -0x4(%rbp),%esi
mov    $0x6f,%edi
call   1030 <iswctype@plt>
mov    %eax,%edi
call   1050 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1040 <wctype@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1050 <assert@plt>
mov    $0x6f,%edi
mov    %ebx,%esi
call   1030 <iswctype@plt>
mov    %eax,%edi
call   1050 <assert@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"lower\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 @wctype(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i32 %2, i32* %1
%3 = call i32 @assert(i32 %2)
%4 = load i32, i32* %1
%5 = call i32 @iswctype(i32 111, i32 %4)
%6 = call i32 @assert(i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"lower\00"
define i32 @main() {
%1 = tail call i32 @wctype(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @assert(i32 %1)
%3 = tail call i32 @iswctype(i32 111, i32 %1)
%4 = tail call i32 @assert(i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ VIM_HIF_SetReg8(int, unsigned char);
void VIM_JPEG_SetVideoWordCount(unsigned long dwCount) {
  dwCount >>= 2;
  VIM_HIF_SetReg8((0x0000 + 0x00F), (unsigned char)dwCount);
  VIM_HIF_SetReg8((0x0000 + 0x00E), (unsigned char)(dwCount >> 8));
  VIM_HIF_SetReg8((0x0000 + 0x00D), (unsigned char)(dwCount >> 16));
  VIM_HIF_SetReg8((0x0000 + 0x00C), (unsigned char)(dwCount >> 24));
}


x86 assembly (clang, -O0):
<VIM_JPEG_SetVideoWordCount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x2,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xf,%edi
movzbl %al,%esi
call   1030 <VIM_HIF_SetReg8@plt>
mov    -0x8(%rbp),%rax
shr    $0x8,%rax
mov    $0xe,%edi
movzbl %al,%esi
call   1030 <VIM_HIF_SetReg8@plt>
mov    -0x8(%rbp),%rax
shr    $0x10,%rax
mov    $0xd,%edi
movzbl %al,%esi
call   1030 <VIM_HIF_SetReg8@plt>
mov    -0x8(%rbp),%rax
shr    $0x18,%rax
mov    $0xc,%edi
movzbl %al,%esi
call   1030 <VIM_HIF_SetReg8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VIM_JPEG_SetVideoWordCount>:
push   %rbx
mov    %rdi,%rbx
mov    %ebx,%eax
shr    $0x2,%eax
movzbl %al,%esi
mov    $0xf,%edi
call   1030 <VIM_HIF_SetReg8@plt>
mov    %ebx,%eax
shr    $0xa,%eax
movzbl %al,%esi
mov    $0xe,%edi
call   1030 <VIM_HIF_SetReg8@plt>
mov    %ebx,%eax
shr    $0x12,%eax
movzbl %al,%esi
mov    $0xd,%edi
call   1030 <VIM_HIF_SetReg8@plt>
shr    $0x1a,%rbx
movzbl %bl,%esi
mov    $0xc,%edi
pop    %rbx
jmp    1030 <VIM_HIF_SetReg8@plt>

LLVM IR (-O0):
define void @VIM_JPEG_SetVideoWordCount(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 2
store i64 %4, i64* %2
%5 = load i64, i64* %2
%6 = trunc i64 %5 to i8
%7 = call i32 @VIM_HIF_SetReg8(i32 15, i8 zeroext %6)
%8 = load i64, i64* %2
%9 = lshr i64 %8, 8
%10 = trunc i64 %9 to i8
%11 = call i32 @VIM_HIF_SetReg8(i32 14, i8 zeroext %10)
%12 = load i64, i64* %2
%13 = lshr i64 %12, 16
%14 = trunc i64 %13 to i8
%15 = call i32 @VIM_HIF_SetReg8(i32 13, i8 zeroext %14)
%16 = load i64, i64* %2
%17 = lshr i64 %16, 24
%18 = trunc i64 %17 to i8
%19 = call i32 @VIM_HIF_SetReg8(i32 12, i8 zeroext %18)
ret void
}

LLVM IR (-O2):
define void @VIM_JPEG_SetVideoWordCount(i64 %0) {
%2 = lshr i64 %0, 2
%3 = trunc i64 %2 to i8
%4 = tail call i32 @VIM_HIF_SetReg8(i32 15, i8 zeroext %3)
%5 = lshr i64 %0, 10
%6 = trunc i64 %5 to i8
%7 = tail call i32 @VIM_HIF_SetReg8(i32 14, i8 zeroext %6)
%8 = lshr i64 %0, 18
%9 = trunc i64 %8 to i8
%10 = tail call i32 @VIM_HIF_SetReg8(i32 13, i8 zeroext %9)
%11 = lshr i64 %0, 26
%12 = trunc i64 %11 to i8
%13 = tail call i32 @VIM_HIF_SetReg8(i32 12, i8 zeroext %12)
ret void
}
int test_imm_56uint16_reg(unsigned short val) {
  return ((val) & (-0x56 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_56uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffffaa,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_56uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -86
%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_56uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -86
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int re_assemble_22(int as22) {
  return (((as22 & 0x200000) >> 21) | ((as22 & 0x1f0000) << (21 - 16)) |
          ((as22 & 0x00f800) << (16 - 11)) | ((as22 & 0x000400) >> (10 - 2)) |
          ((as22 & 0x0003ff) << (1 + 2)));
}


x86 assembly (clang, -O0):
<re_assemble_22>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x200000,%eax
sar    $0x15,%eax
mov    -0x4(%rbp),%ecx
and    $0x1f0000,%ecx
shl    $0x5,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xf800,%ecx
shl    $0x5,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0x400,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0x3ff,%ecx
shl    $0x3,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<re_assemble_22>:
mov    %edi,%eax
shr    $0x15,%eax
mov    %edi,%ecx
shl    $0x5,%ecx
or     %ecx,%eax
and    $0x3e00001,%eax
and    $0x1f0000,%ecx
or     %eax,%ecx
mov    %edi,%eax
shr    $0x8,%eax
and    $0x4,%eax
or     %ecx,%eax
and    $0x3ff,%edi
lea    (%rax,%rdi,8),%eax
ret

LLVM IR (-O0):
define i32 @re_assemble_22(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 2097152
%5 = ashr i32 %4, 21
%6 = load i32, i32* %2
%7 = and i32 %6, 2031616
%8 = shl i32 %7, 5
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = and i32 %10, 63488
%12 = shl i32 %11, 5
%13 = or i32 %9, %12
%14 = load i32, i32* %2
%15 = and i32 %14, 1024
%16 = ashr i32 %15, 8
%17 = or i32 %13, %16
%18 = load i32, i32* %2
%19 = and i32 %18, 1023
%20 = shl i32 %19, 3
%21 = or i32 %17, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @re_assemble_22(i32 %0) {
%2 = lshr i32 %0, 21
%3 = and i32 %2, 1
%4 = shl i32 %0, 5
%5 = and i32 %4, 65011712
%6 = or i32 %3, %5
%7 = and i32 %4, 2031616
%8 = or i32 %6, %7
%9 = lshr i32 %0, 8
%10 = and i32 %9, 4
%11 = or i32 %8, %10
%12 = shl i32 %0, 3
%13 = and i32 %12, 8184
%14 = or i32 %11, %13
ret i32 %14
}
__attribute__((always_)) void insw(int port, void *addr, unsigned long count) {
  __asm__ __volatile__("rep; ins"
                       "w"
                       : "+D"(addr), "+c"(count)
                       : "d"(port));
}


x86 assembly (clang, -O0):
<insw>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    -0x4(%rbp),%edx
rep insw (%dx),%es:(%rdi)
mov    %rdi,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<insw>:
mov    %rdx,%rcx
mov    %edi,%edx
mov    %rsi,%rdi
rep insw (%dx),%es:(%rdi)
ret

LLVM IR (-O0):
define void @insw(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %5
%8 = load i64, i64* %6
%9 = load i32, i32* %4
%10 = call { i8*, i64 } asm sideeffect "rep; insw", "={di},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i32 %9, i8* %7, i64 %8)
%11 = extractvalue { i8*, i64 } %10, 0
%12 = extractvalue { i8*, i64 } %10, 1
store i8* %11, i8** %5
store i64 %12, i64* %6
ret void
}

LLVM IR (-O2):
define void @insw(i32 %0, i8* %1, i64 %2) {
%4 = tail call { i8*, i64 } asm sideeffect "rep; insw", "={di},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i32 %0, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free_memory();
void md_finalize() { free_memory(); }


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

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

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

LLVM IR (-O2):
define void @md_finalize() {
%1 = tail call i32 (...) @free_memory()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
scalar_t__ pthread_mutex_lock(int /*<<< orphan*/ *);
void std_pthread_mutex_lock(pthread_mutex_t *mutex) {
  if (pthread_mutex_lock(mutex) != 0) {
    perror("pthread_mutex_lock");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<std_pthread_mutex_lock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <pthread_mutex_lock@plt>
cmp    $0x0,%rax
je     1165 <std_pthread_mutex_lock+0x35>
lea    0xeaa(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<std_pthread_mutex_lock>:
push   %rax
call   1050 <pthread_mutex_lock@plt>
test   %rax,%rax
jne    113d <std_pthread_mutex_lock+0xd>
pop    %rax
ret
lea    0xebc(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"pthread_mutex_lock\00"
define void @std_pthread_mutex_lock(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i64 @pthread_mutex_lock(i32* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = call i32 @perror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"pthread_mutex_lock\00"
define void @std_pthread_mutex_lock(i32* %0) {
%2 = tail call i64 @pthread_mutex_lock(i32* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
long ftell(int /*<<< orphan*/ *);
size_t kjg_geno_IO_num_snp(FILE *stream, size_t n) {
  fseek(stream, 0, SEEK_END);
  long int l = ftell(stream);
  fseek(stream, 0, 0);
  return (l / (n + 1));
}


x86 assembly (clang, -O0):
<kjg_geno_IO_num_snp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ead(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1040 <fseek@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
add    $0x1,%rcx
xor    %edx,%edx
div    %rcx
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kjg_geno_IO_num_snp>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%rbx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %rbx,%rdi
call   1030 <ftell@plt>
mov    %rax,%r14
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1040 <fseek@plt>
add    $0x1,%r15
mov    %r14,%rax
or     %r15,%rax
shr    $0x20,%rax
je     116c <kjg_geno_IO_num_snp+0x4c>
mov    %r14,%rax
xor    %edx,%edx
div    %r15
jmp    1174 <kjg_geno_IO_num_snp+0x54>
mov    %r14d,%eax
xor    %edx,%edx
div    %r15d
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
define i64 @kjg_geno_IO_num_snp(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
%6 = load i32*, i32** %3
%7 = load i32, i32* @SEEK_END
%8 = call i32 @fseek(i32* %6, i32 0, i32 %7)
%9 = load i32*, i32** %3
%10 = call i64 @ftell(i32* %9)
store i64 %10, i64* %5
%11 = load i32*, i32** %3
%12 = call i32 @fseek(i32* %11, i32 0, i32 0)
%13 = load i64, i64* %5
%14 = load i64, i64* %4
%15 = add i64 %14, 1
%16 = udiv i64 %13, %15
ret i64 %16
}

LLVM IR (-O2):
@SEEK_END = global i32 0
define i64 @kjg_geno_IO_num_snp(i32* nocapture %0, i64 %1) {
%3 = load i32, i32* @SEEK_END
%4 = tail call i32 @fseek(i32* %0, i32 0, i32 %3)
%5 = tail call i64 @ftell(i32* %0)
%6 = tail call i32 @fseek(i32* %0, i32 0, i32 0)
%7 = add i64 %1, 1
%8 = udiv i64 %5, %7
ret i64 %8
}
void ConsoleFlush() {}


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

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

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

LLVM IR (-O2):
define void @ConsoleFlush() {
ret void
}
void gdk_get_show_events() {}


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

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

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

LLVM IR (-O2):
define void @gdk_get_show_events() {
ret void
}
int check_end_with_semicolon_and_remove_it(char *pntword) {
  while (*pntword != '\0') {
    if (*pntword == ';') {
      *pntword = '\0';
      return 1;
      break;
    }
    pntword++;
    return 0;
  }
}


x86 assembly (clang, -O0):
<check_end_with_semicolon_and_remove_it>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114e <check_end_with_semicolon_and_remove_it+0x4e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3b,%eax
jne    113b <check_end_with_semicolon_and_remove_it+0x3b>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    114e <check_end_with_semicolon_and_remove_it+0x4e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_end_with_semicolon_and_remove_it>:
xor    %eax,%eax
cmpb   $0x3b,(%rdi)
jne    110f <check_end_with_semicolon_and_remove_it+0xf>
movb   $0x0,(%rdi)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @check_end_with_semicolon_and_remove_it(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 59
br i1 %3, label %4, label %5
4: ; preds = %1
store i8 0, i8* %0
br label %5
5: ; preds = %1, %4
%6 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %6
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ min_height;
};
typedef TYPE_1__ XIconSize;

/* Variables and functions */
int get_XIconSize_min_height(void *_p) {
  return (int)((XIconSize *)_p)->min_height;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XIconSize_min_height(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XIconSize_min_height(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
char const *bprintf(char *, float);
int pscanf(char *, char *, long *);
const char *ram_total(void) {
  long total;
  return (pscanf("/proc/meminfo", "MemTotal: %ld kB\n", &total) == 1)
             ? bprintf("%f", (float)total / 1024 / 1024)
             : NULL;
}


x86 assembly (clang, -O0):
<ram_total>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed5(%rip),%rdi
lea    0xedc(%rip),%rsi
lea    -0x8(%rbp),%rdx
call   1040 <pscanf@plt>
cmp    $0x1,%eax
jne    117b <ram_total+0x5b>
cvtsi2ssq -0x8(%rbp),%xmm0
movss  0xeaa(%rip),%xmm1
divss  %xmm1,%xmm0
movss  0xe9e(%rip),%xmm1
divss  %xmm1,%xmm0
lea    0xeb7(%rip),%rdi
call   1030 <bprintf@plt>
mov    %rax,-0x10(%rbp)
jmp    1186 <ram_total+0x66>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    1186 <ram_total+0x66>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ram_total>:
push   %rax
lea    0xedc(%rip),%rdi
lea    0xee3(%rip),%rsi
mov    %rsp,%rdx
call   1040 <pscanf@plt>
cmp    $0x1,%eax
jne    1160 <ram_total+0x40>
cvtsi2ssq (%rsp),%xmm0
movss  0xeb6(%rip),%xmm1
mulss  %xmm1,%xmm0
mulss  %xmm1,%xmm0
lea    0xecb(%rip),%rdi
call   1030 <bprintf@plt>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"/proc/meminfo\00"
@.str.1 = [18 x i8] c"MemTotal: %ld kB\0A\00"
@.str.2 = [3 x i8] c"%f\00"
define i8* @ram_total() {
%1 = alloca i64
%2 = call i32 @pscanf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i64* %1)
%3 = icmp eq i32 %2, 1
br i1 %3, label %4, label %10
4: ; preds = %0
%5 = load i64, i64* %1
%6 = sitofp i64 %5 to float
%7 = fdiv float %6, 1.024000e+03
%8 = fdiv float %7, 1.024000e+03
%9 = call i8* @bprintf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float %8)
br label %11
10: ; preds = %0
br label %11
11: ; preds = %10, %4
%12 = phi i8* [ %9, %4 ], [ null, %10 ]
ret i8* %12
}

LLVM IR (-O2):
@.str = [14 x i8] c"/proc/meminfo\00"
@.str.1 = [18 x i8] c"MemTotal: %ld kB\0A\00"
@.str.2 = [3 x i8] c"%f\00"
define i8* @ram_total() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32 @pscanf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i64* %1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %11
5: ; preds = %0
%6 = load i64, i64* %1
%7 = sitofp i64 %6 to float
%8 = fmul float %7, 0x3F50000000000000
%9 = fmul float %8, 0x3F50000000000000
%10 = call i8* @bprintf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float %9)
br label %11
11: ; preds = %0, %5
%12 = phi i8* [ %10, %5 ], [ null, %0 ]
ret i8* %12
}
/* Variables and functions */
scalar_t__ getfloat(double *);
int /*<<< orphan*/ printf(char *, double);
int main(int arg, char *argv[]) {
  double d;
  if (getfloat(&d)) {
    printf("%f\n", d);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
call   1040 <getfloat@plt>
cmp    $0x0,%rax
je     115a <main+0x3a>
movsd  -0x18(%rbp),%xmm0
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rdi
call   1040 <getfloat@plt>
test   %rax,%rax
je     113f <main+0x1f>
movsd  (%rsp),%xmm0
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca double
%4 = bitcast double* %3 to i8*
%5 = call i64 @getfloat(double* %3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load double, double* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %8)
br label %10
10: ; preds = %7, %2
ret i32 0
}
/* Variables and functions */
char *base64_decode(char *, size_t *);
int /*<<< orphan*/ free(char *);
size_t unicode_string_length_utf16be(char *, size_t);
size_t unicode_get_string_length_of_base64(char *string) {
  size_t data_length, ret;
  char *data;
  data = base64_decode(string, &data_length);
  ret = unicode_string_length_utf16be((char *)data, data_length);
  free(data);
  return ret;
}


x86 assembly (clang, -O0):
<unicode_get_string_length_of_base64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <base64_decode@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <unicode_string_length_utf16be@plt>
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unicode_get_string_length_of_base64>:
push   %r14
push   %rbx
push   %rax
mov    %rsp,%rsi
call   1050 <base64_decode@plt>
mov    %rax,%rbx
mov    (%rsp),%rsi
mov    %rax,%rdi
call   1040 <unicode_string_length_utf16be@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @unicode_get_string_length_of_base64(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = call i8* @base64_decode(i8* %6, i64* %3)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = load i64, i64* %3
%10 = call i64 @unicode_string_length_utf16be(i8* %8, i64 %9)
store i64 %10, i64* %4
%11 = load i8*, i8** %5
%12 = call i32 @free(i8* %11)
%13 = load i64, i64* %4
ret i64 %13
}

LLVM IR (-O2):
define i64 @unicode_get_string_length_of_base64(i8* %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = call i8* @base64_decode(i8* %0, i64* %2)
%5 = load i64, i64* %2
%6 = call i64 @unicode_string_length_utf16be(i8* %4, i64 %5)
%7 = call i32 @free(i8* %4)
ret i64 %6
}
/* Type definitions */
struct pscmGfx {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pscmBox(struct pscmGfx *, int, int, int, int, int);
void pscmDot(struct pscmGfx *pscm, int x, int y, int color) {
  pscmBox(pscm, x, y, 1, 1, color);
}


x86 assembly (clang, -O0):
<pscmDot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%r9d
mov    $0x1,%r8d
mov    %r8d,%ecx
call   1030 <pscmBox@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pscmDot>:
mov    %ecx,%r9d
mov    $0x1,%ecx
mov    $0x1,%r8d
jmp    1030 <pscmBox@plt>

LLVM IR (-O0):
%struct.pscmGfx = type { i32 }
define void @pscmDot(%struct.pscmGfx* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca %struct.pscmGfx*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store %struct.pscmGfx* %0, %struct.pscmGfx** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load %struct.pscmGfx*, %struct.pscmGfx** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @pscmBox(%struct.pscmGfx* %9, i32 %10, i32 %11, i32 1, i32 1, i32 %12)
ret void
}

LLVM IR (-O2):
%struct.pscmGfx = type { i32 }
define void @pscmDot(%struct.pscmGfx* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @pscmBox(%struct.pscmGfx* %0, i32 %1, i32 %2, i32 1, i32 1, i32 %3)
ret void
}
double determinant2x2(double a11, double a12, double a21, double a22) {
  double determ = 0.0;
  determ = a11 * a22 - a12 * a21;
  return determ;
}


x86 assembly (clang, -O0):
<determinant2x2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<determinant2x2>:
mulsd  %xmm2,%xmm1
mulsd  %xmm3,%xmm0
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @determinant2x2(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
store double 0.000000e+00, double* %9
%10 = load double, double* %5
%11 = load double, double* %8
%12 = load double, double* %6
%13 = load double, double* %7
%14 = fmul double %12, %13
%15 = fneg double %14
%16 = call double @llvm.fmuladd.f64(double %10, double %11, double %15)
store double %16, double* %9
%17 = load double, double* %9
ret double %17
}

LLVM IR (-O2):
define double @determinant2x2(double %0, double %1, double %2, double %3) {
%5 = fneg double %1
%6 = fmul double %5, %2
%7 = tail call double @llvm.fmuladd.f64(double %0, double %3, double %6)
ret double %7
}
/* Type definitions */
struct comp {
  int dummy;
};
struct BrzAdapt_ {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SEND_ACKDOWN_DELAYED(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ SEND_DATAOFF_DELAYED(int /*<<< orphan*/, int);
void BrzAdapt_ackdown(struct comp *comp, int port) {
  struct BrzAdapt_ *c = (struct BrzAdapt_ *)comp;
  SEND_ACKDOWN_DELAYED(0, 0);
  SEND_DATAOFF_DELAYED(0, 1);
}


x86 assembly (clang, -O0):
<BrzAdapt_ackdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
xor    %esi,%esi
mov    %esi,%edi
call   1030 <SEND_ACKDOWN_DELAYED@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <SEND_DATAOFF_DELAYED@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BrzAdapt_ackdown>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1030 <SEND_ACKDOWN_DELAYED@plt>
xor    %edi,%edi
mov    $0x1,%esi
pop    %rax
jmp    1040 <SEND_DATAOFF_DELAYED@plt>

LLVM IR (-O0):
%struct.comp = type { i32 }
%struct.BrzAdapt_ = type { i32 }
define void @BrzAdapt_ackdown(%struct.comp* %0, i32 %1) {
%3 = alloca %struct.comp*
%4 = alloca i32
%5 = alloca %struct.BrzAdapt_*
store %struct.comp* %0, %struct.comp** %3
store i32 %1, i32* %4
%6 = load %struct.comp*, %struct.comp** %3
%7 = bitcast %struct.comp* %6 to %struct.BrzAdapt_*
store %struct.BrzAdapt_* %7, %struct.BrzAdapt_** %5
%8 = call i32 @SEND_ACKDOWN_DELAYED(i32 0, i32 0)
%9 = call i32 @SEND_DATAOFF_DELAYED(i32 0, i32 1)
ret void
}

LLVM IR (-O2):
%struct.comp = type { i32 }
define void @BrzAdapt_ackdown(%struct.comp* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @SEND_ACKDOWN_DELAYED(i32 0, i32 0)
%4 = tail call i32 @SEND_DATAOFF_DELAYED(i32 0, i32 1)
ret void
}
unsigned long convert_to_32(unsigned char str[4]) {
  unsigned long R = 0x00000000;
  return R;
}


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

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

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

LLVM IR (-O2):
define i64 @convert_to_32(i8* nocapture readnone %0) {
ret i64 0
}
int msm_hsusb_reset_rework_installed(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @msm_hsusb_reset_rework_installed() {
ret i32 0
}
char x(char a, char b) { return a + b; }


x86 assembly (clang, -O0):
<x>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
add    %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<x>:
lea    (%rsi,%rdi,1),%eax
ret

LLVM IR (-O0):
define signext i8 @x(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = add nsw i32 %6, %8
%10 = trunc i32 %9 to i8
ret i8 %10
}

LLVM IR (-O2):
define signext i8 @x(i8 signext %0, i8 signext %1) {
%3 = add i8 %1, %0
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void login_success(void) { exit(0); }


x86 assembly (clang, -O0):
<login_success>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<login_success>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @login_success() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @login_success() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct st_root {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ is_msb_free(struct st_root const *const);
int st_is_empty(const struct st_root *const root) {
  if (!is_msb_free(root))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<st_is_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <is_msb_free@plt>
cmp    $0x0,%eax
jne    113a <st_is_empty+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    1141 <st_is_empty+0x31>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.st_root = type { i32 }
define i32 @st_is_empty(%struct.st_root* %0) {
%2 = tail call i32 @is_msb_free(%struct.st_root* %0)
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
assert(int cond) {
  if (!cond)
    abort();
}


x86 assembly (clang, -O0):
<assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    112c <assert+0x1c>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert>:
test   %edi,%edi
je     1115 <assert+0x5>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @assert(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %1
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @assert(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
ret i32 undef
}
/* Variables and functions */
int core1_swap(char *, int);
int U_EMRPOLYLINE_swap(char *record, int torev) {
  return (core1_swap(record, torev));
}


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

x86 assembly (clang, -O2):
<U_EMRPOLYLINE_swap>:
jmp    1030 <core1_swap@plt>

LLVM IR (-O0):
define i32 @U_EMRPOLYLINE_swap(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 = call i32 @core1_swap(i8* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @U_EMRPOLYLINE_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core1_swap(i8* %0, i32 %1)
ret i32 %3
}
int test_imm_01uint16_mem(unsigned short *val) {
  return ((*val) & (-0x01 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_01uint16_mem>:
cmpw   $0x0,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_01uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
long syscall4(long num, long arg1, long arg2, long arg3, long arg4) {
  long result;
  asm volatile("syscall"
               : "=a"(result)
               : "a"(num), "D"(arg1), "S"(arg2), "d"(arg3), "g"(arg4)
               : "rcx", "r11");
  return result;
}


x86 assembly (clang, -O0):
<syscall4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    %rcx,-0x38(%rbp)
syscall
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscall4>:
mov    %rdi,%rax
mov    %r8,-0x8(%rsp)
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
syscall
ret

LLVM IR (-O0):
define i64 @syscall4(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
store i64 %0, i64* %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%12 = load i64, i64* %6
%13 = load i64, i64* %7
%14 = load i64, i64* %8
%15 = load i64, i64* %9
%16 = load i64, i64* %10
%17 = call i64 asm sideeffect "syscall", "={ax},{ax},{di},{si},{dx},imr,~{rcx},~{r11},~{dirflag},~{fpsr},~{flags}"(i64 %12, i64 %13, i64 %14, i64 %15, i64 %16)
store i64 %17, i64* %11
%18 = load i64, i64* %11
ret i64 %18
}

LLVM IR (-O2):
define i64 @syscall4(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = tail call i64 asm sideeffect "syscall", "={ax},{ax},{di},{si},{dx},imr,~{rcx},~{r11},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4)
ret i64 %6
}
void eat(name, num) const char *const name;
const int num;
{ eats(name, num, (char *)((void *)0), -1); }


x86 assembly (clang, -O0):
<eat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
xor    %eax,%eax
mov    %eax,%edx
mov    $0xffffffff,%ecx
mov    $0x0,%al
call   1030 <eats@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eat>:
xor    %edx,%edx
mov    $0xffffffff,%ecx
xor    %eax,%eax
jmp    1030 <eats@plt>

LLVM IR (-O0):
define void @eat(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 = call i32 (i8*, i32, i8*, i32, ...) bitcast (i32 (...)* @eats to i32 (i8*, i32, i8*, i32, ...)*)(i8* %5, i32 %6, i8* null, i32 -1)
ret void
}

LLVM IR (-O2):
define void @eat(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, i32, i8*, i32, ...) bitcast (i32 (...)* @eats to i32 (i8*, i32, i8*, i32, ...)*)(i8* %0, i32 %1, i8* null, i32 -1)
ret void
}
/* Variables and functions */
scalar_t__ getpid();
int hmmgetseed(void) { return ((int)getpid()); }


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

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

LLVM IR (-O0):
define i32 @hmmgetseed() {
%1 = call i64 (...) @getpid()
%2 = trunc i64 %1 to i32
ret i32 %2
}

LLVM IR (-O2):
define i32 @hmmgetseed() {
%1 = tail call i64 (...) @getpid()
%2 = trunc i64 %1 to i32
ret i32 %2
}
void qsim_bin_out(char i) {
  asm("cpuid;" : : "a"((0xff & i) | 0xc5b10000) : "%ebx", "%edx", "%ecx");
}


x86 assembly (clang, -O0):
<qsim_bin_out>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %dil,%al
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
and    $0xff,%eax
or     $0xc5b10000,%eax
cpuid
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<qsim_bin_out>:
push   %rbx
movzbl %dil,%eax
or     $0xc5b10000,%eax
cpuid
pop    %rbx
ret

LLVM IR (-O0):
define void @qsim_bin_out(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 255, %4
%6 = or i32 %5, -978255872
ret void
}

LLVM IR (-O2):
define void @qsim_bin_out(i8 signext %0) {
%2 = zext i8 %0 to i32
%3 = or i32 %2, -978255872
tail call void asm sideeffect "cpuid;", "{ax},~{ebx},~{edx},~{ecx},~{dirflag},~{fpsr},~{flags}"(i32 %3)
ret void
}
/* Variables and functions */
scalar_t__ strcasecmp(char const *, char const *);
int acase_gt(const char *pat, const char *text) {
  return (strcasecmp(text, pat) > 0);
}


x86 assembly (clang, -O0):
<acase_gt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acase_gt>:
push   %rax
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
call   1030 <strcasecmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
setg   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @acase_gt(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strcasecmp(i8* %1, i8* %0)
%4 = icmp sgt i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ send_ctrl_cmd(int);
void lcm_suspend(void) { send_ctrl_cmd(0x28); }


x86 assembly (clang, -O0):
<lcm_suspend>:
push   %rbp
mov    %rsp,%rbp
mov    $0x28,%edi
call   1030 <send_ctrl_cmd@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcm_suspend>:
mov    $0x28,%edi
jmp    1030 <send_ctrl_cmd@plt>

LLVM IR (-O0):
define void @lcm_suspend() {
%1 = call i32 @send_ctrl_cmd(i32 40)
ret void
}

LLVM IR (-O2):
define void @lcm_suspend() {
%1 = tail call i32 @send_ctrl_cmd(i32 40)
ret void
}
/* Variables and functions */
unsigned int phy_read(unsigned char *, unsigned int, int);
int /*<<< orphan*/ phy_write(unsigned char *, unsigned int, int, unsigned int);
unsigned int phy_read_ext(unsigned char *mdio, unsigned int phyad,
                          unsigned int reg) {
  phy_write(mdio, phyad, 0x0B, reg);
  return phy_read(mdio, phyad, 0x0D);
}


x86 assembly (clang, -O0):
<phy_read_ext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%ecx
mov    $0xb,%edx
call   1030 <phy_write@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0xd,%edx
call   1040 <phy_read@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<phy_read_ext>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ecx
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0xb,%edx
call   1030 <phy_write@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0xd,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <phy_read@plt>

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

LLVM IR (-O2):
define i32 @phy_read_ext(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @phy_write(i8* %0, i32 %1, i32 11, i32 %2)
%5 = tail call i32 @phy_read(i8* %0, i32 %1, i32 13)
ret i32 %5
}
int foo5() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @foo5() {
ret i32 1
}
void foo143() {}


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

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

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

LLVM IR (-O2):
define void @foo143() {
ret void
}
void gdk_event_get_axis() {}


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

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

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

LLVM IR (-O2):
define void @gdk_event_get_axis() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("usage:\n");
  printf("    copycat src_file dst_file\n");
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"usage:\0A\00"
@.str.1 = [31 x i8] c" copycat src_file dst_file\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [7 x i8] c"usage:\00"
@str.2 = [30 x i8] c" copycat src_file dst_file\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}