xunge/DecIR huggingface dataset:
int sys$asctim(unsigned short int *timlen, void *timbuf,
               unsigned long long *timadr, char cvtflg) {
  return ({
    unsigned long resultvar;
    register long int _a4 asm("r10") = (long)((unsigned long)cvtflg);
    register long int _a3 asm("rdx") = (long)(timadr);
    register long int _a2 asm("rsi") = (long)(timbuf);
    register long int _a1 asm("rdi") = (long)(timlen);
    asm volatile("movq %1, %%rax\n\t"
                 "int $0x84\n\t"
                 : "=a"(resultvar)
                 : "i"(1), "r"(_a1), "r"(_a2), "r"(_a3), "r"(_a4)
                 : "memory", "cc", "r11", "cx");
    (long)resultvar;
  });
}


x86 assembly (clang, -O0):
<sys$asctim>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %al,-0x19(%rbp)
movsbq -0x19(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rdi
mov    -0x40(%rbp),%rsi
mov    -0x38(%rbp),%rdx
mov    -0x30(%rbp),%r10
mov    $0x1,%rax
int    $0x84
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys$asctim>:
movslq %ecx,%r10
mov    $0x1,%rax
int    $0x84
ret

LLVM IR (-O0):
define i32 @"sys$asctim"(i16* %0, i8* %1, i64* %2, i8 signext %3) {
%5 = alloca i16*
%6 = alloca i8*
%7 = alloca i64*
%8 = alloca i8
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
store i16* %0, i16** %5
store i8* %1, i8** %6
store i64* %2, i64** %7
store i8 %3, i8* %8
%15 = load i8, i8* %8
%16 = sext i8 %15 to i64
store i64 %16, i64* %10
%17 = load i64*, i64** %7
%18 = ptrtoint i64* %17 to i64
store i64 %18, i64* %11
%19 = load i8*, i8** %6
%20 = ptrtoint i8* %19 to i64
store i64 %20, i64* %12
%21 = load i16*, i16** %5
%22 = ptrtoint i16* %21 to i64
store i64 %22, i64* %13
%23 = load i64, i64* %13
%24 = load i64, i64* %12
%25 = load i64, i64* %11
%26 = load i64, i64* %10
%27 = call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x84\0A\09", "={ax},i,{rdi},{rsi},{rdx},{r10},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 1, i64 %23, i64 %24, i64 %25, i64 %26)
store i64 %27, i64* %9
%28 = load i64, i64* %9
store i64 %28, i64* %14
%29 = load i64, i64* %14
%30 = trunc i64 %29 to i32
ret i32 %30
}

LLVM IR (-O2):
define i32 @"sys$asctim"(i16* %0, i8* %1, i64* %2, i8 signext %3) {
%5 = sext i8 %3 to i64
%6 = ptrtoint i64* %2 to i64
%7 = ptrtoint i8* %1 to i64
%8 = ptrtoint i16* %0 to i64
%9 = tail call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x84\0A\09", "={ax},i,{rdi},{rsi},{rdx},{r10},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 1, i64 %8, i64 %7, i64 %6, i64 %5)
%10 = trunc i64 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ put8(unsigned char);
void shld_reg32_reg32_imm8(unsigned int reg1, unsigned int reg2,
                           unsigned char imm8) {
  put8(0x0F);
  put8(0xA4);
  put8(0xC0 | (reg2 << 3) | reg1);
  put8(imm8);
}


x86 assembly (clang, -O0):
<shld_reg32_reg32_imm8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    $0xf,%edi
call   1030 <put8@plt>
mov    $0xa4,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%eax
shl    $0x3,%eax
or     $0xc0,%eax
or     -0x4(%rbp),%eax
movzbl %al,%edi
call   1030 <put8@plt>
movzbl -0x9(%rbp),%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shld_reg32_reg32_imm8>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
mov    $0xf,%edi
call   1030 <put8@plt>
mov    $0xa4,%edi
call   1030 <put8@plt>
shl    $0x3,%ebp
or     %ebx,%ebp
or     $0xc0,%bpl
movzbl %bpl,%edi
call   1030 <put8@plt>
mov    %r14d,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @shld_reg32_reg32_imm8(i32 %0, i32 %1, i8 zeroext %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 = call i32 @put8(i8 zeroext 15)
%8 = call i32 @put8(i8 zeroext -92)
%9 = load i32, i32* %5
%10 = shl i32 %9, 3
%11 = or i32 192, %10
%12 = load i32, i32* %4
%13 = or i32 %11, %12
%14 = trunc i32 %13 to i8
%15 = call i32 @put8(i8 zeroext %14)
%16 = load i8, i8* %6
%17 = call i32 @put8(i8 zeroext %16)
ret void
}

