xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int __u8;

/* Variables and functions */
int /*<<< orphan*/ close(int);
int i2c_open_slave(int);
scalar_t__ i2c_smbus_write_i2c_block_data(int, int, int, int const *);
int /*<<< orphan*/ printf(char *);
void ledc_reset() {
  int i2c_fd;
  const __u8 resetdata[] = {0x5a};
  i2c_fd = i2c_open_slave(0x03);
  if (i2c_smbus_write_i2c_block_data(i2c_fd, 0xa5, 1, resetdata) < 0) {
    printf("Error: ledcontrol_reset failed!\n");
  }
  close(i2c_fd);
}


x86 assembly (clang, -O0):
<ledc_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xeb2(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    $0x3,%edi
call   1050 <i2c_open_slave@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rcx
mov    $0xa5,%esi
mov    $0x1,%edx
call   1060 <i2c_smbus_write_i2c_block_data@plt>
cmp    $0x0,%rax
jge    118a <ledc_reset+0x4a>
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ledc_reset>:
push   %rbx
sub    $0x10,%rsp
movl   $0x5a,0xc(%rsp)
mov    $0x3,%edi
call   1050 <i2c_open_slave@plt>
mov    %eax,%ebx
lea    0xc(%rsp),%rcx
mov    %eax,%edi
mov    $0xa5,%esi
mov    $0x1,%edx
call   1060 <i2c_smbus_write_i2c_block_data@plt>
test   %rax,%rax
jns    1180 <ledc_reset+0x40>
lea    0xe85(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.ledc_reset.resetdata = [1 x i32] [i32 90]
@.str = [33 x i8] c"Error: ledcontrol_reset failed!\0A\00"
define void @ledc_reset() {
%1 = alloca i32
%2 = alloca [1 x i32]
%3 = bitcast [1 x i32]* %2 to i8*
%4 = call i32 @i2c_open_slave(i32 3)
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
%7 = call i64 @i2c_smbus_write_i2c_block_data(i32 %5, i32 165, i32 1, i32* %6)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %0
%12 = load i32, i32* %1
%13 = call i32 @close(i32 %12)
ret void
}

LLVM IR (-O2):
@str = [32 x i8] c"Error: ledcontrol_reset failed!\00"
define void @ledc_reset() {
%1 = alloca [1 x i32]
%2 = bitcast [1 x i32]* %1 to i8*
%3 = getelementptr inbounds [1 x i32], [1 x i32]* %1, i64 0, i64 0
store i32 90, i32* %3
%4 = tail call i32 @i2c_open_slave(i32 3)
%5 = call i64 @i2c_smbus_write_i2c_block_data(i32 %4, i32 165, i32 1, i32* %3)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
br label %9
9: ; preds = %7, %0
%10 = call i32 @close(i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void imprimir_em_base(int n, int b) {
  if (n == 0) {
    printf("\n");
    return;
  }
  imprimir_em_base(n / b, b);
  printf("%d", n % b);
}


x86 assembly (clang, -O0):
<imprimir_em_base>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    114b <imprimir_em_base+0x2b>
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1173 <imprimir_em_base+0x53>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%edi
mov    -0x8(%rbp),%esi
call   1040 <imprimir_em_base@plt>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%esi
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprimir_em_base>:
test   %edi,%edi
je     1154 <imprimir_em_base+0x24>
push   %rbx
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%ebx
mov    %eax,%edi
call   1050 <imprimir_em_base@plt>
lea    0xeb6(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>
mov    $0xa,%edi
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [3 x i8] c"%d\00"
define void @imprimir_em_base(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %18
9: ; preds = %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = sdiv i32 %10, %11
%13 = load i32, i32* %4
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = srem i32 %14, %15
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %9, %7
ret void
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
define void @imprimir_em_base(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @putchar(i32 10)
br label %6
6: ; preds = %4, %7
ret void
7: ; preds = %2
%8 = sdiv i32 %0, %1
tail call void @imprimir_em_base(i32 %8, i32 %1)
%9 = srem i32 %0, %1
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %9)
br label %6
}
int test_imm_FCuint16_mem(unsigned short *val) {
  return ((*val) & (-0xFC << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_FCuint16_mem>:
movzwl (%rdi),%eax
test   $0xff04,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_FCuint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -252
%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_FCuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -252
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct tempfile {
  int dummy;
};

/* Variables and functions */
int mks_tempfile_tsm(struct tempfile *, char const *, int /*<<< orphan*/, int);
int mks_tempfile_t(struct tempfile *tempfile, const char *template) {
  return mks_tempfile_tsm(tempfile, template, 0, 0600);
}


x86 assembly (clang, -O0):
<mks_tempfile_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
mov    $0x180,%ecx
call   1030 <mks_tempfile_tsm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mks_tempfile_t>:
xor    %edx,%edx
mov    $0x180,%ecx
jmp    1030 <mks_tempfile_tsm@plt>

LLVM IR (-O0):
%struct.tempfile = type { i32 }
define i32 @mks_tempfile_t(%struct.tempfile* %0, i8* %1) {
%3 = alloca %struct.tempfile*
%4 = alloca i8*
store %struct.tempfile* %0, %struct.tempfile** %3
store i8* %1, i8** %4
%5 = load %struct.tempfile*, %struct.tempfile** %3
%6 = load i8*, i8** %4
%7 = call i32 @mks_tempfile_tsm(%struct.tempfile* %5, i8* %6, i32 0, i32 384)
ret i32 %7
}

LLVM IR (-O2):
%struct.tempfile = type { i32 }
define i32 @mks_tempfile_t(%struct.tempfile* %0, i8* %1) {
%3 = tail call i32 @mks_tempfile_tsm(%struct.tempfile* %0, i8* %1, i32 0, i32 384)
ret i32 %3
}
/* Type definitions */
typedef int dev_t;

/* Variables and functions */
unsigned int major(dev_t dev) { return (dev & 0xFF00) >> 8; }


x86 assembly (clang, -O0):
<major>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00,%eax
sar    $0x8,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<major>:
mov    %edi,%eax
movzbl %ah,%eax
ret

LLVM IR (-O0):
define i32 @major(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65280
%5 = ashr i32 %4, 8
ret i32 %5
}

LLVM IR (-O2):
define i32 @major(i32 %0) {
%2 = lshr i32 %0, 8
%3 = and i32 %2, 255
ret i32 %3
}
/* Variables and functions */
void *__attribute__((weak)) dlopen(const char *path, int flag) { return NULL; }


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

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

LLVM IR (-O0):
define weak i8* @dlopen(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret i8* null
}

LLVM IR (-O2):
define weak i8* @dlopen(i8* %0, i32 %1) {
ret i8* null
}
void SPI_MAX7221_DisableRxInt(void) {}


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

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

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

LLVM IR (-O2):
define void @SPI_MAX7221_DisableRxInt() {
ret void
}
/* Variables and functions */
int check_arg_count(int, int);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_error(char *);
void cmd_mvwaddnwstr(int nargs, char **args) {
  if (check_arg_count(nargs, 1) == 1)
    return;
  report_count(1);
  report_error("UNSUPPORTED");
}


x86 assembly (clang, -O0):
<cmd_mvwaddnwstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    115a <cmd_mvwaddnwstr+0x2a>
jmp    1170 <cmd_mvwaddnwstr+0x40>
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xe95(%rip),%rdi
call   1050 <report_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_mvwaddnwstr>:
push   %rax
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1142 <cmd_mvwaddnwstr+0x12>
pop    %rax
ret
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xead(%rip),%rdi
pop    %rax
jmp    1050 <report_error@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_mvwaddnwstr(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = call i32 @check_arg_count(i32 %5, i32 1)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
br label %12
9: ; preds = %2
%10 = call i32 @report_count(i32 1)
%11 = call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_mvwaddnwstr(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ p(char *);
int /*<<< orphan*/ p_good();
int /*<<< orphan*/ p_newline();
void night() {
  p_good();
  p("night");
  p_newline();
}


x86 assembly (clang, -O0):
<night>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <p_good@plt>
lea    0xebe(%rip),%rdi
call   1040 <p@plt>
mov    $0x0,%al
call   1030 <p_newline@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<night>:
push   %rax
xor    %eax,%eax
call   1050 <p_good@plt>
lea    0xec1(%rip),%rdi
call   1040 <p@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <p_newline@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"night\00"
define void @night() {
%1 = call i32 (...) @p_good()
%2 = call i32 @p(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @p_newline()
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"night\00"
define void @night() {
%1 = tail call i32 (...) @p_good()
%2 = tail call i32 @p(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @p_newline()
ret void
}
/* Type definitions */
struct Cyc_Absyn_Exp {
  int dummy;
};

/* Variables and functions */
int Cyc_Tcutil_cnst_exp(int /*<<< orphan*/, int, struct Cyc_Absyn_Exp *);
int Cyc_Tcutil_is_pure_exp(struct Cyc_Absyn_Exp *e) {
  int _T0;
  _T0 = Cyc_Tcutil_cnst_exp(0, 1, e);
  return _T0;
}


x86 assembly (clang, -O0):
<Cyc_Tcutil_is_pure_exp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <Cyc_Tcutil_cnst_exp@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Tcutil_is_pure_exp>:
mov    %rdi,%rdx
xor    %edi,%edi
mov    $0x1,%esi
jmp    1030 <Cyc_Tcutil_cnst_exp@plt>

LLVM IR (-O0):
%struct.Cyc_Absyn_Exp = type { i32 }
define i32 @Cyc_Tcutil_is_pure_exp(%struct.Cyc_Absyn_Exp* %0) {
%2 = alloca %struct.Cyc_Absyn_Exp*
%3 = alloca i32
store %struct.Cyc_Absyn_Exp* %0, %struct.Cyc_Absyn_Exp** %2
%4 = load %struct.Cyc_Absyn_Exp*, %struct.Cyc_Absyn_Exp** %2
%5 = call i32 @Cyc_Tcutil_cnst_exp(i32 0, i32 1, %struct.Cyc_Absyn_Exp* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
%struct.Cyc_Absyn_Exp = type { i32 }
define i32 @Cyc_Tcutil_is_pure_exp(%struct.Cyc_Absyn_Exp* %0) {
%2 = tail call i32 @Cyc_Tcutil_cnst_exp(i32 0, i32 1, %struct.Cyc_Absyn_Exp* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void mlm_free(void *ptr) { free(ptr); }


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

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

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

LLVM IR (-O2):
define void @mlm_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ compile(char *, char *);
int /*<<< orphan*/ usage();
int main(int argc, char *argv[]) {
  char *fileList, *prefix;
  fileList = NULL;
  if (argc != 3) {
    usage();
  }
  prefix = argv[1];
  fileList = argv[2];
  if (compile(fileList, prefix) < 0) {
    return -1;
  }
  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)
movq   $0x0,-0x18(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     114f <main+0x2f>
mov    $0x0,%al
call   1040 <usage@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <compile@plt>
cmp    $0x0,%rax
jge    118a <main+0x6a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1191 <main+0x71>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x3,%edi
je     1130 <main+0x10>
xor    %eax,%eax
call   1040 <usage@plt>
mov    0x8(%rbx),%rsi
mov    0x10(%rbx),%rdi
call   1030 <compile@plt>
sar    $0x3f,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %6
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 3
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 (...) @usage()
br label %12
12: ; preds = %10, %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
store i8* %15, i8** %7
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 2
%18 = load i8*, i8** %17
store i8* %18, i8** %6
%19 = load i8*, i8** %6
%20 = load i8*, i8** %7
%21 = call i64 @compile(i8* %19, i8* %20)
%22 = icmp slt i64 %21, 0
br i1 %22, label %23, label %24
23: ; preds = %12
store i32 -1, i32* %3
br label %25
24: ; preds = %12
store i32 0, i32* %3
br label %25
25: ; preds = %24, %23
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (...) @usage()
br label %6
6: ; preds = %4, %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = getelementptr inbounds i8*, i8** %1, i64 2
%10 = load i8*, i8** %9
%11 = tail call i64 @compile(i8* %10, i8* %8)
%12 = ashr i64 %11, 63
%13 = trunc i64 %12 to i32
ret i32 %13
}
/* Variables and functions */
double log10(scalar_t__);
scalar_t__ pow(double, double);
double gt_quality_solexa_to_phred(double solexascore) {
  return 10.0 * log10(pow(10.0, ((double)solexascore / 10.0)) + 1);
}


x86 assembly (clang, -O0):
<gt_quality_solexa_to_phred>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  0xec6(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xeba(%rip),%xmm0
call   1030 <pow@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1040 <log10@plt>
movaps %xmm0,%xmm1
movsd  0xe9e(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gt_quality_solexa_to_phred>:
push   %rax
movapd %xmm0,%xmm1
movsd  0xed3(%rip),%xmm0
divsd  %xmm0,%xmm1
call   1030 <pow@plt>
lea    0x1(%rax),%rdi
call   1040 <log10@plt>
mulsd  0xeb9(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @gt_quality_solexa_to_phred(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 1.000000e+01
%5 = call i64 @pow(double 1.000000e+01, double %4)
%6 = add nsw i64 %5, 1
%7 = call double @log10(i64 %6)
%8 = fmul double 1.000000e+01, %7
ret double %8
}

LLVM IR (-O2):
define double @gt_quality_solexa_to_phred(double %0) {
%2 = fdiv double %0, 1.000000e+01
%3 = tail call i64 @pow(double 1.000000e+01, double %2)
%4 = add nsw i64 %3, 1
%5 = tail call double @log10(i64 %4)
%6 = fmul double %5, 1.000000e+01
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ pause();
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("start running\n");
  pause();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <pause@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"start running\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @pause()
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"start running\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @pause()
ret i32 0
}
/* Type definitions */
struct UPnPService {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, unsigned short);
void RNDResponseSink_RenderingControl_GetRedVideoGain(
    struct UPnPService *Service, int ErrorCode, void *User,
    unsigned short CurrentRedVideoGain) {
  printf("RND Invoke Response: "
         "RenderingControl/GetRedVideoGain[ErrorCode:%d](%u)\r\n",
         ErrorCode, CurrentRedVideoGain);
}


x86 assembly (clang, -O0):
<RNDResponseSink_RenderingControl_GetRedVideoGain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cx,%ax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ax,-0x1a(%rbp)
mov    -0xc(%rbp),%esi
lea    0xecc(%rip),%rdi
movzwl -0x1a(%rbp),%edx
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RNDResponseSink_RenderingControl_GetRedVideoGain>:
lea    0xee9(%rip),%rdi
mov    %ecx,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.UPnPService = type { i32 }
@.str = [74 x i8] c"RND Invoke Response: RenderingControl/GetRedVideoGain[ErrorCode:%d](%u)\0D\0A\00"
define void @RNDResponseSink_RenderingControl_GetRedVideoGain(%struct.UPnPService* %0, i32 %1, i8* %2, i16 zeroext %3) {
%5 = alloca %struct.UPnPService*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i16
store %struct.UPnPService* %0, %struct.UPnPService** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i16 %3, i16* %8
%9 = load i32, i32* %6
%10 = load i16, i16* %8
%11 = call i32 @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0), i32 %9, i16 zeroext %10)
ret void
}

LLVM IR (-O2):
%struct.UPnPService = type { i32 }
@.str = [74 x i8] c"RND Invoke Response: RenderingControl/GetRedVideoGain[ErrorCode:%d](%u)\0D\0A\00"
define void @RNDResponseSink_RenderingControl_GetRedVideoGain(%struct.UPnPService* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i16 zeroext %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0), i32 %1, i16 zeroext %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ l6480_send_cmd(int, int, int /*<<< orphan*/,
                                  int /*<<< orphan*/);
void l6480_cmd_hardstop(void) {
  l6480_send_cmd(0xB8, 1, 0, 0);
  return;
}


x86 assembly (clang, -O0):
<l6480_cmd_hardstop>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb8,%edi
mov    $0x1,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <l6480_send_cmd@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<l6480_cmd_hardstop>:
mov    $0xb8,%edi
mov    $0x1,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <l6480_send_cmd@plt>

LLVM IR (-O0):
define void @l6480_cmd_hardstop() {
%1 = call i32 @l6480_send_cmd(i32 184, i32 1, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @l6480_cmd_hardstop() {
%1 = tail call i32 @l6480_send_cmd(i32 184, i32 1, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void testBitOr() { printf("%d | %d = %d\n", 10, 4, 10 | 4); }


x86 assembly (clang, -O0):
<testBitOr>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0xa,%esi
mov    $0x4,%edx
mov    $0xe,%ecx
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testBitOr>:
lea    0xee9(%rip),%rdi
mov    $0xa,%esi
mov    $0x4,%edx
mov    $0xe,%ecx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"%d | %d = %d\0A\00"
define void @testBitOr() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 10, i32 4, i32 14)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"%d | %d = %d\0A\00"
define void @testBitOr() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 10, i32 4, i32 14)
ret void
}
/* Variables and functions */
char *strrchr(char *, char);
char *_glp_strtrim(char *str) {
  char *t;
  for (t = strrchr(str, '\0') - 1; t >= str; t--) {
    if (*t != ' ')
      break;
    *t = '\0';
  }
  return str;
}


x86 assembly (clang, -O0):
<_glp_strtrim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <strrchr@plt>
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jb     116a <_glp_strtrim+0x5a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     1152 <_glp_strtrim+0x42>
jmp    116a <_glp_strtrim+0x5a>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    112f <_glp_strtrim+0x1f>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_glp_strtrim>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
add    %rbx,%rax
add    $0xffffffffffffffff,%rax
cmp    %rbx,%rax
jb     1141 <_glp_strtrim+0x31>
cs nopw 0x0(%rax,%rax,1)
nop
cmpb   $0x20,(%rax)
jne    1141 <_glp_strtrim+0x31>
movb   $0x0,(%rax)
add    $0xffffffffffffffff,%rax
cmp    %rbx,%rax
jae    1130 <_glp_strtrim+0x20>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @_glp_strtrim(i8* returned %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = getelementptr i8, i8* %0, i64 %2
%4 = getelementptr inbounds i8, i8* %3, i64 -1
%5 = icmp ult i8* %4, %0
br i1 %5, label %13, label %6
6: ; preds = %1, %10
%7 = phi i8* [ %11, %10 ], [ %4, %1 ]
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 32
br i1 %9, label %10, label %13
10: ; preds = %6
store i8 0, i8* %7
%11 = getelementptr inbounds i8, i8* %7, i64 -1
%12 = icmp ult i8* %11, %0
br i1 %12, label %13, label %6
13: ; preds = %10, %6, %1
ret i8* %0
}
/* Variables and functions */
double fabs(double);
bool isClose(double a, double b) { return (fabs(a - b) <= 5.0); }


x86 assembly (clang, -O0):
<isClose>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
movaps 0xef1(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xed5(%rip),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isClose>:
subsd  %xmm1,%xmm0
andpd  0xef4(%rip),%xmm0
movsd  0xefc(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
setae  %al
ret

LLVM IR (-O0):
define i32 @isClose(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fsub double %5, %6
%8 = call double @llvm.fabs.f64(double %7)
%9 = fcmp ole double %8, 5.000000e+00
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isClose(double %0, double %1) {
%3 = fsub double %0, %1
%4 = tail call double @llvm.fabs.f64(double %3)
%5 = fcmp ole double %4, 5.000000e+00
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ memcpy(char *, char *, int);
char *slice_array(char *array, int start, int end) {
  int numElements = (end - start + 1);
  int numBytes = sizeof(char) * numElements;
  char *slice = (char *)malloc(numBytes);
  memcpy(slice, array + start, numBytes);
  return slice;
}


x86 assembly (clang, -O0):
<slice_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
movslq -0x14(%rbp),%rax
shl    $0x0,%rax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
add    %rax,%rsi
mov    -0x18(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slice_array>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%r15d
mov    %rdi,%r14
sub    %esi,%ebx
add    $0x1,%ebx
mov    %ebx,%edi
call   1040 <malloc@plt>
mov    %rax,%rbp
movslq %r15d,%rsi
add    %r14,%rsi
mov    %rax,%rdi
mov    %ebx,%edx
call   1030 <memcpy@plt>
mov    %rbp,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @slice_array(i8* %0, i32 %1, i32 %2) {
%4 = sub nsw i32 %2, %1
%5 = add nsw i32 %4, 1
%6 = tail call i64 @malloc(i32 %5)
%7 = inttoptr i64 %6 to i8*
%8 = sext i32 %1 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = tail call i32 @memcpy(i8* %7, i8* %9, i32 %5)
ret i8* %7
}
/* Variables and functions */
char *getlogin();
int /*<<< orphan*/ printf(char *, char *);
int main(int artc, char *argv[]) {
  printf("%s\n", getlogin());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getlogin@plt>
mov    %rax,%rsi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <getlogin@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* (...) @getlogin()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ bfalgo(char *, int, int, int);
int /*<<< orphan*/ codeZero(int);
void moveXToY(int x, int y) {
  codeZero(y);
  bfalgo("$[$+$-]", x, y, x);
}


x86 assembly (clang, -O0):
<moveXToY>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <codeZero@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x4(%rbp),%ecx
lea    0xeba(%rip),%rdi
call   1040 <bfalgo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<moveXToY>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %esi,%edi
call   1030 <codeZero@plt>
lea    0xecb(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %ebp,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <bfalgo@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"$[$+$-]\00"
define void @moveXToY(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @codeZero(i32 %5)
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = call i32 @bfalgo(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"$[$+$-]\00"
define void @moveXToY(i32 %0, i32 %1) {
%3 = tail call i32 @codeZero(i32 %1)
%4 = tail call i32 @bfalgo(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, long, int /*<<< orphan*/);
long ftell(int /*<<< orphan*/ *);
long getFsize(FILE *fp) {
  fseek(fp, 0L, SEEK_END);
  return ftell(fp);
}


x86 assembly (clang, -O0):
<getFsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1040 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFsize>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ebd(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <ftell@plt>

LLVM IR (-O0):
@SEEK_END = global i32 0
define i64 @getFsize(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* @SEEK_END
%5 = call i32 @fseek(i32* %3, i64 0, i32 %4)
%6 = load i32*, i32** %2
%7 = call i64 @ftell(i32* %6)
ret i64 %7
}

LLVM IR (-O2):
@SEEK_END = global i32 0
define i64 @getFsize(i32* nocapture %0) {
%2 = load i32, i32* @SEEK_END
%3 = tail call i32 @fseek(i32* %0, i64 0, i32 %2)
%4 = tail call i64 @ftell(i32* %0)
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, void const *, int);
int /*<<< orphan*/ ntohs(int /*<<< orphan*/);
int16_t readInt16(const void *p) {
  int16_t v;
  memcpy(&v, p, 2);
  return ntohs(v);
}


x86 assembly (clang, -O0):
<readInt16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x2,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%edi
call   1040 <ntohs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readInt16>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x2,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%edi
call   1040 <ntohs@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @readInt16(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @memcpy(i32* %3, i8* %4, i32 2)
%6 = load i32, i32* %3
%7 = call i32 @ntohs(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @readInt16(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i8* %0, i32 2)
%5 = load i32, i32* %2
%6 = call i32 @ntohs(i32 %5)
ret i32 %6
}
double r6(void *x) { return *(double *)(x + 32762); }


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

x86 assembly (clang, -O2):
<r6>:
movsd  0x7ffa(%rdi),%xmm0
ret

LLVM IR (-O0):
define double @r6(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr i8, i8* %3, i64 32762
%5 = bitcast i8* %4 to double*
%6 = load double, double* %5
ret double %6
}

LLVM IR (-O2):
define double @r6(i8* nocapture %0) {
%2 = getelementptr i8, i8* %0, i64 32762
%3 = bitcast i8* %2 to double*
%4 = load double, double* %3
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ __set_file_attribute(int *);
scalar_t__ malloc(int);
int open(const char *path, int oflag, ...) {
  int *ret = (int *)malloc(sizeof(int));
  if (ret) {
    __set_file_attribute(ret);
    if (ret < (int *)1)
      while (1)
        ;
    return (size_t)ret;
  }
  return -1;
}


x86 assembly (clang, -O0):
<open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1176 <open+0x56>
mov    -0x20(%rbp),%rdi
call   1040 <__set_file_attribute@plt>
mov    $0x1,%eax
cmp    %rax,-0x20(%rbp)
jae    116a <open+0x4a>
jmp    1165 <open+0x45>
jmp    1165 <open+0x45>
mov    -0x20(%rbp),%rax
mov    %eax,-0x4(%rbp)
jmp    117d <open+0x5d>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open>:
push   %rbx
mov    $0x4,%edi
call   1030 <malloc@plt>
test   %rax,%rax
je     1142 <open+0x22>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <__set_file_attribute@plt>
test   %rbx,%rbx
jne    1147 <open+0x27>
jmp    1140 <open+0x20>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @open(i8* %0, i32 %1, ...) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
store i8* %0, i8** %4
store i32 %1, i32* %5
%7 = call i64 @malloc(i32 4)
%8 = inttoptr i64 %7 to i32*
store i32* %8, i32** %6
%9 = load i32*, i32** %6
%10 = icmp ne i32* %9, null
br i1 %10, label %11, label %22
11: ; preds = %2
%12 = load i32*, i32** %6
%13 = call i32 @__set_file_attribute(i32* %12)
%14 = load i32*, i32** %6
%15 = icmp ult i32* %14, inttoptr (i64 1 to i32*)
br i1 %15, label %16, label %18
16: ; preds = %11
br label %17
17: ; preds = %16, %17
br label %17
18: ; preds = %11
%19 = load i32*, i32** %6
%20 = ptrtoint i32* %19 to i64
%21 = trunc i64 %20 to i32
store i32 %21, i32* %3
br label %23
22: ; preds = %2
store i32 -1, i32* %3
br label %23
23: ; preds = %22, %18
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @open(i8* nocapture readnone %0, i32 %1, ...) {
%3 = tail call i64 @malloc(i32 4)
%4 = inttoptr i64 %3 to i32*
%5 = icmp eq i64 %3, 0
br i1 %5, label %12, label %6
6: ; preds = %2
%7 = tail call i32 @__set_file_attribute(i32* %4)
%8 = icmp ult i32* %4, inttoptr (i64 1 to i32*)
br i1 %8, label %9, label %10
9: ; preds = %6, %9
br label %9
10: ; preds = %6
%11 = trunc i64 %3 to i32
br label %12
12: ; preds = %2, %10
%13 = phi i32 [ %11, %10 ], [ -1, %2 ]
ret i32 %13
}
void ecleazs(xi) register unsigned short *xi;
{
  register int i;
  ++xi;
  for (i = 0; i < (6 + 3) - 1; i++)
    *xi++ = 0;
}


x86 assembly (clang, -O0):
<ecleazs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    1147 <ecleazs+0x47>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x2,%rcx
mov    %rcx,-0x8(%rbp)
movw   $0x0,(%rax)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111b <ecleazs+0x1b>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ecleazs>:
xorps  %xmm0,%xmm0
movups %xmm0,0x2(%rdi)
ret

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

LLVM IR (-O2):
define void @ecleazs(i16* nocapture writeonly %0) {
%2 = getelementptr i16, i16* %0, i64 1
%3 = bitcast i16* %2 to i8*
ret void
}
unsigned int tausStep(unsigned int *z, int S1, int S2, int S3, unsigned int M) {
  return *z = (((*z & M) << S3) ^ (((*z << S1) ^ *z) >> S2));
}


x86 assembly (clang, -O0):
<tausStep>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    -0x18(%rbp),%eax
mov    -0x14(%rbp),%ecx
shl    %cl,%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%edx
mov    -0xc(%rbp),%ecx
shl    %cl,%edx
mov    -0x8(%rbp),%rcx
xor    (%rcx),%edx
mov    -0x10(%rbp),%ecx
shr    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    %eax,(%rcx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<tausStep>:
mov    (%rdi),%r9d
and    %r9d,%r8d
shl    %cl,%r8d
mov    %esi,%ecx
mov    %r9d,%eax
shl    %cl,%eax
xor    %r9d,%eax
mov    %edx,%ecx
shr    %cl,%eax
xor    %r8d,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define i32 @tausStep(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32*, i32** %6
%12 = load i32, i32* %11
%13 = load i32, i32* %10
%14 = and i32 %12, %13
%15 = load i32, i32* %9
%16 = shl i32 %14, %15
%17 = load i32*, i32** %6
%18 = load i32, i32* %17
%19 = load i32, i32* %7
%20 = shl i32 %18, %19
%21 = load i32*, i32** %6
%22 = load i32, i32* %21
%23 = xor i32 %20, %22
%24 = load i32, i32* %8
%25 = lshr i32 %23, %24
%26 = xor i32 %16, %25
%27 = load i32*, i32** %6
store i32 %26, i32* %27
ret i32 %26
}

LLVM IR (-O2):
define i32 @tausStep(i32* nocapture %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = load i32, i32* %0
%7 = and i32 %6, %4
%8 = shl i32 %7, %3
%9 = shl i32 %6, %1
%10 = xor i32 %9, %6
%11 = lshr i32 %10, %2
%12 = xor i32 %11, %8
store i32 %12, i32* %0
ret i32 %12
}
/* Variables and functions */
int db_int_query(char const *, int);
int class_max(void) {
  static const char q[] = "SELECT MAX(id) FROM class";
  return db_int_query(q, sizeof q);
}


x86 assembly (clang, -O0):
<class_max>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1a,%esi
call   1030 <db_int_query@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<class_max>:
lea    0xee9(%rip),%rdi
mov    $0x1a,%esi
jmp    1030 <db_int_query@plt>

LLVM IR (-O0):
@class_max.q = internal constant [26 x i8] c"SELECT MAX(id) FROM class\00"
define i32 @class_max() {
%1 = call i32 @db_int_query(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @class_max.q, i64 0, i64 0), i32 26)
ret i32 %1
}

LLVM IR (-O2):
@class_max.q = internal constant [26 x i8] c"SELECT MAX(id) FROM class\00"
define i32 @class_max() {
%1 = tail call i32 @db_int_query(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @class_max.q, i64 0, i64 0), i32 26)
ret i32 %1
}
/* Variables and functions */
char *tor_strdup_(char *);
char *directory_dump_request_log(void) { return tor_strdup_("Not supported."); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"Not supported.\00"
define i8* @directory_dump_request_log() {
%1 = call i8* @tor_strdup_(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [15 x i8] c"Not supported.\00"
define i8* @directory_dump_request_log() {
%1 = tail call i8* @tor_strdup_(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ syscall(int, long, unsigned long, long long *);
long long rtai_srq(long srq, unsigned long args) {
  long long retval;
  syscall(0x70000001, srq, args, &retval);
  return retval;
}


x86 assembly (clang, -O0):
<rtai_srq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x70000001,%edi
lea    -0x18(%rbp),%rcx
call   1030 <syscall@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtai_srq>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %rsp,%rcx
mov    $0x70000001,%edi
call   1030 <syscall@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @rtai_srq(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i32 @syscall(i32 1879048193, i64 %6, i64 %7, i64* %5)
%9 = load i64, i64* %5
ret i64 %9
}

LLVM IR (-O2):
define i64 @rtai_srq(i64 %0, i64 %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = call i32 @syscall(i32 1879048193, i64 %0, i64 %1, i64* %3)
%6 = load i64, i64* %3
ret i64 %6
}
float fadd(float a, float b) { return a + b; }


x86 assembly (clang, -O0):
<fadd>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fadd>:
addss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @fadd(float %0, float %1) {
%3 = fadd float %0, %1
ret float %3
}
signed char signedchar_ignoring_longlong(signed char x, long long y) {
  return x;
}


x86 assembly (clang, -O0):
<signedchar_ignoring_longlong>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define signext i8 @signedchar_ignoring_longlong(i8 returned signext %0, i64 %1) {
ret i8 %0
}
/* Variables and functions */
int /*<<< orphan*/ VIM_HIF_SetReg8(int, unsigned char);
void VIM_MARB_SetJbufLowThreshold(unsigned long Length) {
  VIM_HIF_SetReg8((0x2400 + 0x02B), (unsigned char)Length);
  VIM_HIF_SetReg8((0x2400 + 0x02A), (unsigned char)(Length >> 8));
  VIM_HIF_SetReg8((0x2400 + 0x029), (unsigned char)(Length >> 16));
}


x86 assembly (clang, -O0):
<VIM_MARB_SetJbufLowThreshold>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x242b,%edi
movzbl %al,%esi
call   1030 <VIM_HIF_SetReg8@plt>
mov    -0x8(%rbp),%rax
shr    $0x8,%rax
mov    $0x242a,%edi
movzbl %al,%esi
call   1030 <VIM_HIF_SetReg8@plt>
mov    -0x8(%rbp),%rax
shr    $0x10,%rax
mov    $0x2429,%edi
movzbl %al,%esi
call   1030 <VIM_HIF_SetReg8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VIM_MARB_SetJbufLowThreshold>:
push   %rbx
mov    %rdi,%rbx
movzbl %bl,%esi
mov    $0x242b,%edi
call   1030 <VIM_HIF_SetReg8@plt>
movzbl %bh,%esi
mov    $0x242a,%edi
call   1030 <VIM_HIF_SetReg8@plt>
shr    $0x10,%ebx
movzbl %bl,%esi
mov    $0x2429,%edi
pop    %rbx
jmp    1030 <VIM_HIF_SetReg8@plt>

LLVM IR (-O0):
define void @VIM_MARB_SetJbufLowThreshold(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i8
%5 = call i32 @VIM_HIF_SetReg8(i32 9259, i8 zeroext %4)
%6 = load i64, i64* %2
%7 = lshr i64 %6, 8
%8 = trunc i64 %7 to i8
%9 = call i32 @VIM_HIF_SetReg8(i32 9258, i8 zeroext %8)
%10 = load i64, i64* %2
%11 = lshr i64 %10, 16
%12 = trunc i64 %11 to i8
%13 = call i32 @VIM_HIF_SetReg8(i32 9257, i8 zeroext %12)
ret void
}

LLVM IR (-O2):
define void @VIM_MARB_SetJbufLowThreshold(i64 %0) {
%2 = trunc i64 %0 to i8
%3 = tail call i32 @VIM_HIF_SetReg8(i32 9259, i8 zeroext %2)
%4 = lshr i64 %0, 8
%5 = trunc i64 %4 to i8
%6 = tail call i32 @VIM_HIF_SetReg8(i32 9258, i8 zeroext %5)
%7 = lshr i64 %0, 16
%8 = trunc i64 %7 to i8
%9 = tail call i32 @VIM_HIF_SetReg8(i32 9257, i8 zeroext %8)
ret void
}