xunge/DecIR huggingface dataset:
/* Variables and functions */
int abs(int);
int h_leapyear(int year) {
  if (abs(((11 * year) + 14) % 30) < 11)
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<h_leapyear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
imul   $0xb,-0x8(%rbp),%eax
add    $0xe,%eax
mov    $0x1e,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
call   1030 <abs@plt>
cmp    $0xb,%eax
jge    1146 <h_leapyear+0x36>
movl   $0x1,-0x4(%rbp)
jmp    114d <h_leapyear+0x3d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h_leapyear>:
lea    (%rdi,%rdi,4),%eax
lea    (%rdi,%rax,2),%ecx
lea    (%rdi,%rax,2),%eax
add    $0xe,%eax
cltq
imul   $0xffffffff88888889,%rax,%rdx
shr    $0x20,%rdx
add    %edx,%ecx
add    $0xe,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x4,%ecx
add    %edx,%ecx
mov    %ecx,%edx
shl    $0x5,%edx
mov    %ecx,%esi
sub    %edx,%esi
add    %ecx,%esi
add    %esi,%eax
mov    %eax,%ecx
neg    %ecx
cmovs  %eax,%ecx
xor    %eax,%eax
cmp    $0xb,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @h_leapyear(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = mul nsw i32 11, %4
%6 = add nsw i32 %5, 14
%7 = srem i32 %6, 30
%8 = call i32 @abs(i32 %7)
%9 = icmp slt i32 %8, 11
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 1, i32* %2
br label %12
11: ; preds = %1
store i32 0, i32* %2
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @h_leapyear(i32 %0) {
%2 = mul nsw i32 %0, 11
%3 = add nsw i32 %2, 14
%4 = srem i32 %3, 30
%5 = tail call i32 @llvm.abs.i32(i32 %4, i1 true)
%6 = icmp ult i32 %5, 11
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
scalar_t__ isalpha(int);
scalar_t__ isdigit(int);
int ispermitedchar(int c) { return isalpha(c) || isdigit(c) || c == '_'; }


x86 assembly (clang, -O0):
<ispermitedchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <isalpha@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1169 <ispermitedchar+0x49>
mov    -0x4(%rbp),%edi
call   1030 <isdigit@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1169 <ispermitedchar+0x49>
cmpl   $0x5f,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ispermitedchar>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1040 <isalpha@plt>
mov    $0x1,%ebx
test   %rax,%rax
jne    1148 <ispermitedchar+0x28>
mov    %ebp,%edi
call   1030 <isdigit@plt>
test   %rax,%rax
jne    1148 <ispermitedchar+0x28>
xor    %ebx,%ebx
cmp    $0x5f,%ebp
sete   %bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ispermitedchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isalpha(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i64 @isdigit(i32 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 95
br label %13
13: ; preds = %10, %6, %1
%14 = phi i1 [ true, %6 ], [ true, %1 ], [ %12, %10 ]
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @ispermitedchar(i32 %0) {
%2 = tail call i64 @isalpha(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = tail call i64 @isdigit(i32 %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = icmp eq i32 %0, 95
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %7, %4, %1
%11 = phi i32 [ 1, %4 ], [ 1, %1 ], [ %9, %7 ]
ret i32 %11
}
/* Type definitions */
struct _PDCLIB_file_t {
  int dummy;
};

/* Variables and functions */
int fputc(int, struct _PDCLIB_file_t *);
int putc(int c, struct _PDCLIB_file_t *stream) { return fputc(c, stream); }


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

x86 assembly (clang, -O2):
<putc>:
jmp    1030 <fputc@plt>

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

LLVM IR (-O2):
%struct._PDCLIB_file_t = type { i32 }
define i32 @putc(i32 %0, %struct._PDCLIB_file_t* nocapture %1) {
%3 = tail call i32 @fputc(i32 %0, %struct._PDCLIB_file_t* %1)
ret i32 %3
}
/* Type definitions */
struct gbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gbuf_add_buf(struct gbuf *, char const *,
                                int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
void gbuf_add_str(struct gbuf *buf, const char *str) {
  gbuf_add_buf(buf, str, strlen(str));
}


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

x86 assembly (clang, -O2):
<gbuf_add_str>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <gbuf_add_buf@plt>

LLVM IR (-O0):
%struct.gbuf = type { i32 }
define void @gbuf_add_str(%struct.gbuf* %0, i8* %1) {
%3 = alloca %struct.gbuf*
%4 = alloca i8*
store %struct.gbuf* %0, %struct.gbuf** %3
store i8* %1, i8** %4
%5 = load %struct.gbuf*, %struct.gbuf** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @gbuf_add_buf(%struct.gbuf* %5, i8* %6, i32 %8)
ret void
}

LLVM IR (-O2):
%struct.gbuf = type { i32 }
define void @gbuf_add_str(%struct.gbuf* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @gbuf_add_buf(%struct.gbuf* %0, i8* %1, i32 %3)
ret void
}
int test_imm_D6uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0xD6 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_D6uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 919123001344
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
long double atanl(long double x) {
  long double res = 0.0L;
  asm("fld1\n\t"
      "fpatan"
      : "=t"(res)
      : "0"(x));
  return res;
}


x86 assembly (clang, -O0):
<atanl>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldz
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fld1
fpatan
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<atanl>:
fldt   0x8(%rsp)
fld1
fpatan
ret

LLVM IR (-O0):
define x86_fp80 @atanl(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
store x86_fp80 0xK00000000000000000000, x86_fp80* %3
%4 = load x86_fp80, x86_fp80* %2
%5 = call x86_fp80 asm "fld1\0A\09fpatan", "={st},0,~{dirflag},~{fpsr},~{flags}"(x86_fp80 %4)
store x86_fp80 %5, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %3
ret x86_fp80 %6
}

LLVM IR (-O2):
define x86_fp80 @atanl(x86_fp80 %0) {
%2 = tail call x86_fp80 asm "fld1\0A\09fpatan", "={st},0,~{dirflag},~{fpsr},~{flags}"(x86_fp80 %0)
ret x86_fp80 %2
}
/* Type definitions */
struct buffer_t {
  int dummy;
};

/* Variables and functions */
scalar_t__ tunnel_read(struct buffer_t *, int);
short tunnel_write(struct buffer_t *, int);
short tunnel_tx(struct buffer_t *b, int rfd, int wfd) {
  if (tunnel_read(b, rfd) == 0)
    return 0;
  return tunnel_write(b, wfd);
}


x86 assembly (clang, -O0):
<tunnel_tx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <tunnel_read@plt>
cmp    $0x0,%rax
jne    1153 <tunnel_tx+0x33>
movw   $0x0,-0x2(%rbp)
jmp    1163 <tunnel_tx+0x43>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%esi
call   1040 <tunnel_write@plt>
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tunnel_tx>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rdi,%rbx
call   1030 <tunnel_read@plt>
test   %rax,%rax
je     1142 <tunnel_tx+0x22>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <tunnel_write@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.buffer_t = type { i32 }
define signext i16 @tunnel_tx(%struct.buffer_t* %0, i32 %1, i32 %2) {
%4 = alloca i16
%5 = alloca %struct.buffer_t*
%6 = alloca i32
%7 = alloca i32
store %struct.buffer_t* %0, %struct.buffer_t** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load %struct.buffer_t*, %struct.buffer_t** %5
%9 = load i32, i32* %6
%10 = call i64 @tunnel_read(%struct.buffer_t* %8, i32 %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %3
store i16 0, i16* %4
br label %17
13: ; preds = %3
%14 = load %struct.buffer_t*, %struct.buffer_t** %5
%15 = load i32, i32* %7
%16 = call signext i16 @tunnel_write(%struct.buffer_t* %14, i32 %15)
store i16 %16, i16* %4
br label %17
17: ; preds = %13, %12
%18 = load i16, i16* %4
ret i16 %18
}

LLVM IR (-O2):
%struct.buffer_t = type { i32 }
define signext i16 @tunnel_tx(%struct.buffer_t* %0, i32 %1, i32 %2) {
%4 = tail call i64 @tunnel_read(%struct.buffer_t* %0, i32 %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call signext i16 @tunnel_write(%struct.buffer_t* %0, i32 %2)
br label %8
8: ; preds = %3, %6
%9 = phi i16 [ %7, %6 ], [ 0, %3 ]
ret i16 %9
}
unsigned farpeekl(unsigned sel, void *off) {
  unsigned ret;
  __asm__ __volatile__("push %%fs\n\t"
                       "mov  %1, %%fs\n\t"
                       "mov  %%fs:(%2), %0\n\t"
                       "pop  %%fs"
                       : "=r"(ret)
                       : "g"(sel), "r"(off));
  return ret;
}


x86 assembly (clang, -O0):
<farpeekl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,-0x18(%rbp)
push   %fs
mov    -0x18(%rbp),%fs
mov    %fs:(%rax),%eax
pop    %fs
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<farpeekl>:
mov    %edi,-0x4(%rsp)
push   %fs
mov    -0x4(%rsp),%fs
mov    %fs:(%rsi),%eax
pop    %fs
ret

LLVM IR (-O0):
define i32 @farpeekl(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = load i8*, i8** %4
%8 = call i32 asm sideeffect "push %fs\0A\09mov $1, %fs\0A\09mov %fs:($2), $0\0A\09pop %fs", "=r,imr,r,~{dirflag},~{fpsr},~{flags}"(i32 %6, i8* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @farpeekl(i32 %0, i8* %1) {
%3 = tail call i32 asm sideeffect "push %fs\0A\09mov $1, %fs\0A\09mov %fs:($2), $0\0A\09pop %fs", "=r,imr,r,~{dirflag},~{fpsr},~{flags}"(i32 %0, i8* %1)
ret i32 %3
}
int ansikopen() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ansikopen() {
ret i32 0
}
void pinctrl_dt_free_maps(struct pinctrl *p) {}


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

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

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

LLVM IR (-O2):
%struct.pinctrl = type opaque
define void @pinctrl_dt_free_maps(%struct.pinctrl* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free_unlocked(void *);
void free(void *ptr) {
  ;
  free_unlocked(ptr);
  ;
}


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

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

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

LLVM IR (-O2):
define void @free(i8* %0) {
%2 = tail call i32 @free_unlocked(i8* %0)
ret void
}
void toLower(char *c) { *c |= 0x20; }


x86 assembly (clang, -O0):
<toLower>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
or     $0x20,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<toLower>:
orb    $0x20,(%rdi)
ret

LLVM IR (-O0):
define void @toLower(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = or i32 %5, 32
%7 = trunc i32 %6 to i8
store i8 %7, i8* %3
ret void
}

LLVM IR (-O2):
define void @toLower(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = or i8 %2, 32
store i8 %3, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ *strncat(char *, char const *, size_t);
int os_strncat(char *strDest, size_t numberOfElements, const char *strSource,
               size_t count) {
  if (strncat(strDest, strSource, count) == NULL) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<os_strncat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1030 <strncat@plt>
cmp    $0x0,%rax
jne    114f <os_strncat+0x3f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1156 <os_strncat+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_strncat>:
push   %rax
mov    %rdx,%rsi
mov    %rcx,%rdx
call   1030 <strncat@plt>
cmp    $0x1,%rax
sbb    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @os_strncat(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = tail call i32* @strncat(i8* %0, i8* %2, i64 %3)
%6 = icmp eq i32* %5, null
%7 = sext i1 %6 to i32
ret i32 %7
}
unsigned long bitop_fmsb(unsigned long val) {
  return sizeof(val) * 8 - 1 - __builtin_clzl(val);
}


x86 assembly (clang, -O0):
<bitop_fmsb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
bsr    %rax,%rax
xor    $0x3f,%rax
movslq %eax,%rcx
mov    $0x3f,%eax
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitop_fmsb>:
bsr    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @bitop_fmsb(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @llvm.ctlz.i64(i64 %3, i1 true)
%5 = trunc i64 %4 to i32
%6 = sext i32 %5 to i64
%7 = sub i64 63, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @bitop_fmsb(i64 %0) {
%2 = tail call i64 @llvm.ctlz.i64(i64 %0, i1 true)
%3 = xor i64 %2, 63
ret i64 %3
}
/* Variables and functions */
float __nv_normf(int, float const *);
float normf(int __dim, const float *__t) { return __nv_normf(__dim, __t); }


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

x86 assembly (clang, -O2):
<normf>:
jmp    1030 <__nv_normf@plt>

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

LLVM IR (-O2):
define float @normf(i32 %0, float* %1) {
%3 = tail call float @__nv_normf(i32 %0, float* %1)
ret float %3
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ fread(int *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
uint32_t read_uint8() {
  uint8_t byte[1] = {0x00};
  fread(byte, sizeof(uint8_t), 1, stdin);
  return byte[0];
}


x86 assembly (clang, -O0):
<read_uint8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
lea    -0x4(%rbp),%rdi
mov    0x2ea5(%rip),%rax
mov    (%rax),%ecx
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_uint8>:
push   %rax
movl   $0x0,0x4(%rsp)
mov    0x2ec8(%rip),%rax
mov    (%rax),%ecx
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdin = global i32 0
define i32 @read_uint8() {
%1 = alloca [1 x i32]
%2 = bitcast [1 x i32]* %1 to i8*
%3 = getelementptr inbounds [1 x i32], [1 x i32]* %1, i64 0, i64 0
%4 = load i32, i32* @stdin
%5 = call i32 @fread(i32* %3, i32 4, i32 1, i32 %4)
%6 = getelementptr inbounds [1 x i32], [1 x i32]* %1, i64 0, i64 0
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @read_uint8() {
%1 = alloca [1 x i32]
%2 = bitcast [1 x i32]* %1 to i8*
%3 = getelementptr inbounds [1 x i32], [1 x i32]* %1, i64 0, i64 0
store i32 0, i32* %3
%4 = load i32, i32* @stdin
%5 = call i32 @fread(i32* %3, i32 4, i32 1, i32 %4)
%6 = load i32, i32* %3
ret i32 %6
}
/* Type definitions */
typedef scalar_t__ off_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ EOVERFLOW;
scalar_t__ LONG_MAX;
int /*<<< orphan*/ errno;
scalar_t__ ftello(int /*<<< orphan*/ *);
long ftell(FILE *stream) {
  off_t l;
  l = ftello(stream);
  if (l > LONG_MAX) {
    errno = EOVERFLOW;
    return -1;
  }
  return (long)l;
}


x86 assembly (clang, -O0):
<ftell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <ftello@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    0x2ea4(%rip),%rcx
cmp    (%rcx),%rax
jle    115c <ftell+0x4c>
mov    0x2eac(%rip),%rax
mov    (%rax),%ecx
mov    0x2e83(%rip),%rax
mov    %ecx,(%rax)
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    1164 <ftell+0x54>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftell>:
push   %rax
call   1030 <ftello@plt>
mov    0x2ebb(%rip),%rcx
cmp    (%rcx),%rax
jle    113b <ftell+0x2b>
mov    0x2ec7(%rip),%rax
mov    (%rax),%eax
mov    0x2e9e(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffffffffffff,%rax
pop    %rcx
ret

LLVM IR (-O0):
@LONG_MAX = global i64 0
@EOVERFLOW = global i32 0
@errno = global i32 0
define i64 @ftell(i32* %0) {
%2 = alloca i64
%3 = alloca i32*
%4 = alloca i64
store i32* %0, i32** %3
%5 = load i32*, i32** %3
%6 = call i64 @ftello(i32* %5)
store i64 %6, i64* %4
%7 = load i64, i64* %4
%8 = load i64, i64* @LONG_MAX
%9 = icmp sgt i64 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = load i32, i32* @EOVERFLOW
store i32 %11, i32* @errno
store i64 -1, i64* %2
br label %14
12: ; preds = %1
%13 = load i64, i64* %4
store i64 %13, i64* %2
br label %14
14: ; preds = %12, %10
%15 = load i64, i64* %2
ret i64 %15
}

LLVM IR (-O2):
@LONG_MAX = global i64 0
@EOVERFLOW = global i32 0
@errno = global i32 0
define i64 @ftell(i32* nocapture %0) {
%2 = tail call i64 @ftello(i32* %0)
%3 = load i64, i64* @LONG_MAX
%4 = icmp sgt i64 %2, %3
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i32, i32* @EOVERFLOW
store i32 %6, i32* @errno
br label %7
7: ; preds = %1, %5
%8 = phi i64 [ -1, %5 ], [ %2, %1 ]
ret i64 %8
}
int InRange(int n, int lo, int hi) {
  if (n >= lo && n <= hi)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<InRange>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     1131 <InRange+0x31>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1131 <InRange+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1138 <InRange+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<InRange>:
cmp    %esi,%edi
setge  %al
cmp    %edx,%edi
setle  %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @InRange(i32 %0, i32 %1, i32 %2) {
%4 = icmp sge i32 %0, %1
%5 = icmp sle i32 %0, %2
%6 = and i1 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
float glm_smooth(float);
__attribute((always_)) float glm_smoothinterp(float from, float to, float t) {
  return from + glm_smooth(t) * (to - from);
}


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

x86 assembly (clang, -O2):
<glm_smoothinterp>:
push   %rax
movss  %xmm1,0x4(%rsp)
movss  %xmm0,(%rsp)
movaps %xmm2,%xmm0
call   1030 <glm_smooth@plt>
movss  (%rsp),%xmm1
movss  0x4(%rsp),%xmm2
subss  %xmm1,%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @glm_smoothinterp(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 = call float @glm_smooth(float %8)
%10 = load float, float* %5
%11 = load float, float* %4
%12 = fsub float %10, %11
%13 = call float @llvm.fmuladd.f32(float %9, float %12, float %7)
ret float %13
}

LLVM IR (-O2):
define float @glm_smoothinterp(float %0, float %1, float %2) {
%4 = tail call float @glm_smooth(float %2)
%5 = fsub float %1, %0
%6 = tail call float @llvm.fmuladd.f32(float %4, float %5, float %0)
ret float %6
}
void Init_kryptprovideropenssl(void) {}


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

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

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

LLVM IR (-O2):
define void @Init_kryptprovideropenssl() {
ret void
}
/* Type definitions */
struct fb_var_screeninfo {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ FBIOPAN_DISPLAY;
scalar_t__ ioctl(int, int /*<<< orphan*/, struct fb_var_screeninfo *);
int /*<<< orphan*/ print_strerror_and_exit(char *);
void tfbm_pan_display(int fh, struct fb_var_screeninfo *var) {
  if (ioctl(fh, FBIOPAN_DISPLAY, var)) {
    print_strerror_and_exit("ioctl FBIOPAN_DISPLAY");
  }
}


x86 assembly (clang, -O0):
<tfbm_pan_display>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ea7(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
call   1040 <ioctl@plt>
cmp    $0x0,%rax
je     115a <tfbm_pan_display+0x3a>
lea    0xeab(%rip),%rdi
call   1030 <print_strerror_and_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tfbm_pan_display>:
push   %rax
mov    %rsi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
call   1040 <ioctl@plt>
test   %rax,%rax
je     1144 <tfbm_pan_display+0x24>
lea    0xec2(%rip),%rdi
pop    %rax
jmp    1030 <print_strerror_and_exit@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.fb_var_screeninfo = type { i32 }
@FBIOPAN_DISPLAY = global i32 0
@.str = [22 x i8] c"ioctl FBIOPAN_DISPLAY\00"
define void @tfbm_pan_display(i32 %0, %struct.fb_var_screeninfo* %1) {
%3 = alloca i32
%4 = alloca %struct.fb_var_screeninfo*
store i32 %0, i32* %3
store %struct.fb_var_screeninfo* %1, %struct.fb_var_screeninfo** %4
%5 = load i32, i32* %3
%6 = load i32, i32* @FBIOPAN_DISPLAY
%7 = load %struct.fb_var_screeninfo*, %struct.fb_var_screeninfo** %4
%8 = call i64 @ioctl(i32 %5, i32 %6, %struct.fb_var_screeninfo* %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @print_strerror_and_exit(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
%struct.fb_var_screeninfo = type { i32 }
@FBIOPAN_DISPLAY = global i32 0
@.str = [22 x i8] c"ioctl FBIOPAN_DISPLAY\00"
define void @tfbm_pan_display(i32 %0, %struct.fb_var_screeninfo* %1) {
%3 = load i32, i32* @FBIOPAN_DISPLAY
%4 = tail call i64 @ioctl(i32 %0, i32 %3, %struct.fb_var_screeninfo* %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @print_strerror_and_exit(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ __vpr_stat(char const *, int /*<<< orphan*/);
void __attribute__((weak)) vpr_stat(const char *fmt, va_list ap) {
  __vpr_stat(fmt, ap);
}


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

x86 assembly (clang, -O2):
<vpr_stat>:
jmp    1030 <__vpr_stat@plt>

LLVM IR (-O0):
define weak void @vpr_stat(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 @__vpr_stat(i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define weak void @vpr_stat(i8* %0, i32 %1) {
%3 = tail call i32 @__vpr_stat(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ a1_function();
void a2_function(void) { a1_function(); }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
char *emit_up_to(FILE *f, char *s, char *limit) {
  if (s < limit) {
    char saved = *limit;
    *limit = 0;
    fprintf(f, "@text %s\n", s);
    *limit = saved;
    return limit;
  } else {
    return s;
  }
}


x86 assembly (clang, -O0):
<emit_up_to>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    116c <emit_up_to+0x5c>
mov    -0x20(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x21(%rbp)
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xeaf(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x21(%rbp),%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1174 <emit_up_to+0x64>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_up_to>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%rdx
cmp    %rbx,%rsi
jae    1135 <emit_up_to+0x25>
mov    (%rbx),%bpl
movb   $0x0,(%rbx)
lea    0xed5(%rip),%rsi
call   1030 <fprintf@plt>
mov    %bpl,(%rbx)
jmp    1138 <emit_up_to+0x28>
mov    %rdx,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"@text %s\0A\00"
define i8* @emit_up_to(i32* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8
store i32* %0, i32** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%9 = load i8*, i8** %6
%10 = load i8*, i8** %7
%11 = icmp ult i8* %9, %10
br i1 %11, label %12, label %22
12: ; preds = %3
%13 = load i8*, i8** %7
%14 = load i8, i8* %13
store i8 %14, i8* %8
%15 = load i8*, i8** %7
store i8 0, i8* %15
%16 = load i32*, i32** %5
%17 = load i8*, i8** %6
%18 = call i32 @fprintf(i32* %16, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %17)
%19 = load i8, i8* %8
%20 = load i8*, i8** %7
store i8 %19, i8* %20
%21 = load i8*, i8** %7
store i8* %21, i8** %4
br label %24
22: ; preds = %3
%23 = load i8*, i8** %6
store i8* %23, i8** %4
br label %24
24: ; preds = %22, %12
%25 = load i8*, i8** %4
ret i8* %25
}

LLVM IR (-O2):
@.str = [10 x i8] c"@text %s\0A\00"
define i8* @emit_up_to(i32* nocapture %0, i8* %1, i8* %2) {
%4 = icmp ult i8* %1, %2
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = load i8, i8* %2
store i8 0, i8* %2
%7 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %1)
store i8 %6, i8* %2
br label %8
8: ; preds = %3, %5
%9 = phi i8* [ %2, %5 ], [ %1, %3 ]
ret i8* %9
}
double calculate_final_bill(double monthly_bill, double taxes) {
  double final_bill = monthly_bill + taxes;
  return final_bill;
}


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

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

LLVM IR (-O0):
define double @calculate_final_bill(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %4
%8 = fadd double %6, %7
store double %8, double* %5
%9 = load double, double* %5
ret double %9
}

LLVM IR (-O2):
define double @calculate_final_bill(double %0, double %1) {
%3 = fadd double %0, %1
ret double %3
}
/* Variables and functions */
int negamax(char *, int, int, int);
int get_move(char *node, int side) { return negamax(node, 9, side, 1); }


x86 assembly (clang, -O0):
<get_move>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    $0x9,%esi
mov    $0x1,%ecx
call   1030 <negamax@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_move>:
mov    %esi,%edx
mov    $0x9,%esi
mov    $0x1,%ecx
jmp    1030 <negamax@plt>

LLVM IR (-O0):
define i32 @get_move(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 @negamax(i8* %5, i32 9, i32 %6, i32 1)
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_move(i8* %0, i32 %1) {
%3 = tail call i32 @negamax(i8* %0, i32 9, i32 %1, i32 1)
ret i32 %3
}
extern void __outb(unsigned char value, unsigned short port) {
  __asm__ __volatile__("out"
                       "b"
                       " %"
                       "b"
                       "0,%"
                       "w"
                       "1"
                       :
                       : "a"(value), "d"(port));
}


x86 assembly (clang, -O0):
<__outb>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x1(%rbp),%al
mov    -0x4(%rbp),%dx
out    %al,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__outb>:
mov    %esi,%edx
mov    %edi,%eax
out    %al,(%dx)
ret

LLVM IR (-O0):
define void @__outb(i8 zeroext %0, i16 zeroext %1) {
%3 = alloca i8
%4 = alloca i16
store i8 %0, i8* %3
store i16 %1, i16* %4
%5 = load i8, i8* %3
%6 = load i16, i16* %4
ret void
}

LLVM IR (-O2):
define void @__outb(i8 zeroext %0, i16 zeroext %1) {
tail call void asm sideeffect "outb ${0:b},${1:w}", "{ax},{dx},~{dirflag},~{fpsr},~{flags}"(i8 %0, i16 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
double time_readlines();
int main() {
  printf("\nRuntime:\t%f sec", time_readlines());
  printf("\n\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <time_readlines@plt>
lea    0xece(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <time_readlines@plt>
lea    0xec1(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xec4(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"\0ARuntime:\09%f sec\00"
@.str.1 = [3 x i8] c"\0A\0A\00"
define i32 @main() {
%1 = call double (...) @time_readlines()
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), double %1)
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"\0ARuntime:\09%f sec\00"
@str = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = tail call double (...) @time_readlines()
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), double %1)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void arg_short3(short x, short y, short z) {}


x86 assembly (clang, -O0):
<arg_short3>:
push   %rbp
mov    %rsp,%rbp
mov    %dx,%ax
mov    %si,%cx
mov    %di,%dx
mov    %dx,-0x2(%rbp)
mov    %cx,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @arg_short3(i16 signext %0, i16 signext %1, i16 signext %2) {
%4 = alloca i16
%5 = alloca i16
%6 = alloca i16
store i16 %0, i16* %4
store i16 %1, i16* %5
store i16 %2, i16* %6
ret void
}

LLVM IR (-O2):
define void @arg_short3(i16 signext %0, i16 signext %1, i16 signext %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ExampleWithSema();
int main() {
  ExampleWithSema();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @ExampleWithSema()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ siginfo_t;

/* Variables and functions */
int /*<<< orphan*/ sig_action(int, int /*<<< orphan*/ *, void *, char *,
                              char *);
void sigabrt_action(int number, siginfo_t *info, void *data) {
  sig_action(number, info, data, "Abort", "Your application aborted.");
}


x86 assembly (clang, -O0):
<sigabrt_action>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xecb(%rip),%rcx
lea    0xeca(%rip),%r8
call   1030 <sig_action@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigabrt_action>:
lea    0xee9(%rip),%rcx
lea    0xee8(%rip),%r8
jmp    1030 <sig_action@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"Abort\00"
@.str.1 = [26 x i8] c"Your application aborted.\00"
define void @sigabrt_action(i32 %0, i32* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i8*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i32*, i32** %5
%9 = load i8*, i8** %6
%10 = call i32 @sig_action(i32 %7, i32* %8, i8* %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"Abort\00"
@.str.1 = [26 x i8] c"Your application aborted.\00"
define void @sigabrt_action(i32 %0, i32* %1, i8* %2) {
%4 = tail call i32 @sig_action(i32 %0, i32* %1, i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;
typedef int /*<<< orphan*/ p;

/* Variables and functions */
uint32_t compat_be32dec(const void *pp) {
  const uint8_t *p = (uint8_t const *)pp;
  return ((uint32_t)(p[3]) + ((uint32_t)(p[2]) << 8) +
          ((uint32_t)(p[1]) << 16) + ((uint32_t)(p[0]) << 24));
}


x86 assembly (clang, -O0):
<compat_be32dec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    -0x10(%rbp),%rcx
mov    0x10(%rcx),%rcx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    0x8(%rcx),%rcx
shl    $0x10,%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rcx
shl    $0x18,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compat_be32dec>:
mov    0x10(%rdi),%ecx
shl    $0x8,%ecx
add    0x18(%rdi),%ecx
mov    (%rdi),%eax
mov    0x8(%rdi),%edx
shl    $0x10,%edx
add    %ecx,%edx
shl    $0x18,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @compat_be32dec(i8* %0) {
%2 = alloca i8*
%3 = alloca i64*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i64*
store i64* %5, i64** %3
%6 = load i64*, i64** %3
%7 = getelementptr inbounds i64, i64* %6, i64 3
%8 = load i64, i64* %7
%9 = trunc i64 %8 to i32
%10 = load i64*, i64** %3
%11 = getelementptr inbounds i64, i64* %10, i64 2
%12 = load i64, i64* %11
%13 = trunc i64 %12 to i32
%14 = shl i32 %13, 8
%15 = add nsw i32 %9, %14
%16 = load i64*, i64** %3
%17 = getelementptr inbounds i64, i64* %16, i64 1
%18 = load i64, i64* %17
%19 = trunc i64 %18 to i32
%20 = shl i32 %19, 16
%21 = add nsw i32 %15, %20
%22 = load i64*, i64** %3
%23 = getelementptr inbounds i64, i64* %22, i64 0
%24 = load i64, i64* %23
%25 = trunc i64 %24 to i32
%26 = shl i32 %25, 24
%27 = add nsw i32 %21, %26
ret i32 %27
}

LLVM IR (-O2):
define i32 @compat_be32dec(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = getelementptr inbounds i8, i8* %0, i64 24
%4 = bitcast i8* %3 to i64*
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = getelementptr inbounds i8, i8* %0, i64 16
%8 = bitcast i8* %7 to i64*
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = shl i32 %10, 8
%12 = add nsw i32 %11, %6
%13 = getelementptr inbounds i8, i8* %0, i64 8
%14 = bitcast i8* %13 to i64*
%15 = load i64, i64* %14
%16 = trunc i64 %15 to i32
%17 = shl i32 %16, 16
%18 = add nsw i32 %12, %17
%19 = load i64, i64* %2
%20 = trunc i64 %19 to i32
%21 = shl i32 %20, 24
%22 = add nsw i32 %18, %21
ret i32 %22
}
int Hash(int ci, int size) { return ci % size; }


x86 assembly (clang, -O0):
<Hash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Hash>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @Hash(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 = srem i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @Hash(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
ret i32 %3
}
int test_imm_94uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x94 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_94uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 9699328
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int min(const int a, const int b) { return ((a) < (b) ? (a) : (b)); }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <min+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <min+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @min(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 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ log_entry(int /*<<< orphan*/, char *);
char *strdup(char const *);
char *xstrdup(const char *s) {
  char *const retval = strdup(s);
  if (!retval) {
    log_entry(errno, "string allocation failure");
    exit(1);
  }
  return (retval);
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1173 <xstrdup+0x43>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1030 <log_entry@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rax
call   1050 <strdup@plt>
test   %rax,%rax
je     113d <xstrdup+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <log_entry@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@errno = global i32 0
@.str = [26 x i8] c"string allocation failure\00"
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %12, label %8
8: ; preds = %1
%9 = load i32, i32* @errno
%10 = call i32 @log_entry(i32 %9, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@errno = global i32 0
@.str = [26 x i8] c"string allocation failure\00"
define noalias i8* @xstrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @errno
%6 = tail call i32 @log_entry(i32 %5, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ polyglot_array_typeid(int /*<<< orphan*/,
                                         int /*<<< orphan*/);
void *polyglot_as_typed(void *, int /*<<< orphan*/);
int /*<<< orphan*/ polyglot_boolean_typeid();
__attribute__((always_)) bool *polyglot_as_boolean_array(void *p) {
  void *ret =
      polyglot_as_typed(p, polyglot_array_typeid(polyglot_boolean_typeid(), 0));
  return (bool *)ret;
}


x86 assembly (clang, -O0):
<polyglot_as_boolean_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1040 <polyglot_boolean_typeid@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1050 <polyglot_array_typeid@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1030 <polyglot_as_typed@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<polyglot_as_boolean_array>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <polyglot_boolean_typeid@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1050 <polyglot_array_typeid@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <polyglot_as_typed@plt>

LLVM IR (-O0):
define i32* @polyglot_as_boolean_array(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 (...) @polyglot_boolean_typeid()
%6 = call i32 @polyglot_array_typeid(i32 %5, i32 0)
%7 = call i8* @polyglot_as_typed(i8* %4, i32 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to i32*
ret i32* %9
}

LLVM IR (-O2):
define i32* @polyglot_as_boolean_array(i8* %0) {
%2 = tail call i32 (...) @polyglot_boolean_typeid()
%3 = tail call i32 @polyglot_array_typeid(i32 %2, i32 0)
%4 = tail call i8* @polyglot_as_typed(i8* %0, i32 %3)
%5 = bitcast i8* %4 to i32*
ret i32* %5
}