LLVM IR (-O2):
define void @shld_reg32_reg32_imm8(i32 %0, i32 %1, i8 zeroext %2) {
%4 = tail call i32 @put8(i8 zeroext 15)
%5 = tail call i32 @put8(i8 zeroext -92)
%6 = shl i32 %1, 3
%7 = or i32 %6, %0
%8 = trunc i32 %7 to i8
%9 = or i8 %8, -64
%10 = tail call i32 @put8(i8 zeroext %9)
%11 = tail call i32 @put8(i8 zeroext %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ board_init();
int /*<<< orphan*/ printf(char *);
void main(void) {
  board_init();
  printf("/****************Welcome to the usb world!****************/\r\n");
  while (1)
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <board_init@plt>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
jmp    1137 <main+0x17>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <board_init@plt>
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
jmp    1140 <main+0x20>

LLVM IR (-O0):
@.str = [62 x i8] c"/****************Welcome to the usb world!****************/\0D\0A\00"
define void @main() {
%1 = call i32 (...) @board_init()
%2 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %0, %3
br label %3
}

LLVM IR (-O2):
@str = [61 x i8] c"/****************Welcome to the usb world!****************/\0D\00"
define void @main() {
%1 = tail call i32 (...) @board_init()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str, i64 0, i64 0))
br label %3
3: ; preds = %0, %3
br label %3
}
int ssize(char *str) {
  int i;
  for (i = 0; str[i] != '\0'; i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<ssize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1137 <ssize+0x37>
jmp    1129 <ssize+0x29>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <ssize+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssize>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <ssize+0x10>
ret

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

LLVM IR (-O2):
define i32 @ssize(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
int m(int i) {
  short j, j1, **j2;
  if (i) {
    char c, *c2;
    static int d, *d2;
  }
}


x86 assembly (clang, -O0):
<m>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1116 <m+0x16>
jmp    1116 <m+0x16>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@m.d = internal global i32 0
@m.d2 = internal global i32* null
define i32 @m(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i16
%5 = alloca i16
%6 = alloca i16**
%7 = alloca i8
%8 = alloca i8*
store i32 %0, i32* %3
%9 = load i32, i32* %3
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %1
br label %12
12: ; preds = %11, %1
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @m(i32 %0) {
ret i32 undef
}
int bcm_sg_suitable_for_dma(struct scatterlist *sg_ptr, int sg_len) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.scatterlist = type opaque
define i32 @bcm_sg_suitable_for_dma(%struct.scatterlist* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
int /*<<< orphan*/ *init_memory_from_file(int /*<<< orphan*/ *);
int /*<<< orphan*/ run_x6502(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void load_from_files(FILE *fp_x6502, FILE *fp_out) {
  uint8_t *mem = init_memory_from_file(fp_x6502);
  run_x6502(mem, fp_out);
  free(mem);
}


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

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

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

LLVM IR (-O2):
define void @load_from_files(i32* %0, i32* %1) {
%3 = tail call i32* @init_memory_from_file(i32* %0)
%4 = tail call i32 @run_x6502(i32* %3, i32* %1)
%5 = tail call i32 @free(i32* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ I2C_BurstWrite(int /*<<< orphan*/, int, int, int,
                                  unsigned char *, int);
void WriteDat(unsigned char data) {
  I2C_BurstWrite(0, (0x3C), 0x40, 1, &data, 1);
}


x86 assembly (clang, -O0):
<WriteDat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
xor    %edi,%edi
mov    $0x3c,%esi
mov    $0x40,%edx
mov    $0x1,%r9d
lea    -0x1(%rbp),%r8
mov    %r9d,%ecx
call   1030 <I2C_BurstWrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteDat>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%r8
xor    %edi,%edi
mov    $0x3c,%esi
mov    $0x40,%edx
mov    $0x1,%ecx
mov    $0x1,%r9d
call   1030 <I2C_BurstWrite@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @WriteDat(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @I2C_BurstWrite(i32 0, i32 60, i32 64, i32 1, i8* %2, i32 1)
ret void
}

LLVM IR (-O2):
define void @WriteDat(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @I2C_BurstWrite(i32 0, i32 60, i32 64, i32 1, i8* %2, i32 1)
ret void
}
/* Variables and functions */
char const *basename(char *);
int /*<<< orphan*/ free(char *);
char *strdup(char const *);
char *fp_base(const char *path) {
  char *p = strdup(path), *base = NULL;
  if (!p)
    return NULL;
  base = strdup(basename(p));
  free(p);
  return base;
}


x86 assembly (clang, -O0):
<fp_base>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1169 <fp_base+0x39>
movq   $0x0,-0x8(%rbp)
jmp    118f <fp_base+0x5f>
mov    -0x18(%rbp),%rdi
call   1040 <basename@plt>
mov    %rax,%rdi
call   1050 <strdup@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fp_base>:
push   %r14
push   %rbx
push   %rax
call   1050 <strdup@plt>
test   %rax,%rax
je     1161 <fp_base+0x31>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <basename@plt>
mov    %rax,%rdi
call   1050 <strdup@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
jmp    1163 <fp_base+0x33>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define noalias i8* @fp_base(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i8* @basename(i8* %2)
%6 = tail call i8* @strdup(i8* %5)
%7 = tail call i32 @free(i8* %2)
br label %8
8: ; preds = %1, %4
%9 = phi i8* [ %6, %4 ], [ null, %1 ]
ret i8* %9
}
/* Type definitions */
typedef int /*<<< orphan*/ value;

/* Variables and functions */
int /*<<< orphan*/ eeread(int, int, float *);
float read_float(int address) {
  float value;
  eeread(address, sizeof(value), &value);
  return value;
}


x86 assembly (clang, -O0):
<read_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x4,%esi
lea    -0x8(%rbp),%rdx
call   1030 <eeread@plt>
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_float>:
push   %rax
lea    0x4(%rsp),%rdx
mov    $0x4,%esi
call   1030 <eeread@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @read_float(i32 %0) {
%2 = alloca i32
%3 = alloca float
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @eeread(i32 %4, i32 4, float* %3)
%6 = load float, float* %3
ret float %6
}

LLVM IR (-O2):
define float @read_float(i32 %0) {
%2 = alloca float
%3 = bitcast float* %2 to i8*
%4 = call i32 @eeread(i32 %0, i32 4, float* %2)
%5 = load float, float* %2
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ putd(int);
int /*<<< orphan*/ puts(char *);
void emitlabel(int label) {
  puts("label");
  putd(label);
  puts(":\n");
}


x86 assembly (clang, -O0):
<emitlabel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
mov    -0x4(%rbp),%edi
call   1040 <putd@plt>
lea    0xec0(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emitlabel>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1040 <putd@plt>
lea    0xec9(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"label\00"
@.str.1 = [3 x i8] c":\0A\00"
define void @emitlabel(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @putd(i32 %0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
}
__attribute__((always_)) void kmemcheck_mark_initialized_pages(struct page *p,
                                                               unsigned int n) {
}


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

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

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

LLVM IR (-O2):
%struct.page = type opaque
define void @kmemcheck_mark_initialized_pages(%struct.page* nocapture %0, i32 %1) {
ret void
}
float copysignf(float x, float y) {
  union {
    float f;
    unsigned int u;
  } ux = {x}, uy = {y};
  ux.u &= 0x7fffffffu;
  ux.u |= (uy.u & 0x80000000u);
  return ux.f;
}


x86 assembly (clang, -O0):
<copysignf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%eax
and    $0x7fffffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x18(%rbp),%eax
and    $0x80000000,%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<copysignf>:
movd   %xmm0,%eax
and    $0x7fffffff,%eax
movmskps %xmm1,%ecx
shl    $0x1f,%ecx
or     %eax,%ecx
movd   %ecx,%xmm0
ret

LLVM IR (-O0):
%union.anon = type { float }
define float @copysignf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca %union.anon
%6 = alloca %union.anon
store float %0, float* %3
store float %1, float* %4
%7 = bitcast %union.anon* %5 to float*
%8 = load float, float* %3
store float %8, float* %7
%9 = bitcast %union.anon* %6 to float*
%10 = load float, float* %4
store float %10, float* %9
%11 = bitcast %union.anon* %5 to i32*
%12 = load i32, i32* %11
%13 = and i32 %12, 2147483647
store i32 %13, i32* %11
%14 = bitcast %union.anon* %6 to i32*
%15 = load i32, i32* %14
%16 = and i32 %15, -2147483648
%17 = bitcast %union.anon* %5 to i32*
%18 = load i32, i32* %17
%19 = or i32 %18, %16
store i32 %19, i32* %17
%20 = bitcast %union.anon* %5 to float*
%21 = load float, float* %20
ret float %21
}

LLVM IR (-O2):
define float @copysignf(float %0, float %1) {
%3 = bitcast float %0 to i32
%4 = and i32 %3, 2147483647
%5 = bitcast float %1 to i32
%6 = and i32 %5, -2147483648
%7 = or i32 %6, %4
%8 = bitcast i32 %7 to float
ret float %8
}
/* Variables and functions */
int bot_fileutils_read_available(int);
int /*<<< orphan*/ read(int, char *, int);
void bot_fileutils_read_flush(int fd) {
  int avail;
  char buf[1024];
  do {
    avail = bot_fileutils_read_available(fd);
    if (avail > 1024)
      avail = 1024;
    read(fd, buf, avail);
  } while (avail > 0);
}


x86 assembly (clang, -O0):
<bot_fileutils_read_flush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <bot_fileutils_read_available@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x400,-0x8(%rbp)
jle    114d <bot_fileutils_read_flush+0x2d>
movl   $0x400,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x410(%rbp),%rsi
mov    -0x8(%rbp),%edx
call   1030 <read@plt>
cmpl   $0x0,-0x8(%rbp)
jg     112e <bot_fileutils_read_flush+0xe>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bot_fileutils_read_flush>:
push   %rbp
push   %r14
push   %rbx
sub    $0x400,%rsp
mov    %edi,%ebx
mov    %rsp,%r14
mov    %ebx,%edi
call   1040 <bot_fileutils_read_available@plt>
mov    %eax,%ebp
cmp    $0x400,%eax
mov    $0x400,%edx
cmovl  %eax,%edx
mov    %ebx,%edi
mov    %r14,%rsi
call   1030 <read@plt>
test   %ebp,%ebp
jg     1130 <bot_fileutils_read_flush+0x10>
add    $0x400,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @bot_fileutils_read_flush(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [1024 x i8]
store i32 %0, i32* %2
br label %5
5: ; preds = %16, %1
%6 = load i32, i32* %2
%7 = call i32 @bot_fileutils_read_available(i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 1024
br i1 %9, label %10, label %11
10: ; preds = %5
store i32 1024, i32* %3
br label %11
11: ; preds = %10, %5
%12 = load i32, i32* %2
%13 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%14 = load i32, i32* %3
%15 = call i32 @read(i32 %12, i8* %13, i32 %14)
br label %16
16: ; preds = %11
%17 = load i32, i32* %3
%18 = icmp sgt i32 %17, 0
br i1 %18, label %5, label %19
19: ; preds = %16
ret void
}

LLVM IR (-O2):
define void @bot_fileutils_read_flush(i32 %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
br label %4
4: ; preds = %4, %1
%5 = tail call i32 @bot_fileutils_read_available(i32 %0)
%6 = icmp slt i32 %5, 1024
%7 = select i1 %6, i32 %5, i32 1024
%8 = call i32 @read(i32 %0, i8* %3, i32 %7)
%9 = icmp sgt i32 %5, 0
br i1 %9, label %4, label %10
10: ; preds = %4
ret void
}
void glSamplerParameteriv(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glSamplerParameteriv() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ jul2greg(double, int *, int *, int *, int *, int *,
                            double *);
int julian_get_hour_number(double current) {
  int year, month, day, hour, minute;
  double seconds;
  jul2greg(current, &month, &day, &year, &hour, &minute, &seconds);
  return hour;
}


x86 assembly (clang, -O0):
<julian_get_hour_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x18(%rbp),%rcx
lea    -0x1c(%rbp),%r8
lea    -0x28(%rbp),%r9
call   1030 <jul2greg@plt>
mov    -0x18(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<julian_get_hour_number>:
sub    $0x28,%rsp
lea    0x18(%rsp),%rdi
lea    0x14(%rsp),%rsi
lea    0x1c(%rsp),%rdx
lea    0xc(%rsp),%rcx
lea    0x10(%rsp),%r8
lea    0x20(%rsp),%r9
call   1030 <jul2greg@plt>
mov    0xc(%rsp),%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @julian_get_hour_number(double %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca double
store double %0, double* %2
%9 = load double, double* %2
%10 = call i32 @jul2greg(double %9, i32* %4, i32* %5, i32* %3, i32* %6, i32* %7, double* %8)
%11 = load i32, i32* %6
ret i32 %11
}

LLVM IR (-O2):
define i32 @julian_get_hour_number(double %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
%8 = bitcast i32* %2 to i8*
%9 = bitcast i32* %3 to i8*
%10 = bitcast i32* %4 to i8*
%11 = bitcast i32* %5 to i8*
%12 = bitcast i32* %6 to i8*
%13 = bitcast double* %7 to i8*
%14 = call i32 @jul2greg(double %0, i32* %3, i32* %4, i32* %2, i32* %5, i32* %6, double* %7)
%15 = load i32, i32* %5
ret i32 %15
}
/* Variables and functions */
char const *DES_options();
const char *_ossl_old_des_options(void) { return DES_options(); }


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

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

LLVM IR (-O0):
define i8* @_ossl_old_des_options() {
%1 = call i8* (...) @DES_options()
ret i8* %1
}

LLVM IR (-O2):
define i8* @_ossl_old_des_options() {
%1 = tail call i8* (...) @DES_options()
ret i8* %1
}
int iDivUp(int a, int b) { return (a % b != 0) ? (a / b + 1) : (a / b); }


x86 assembly (clang, -O0):
<iDivUp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
je     112c <iDivUp+0x2c>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <iDivUp+0x36>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iDivUp>:
mov    %edi,%eax
cltd
idiv   %esi
cmp    $0x1,%edx
sbb    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @iDivUp(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
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = sdiv i32 %10, %11
%13 = add nsw i32 %12, 1
br label %18
14: ; preds = %2
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = sdiv i32 %15, %16
br label %18
18: ; preds = %14, %9
%19 = phi i32 [ %13, %9 ], [ %17, %14 ]
ret i32 %19
}

LLVM IR (-O2):
define i32 @iDivUp(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = icmp ne i32 %3, 0
%5 = sdiv i32 %0, %1
%6 = zext i1 %4 to i32
%7 = add nsw i32 %5, %6
ret i32 %7
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ strncpy(char *, char *, int);
char *newstr(char *s, int len) {
  char *rv = malloc(len + 1);
  rv[len] = '\0';
  strncpy(rv, s, len);
  return rv;
}


x86 assembly (clang, -O0):
<newstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <strncpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<newstr>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r15d
mov    %rdi,%r14
lea    0x1(%r15),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
movslq %r15d,%rdx
movb   $0x0,(%rax,%rdx,1)
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strncpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @newstr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = add nsw i32 %6, 1
%8 = call i8* @malloc(i32 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
store i8 0, i8* %12
%13 = load i8*, i8** %5
%14 = load i8*, i8** %3
%15 = load i32, i32* %4
%16 = call i32 @strncpy(i8* %13, i8* %14, i32 %15)
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
define i8* @newstr(i8* %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = tail call i8* @malloc(i32 %3)
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i8, i8* %4, i64 %5
store i8 0, i8* %6
%7 = tail call i32 @strncpy(i8* %4, i8* %0, i32 %1)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "usage: ctags [-BFTaduwvx] [-f tagsfile] file ...\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [50 x i8] c"usage: ctags [-BFTaduwvx] [-f tagsfile] file ...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [50 x i8] c"usage: ctags [-BFTaduwvx] [-f tagsfile] file ...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void setcork_ssl(int state) {}


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

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

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

LLVM IR (-O2):
define void @setcork_ssl(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int bfd_UP() {
  printf("BFD in UP state");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"BFD in UP state\00"
define i32 @bfd_UP() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"BFD in UP state\00"
define i32 @bfd_UP() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void moveright(int frame[][4]) { return; }


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

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

LLVM IR (-O0):
define void @moveright([4 x i32]* %0) {
%2 = alloca [4 x i32]*
store [4 x i32]* %0, [4 x i32]** %2
ret void
}

LLVM IR (-O2):
define void @moveright([4 x i32]* nocapture %0) {
ret void
}
/* Type definitions */
struct in_addr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ close(int);
void close_inetsock(int fd, struct in_addr inetaddr) { close(fd); }


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

x86 assembly (clang, -O2):
<close_inetsock>:
jmp    1030 <close@plt>

LLVM IR (-O0):
%struct.in_addr = type { i32 }
define void @close_inetsock(i32 %0, i32 %1) {
%3 = alloca %struct.in_addr
%4 = alloca i32
%5 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %3, i32 0, i32 0
store i32 %1, i32* %5
store i32 %0, i32* %4
%6 = load i32, i32* %4
%7 = call i32 @close(i32 %6)
ret void
}

LLVM IR (-O2):
define void @close_inetsock(i32 %0, i32 %1) {
%3 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ db(int);
void rdmsr() {
  db(0x0F);
  db(0x32);
}


x86 assembly (clang, -O0):
<rdmsr>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf,%edi
call   1030 <db@plt>
mov    $0x32,%edi
call   1030 <db@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdmsr>:
push   %rax
mov    $0xf,%edi
call   1030 <db@plt>
mov    $0x32,%edi
pop    %rax
jmp    1030 <db@plt>

LLVM IR (-O0):
define void @rdmsr() {
%1 = call i32 @db(i32 15)
%2 = call i32 @db(i32 50)
ret void
}

LLVM IR (-O2):
define void @rdmsr() {
%1 = tail call i32 @db(i32 15)
%2 = tail call i32 @db(i32 50)
ret void
}
/* Type definitions */
struct msghdr {
  int dummy;
};

/* Variables and functions */
int recvmsg(int, struct msghdr *, int);
int _gpgme_ath_recvmsg(int s, struct msghdr *msg, int flags) {
  return recvmsg(s, msg, flags);
}


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

x86 assembly (clang, -O2):
<_gpgme_ath_recvmsg>:
jmp    1030 <recvmsg@plt>

LLVM IR (-O0):
%struct.msghdr = type { i32 }
define i32 @_gpgme_ath_recvmsg(i32 %0, %struct.msghdr* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.msghdr*
%6 = alloca i32
store i32 %0, i32* %4
store %struct.msghdr* %1, %struct.msghdr** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load %struct.msghdr*, %struct.msghdr** %5
%9 = load i32, i32* %6
%10 = call i32 @recvmsg(i32 %7, %struct.msghdr* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.msghdr = type { i32 }
define i32 @_gpgme_ath_recvmsg(i32 %0, %struct.msghdr* %1, i32 %2) {
%4 = tail call i32 @recvmsg(i32 %0, %struct.msghdr* %1, i32 %2)
ret i32 %4
}
int my_strlen01(char *str) {
  int i;
  i = 0;
  while (str[i] != '\0')
    i++;
  return (i);
}


x86 assembly (clang, -O0):
<my_strlen01>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <my_strlen01+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <my_strlen01+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strlen01>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <my_strlen01+0x10>
ret

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

LLVM IR (-O2):
define i32 @my_strlen01(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
unsigned xrop3_20_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = T ^ S;
  stk2 = ~stk2;
  stk1 = D | stk2;
  stk1 = ~stk1;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_20_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @xrop3_20_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = or i8 %1, %0
%4 = zext i8 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ random();
float random_unif(void) { return (float)random() / 0x7fffffff; }


x86 assembly (clang, -O0):
<random_unif>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <random@plt>
cvtsi2ss %rax,%xmm0
movss  0xed8(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_unif>:
push   %rax
xor    %eax,%eax
call   1030 <random@plt>
cvtsi2ss %rax,%xmm0
mulss  0xedb(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @random_unif() {
%1 = call i64 (...) @random()
%2 = sitofp i64 %1 to float
%3 = fdiv float %2, 0x41E0000000000000
ret float %3
}

LLVM IR (-O2):
define float @random_unif() {
%1 = tail call i64 (...) @random()
%2 = sitofp i64 %1 to float
%3 = fmul float %2, 0x3E00000000000000
ret float %3
}
void pj_release_lock() {}


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

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

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

LLVM IR (-O2):
define void @pj_release_lock() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ create_write_byte(int);
void create_drive_bump(int rvel, int lvel) {
  ;
  create_write_byte(145);
  create_write_byte(((rvel & 0xFFFF) >> 8));
  create_write_byte((rvel & 0xFF));
  create_write_byte(((lvel & 0xFFFF) >> 8));
  create_write_byte((lvel & 0xFF));
  create_write_byte(158);
  create_write_byte(5);
  ;
}


x86 assembly (clang, -O0):
<create_drive_bump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x91,%edi
call   1030 <create_write_byte@plt>
mov    -0x4(%rbp),%edi
and    $0xffff,%edi
sar    $0x8,%edi
call   1030 <create_write_byte@plt>
mov    -0x4(%rbp),%edi
and    $0xff,%edi
call   1030 <create_write_byte@plt>
mov    -0x8(%rbp),%edi
and    $0xffff,%edi
sar    $0x8,%edi
call   1030 <create_write_byte@plt>
mov    -0x8(%rbp),%edi
and    $0xff,%edi
call   1030 <create_write_byte@plt>
mov    $0x9e,%edi
call   1030 <create_write_byte@plt>
mov    $0x5,%edi
call   1030 <create_write_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_drive_bump>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
mov    $0x91,%edi
call   1030 <create_write_byte@plt>
movzbl %bh,%edi
call   1030 <create_write_byte@plt>
movzbl %bl,%edi
call   1030 <create_write_byte@plt>
mov    %ebp,%ebx
movzbl %bh,%edi
call   1030 <create_write_byte@plt>
movzbl %bl,%edi
call   1030 <create_write_byte@plt>
mov    $0x9e,%edi
call   1030 <create_write_byte@plt>
mov    $0x5,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <create_write_byte@plt>

LLVM IR (-O0):
define void @create_drive_bump(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @create_write_byte(i32 145)
%6 = load i32, i32* %3
%7 = and i32 %6, 65535
%8 = ashr i32 %7, 8
%9 = call i32 @create_write_byte(i32 %8)
%10 = load i32, i32* %3
%11 = and i32 %10, 255
%12 = call i32 @create_write_byte(i32 %11)
%13 = load i32, i32* %4
%14 = and i32 %13, 65535
%15 = ashr i32 %14, 8
%16 = call i32 @create_write_byte(i32 %15)
%17 = load i32, i32* %4
%18 = and i32 %17, 255
%19 = call i32 @create_write_byte(i32 %18)
%20 = call i32 @create_write_byte(i32 158)
%21 = call i32 @create_write_byte(i32 5)
ret void
}

LLVM IR (-O2):
define void @create_drive_bump(i32 %0, i32 %1) {
%3 = tail call i32 @create_write_byte(i32 145)
%4 = lshr i32 %0, 8
%5 = and i32 %4, 255
%6 = tail call i32 @create_write_byte(i32 %5)
%7 = and i32 %0, 255
%8 = tail call i32 @create_write_byte(i32 %7)
%9 = lshr i32 %1, 8
%10 = and i32 %9, 255
%11 = tail call i32 @create_write_byte(i32 %10)
%12 = and i32 %1, 255
%13 = tail call i32 @create_write_byte(i32 %12)
%14 = tail call i32 @create_write_byte(i32 158)
%15 = tail call i32 @create_write_byte(i32 5)
ret void
}
/* Variables and functions */
int fdread(int, char *, int);
int cornet_read(int fd, char *buf, int len) { return fdread(fd, buf, len); }


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

x86 assembly (clang, -O2):
<cornet_read>:
jmp    1030 <fdread@plt>

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

LLVM IR (-O2):
define i32 @cornet_read(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @fdread(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ CAN1_TX_ISR();
int /*<<< orphan*/ USB_HP_ISR();
void USB_HP_CAN1_TX_ISR(void) {
  USB_HP_ISR();
  CAN1_TX_ISR();
}


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

x86 assembly (clang, -O2):
<USB_HP_CAN1_TX_ISR>:
push   %rax
xor    %eax,%eax
call   1040 <USB_HP_ISR@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <CAN1_TX_ISR@plt>

LLVM IR (-O0):
define void @USB_HP_CAN1_TX_ISR() {
%1 = call i32 (...) @USB_HP_ISR()
%2 = call i32 (...) @CAN1_TX_ISR()
ret void
}

LLVM IR (-O2):
define void @USB_HP_CAN1_TX_ISR() {
%1 = tail call i32 (...) @USB_HP_ISR()
%2 = tail call i32 (...) @CAN1_TX_ISR()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sh2_dynarec_cleanup();
void SH2DynarecDeInit() { sh2_dynarec_cleanup(); }


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

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

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

LLVM IR (-O2):
define void @SH2DynarecDeInit() {
%1 = tail call i32 (...) @sh2_dynarec_cleanup()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, int);
void print_move(int x, int y) { printf("%c%d\n", 'A' + x, y); }


x86 assembly (clang, -O0):
<print_move>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x41,%eax
mov    -0x8(%rbp),%edx
lea    0xed2(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_move>:
mov    %esi,%edx
add    $0x41,%dil
movsbl %dil,%esi
lea    0xedf(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%c%d\0A\00"
define void @print_move(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 = add nsw i32 65, %5
%7 = trunc i32 %6 to i8
%8 = load i32, i32* %4
%9 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext %7, i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%c%d\0A\00"
define void @print_move(i32 %0, i32 %1) {
%3 = trunc i32 %0 to i8
%4 = add i8 %3, 65
%5 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext %4, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ color;

/* Variables and functions */
int /*<<< orphan*/ kannotate_write(char *, int);
int strlen(char *);
void gator_annotate_color(int color, char *string) {
  kannotate_write((char *)&color, sizeof(color));
  kannotate_write(string, strlen(string) + 1);
}


x86 assembly (clang, -O0):
<gator_annotate_color>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x4(%rbp),%rdi
mov    $0x4,%esi
call   1040 <kannotate_write@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
add    $0x1,%esi
call   1040 <kannotate_write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gator_annotate_color>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %edi,0xc(%rsp)
lea    0xc(%rsp),%rdi
mov    $0x4,%esi
call   1040 <kannotate_write@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%esi
mov    %rbx,%rdi
call   1040 <kannotate_write@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @gator_annotate_color(i32 %0, i8* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = bitcast i32* %3 to i8*
%5 = call i32 @kannotate_write(i8* %4, i32 4)
%6 = call i32 @strlen(i8* %1)
%7 = add nsw i32 %6, 1
%8 = call i32 @kannotate_write(i8* %1, i32 %7)
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char *, void *);
int intfind(void *d, int k, char *v) { return (strcmp(v, d) == 0); }


x86 assembly (clang, -O0):
<intfind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @intfind(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = call i64 @strcmp(i8* %7, i8* %8)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @intfind(i8* %0, i32 %1, i8* %2) {
%4 = tail call i64 @strcmp(i8* %2, i8* %0)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ clear_io_bit(int, int);
void TOSH_MAKE_GREEN_LED_INPUT() { clear_io_bit(0x39, 6); }


x86 assembly (clang, -O0):
<TOSH_MAKE_GREEN_LED_INPUT>:
push   %rbp
mov    %rsp,%rbp
mov    $0x39,%edi
mov    $0x6,%esi
call   1030 <clear_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_MAKE_GREEN_LED_INPUT>:
mov    $0x39,%edi
mov    $0x6,%esi
jmp    1030 <clear_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_MAKE_GREEN_LED_INPUT() {
%1 = call i32 @clear_io_bit(i32 57, i32 6)
ret void
}

LLVM IR (-O2):
define void @TOSH_MAKE_GREEN_LED_INPUT() {
%1 = tail call i32 @clear_io_bit(i32 57, i32 6)
ret void
}