xunge/DecIR huggingface dataset:
int test_imm_F7uint8_reg(unsigned char val) {
  return ((val) & (-0xF7 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_F7uint8_reg>:
test   $0x9,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_F7uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -247
%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_F7uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 9
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fexpect(char *, int, int, int);
void t1() {
  struct {
    int a;
  } x;
  x.a = 61;
  fexpect("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/struct.c",
          9, 61, x.a);
  ;
}


x86 assembly (clang, -O0):
<t1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3d,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
lea    0xed7(%rip),%rdi
mov    $0x9,%esi
mov    $0x3d,%edx
call   1030 <fexpect@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t1>:
lea    0xee9(%rip),%rdi
mov    $0x9,%esi
mov    $0x3d,%edx
mov    $0x3d,%ecx
jmp    1030 <fexpect@plt>

LLVM IR (-O0):
%struct.anon = type { i32 }
@.str = [129 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/struct.c\00"
define void @t1() {
%1 = alloca %struct.anon
%2 = getelementptr inbounds %struct.anon, %struct.anon* %1, i32 0, i32 0
store i32 61, i32* %2
%3 = getelementptr inbounds %struct.anon, %struct.anon* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = call i32 @fexpect(i8* getelementptr inbounds ([129 x i8], [129 x i8]* @.str, i64 0, i64 0), i32 9, i32 61, i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [129 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/struct.c\00"
define void @t1() {
%1 = tail call i32 @fexpect(i8* getelementptr inbounds ([129 x i8], [129 x i8]* @.str, i64 0, i64 0), i32 9, i32 61, i32 61)
ret void
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t xlat_addr64(void *base, uint64_t offs) {
  uint64_t out;
  asm("xlat" : "=a"(out) : "b"(base), "0"(offs));
  return out;
}


x86 assembly (clang, -O0):
<xlat_addr64>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rbx
mov    -0x18(%rbp),%rax
xlat   %ds:(%rbx)
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<xlat_addr64>:
push   %rbx
mov    %rsi,%rax
mov    %rdi,%rbx
xlat   %ds:(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define i8* @xlat_addr64(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i8* asm "xlat", "={ax},{bx},0,~{dirflag},~{fpsr},~{flags}"(i8* %6, i8* %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
ret i8* %9
}

LLVM IR (-O2):
define i8* @xlat_addr64(i8* readnone %0, i8* readnone %1) {
%3 = tail call i8* asm "xlat", "={ax},{bx},0,~{dirflag},~{fpsr},~{flags}"(i8* %0, i8* %1)
ret i8* %3
}
void genc_ult_s() {}


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

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

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

LLVM IR (-O2):
define void @genc_ult_s() {
ret void
}
unsigned short bswap_16(const unsigned short x) {
  return ((((x) >> 8) & 0xff) | (((x)&0xff) << 8));
}


x86 assembly (clang, -O0):
<bswap_16>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
movzwl -0x2(%rbp),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bswap_16>:
mov    %edi,%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @bswap_16(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = ashr i32 %4, 8
%6 = and i32 %5, 255
%7 = load i16, i16* %2
%8 = zext i16 %7 to i32
%9 = and i32 %8, 255
%10 = shl i32 %9, 8
%11 = or i32 %6, %10
%12 = trunc i32 %11 to i16
ret i16 %12
}

LLVM IR (-O2):
define zeroext i16 @bswap_16(i16 zeroext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}
int are_equal_float(const void *a, const void *b) {
  return *(float *)a == *(float *)b;
}


x86 assembly (clang, -O0):
<are_equal_float>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
ucomiss (%rax),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<are_equal_float>:
movss  (%rsi),%xmm0
cmpeqss (%rdi),%xmm0
movd   %xmm0,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @are_equal_float(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to float*
%7 = load float, float* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to float*
%10 = load float, float* %9
%11 = fcmp oeq float %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @are_equal_float(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = load float, float* %3
%5 = bitcast i8* %1 to float*
%6 = load float, float* %5
%7 = fcmp oeq float %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ LCD4Bit_pushNibble(int);
void LCD4Bit_pushByte(int value) {
  int val_lower = value & 0x0F;
  int val_upper = value >> 4;
  LCD4Bit_pushNibble(val_upper);
  LCD4Bit_pushNibble(val_lower);
}


x86 assembly (clang, -O0):
<LCD4Bit_pushByte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <LCD4Bit_pushNibble@plt>
mov    -0x8(%rbp),%edi
call   1030 <LCD4Bit_pushNibble@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCD4Bit_pushByte>:
push   %rbx
mov    %edi,%ebx
and    $0xf,%ebx
sar    $0x4,%edi
call   1030 <LCD4Bit_pushNibble@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <LCD4Bit_pushNibble@plt>

LLVM IR (-O0):
define void @LCD4Bit_pushByte(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = and i32 %5, 15
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = ashr i32 %7, 4
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = call i32 @LCD4Bit_pushNibble(i32 %9)
%11 = load i32, i32* %3
%12 = call i32 @LCD4Bit_pushNibble(i32 %11)
ret void
}

LLVM IR (-O2):
define void @LCD4Bit_pushByte(i32 %0) {
%2 = and i32 %0, 15
%3 = ashr i32 %0, 4
%4 = tail call i32 @LCD4Bit_pushNibble(i32 %3)
%5 = tail call i32 @LCD4Bit_pushNibble(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void usage(const char *mess) {
  fprintf(stderr, "Error: %s\n", mess);
  fprintf(stderr, "Usage: r9000 input_file output_file\n");
  fprintf(stderr, "\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xeb4(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
lea    0xec0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rbx
mov    (%rbx),%edi
lea    0xecc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xec7(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xeda(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"Error: %s\0A\00"
@.str.1 = [37 x i8] c"Usage: r9000 input_file output_file\0A\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* @stderr
%9 = call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"Error: %s\0A\00"
@.str.1 = [37 x i8] c"Usage: r9000 input_file output_file\0A\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @stderr
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
}
void move_rtsxy() {}


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

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

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

LLVM IR (-O2):
define void @move_rtsxy() {
ret void
}
void rop3_235_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = T ^ S;
  stk2 = ~stk2;
  stk1 = *D | stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_235_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_235_1_0>:
xor    %esi,%edx
not    %dl
mov    (%rdi),%al
or     %al,%dl
xor    %dl,%al
and    %sil,%al
xor    %dl,%al
mov    %al,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_235_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %1, %2
%5 = xor i8 %4, -1
%6 = load i8, i8* %0
%7 = or i8 %6, %5
%8 = xor i8 %1, -1
%9 = and i8 %7, %8
%10 = and i8 %6, %1
%11 = or i8 %9, %10
store i8 %11, i8* %0
ret void
}
/* Variables and functions */
int char_to_int(char);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, char *);
int main(int argc, char *argv[]) {
  char c;
  scanf("%c", &c);
  printf("%d\n", char_to_int(c));
  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    0xeb3(%rip),%rdi
lea    -0x11(%rbp),%rsi
call   1050 <scanf@plt>
movsbl -0x11(%rbp),%edi
call   1040 <char_to_int@plt>
mov    %eax,%esi
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1050 <scanf@plt>
movsbl 0x7(%rsp),%edi
call   1040 <char_to_int@plt>
lea    0xeb0(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i8, i8* %6
%9 = call i32 @char_to_int(i8 signext %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i8
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8, i8* %3
%6 = call i32 @char_to_int(i8 signext %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int ascending_order(const void *a, const void *b) {
  return *(const uint32_t *)a - *(const uint32_t *)b;
}


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

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

LLVM IR (-O0):
define i32 @ascending_order(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @ascending_order(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
int test_imm_D8int8_mem(signed char *val) {
  return ((*val) & (0xD8 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_D8int8_mem(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 = and i32 %5, 216
%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_D8int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -40
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void RTLockValidatorReadLockInc(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLockValidatorReadLockInc() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ siginfo_t;

/* Variables and functions */
int /*<<< orphan*/ my_abort();
void sigsegv(int segv, siginfo_t *info, void *ctxv) {
  (void)segv;
  (void)info;
  (void)ctxv;
  my_abort();
}


x86 assembly (clang, -O0):
<sigsegv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <my_abort@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @sigsegv(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 (...) @my_abort()
ret void
}

LLVM IR (-O2):
define void @sigsegv(i32 %0, i32* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 (...) @my_abort()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ displayBits(unsigned int);
void packCharacters(char c1, char c2) {
  unsigned pack;
  pack = c1;
  pack <<= 8;
  pack |= c2;
  displayBits(pack);
}


x86 assembly (clang, -O0):
<packCharacters>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x8(%rbp)
movsbl -0x2(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <displayBits@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<packCharacters>:
shl    $0x8,%edi
or     %esi,%edi
jmp    1030 <displayBits@plt>

LLVM IR (-O0):
define void @packCharacters(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = shl i32 %8, 8
store i32 %9, i32* %5
%10 = load i8, i8* %4
%11 = sext i8 %10 to i32
%12 = load i32, i32* %5
%13 = or i32 %12, %11
store i32 %13, i32* %5
%14 = load i32, i32* %5
%15 = call i32 @displayBits(i32 %14)
ret void
}

LLVM IR (-O2):
define void @packCharacters(i8 signext %0, i8 signext %1) {
%3 = sext i8 %0 to i32
%4 = shl nsw i32 %3, 8
%5 = sext i8 %1 to i32
%6 = or i32 %4, %5
%7 = tail call i32 @displayBits(i32 %6)
ret void
}
/* Type definitions */
struct _stor_lookup_create_rsp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ osapi_free(struct _stor_lookup_create_rsp *);
void stor_lookup_create_rsp_free(struct _stor_lookup_create_rsp *ptr) {
  osapi_free(ptr);
}


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

x86 assembly (clang, -O2):
<stor_lookup_create_rsp_free>:
jmp    1030 <osapi_free@plt>

LLVM IR (-O0):
%struct._stor_lookup_create_rsp = type { i32 }
define void @stor_lookup_create_rsp_free(%struct._stor_lookup_create_rsp* %0) {
%2 = alloca %struct._stor_lookup_create_rsp*
store %struct._stor_lookup_create_rsp* %0, %struct._stor_lookup_create_rsp** %2
%3 = load %struct._stor_lookup_create_rsp*, %struct._stor_lookup_create_rsp** %2
%4 = call i32 @osapi_free(%struct._stor_lookup_create_rsp* %3)
ret void
}

LLVM IR (-O2):
%struct._stor_lookup_create_rsp = type { i32 }
define void @stor_lookup_create_rsp_free(%struct._stor_lookup_create_rsp* %0) {
%2 = tail call i32 @osapi_free(%struct._stor_lookup_create_rsp* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void cleanupHandler(void *arg) { printf("In the cleanup handler\n"); }


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"In the cleanup handler\0A\00"
define void @cleanupHandler(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [23 x i8] c"In the cleanup handler\00"
define void @cleanupHandler(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret void
}
short prog_q168decision(short A) {
  short S;
  if (A < 0)
    S = 0;
  else
    S = 1;
  return S;
}


x86 assembly (clang, -O0):
<prog_q168decision>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
cmp    $0x0,%eax
jge    1123 <prog_q168decision+0x23>
movw   $0x0,-0x4(%rbp)
jmp    1129 <prog_q168decision+0x29>
movw   $0x1,-0x4(%rbp)
movswl -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prog_q168decision>:
not    %edi
movzwl %di,%eax
shr    $0xf,%eax
ret

LLVM IR (-O0):
define signext i16 @prog_q168decision(i16 signext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = sext i16 %4 to i32
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i16 0, i16* %3
br label %9
8: ; preds = %1
store i16 1, i16* %3
br label %9
9: ; preds = %8, %7
%10 = load i16, i16* %3
ret i16 %10
}

LLVM IR (-O2):
define signext i16 @prog_q168decision(i16 signext %0) {
%2 = xor i16 %0, -1
%3 = lshr i16 %2, 15
ret i16 %3
}
/* Variables and functions */
int /*<<< orphan*/ LOG_INFO;
int /*<<< orphan*/ closelog();
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *);
void daemon_stop() {
  syslog(LOG_INFO, "daemon stopped");
  closelog();
}


x86 assembly (clang, -O0):
<daemon_stop>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <syslog@plt>
mov    $0x0,%al
call   1030 <closelog@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<daemon_stop>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <syslog@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <closelog@plt>

LLVM IR (-O0):
@LOG_INFO = global i32 0
@.str = [15 x i8] c"daemon stopped\00"
define void @daemon_stop() {
%1 = load i32, i32* @LOG_INFO
%2 = call i32 @syslog(i32 %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @closelog()
ret void
}

LLVM IR (-O2):
@LOG_INFO = global i32 0
@.str = [15 x i8] c"daemon stopped\00"
define void @daemon_stop() {
%1 = load i32, i32* @LOG_INFO
%2 = tail call i32 @syslog(i32 %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @closelog()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DEC16(int /*<<< orphan*/, int);
int /*<<< orphan*/ DirectIndexedXE0(int);
void OpD6E0M0(void) { DEC16(DirectIndexedXE0(3), 0xFFFF); }


x86 assembly (clang, -O0):
<OpD6E0M0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1030 <DirectIndexedXE0@plt>
mov    %eax,%edi
mov    $0xffff,%esi
call   1040 <DEC16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<OpD6E0M0>:
push   %rax
mov    $0x3,%edi
call   1030 <DirectIndexedXE0@plt>
mov    %eax,%edi
mov    $0xffff,%esi
pop    %rax
jmp    1040 <DEC16@plt>

LLVM IR (-O0):
define void @OpD6E0M0() {
%1 = call i32 @DirectIndexedXE0(i32 3)
%2 = call i32 @DEC16(i32 %1, i32 65535)
ret void
}

LLVM IR (-O2):
define void @OpD6E0M0() {
%1 = tail call i32 @DirectIndexedXE0(i32 3)
%2 = tail call i32 @DEC16(i32 %1, i32 65535)
ret void
}
/* Variables and functions */
int getSubTick();
int getTick();
unsigned long getTime(unsigned short fromTick) {
  if (fromTick)
    return (getTick() * 300) >> 8;
  else
    return getSubTick() / 300;
}


x86 assembly (clang, -O0):
<getTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0xa(%rbp)
cmpw   $0x0,-0xa(%rbp)
je     1155 <getTime+0x35>
mov    $0x0,%al
call   1040 <getTick@plt>
imul   $0x12c,%eax,%eax
sar    $0x8,%eax
cltq
mov    %rax,-0x8(%rbp)
jmp    116a <getTime+0x4a>
mov    $0x0,%al
call   1030 <getSubTick@plt>
mov    $0x12c,%ecx
cltd
idiv   %ecx
cltq
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTime>:
push   %rax
xor    %eax,%eax
test   %edi,%edi
je     1137 <getTime+0x17>
call   1040 <getTick@plt>
imul   $0x12c,%eax,%eax
sar    $0x8,%eax
jmp    1152 <getTime+0x32>
call   1030 <getSubTick@plt>
cltq
imul   $0x1b4e81b5,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @getTime(i16 zeroext %0) {
%2 = alloca i64
%3 = alloca i16
store i16 %0, i16* %3
%4 = load i16, i16* %3
%5 = icmp ne i16 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = call i32 (...) @getTick()
%8 = mul nsw i32 %7, 300
%9 = ashr i32 %8, 8
%10 = sext i32 %9 to i64
store i64 %10, i64* %2
br label %15
11: ; preds = %1
%12 = call i32 (...) @getSubTick()
%13 = sdiv i32 %12, 300
%14 = sext i32 %13 to i64
store i64 %14, i64* %2
br label %15
15: ; preds = %11, %6
%16 = load i64, i64* %2
ret i64 %16
}

LLVM IR (-O2):
define i64 @getTime(i16 zeroext %0) {
%2 = icmp eq i16 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 (...) @getTick()
%5 = mul nsw i32 %4, 300
%6 = ashr i32 %5, 8
br label %10
7: ; preds = %1
%8 = tail call i32 (...) @getSubTick()
%9 = sdiv i32 %8, 300
br label %10
10: ; preds = %7, %3
%11 = phi i32 [ %6, %3 ], [ %9, %7 ]
%12 = sext i32 %11 to i64
ret i64 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void StartSUMOProof(FILE *Stream) {
  fprintf(Stream, "<queryResponse>\n");
  fprintf(Stream, "  <answer result='yes' number='1'>\n");
  fprintf(Stream, "    <proof>\n");
}


x86 assembly (clang, -O0):
<StartSUMOProof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xeda(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xeee(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StartSUMOProof>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    $0x10,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
lea    0xedd(%rip),%rdi
mov    $0x23,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
lea    0xee8(%rip),%rdi
mov    $0xc,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
pop    %rbx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"<queryResponse>\0A\00"
@.str.1 = [36 x i8] c" <answer result='yes' number='1'>\0A\00"
@.str.2 = [13 x i8] c" <proof>\0A\00"
define void @StartSUMOProof(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%5 = load i32*, i32** %2
%6 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32*, i32** %2
%8 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"<queryResponse>\0A\00"
@.str.1 = [36 x i8] c" <answer result='yes' number='1'>\0A\00"
@.str.2 = [13 x i8] c" <proof>\0A\00"
define void @StartSUMOProof(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i64 16, i64 1, i32* %0)
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i64 35, i64 1, i32* %0)
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i64 12, i64 1, i32* %0)
ret void
}
void set_base_time(int minutes, int seconds) {}


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

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

LLVM IR (-O0):
define void @set_base_time(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @set_base_time(i32 %0, i32 %1) {
ret void
}
void RAWToARGBRow_NEON() {}


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

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

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

LLVM IR (-O2):
define void @RAWToARGBRow_NEON() {
ret void
}
/* Variables and functions */
int ctest_main(int, char const **);
int main(int argc, char **argv) {
  char const **margv = (char const **)argv;
  int ret = ctest_main(argc, margv);
  return ret;
}


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)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1030 <ctest_main@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <ctest_main@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @ctest_main(i32 %0, i8** %1)
ret i32 %3
}
qp(a) { return a >= 'a' && a <= 'z'; }


x86 assembly (clang, -O0):
<qp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x61,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <qp+0x20>
cmpl   $0x7a,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qp>:
add    $0xffffff9f,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @qp(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fatal_error(char *, char *, int);
int /*<<< orphan*/ val_is_ok(int);
int val_from_hash(int val, int ply) {
  if ((2) <= 1 && !(val_is_ok(val)))
    fatal_error("%s:%u: Assertion '"
                "val_is_ok(val)"
                "' failed.",
                "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                "outputs/2022-01-22/02-19-57/repos/cutechess/sloppy/refs/heads/"
                "master/src/hash.c",
                138);
  ;
  if (val < -5000)
    val += ply;
  else if (val > 5000)
    val -= ply;
  if ((2) <= 1 && !(val_is_ok(val)))
    fatal_error("%s:%u: Assertion '"
                "val_is_ok(val)"
                "' failed.",
                "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                "outputs/2022-01-22/02-19-57/repos/cutechess/sloppy/refs/heads/"
                "master/src/hash.c",
                145);
  ;
  return val;
}


x86 assembly (clang, -O0):
<val_from_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0xffffec78,-0x4(%rbp)
jge    1125 <val_from_hash+0x25>
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1142 <val_from_hash+0x42>
cmpl   $0x1388,-0x4(%rbp)
jle    113d <val_from_hash+0x3d>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1142 <val_from_hash+0x42>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<val_from_hash>:
xor    %eax,%eax
cmp    $0x1389,%edi
cmovge %esi,%eax
neg    %eax
cmp    $0xffffec78,%edi
cmovl  %esi,%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @val_from_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 = icmp slt i32 %5, -5000
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = add nsw i32 %9, %8
store i32 %10, i32* %3
br label %19
11: ; preds = %2
%12 = load i32, i32* %3
%13 = icmp sgt i32 %12, 5000
br i1 %13, label %14, label %18
14: ; preds = %11
%15 = load i32, i32* %4
%16 = load i32, i32* %3
%17 = sub nsw i32 %16, %15
store i32 %17, i32* %3
br label %18
18: ; preds = %14, %11
br label %19
19: ; preds = %18, %7
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @val_from_hash(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, -5000
%4 = icmp sgt i32 %0, 5000
%5 = select i1 %4, i32 %1, i32 0
%6 = sub i32 0, %5
%7 = select i1 %3, i32 %1, i32 %6
%8 = add i32 %7, %0
ret i32 %8
}
void c_function(void) {}


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

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

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

LLVM IR (-O2):
define void @c_function() {
ret void
}
/* Type definitions */
typedef scalar_t__ clock_t;

/* Variables and functions */
scalar_t__ clock();
clock_t get_clocks(clock_t time_marker) { return clock() - time_marker; }


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

x86 assembly (clang, -O2):
<get_clocks>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <clock@plt>
sub    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @get_clocks(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i64 (...) @clock()
%4 = load i64, i64* %2
%5 = sub nsw i64 %3, %4
ret i64 %5
}

LLVM IR (-O2):
define i64 @get_clocks(i64 %0) {
%2 = tail call i64 (...) @clock()
%3 = sub nsw i64 %2, %0
ret i64 %3
}
void loop(int *p) {
  while (p != ((void *)0) && *p == 0) {
    p++;
  }
}


x86 assembly (clang, -O0):
<loop>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1125 <loop+0x25>
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1135 <loop+0x35>
jmp    1146 <loop+0x46>
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <loop+0x8>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @loop(i32* nocapture %0) {
ret void
}
/* Type definitions */
struct pci_dev {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pci_write_config_dword(struct pci_dev *, int, int);
void dma_doorbell(struct pci_dev *pdev, unsigned int chn_num,
                  unsigned int w_r) {
  if (w_r) {
    pci_write_config_dword(pdev, ((0x0 + 0x700) + 0x2a0),
                           ((0 << 31) + (chn_num)));
  } else {
    pci_write_config_dword(pdev, ((0x0 + 0x700) + 0x280),
                           ((0 << 31) + (chn_num)));
  }
}


x86 assembly (clang, -O0):
<dma_doorbell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1145 <dma_doorbell+0x35>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
add    $0x0,%edx
mov    $0x9a0,%esi
call   1030 <pci_write_config_dword@plt>
jmp    1159 <dma_doorbell+0x49>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
add    $0x0,%edx
mov    $0x980,%esi
call   1030 <pci_write_config_dword@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dma_doorbell>:
mov    %esi,%eax
xor    %esi,%esi
test   %edx,%edx
setne  %sil
or     $0x4c,%esi
shl    $0x5,%esi
mov    %eax,%edx
jmp    1030 <pci_write_config_dword@plt>

LLVM IR (-O0):
%struct.pci_dev = type { i32 }
define void @dma_doorbell(%struct.pci_dev* %0, i32 %1, i32 %2) {
%4 = alloca %struct.pci_dev*
%5 = alloca i32
%6 = alloca i32
store %struct.pci_dev* %0, %struct.pci_dev** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %3
%10 = load %struct.pci_dev*, %struct.pci_dev** %4
%11 = load i32, i32* %5
%12 = add i32 0, %11
%13 = call i32 @pci_write_config_dword(%struct.pci_dev* %10, i32 2464, i32 %12)
br label %19
14: ; preds = %3
%15 = load %struct.pci_dev*, %struct.pci_dev** %4
%16 = load i32, i32* %5
%17 = add i32 0, %16
%18 = call i32 @pci_write_config_dword(%struct.pci_dev* %15, i32 2432, i32 %17)
br label %19
19: ; preds = %14, %9
ret void
}

LLVM IR (-O2):
%struct.pci_dev = type { i32 }
define void @dma_doorbell(%struct.pci_dev* %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
%5 = select i1 %4, i32 2432, i32 2464
%6 = tail call i32 @pci_write_config_dword(%struct.pci_dev* %0, i32 %5, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ zlog_signal(int, char *);
void __attribute__((noreturn)) exit_handler(int signo) {
  zlog_signal(signo, "exiting...");
  _exit(128 + signo);
}


x86 assembly (clang, -O0):
<exit_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xecb(%rip),%rsi
call   1040 <zlog_signal@plt>
mov    -0x4(%rbp),%edi
add    $0x80,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<exit_handler>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rsi
call   1040 <zlog_signal@plt>
sub    $0xffffff80,%ebx
mov    %ebx,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"exiting...\00"
define void @exit_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @zlog_signal(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = add nsw i32 128, %5
%7 = call i32 @_exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@.str = [11 x i8] c"exiting...\00"
define void @exit_handler(i32 %0) {
%2 = tail call i32 @zlog_signal(i32 %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = add nsw i32 %0, 128
%4 = tail call i32 @_exit(i32 %3)
unreachable
}
/* Variables and functions */
bool is_delimiter(int c, int delimiter) {
  if (c == delimiter)
    return true;
  if ((delimiter == ' ') && (c < 32))
    return true;
  return false;
}


x86 assembly (clang, -O0):
<is_delimiter>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1122 <is_delimiter+0x22>
movl   $0x1,-0x4(%rbp)
jmp    1149 <is_delimiter+0x49>
cmpl   $0x20,-0xc(%rbp)
jne    1142 <is_delimiter+0x42>
cmpl   $0x20,-0x8(%rbp)
jge    1142 <is_delimiter+0x42>
movl   $0x1,-0x4(%rbp)
jmp    1149 <is_delimiter+0x49>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_delimiter>:
cmp    %esi,%edi
sete   %al
cmp    $0x20,%esi
sete   %cl
cmp    $0x20,%edi
setl   %dl
and    %cl,%dl
or     %al,%dl
movzbl %dl,%eax
ret

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

LLVM IR (-O2):
define i32 @is_delimiter(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = icmp eq i32 %1, 32
%5 = icmp slt i32 %0, 32
%6 = and i1 %5, %4
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
char *strchr(char const *, char);
int /*<<< orphan*/ *strstr(char *, char const *);
bool match(const char *sym, const char *name) {
  char *p = strchr(sym, '(');
  return p != NULL && strstr(p, name) != NULL;
}


x86 assembly (clang, -O0):
<match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x28,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x18(%rbp)
mov    %al,-0x19(%rbp)
je     1169 <match+0x49>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strstr@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<match>:
push   %rbx
mov    %rsi,%rbx
mov    $0x28,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     114b <match+0x2b>
mov    %rax,%rdi
mov    %rbx,%rsi
call   1040 <strstr@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @match(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i8* @strchr(i8* %6, i8 signext 40)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i8*, i8** %5
%12 = load i8*, i8** %4
%13 = call i32* @strstr(i8* %11, i8* %12)
%14 = icmp ne i32* %13, null
br label %15
15: ; preds = %10, %2
%16 = phi i1 [ false, %2 ], [ %14, %10 ]
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @match(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 40)
%4 = icmp eq i8* %3, null
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32* @strstr(i8* %3, i8* dereferenceable(1) %1)
%7 = icmp ne i32* %6, null
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 0, %2 ], [ %8, %5 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ remove(char *);
int /*<<< orphan*/ warnx(char *, char *);
void eremove(char *fn) {
  if (remove(fn)) {
    warnx("remove: %s", fn);
    abort();
  }
}


x86 assembly (clang, -O0):
<eremove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <remove@plt>
cmp    $0x0,%rax
je     1166 <eremove+0x36>
mov    -0x8(%rbp),%rsi
lea    0xea6(%rip),%rdi
call   1050 <warnx@plt>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eremove>:
push   %rbx
mov    %rdi,%rbx
call   1040 <remove@plt>
test   %rax,%rax
jne    1140 <eremove+0x10>
pop    %rbx
ret
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
call   1050 <warnx@plt>
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"remove: %s\00"
define void @eremove(i8* %0) {
%2 = tail call i64 @remove(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @warnx(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %1
ret void
}
/* Variables and functions */
int vga_crt_in(int);
int /*<<< orphan*/ vga_crt_out(int, int);
void tty_disable_cursor() {
  int csr = vga_crt_in(0xA);
  csr |= 020;
  vga_crt_out(0xA, csr);
}


x86 assembly (clang, -O0):
<tty_disable_cursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xa,%edi
call   1040 <vga_crt_in@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     $0x10,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0xa,%edi
call   1030 <vga_crt_out@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tty_disable_cursor>:
push   %rax
mov    $0xa,%edi
call   1040 <vga_crt_in@plt>
or     $0x10,%eax
mov    $0xa,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <vga_crt_out@plt>

LLVM IR (-O0):
define void @tty_disable_cursor() {
%1 = alloca i32
%2 = call i32 @vga_crt_in(i32 10)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = or i32 %3, 16
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = call i32 @vga_crt_out(i32 10, i32 %5)
ret void
}

LLVM IR (-O2):
define void @tty_disable_cursor() {
%1 = tail call i32 @vga_crt_in(i32 10)
%2 = or i32 %1, 16
%3 = tail call i32 @vga_crt_out(i32 10, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *ft_itoa_base(long, int, char *);
int /*<<< orphan*/ ft_putstr_fd(char *, int);
void ft_putnbr_fd(long n, int fd) {
  char *number;
  number = ft_itoa_base(n, 10, "0123456789");
  ft_putstr_fd(number, fd);
  free(number);
}


x86 assembly (clang, -O0):
<ft_putnbr_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
lea    0xeb1(%rip),%rdx
call   1040 <ft_itoa_base@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <ft_putstr_fd@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putnbr_fd>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
lea    0xec4(%rip),%rdx
mov    $0xa,%esi
call   1040 <ft_itoa_base@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %ebp,%esi
call   1050 <ft_putstr_fd@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"0123456789\00"
define void @ft_putnbr_fd(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
%5 = alloca i8*
store i64 %0, i64* %3
store i32 %1, i32* %4
%6 = load i64, i64* %3
%7 = call i8* @ft_itoa_base(i64 %6, i32 10, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = load i32, i32* %4
%10 = call i32 @ft_putstr_fd(i8* %8, i32 %9)
%11 = load i8*, i8** %5
%12 = call i32 @free(i8* %11)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"0123456789\00"
define void @ft_putnbr_fd(i64 %0, i32 %1) {
%3 = tail call i8* @ft_itoa_base(i64 %0, i32 10, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @ft_putstr_fd(i8* %3, i32 %1)
%5 = tail call i32 @free(i8* %3)
ret void
}
void ExttResourceImportAuxTable(void) {}


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

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

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

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