xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ close(int);
int /*<<< orphan*/ ft_error();
int ft_close(int fd) {
  if (close(fd) < 0) {
    ft_error();
    return (-1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<ft_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
cmp    $0x0,%rax
jge    1150 <ft_close+0x30>
mov    $0x0,%al
call   1040 <ft_error@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1157 <ft_close+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_close>:
push   %rax
call   1030 <close@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
js     1132 <ft_close+0x12>
pop    %rcx
ret
xor    %eax,%eax
call   1040 <ft_error@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ft_close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @close(i32 %4)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (...) @ft_error()
store i32 -1, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %7
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @ft_close(i32 %0) {
%2 = tail call i64 @close(i32 %0)
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @ft_error()
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ -1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ pathmake2(char *, char const *, char *, char *,
                             int /*<<< orphan*/ *);
void path_add_dir(char *path, char const *dir) {
  pathmake2(path, dir, "/", path, NULL);
}


x86 assembly (clang, -O0):
<path_add_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rcx
lea    0xecd(%rip),%rdx
xor    %eax,%eax
mov    %eax,%r8d
call   1030 <pathmake2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<path_add_dir>:
lea    0xee9(%rip),%rdx
mov    %rdi,%rcx
xor    %r8d,%r8d
jmp    1030 <pathmake2@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"/\00"
define void @path_add_dir(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %3
%8 = call i32 @pathmake2(i8* %5, i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* %7, i32* null)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
define void @path_add_dir(i8* %0, i8* %1) {
%3 = tail call i32 @pathmake2(i8* %0, i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* %0, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void help(char *program) {
  printf(
      "\nUsage: %s -[aedt] user [-t type]\n\n"
      "options:\n"
      "     -s file     Set the path of smbftpd.conf\n"
      "     -a user     Add a smbftpd virtual user into text file\n"
      "     -e user     Edit a smbftpd virtual user into text file\n"
      "     -d user     Delete a smbftpd virtual user into text file\n"
      "     -g user     Get the status of user.\n"
      "                 The user can be real user or mysql/pgsql/text virtual\n"
      "                 user. We will print the available share and "
      "permission\n"
      "                 of the user.\n"
      "     -h          Print this help message\n\n",
      program);
}


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

x86 assembly (clang, -O2):
<help>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [528 x i8] c"\0AUsage: %s -[aedt] user [-t type]\0A\0Aoptions:\0A -s file Set the path of smbftpd.conf\0A -a user Add a smbftpd virtual user into text file\0A -e user Edit a smbftpd virtual user into text file\0A -d user Delete a smbftpd virtual user into text file\0A -g user Get the status of user.\0A The user can be real user or mysql/pgsql/text virtual\0A user. We will print the available share and permission\0A of the user.\0A -h Print this help message\0A\0A\00"
define void @help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([528 x i8], [528 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [528 x i8] c"\0AUsage: %s -[aedt] user [-t type]\0A\0Aoptions:\0A -s file Set the path of smbftpd.conf\0A -a user Add a smbftpd virtual user into text file\0A -e user Edit a smbftpd virtual user into text file\0A -d user Delete a smbftpd virtual user into text file\0A -g user Get the status of user.\0A The user can be real user or mysql/pgsql/text virtual\0A user. We will print the available share and permission\0A of the user.\0A -h Print this help message\0A\0A\00"
define void @help(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([528 x i8], [528 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int _dldump(const char *str1, const char *str2, int x) { return 0; }


x86 assembly (clang, -O0):
<_dldump>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @_dldump(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @_dldump(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
int main(int argc, char *argv[], char *envp[]) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
jmp    1116 <main+0x16>

x86 assembly (clang, -O2):
<main>:
jmp    1100 <main>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
br label %8
8: ; preds = %3, %8
br label %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
br label %4
4: ; preds = %3, %4
br label %4
}
int main(int argc, char *argv[]) {
  void *Ah;
  int nt;
  nt = 1000;
  (void *(*)[nt]) Ah;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x3e8,-0x1c(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
double __llvm_amdgcn_rcp_f64(double);
double __drcp_ru(double x) { return __llvm_amdgcn_rcp_f64(x); }


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

x86 assembly (clang, -O2):
<__drcp_ru>:
jmp    1030 <__llvm_amdgcn_rcp_f64@plt>

LLVM IR (-O0):
define double @__drcp_ru(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @__llvm_amdgcn_rcp_f64(double %3)
ret double %4
}

LLVM IR (-O2):
define double @__drcp_ru(double %0) {
%2 = tail call double @__llvm_amdgcn_rcp_f64(double %0)
ret double %2
}
/* Variables and functions */
scalar_t__ _irc_chan_init();
scalar_t__ _irc_handler_init();
int irc_init(void) {
  if (_irc_chan_init() < 0)
    return -1;
  if (_irc_handler_init() < 0)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<irc_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <_irc_chan_init@plt>
cmp    $0x0,%rax
jge    1145 <irc_init+0x25>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <irc_init+0x49>
mov    $0x0,%al
call   1040 <_irc_handler_init@plt>
cmp    $0x0,%rax
jge    1162 <irc_init+0x42>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <irc_init+0x49>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_init>:
push   %rax
xor    %eax,%eax
call   1030 <_irc_chan_init@plt>
test   %rax,%rax
js     113a <irc_init+0x1a>
xor    %eax,%eax
call   1040 <_irc_handler_init@plt>
sar    $0x3f,%rax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @irc_init() {
%1 = alloca i32
%2 = call i64 (...) @_irc_chan_init()
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 -1, i32* %1
br label %10
5: ; preds = %0
%6 = call i64 (...) @_irc_handler_init()
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %5
store i32 -1, i32* %1
br label %10
9: ; preds = %5
store i32 0, i32* %1
br label %10
10: ; preds = %9, %8, %4
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
define i32 @irc_init() {
%1 = tail call i64 (...) @_irc_chan_init()
%2 = icmp slt i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i64 (...) @_irc_handler_init()
%5 = ashr i64 %4, 63
%6 = trunc i64 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ -1, %0 ], [ %6, %3 ]
ret i32 %8
}
void XSetAccessControl() {}


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

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

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

LLVM IR (-O2):
define void @XSetAccessControl() {
ret void
}
/* Variables and functions */
int read_int(char *);
int get_max_brightness() {
  return read_int("/sys/class/backlight/acpi_video0/max_brightness");
}


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

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

LLVM IR (-O0):
@.str = [48 x i8] c"/sys/class/backlight/acpi_video0/max_brightness\00"
define i32 @get_max_brightness() {
%1 = call i32 @read_int(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [48 x i8] c"/sys/class/backlight/acpi_video0/max_brightness\00"
define i32 @get_max_brightness() {
%1 = tail call i32 @read_int(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void handle_error(const char *error_message, void *ctx) {
  printf("%s\n", error_message);
}


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

x86 assembly (clang, -O2):
<handle_error>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @handle_error(i8* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void RTAvlroGCPhysDoWithAll(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlroGCPhysDoWithAll() {
ret void
}
void dummy(void) {
  while (1) {
  };
}


x86 assembly (clang, -O0):
<dummy>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <dummy+0x9>
jmp    1109 <dummy+0x9>

x86 assembly (clang, -O2):
<dummy>:
jmp    1100 <dummy>

LLVM IR (-O0):
define void @dummy() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @dummy() {
br label %1
1: ; preds = %0, %1
br label %1
}
float ease(const float in_T) {
  return in_T * in_T * in_T * (in_T * (in_T * 6.0f - 15.0f) + 10.0f);
}


x86 assembly (clang, -O0):
<ease>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
movss  -0x4(%rbp),%xmm2
movss  0xeda(%rip),%xmm3
mulss  %xmm3,%xmm2
movss  0xed2(%rip),%xmm3
addss  %xmm3,%xmm2
mulss  %xmm2,%xmm1
movss  0xeba(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ease>:
movaps %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
movss  0xeed(%rip),%xmm2
mulss  %xmm0,%xmm2
addss  0xee5(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  0xedd(%rip),%xmm0
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @ease(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fmul float %3, %4
%6 = load float, float* %2
%7 = fmul float %5, %6
%8 = load float, float* %2
%9 = load float, float* %2
%10 = call float @llvm.fmuladd.f32(float %9, float 6.000000e+00, float -1.500000e+01)
%11 = call float @llvm.fmuladd.f32(float %8, float %10, float 1.000000e+01)
%12 = fmul float %7, %11
ret float %12
}

LLVM IR (-O2):
define float @ease(float %0) {
%2 = fmul float %0, %0
%3 = fmul float %2, %0
%4 = tail call float @llvm.fmuladd.f32(float %0, float 6.000000e+00, float -1.500000e+01)
%5 = tail call float @llvm.fmuladd.f32(float %0, float %4, float 1.000000e+01)
%6 = fmul float %3, %5
ret float %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ return_sense(int, int /*<<< orphan*/, int /*<<< orphan*/ *,
                                int /*<<< orphan*/ *);
void sam_unit_attention(uint16_t ascq, uint8_t *sam_stat) {
  return_sense(0x06, ascq, NULL, sam_stat);
}


x86 assembly (clang, -O0):
<sam_unit_attention>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rcx
mov    $0x6,%edi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <return_sense@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sam_unit_attention>:
mov    %rsi,%rcx
mov    %edi,%esi
mov    $0x6,%edi
xor    %edx,%edx
jmp    1030 <return_sense@plt>

LLVM IR (-O0):
define void @sam_unit_attention(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 = call i32 @return_sense(i32 6, i32 %5, i32* null, i32* %6)
ret void
}

LLVM IR (-O2):
define void @sam_unit_attention(i32 %0, i32* %1) {
%3 = tail call i32 @return_sense(i32 6, i32 %0, i32* null, i32* %1)
ret void
}
/* Variables and functions */
int log10(double);
double vol_to_db(double vol) { return 20. * log10(vol); }


x86 assembly (clang, -O0):
<vol_to_db>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <log10@plt>
cvtsi2sd %eax,%xmm1
movsd  0xecd(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vol_to_db>:
push   %rax
call   1030 <log10@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xedb(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @vol_to_db(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @log10(double %3)
%5 = sitofp i32 %4 to double
%6 = fmul double 2.000000e+01, %5
ret double %6
}

LLVM IR (-O2):
define double @vol_to_db(double %0) {
%2 = tail call i32 @log10(double %0)
%3 = sitofp i32 %2 to double
%4 = fmul double %3, 2.000000e+01
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_livecode_block_comment() {
  test_parser_verify_parse(test_parser_sourcefile("livecode", " /*livecode*/"),
                           "livecode", "", "/*livecode*/", 0);
}


x86 assembly (clang, -O0):
<test_livecode_block_comment>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed7(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xecf(%rip),%rdx
lea    0xebc(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_livecode_block_comment>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xeda(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xed8(%rip),%rdx
lea    0xec5(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"livecode\00"
@.str.1 = [14 x i8] c" /*livecode*/\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [13 x i8] c"/*livecode*/\00"
define void @test_livecode_block_comment() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"livecode\00"
@.str.1 = [14 x i8] c" /*livecode*/\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [13 x i8] c"/*livecode*/\00"
define void @test_livecode_block_comment() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
int size_col(char *str) {
  int i;
  int j;
  i = 0;
  j = 0;
  while (str[i] != '\n')
    i++;
  i += 1;
  while (str[i] != '\n') {
    j++;
    i++;
  }
  return (j);
}


x86 assembly (clang, -O0):
<size_col>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
je     1139 <size_col+0x39>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <size_col+0x16>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
je     116e <size_col+0x6e>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1142 <size_col+0x42>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<size_col>:
mov    $0xffffffff,%eax
mov    %rdi,%rcx
nopl   0x0(%rax,%rax,1)
add    $0x1,%eax
cmpb   $0xa,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <size_col+0x10>
mov    %eax,%eax
lea    (%rdi,%rax,1),%rcx
add    $0x1,%rcx
mov    $0xffffffff,%eax
nopl   0x0(%rax,%rax,1)
add    $0x1,%eax
cmpb   $0xa,(%rcx)
lea    0x1(%rcx),%rcx
jne    1130 <size_col+0x30>
ret

LLVM IR (-O0):
define i32 @size_col(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %13, %1
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 10
br i1 %12, label %13, label %16
13: ; preds = %5
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %5
16: ; preds = %5
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %19
19: ; preds = %27, %16
%20 = load i8*, i8** %2
%21 = load i32, i32* %3
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %20, i64 %22
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp ne i32 %25, 10
br i1 %26, label %27, label %32
27: ; preds = %19
%28 = load i32, i32* %4
%29 = add nsw i32 %28, 1
store i32 %29, i32* %4
%30 = load i32, i32* %3
%31 = add nsw i32 %30, 1
store i32 %31, i32* %3
br label %19
32: ; preds = %19
%33 = load i32, i32* %4
ret i32 %33
}

LLVM IR (-O2):
define i32 @size_col(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, 10
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = and i64 %3, 4294967295
br label %10
10: ; preds = %8, %10
%11 = phi i64 [ %9, %8 ], [ %13, %10 ]
%12 = phi i32 [ 0, %8 ], [ %17, %10 ]
%13 = add nuw nsw i64 %11, 1
%14 = getelementptr inbounds i8, i8* %0, i64 %13
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 10
%17 = add nuw nsw i32 %12, 1
br i1 %16, label %18, label %10
18: ; preds = %10
ret i32 %12
}
/* Variables and functions */
int do_work(int, char **, char const *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  const char *name = argv[0];
  int stat;
  if (argc < 1) {
    fprintf(stderr, "Usage: %s <hex_num1> [<hex_num_2>...]\n", name);
    exit(1);
  }
  stat = do_work(argc, argv, name);
  exit(stat);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    117e <main+0x4e>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xe91(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <do_work@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    (%rsi),%rdx
test   %edi,%edi
jg     1157 <main+0x27>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
lea    0xeb8(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
call   1030 <do_work@plt>
mov    %eax,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [39 x i8] c"Usage: %s <hex_num1> [<hex_num_2>...]\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 0
%10 = load i8*, i8** %9
store i8* %10, i8** %6
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 1
br i1 %12, label %13, label %18
13: ; preds = %2
%14 = load i32, i32* @stderr
%15 = load i8*, i8** %6
%16 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = call i32 @exit(i32 1)
unreachable
18: ; preds = %2
%19 = load i32, i32* %4
%20 = load i8**, i8*** %5
%21 = load i8*, i8** %6
%22 = call i32 @do_work(i32 %19, i8** %20, i8* %21)
store i32 %22, i32* %7
%23 = load i32, i32* %7
%24 = call i32 @exit(i32 %23)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [39 x i8] c"Usage: %s <hex_num1> [<hex_num_2>...]\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = load i8*, i8** %1
%4 = icmp slt i32 %0, 1
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %3)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
%10 = tail call i32 @do_work(i32 %0, i8** %1, i8* %3)
%11 = tail call i32 @exit(i32 %10)
unreachable
}
/* Variables and functions */
int memcmp(void *, void *, int);
int keyCompare(void *pKey1, int nKey1, void *pKey2, int nKey2) {
  int res;
  res = memcmp(pKey1, pKey2, ((nKey1) < (nKey2) ? (nKey1) : (nKey2)));
  if (res == 0) {
    res = nKey1 - nKey2;
  }
  return res;
}


x86 assembly (clang, -O0):
<keyCompare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    114d <keyCompare+0x3d>
mov    -0xc(%rbp),%eax
mov    %eax,-0x34(%rbp)
jmp    1153 <keyCompare+0x43>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%edx
call   1030 <memcmp@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jne    1179 <keyCompare+0x69>
mov    -0xc(%rbp),%eax
sub    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keyCompare>:
push   %rbx
mov    %esi,%ebx
sub    %ecx,%ebx
cmovl  %esi,%ecx
mov    %rdx,%rsi
mov    %ecx,%edx
call   1030 <memcmp@plt>
test   %eax,%eax
cmove  %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @keyCompare(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = load i8*, i8** %5
%11 = load i8*, i8** %7
%12 = load i32, i32* %6
%13 = load i32, i32* %8
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %17
15: ; preds = %4
%16 = load i32, i32* %6
br label %19
17: ; preds = %4
%18 = load i32, i32* %8
br label %19
19: ; preds = %17, %15
%20 = phi i32 [ %16, %15 ], [ %18, %17 ]
%21 = call i32 @memcmp(i8* %10, i8* %11, i32 %20)
store i32 %21, i32* %9
%22 = load i32, i32* %9
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %28
24: ; preds = %19
%25 = load i32, i32* %6
%26 = load i32, i32* %8
%27 = sub nsw i32 %25, %26
store i32 %27, i32* %9
br label %28
28: ; preds = %24, %19
%29 = load i32, i32* %9
ret i32 %29
}

LLVM IR (-O2):
define i32 @keyCompare(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = icmp slt i32 %1, %3
%6 = select i1 %5, i32 %1, i32 %3
%7 = tail call i32 @memcmp(i8* %0, i8* %2, i32 %6)
%8 = icmp eq i32 %7, 0
%9 = sub nsw i32 %1, %3
%10 = select i1 %8, i32 %9, i32 %7
ret i32 %10
}
/* Variables and functions */
int strlen(char *);
int tools_add_sharp(char *expPtr) {
  int res = 1;
  int len = strlen(expPtr);
  expPtr[len] = '#';
  expPtr[len + 1] = '\0';
  res = 0;
  return res;
}


x86 assembly (clang, -O0):
<tools_add_sharp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x23,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tools_add_sharp>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
movw   $0x23,(%rbx,%rax,1)
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @tools_add_sharp(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
store i8 35, i8* %4
%5 = add nsw i32 %2, 1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 0, i8* %7
ret i32 0
}
int roundNo(float num) { return num < 0 ? num - 0.5 : num + 0.5; }


x86 assembly (clang, -O0):
<roundNo>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1135 <roundNo+0x35>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed9(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    114f <roundNo+0x4f>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeba(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundNo>:
xorps  %xmm1,%xmm1
xor    %eax,%eax
ucomiss %xmm0,%xmm1
seta   %al
cvtss2sd %xmm0,%xmm0
lea    0xeea(%rip),%rcx
addsd  (%rcx,%rax,8),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @roundNo(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp olt float %3, 0.000000e+00
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load float, float* %2
%7 = fpext float %6 to double
%8 = fsub double %7, 5.000000e-01
br label %13
9: ; preds = %1
%10 = load float, float* %2
%11 = fpext float %10 to double
%12 = fadd double %11, 5.000000e-01
br label %13
13: ; preds = %9, %5
%14 = phi double [ %8, %5 ], [ %12, %9 ]
%15 = fptosi double %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @roundNo(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fpext float %0 to double
%4 = select i1 %2, double -5.000000e-01, double 5.000000e-01
%5 = fadd double %4, %3
%6 = fptosi double %5 to i32
ret i32 %6
}
int test_imm_71int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x71 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_71int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 485331304448
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
void regwrite8(uint8_t addr, uint8_t data) { *(volatile uint8_t *)addr = data; }


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

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

LLVM IR (-O0):
define void @regwrite8(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = inttoptr i64 %6 to i64*
store volatile i64 %5, i64* %7
ret void
}

LLVM IR (-O2):
define void @regwrite8(i64 %0, i64 %1) {
%3 = inttoptr i64 %0 to i64*
store volatile i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ setuid(int /*<<< orphan*/);
int /*<<< orphan*/ system(char *);
int main() {
  setuid(0);
  printf("# rmmod -v psmouse\n");
  system("rmmod -v psmouse");
  printf("# modprobe -v psmouse\n");
  system("modprobe -v psmouse");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1050 <setuid@plt>
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
lea    0xebb(%rip),%rdi
call   1030 <system@plt>
lea    0xec0(%rip),%rdi
call   1040 <printf@plt>
lea    0xecb(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1050 <setuid@plt>
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb7(%rip),%rdi
call   1040 <system@plt>
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb2(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"# rmmod -v psmouse\0A\00"
@.str.1 = [17 x i8] c"rmmod -v psmouse\00"
@.str.2 = [23 x i8] c"# modprobe -v psmouse\0A\00"
@.str.3 = [20 x i8] c"modprobe -v psmouse\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @setuid(i32 0)
%3 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @system(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @system(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [17 x i8] c"rmmod -v psmouse\00"
@.str.3 = [20 x i8] c"modprobe -v psmouse\00"
@str = [19 x i8] c"# rmmod -v psmouse\00"
@str.4 = [22 x i8] c"# modprobe -v psmouse\00"
define i32 @main() {
%1 = tail call i32 @setuid(i32 0)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @system(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.4, i64 0, i64 0))
%5 = tail call i32 @system(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct Queue {
  int dummy;
};
struct Node {
  int dummy;
};

/* Variables and functions */
struct Node *_PopFront(struct Queue *);
struct Node *PopFront(struct Queue *queue) {
  if (queue == NULL)
    return NULL;
  return _PopFront(queue);
}


x86 assembly (clang, -O0):
<PopFront>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <PopFront+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1141 <PopFront+0x31>
mov    -0x10(%rbp),%rdi
call   1030 <_PopFront@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PopFront>:
test   %rdi,%rdi
je     111a <PopFront+0xa>
jmp    1030 <_PopFront@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.Node = type { i32 }
%struct.Queue = type { i32 }
define %struct.Node* @PopFront(%struct.Queue* %0) {
%2 = alloca %struct.Node*
%3 = alloca %struct.Queue*
store %struct.Queue* %0, %struct.Queue** %3
%4 = load %struct.Queue*, %struct.Queue** %3
%5 = icmp eq %struct.Queue* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
store %struct.Node* null, %struct.Node** %2
br label %10
7: ; preds = %1
%8 = load %struct.Queue*, %struct.Queue** %3
%9 = call %struct.Node* @_PopFront(%struct.Queue* %8)
store %struct.Node* %9, %struct.Node** %2
br label %10
10: ; preds = %7, %6
%11 = load %struct.Node*, %struct.Node** %2
ret %struct.Node* %11
}

LLVM IR (-O2):
%struct.Node = type { i32 }
%struct.Queue = type { i32 }
define %struct.Node* @PopFront(%struct.Queue* %0) {
%2 = icmp eq %struct.Queue* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call %struct.Node* @_PopFront(%struct.Queue* %0)
br label %5
5: ; preds = %1, %3
%6 = phi %struct.Node* [ %4, %3 ], [ null, %1 ]
ret %struct.Node* %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;
typedef int /*<<< orphan*/ tmp;

/* Variables and functions */
int /*<<< orphan*/ le16toh(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
uint16_t get_le16(uint8_t **bufferp) {
  uint16_t tmp;
  memcpy(&tmp, *bufferp, sizeof(tmp));
  *bufferp += sizeof(tmp);
  return le16toh(tmp);
}


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

x86 assembly (clang, -O2):
<get_le16>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    (%rdi),%rsi
lea    0xc(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
addq   $0x10,(%rbx)
mov    0xc(%rsp),%edi
call   1040 <le16toh@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @get_le16(i32** %0) {
%2 = alloca i32**
%3 = alloca i32
store i32** %0, i32*** %2
%4 = load i32**, i32*** %2
%5 = load i32*, i32** %4
%6 = call i32 @memcpy(i32* %3, i32* %5, i32 4)
%7 = load i32**, i32*** %2
%8 = load i32*, i32** %7
%9 = getelementptr inbounds i32, i32* %8, i64 4
store i32* %9, i32** %7
%10 = load i32, i32* %3
%11 = call i32 @le16toh(i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @get_le16(i32** nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32*, i32** %0
%5 = call i32 @memcpy(i32* %2, i32* %4, i32 4)
%6 = load i32*, i32** %0
%7 = getelementptr inbounds i32, i32* %6, i64 4
store i32* %7, i32** %0
%8 = load i32, i32* %2
%9 = call i32 @le16toh(i32 %8)
ret i32 %9
}
/* Type definitions */
struct stat {
  int st_size;
};

/* Variables and functions */
int /*<<< orphan*/ fstat(int, struct stat *);
int file_size(int file) {
  struct stat buf;
  fstat(file, &buf);
  return buf.st_size;
}


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

x86 assembly (clang, -O2):
<file_size>:
push   %rax
mov    %rsp,%rsi
call   1030 <fstat@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @file_size(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.stat
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @fstat(i32 %4, %struct.stat* %3)
%6 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @file_size(i32 %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @fstat(i32 %0, %struct.stat* %2)
%5 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t swap8(uint8_t b) { return (b << 4) | (b >> 4); }


x86 assembly (clang, -O0):
<swap8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x4,%eax
mov    -0x4(%rbp),%ecx
sar    $0x4,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap8>:
mov    %edi,%eax
shl    $0x4,%eax
sar    $0x4,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @swap8(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 4
%5 = load i32, i32* %2
%6 = ashr i32 %5, 4
%7 = or i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @swap8(i32 %0) {
%2 = shl i32 %0, 4
%3 = ashr i32 %0, 4
%4 = or i32 %2, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stdout;
void usage(char *arg0) {
  fprintf(stdout, "%s input_file output_file max_len", arg0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [34 x i8] c"%s input_file output_file max_len\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [34 x i8] c"%s input_file output_file max_len\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int wcscmp(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int Loopr_wcscmp(wchar_t *s1, wchar_t *s2) { return wcscmp(s1, s2); }


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

x86 assembly (clang, -O2):
<Loopr_wcscmp>:
jmp    1030 <wcscmp@plt>

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

LLVM IR (-O2):
define i32 @Loopr_wcscmp(i32* %0, i32* %1) {
%3 = tail call i32 @wcscmp(i32* %0, i32* %1)
ret i32 %3
}
void ft_strclr(char *s) {
  if (!s)
    return;
  while (*s)
    *(s++) = '\0';
}


x86 assembly (clang, -O0):
<ft_strclr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1118 <ft_strclr+0x18>
jmp    1141 <ft_strclr+0x41>
jmp    111d <ft_strclr+0x1d>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1141 <ft_strclr+0x41>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x0,(%rax)
jmp    111d <ft_strclr+0x1d>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strclr>:
test   %rdi,%rdi
je     111d <ft_strclr+0x1d>
cmpb   $0x0,(%rdi)
je     111d <ft_strclr+0x1d>
add    $0x1,%rdi
xchg   %ax,%ax
movb   $0x0,-0x1(%rdi)
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <ft_strclr+0x10>
ret

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

LLVM IR (-O2):
define void @ft_strclr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %8, %6 ], [ %0, %3 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8 0, i8* %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %6
11: ; preds = %6, %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ writeVerbose(int, char *, char *, char *, char *, char *);
void showUsage() {
  writeVerbose(1, "%s (%s) %s :: %s\n", "rlogin.mod", "2.0",
               "pMonkey <pmonkey@foofus.net>",
               "Brute force module for RLOGIN sessions");
}


x86 assembly (clang, -O0):
<showUsage>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
lea    0xeeb(%rip),%rdx
lea    0xeef(%rip),%rcx
lea    0xeec(%rip),%r8
lea    0xf02(%rip),%r9
call   1030 <writeVerbose@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<showUsage>:
lea    0xee9(%rip),%rsi
lea    0xef4(%rip),%rdx
lea    0xef8(%rip),%rcx
lea    0xef5(%rip),%r8
lea    0xf0b(%rip),%r9
mov    $0x1,%edi
jmp    1030 <writeVerbose@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"%s (%s) %s :: %s\0A\00"
@.str.1 = [11 x i8] c"rlogin.mod\00"
@.str.2 = [4 x i8] c"2.0\00"
@.str.3 = [29 x i8] c"pMonkey <pmonkey@foofus.net>\00"
@.str.4 = [39 x i8] c"Brute force module for RLOGIN sessions\00"
define void @showUsage() {
%1 = call i32 @writeVerbose(i32 1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"%s (%s) %s :: %s\0A\00"
@.str.1 = [11 x i8] c"rlogin.mod\00"
@.str.2 = [4 x i8] c"2.0\00"
@.str.3 = [29 x i8] c"pMonkey <pmonkey@foofus.net>\00"
@.str.4 = [39 x i8] c"Brute force module for RLOGIN sessions\00"
define void @showUsage() {
%1 = tail call i32 @writeVerbose(i32 1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello Split Module Table world (4)\n");
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"Hello Split Module Table world (4)\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [35 x i8] c"Hello Split Module Table world (4)\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ TPU_restart_ch(int);
void tcnt_restart(void) { TPU_restart_ch(3); }


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

x86 assembly (clang, -O2):
<tcnt_restart>:
mov    $0x3,%edi
jmp    1030 <TPU_restart_ch@plt>

LLVM IR (-O0):
define void @tcnt_restart() {
%1 = call i32 @TPU_restart_ch(i32 3)
ret void
}

LLVM IR (-O2):
define void @tcnt_restart() {
%1 = tail call i32 @TPU_restart_ch(i32 3)
ret void
}