xunge/DecIR huggingface dataset:
unsigned str_length(const char *s) {
  unsigned len = 0;
  while (s[len])
    len++;
  return len;
}


x86 assembly (clang, -O0):
<str_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
cmpb   $0x0,(%rax,%rcx,1)
je     112e <str_length+0x2e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <str_length+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @str_length(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %8, %2 ]
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = add i32 %3, 1
br i1 %7, label %9, label %2
9: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ NOROM_DDI16BitfieldWrite(int, int, int, int, int);
void OSCClockLossEventEnable(void) {
  NOROM_DDI16BitfieldWrite(0x400CA000, 0x00000000, 0x00000200, 9, 1);
}


x86 assembly (clang, -O0):
<OSCClockLossEventEnable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400ca000,%edi
xor    %esi,%esi
mov    $0x200,%edx
mov    $0x9,%ecx
mov    $0x1,%r8d
call   1030 <NOROM_DDI16BitfieldWrite@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<OSCClockLossEventEnable>:
mov    $0x400ca000,%edi
xor    %esi,%esi
mov    $0x200,%edx
mov    $0x9,%ecx
mov    $0x1,%r8d
jmp    1030 <NOROM_DDI16BitfieldWrite@plt>

LLVM IR (-O0):
define void @OSCClockLossEventEnable() {
%1 = call i32 @NOROM_DDI16BitfieldWrite(i32 1074569216, i32 0, i32 512, i32 9, i32 1)
ret void
}

LLVM IR (-O2):
define void @OSCClockLossEventEnable() {
%1 = tail call i32 @NOROM_DDI16BitfieldWrite(i32 1074569216, i32 0, i32 512, i32 9, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ extract_file_id(char const *, char *);
int /*<<< orphan*/ strcat(char *, char *);
void align_id(const char *file1, const char *file2, char *id) {
  char id2[100];
  extract_file_id(file1, id);
  extract_file_id(file2, id2);
  strcat(id, "_");
  strcat(id, id2);
}


x86 assembly (clang, -O0):
<align_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <extract_file_id@plt>
mov    -0x10(%rbp),%rdi
lea    -0x80(%rbp),%rsi
call   1030 <extract_file_id@plt>
mov    -0x18(%rbp),%rdi
lea    0xea4(%rip),%rsi
call   1040 <strcat@plt>
mov    -0x18(%rbp),%rdi
lea    -0x80(%rbp),%rsi
call   1040 <strcat@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<align_id>:
push   %r15
push   %r14
push   %rbx
sub    $0x70,%rsp
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdx,%rsi
call   1030 <extract_file_id@plt>
mov    %rsp,%r15
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <extract_file_id@plt>
lea    0xeb4(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcat@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <strcat@plt>
add    $0x70,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [2 x i8] c"_\00"
define void @align_id(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [100 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %6
%10 = call i32 @extract_file_id(i8* %8, i8* %9)
%11 = load i8*, i8** %5
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%13 = call i32 @extract_file_id(i8* %11, i8* %12)
%14 = load i8*, i8** %6
%15 = call i32 @strcat(i8* %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%16 = load i8*, i8** %6
%17 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%18 = call i32 @strcat(i8* %16, i8* %17)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"_\00"
define void @align_id(i8* %0, i8* %1, i8* %2) {
%4 = alloca [100 x i8]
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%6 = tail call i32 @extract_file_id(i8* %0, i8* %2)
%7 = call i32 @extract_file_id(i8* %1, i8* %5)
%8 = call i32 @strcat(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @strcat(i8* %2, i8* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fh_print_help() {
  printf("Usage: flat [options] [script.js] \n"
         "\n"
         "Options:\n"
         "  -v, --version       print version info\n"
         "  -h, --help          print this help text\n"
         "  -i, --interactive   force REPL\n"
         "  -n, --nodes         print the AST\n"
         "  -t, --tokens        print tokens\n");
}


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

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

LLVM IR (-O0):
@.str = [234 x i8] c"Usage: flat [options] [script.js] \0A\0AOptions:\0A -v, --version print version info\0A -h, --help print this help text\0A -i, --interactive force REPL\0A -n, --nodes print the AST\0A -t, --tokens print tokens\0A\00"
define void @fh_print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([234 x i8], [234 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [233 x i8] c"Usage: flat [options] [script.js] \0A\0AOptions:\0A -v, --version print version info\0A -h, --help print this help text\0A -i, --interactive force REPL\0A -n, --nodes print the AST\0A -t, --tokens print tokens\00"
define void @fh_print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([233 x i8], [233 x i8]* @str, i64 0, i64 0))
ret void
}
void ct_callback_do_nothing(struct ct_model *model,
                            struct ct_section *section) {}


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

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

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

LLVM IR (-O2):
%struct.ct_model = type opaque
%struct.ct_section = type opaque
define void @ct_callback_do_nothing(%struct.ct_model* nocapture %0, %struct.ct_section* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gms_styled_char(int, char);
void gms_standout_char(char c) { gms_styled_char((1), c); }


x86 assembly (clang, -O0):
<gms_standout_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%edi
movsbl -0x1(%rbp),%esi
call   1030 <gms_styled_char@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gms_standout_char>:
mov    %edi,%esi
mov    $0x1,%edi
jmp    1030 <gms_styled_char@plt>

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

LLVM IR (-O2):
define void @gms_standout_char(i8 signext %0) {
%2 = tail call i32 @gms_styled_char(i32 1, i8 signext %0)
ret void
}
/* Variables and functions */
double floor(double);
double astro_julian_0h(double jd) { return floor(jd - 0.5) + 0.5; }


x86 assembly (clang, -O0):
<astro_julian_0h>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <floor@plt>
movsd  0xec5(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<astro_julian_0h>:
push   %rax
addsd  0xee7(%rip),%xmm0
call   1030 <floor@plt>
addsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @astro_julian_0h(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double %3, 5.000000e-01
%5 = call double @llvm.floor.f64(double %4)
%6 = fadd double %5, 5.000000e-01
ret double %6
}

LLVM IR (-O2):
define double @astro_julian_0h(double %0) {
%2 = fadd double %0, -5.000000e-01
%3 = tail call double @llvm.floor.f64(double %2)
%4 = fadd double %3, 5.000000e-01
ret double %4
}
void INT_Excep_PERIB_INTB197(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIB_INTB197() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ error(int, int /*<<< orphan*/, char *, char const *);
void die(const char *msg) { error(1, errno, "%s", msg); }


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rcx
mov    $0x1,%edi
lea    0xecb(%rip),%rdx
call   1030 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<die>:
mov    %rdi,%rcx
mov    0x2ec6(%rip),%rax
mov    (%rax),%esi
lea    0xedd(%rip),%rdx
mov    $0x1,%edi
jmp    1030 <error@plt>

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

LLVM IR (-O2):
@errno = global i32 0
@.str = [3 x i8] c"%s\00"
define void @die(i8* %0) {
%2 = load i32, i32* @errno
%3 = tail call i32 @error(i32 1, i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
int /*<<< orphan*/ *strchr(char *, char);
int dispatch_command(char *inBuf, char *outBuf) {
  memcpy(outBuf, inBuf, 256);
  if (NULL != strchr(inBuf, '\n')) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<dispatch_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x100,%edx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     116a <dispatch_command+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1171 <dispatch_command+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dispatch_command>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rbx,%rsi
mov    $0x100,%edx
call   1040 <memcpy@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @dispatch_command(i8* %0, i8* %1) {
%3 = tail call i32 @memcpy(i8* %1, i8* %0, i32 256)
%4 = tail call i32* @strchr(i8* %0, i8 signext 10)
%5 = icmp ne i32* %4, null
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ die(char *, scalar_t__);
char *strdup(char *);
scalar_t__ strlen(char *);
char *hlr_strdups(char *s1) {
  char *s2 = strdup(s1);
  if (!s2)
    die("hlr_strdups([%d bytes]) failed.", strlen(s1) + 1);
  return s2;
}


x86 assembly (clang, -O0):
<hlr_strdups>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1170 <hlr_strdups+0x40>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rsi
add    $0x1,%rsi
lea    0xe95(%rip),%rdi
call   1040 <die@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hlr_strdups>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    115c <hlr_strdups+0x2c>
mov    %r14,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%rsi
lea    0xea9(%rip),%rdi
call   1040 <die@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [32 x i8] c"hlr_strdups([%d bytes]) failed.\00"
define i8* @hlr_strdups(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %13, label %8
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i64 @strlen(i8* %9)
%11 = add nsw i64 %10, 1
%12 = call i32 @die(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i64 %11)
br label %13
13: ; preds = %8, %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@.str = [32 x i8] c"hlr_strdups([%d bytes]) failed.\00"
define noalias i8* @hlr_strdups(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%6 = add nsw i64 %5, 1
%7 = tail call i32 @die(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i64 %6)
br label %8
8: ; preds = %4, %1
ret i8* %2
}
char *procprt_TSLPI_e(struct tstat *curstat, int avgval, int nsecs) {
  return "    0";
}


x86 assembly (clang, -O0):
<procprt_TSLPI_e>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    0xeeb(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<procprt_TSLPI_e>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
%struct.tstat = type opaque
@.str = [6 x i8] c" 0\00"
define i8* @procprt_TSLPI_e(%struct.tstat* %0, i32 %1, i32 %2) {
%4 = alloca %struct.tstat*
%5 = alloca i32
%6 = alloca i32
store %struct.tstat* %0, %struct.tstat** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.tstat = type opaque
@.str = [6 x i8] c" 0\00"
define i8* @procprt_TSLPI_e(%struct.tstat* nocapture readnone %0, i32 %1, i32 %2) {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int close(int);
int close_connection(int sock) { return close(sock); }


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

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

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

LLVM IR (-O2):
define i32 @close_connection(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
int count_dots(const char *p) {
  int dots = 0;
  while (*p)
    if (*p++ == '.')
      dots++;
  return dots;
}


x86 assembly (clang, -O0):
<count_dots>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <count_dots+0x45>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    1140 <count_dots+0x40>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <count_dots+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_dots>:
mov    (%rdi),%cl
test   %cl,%cl
je     1126 <count_dots+0x26>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
xor    %edx,%edx
cmp    $0x2e,%cl
sete   %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <count_dots+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @count_dots(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = icmp eq i8 %5, 46
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %6, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %15
}
int main() {
  int a;
  a = 5;
  return 5;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    $0x5,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x5,%eax
ret

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

LLVM IR (-O2):
define i32 @main() {
ret i32 5
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t Sigma1(uint64_t x) {
  return (x >> 14 | x << 50) ^ (x >> 18 | x << 46) ^ (x >> 41 | x << 23);
}


x86 assembly (clang, -O0):
<Sigma1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0xe,%eax
mov    -0x4(%rbp),%edx
mov    $0x32,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x12,%ecx
mov    %ecx,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x2e,%ecx
shl    %cl,%edx
mov    -0x8(%rbp),%ecx
or     %edx,%ecx
xor    %ecx,%eax
mov    -0x4(%rbp),%edx
mov    $0x29,%ecx
sar    %cl,%edx
mov    %edx,%ecx
mov    -0x4(%rbp),%edx
shl    $0x17,%edx
or     %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @Sigma1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 14
%5 = load i32, i32* %2
%6 = shl i32 %5, 50
%7 = or i32 %4, %6
%8 = load i32, i32* %2
%9 = ashr i32 %8, 18
%10 = load i32, i32* %2
%11 = shl i32 %10, 46
%12 = or i32 %9, %11
%13 = xor i32 %7, %12
%14 = load i32, i32* %2
%15 = ashr i32 %14, 41
%16 = load i32, i32* %2
%17 = shl i32 %16, 23
%18 = or i32 %15, %17
%19 = xor i32 %13, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @Sigma1(i32 %0) {
ret i32 poison
}
int rmdir2(char *pathname) { return -1; }


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

x86 assembly (clang, -O2):
<rmdir2>:
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @rmdir2(i8* nocapture readnone %0) {
ret i32 -1
}
char get_file_chr(int file_int) {
  if (file_int >= 0 && file_int <= 7)
    return (char)('a' + file_int);
  return '\0';
}


x86 assembly (clang, -O0):
<get_file_chr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1129 <get_file_chr+0x29>
cmpl   $0x7,-0x8(%rbp)
jg     1129 <get_file_chr+0x29>
mov    -0x8(%rbp),%eax
add    $0x61,%eax
mov    %al,-0x1(%rbp)
jmp    112d <get_file_chr+0x2d>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_file_chr>:
lea    0x61(%rdi),%eax
xor    %ecx,%ecx
cmp    $0x8,%edi
movzbl %al,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @get_file_chr(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 7
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = load i32, i32* %3
%11 = add nsw i32 97, %10
%12 = trunc i32 %11 to i8
store i8 %12, i8* %2
br label %14
13: ; preds = %6, %1
store i8 0, i8* %2
br label %14
14: ; preds = %13, %9
%15 = load i8, i8* %2
ret i8 %15
}

LLVM IR (-O2):
define signext i8 @get_file_chr(i32 %0) {
%2 = icmp ult i32 %0, 8
%3 = trunc i32 %0 to i8
%4 = add i8 %3, 97
%5 = select i1 %2, i8 %4, i8 0
ret i8 %5
}
int toyarda(int m) {
  int yarda;
  yarda = m / 3;
  return yarda;
}


x86 assembly (clang, -O0):
<toyarda>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toyarda>:
movslq %edi,%rax
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @toyarda(i32 %0) {
%2 = sdiv i32 %0, 3
ret i32 %2
}
int main(int argc, char *argv[]) {
  int thread_id = (int)(argv[1]);
  int (*component_main)(int) = (int (*)(int))(argv[2]);
  return component_main(thread_id);
}


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    0x8(%rax),%rax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x14(%rbp),%edi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    0x8(%rsi),%edi
jmp    *0x10(%rsi)

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32 (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 1
%10 = load i8*, i8** %9
%11 = ptrtoint i8* %10 to i32
store i32 %11, i32* %6
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 2
%14 = load i8*, i8** %13
%15 = bitcast i8* %14 to i32 (i32)*
store i32 (i32)* %15, i32 (i32)** %7
%16 = load i32 (i32)*, i32 (i32)** %7
%17 = load i32, i32* %6
%18 = call i32 %16(i32 %17)
ret i32 %18
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = ptrtoint i8* %4 to i64
%6 = trunc i64 %5 to i32
%7 = getelementptr inbounds i8*, i8** %1, i64 2
%8 = bitcast i8** %7 to i32 (i32)**
%9 = load i32 (i32)*, i32 (i32)** %8
%10 = tail call i32 %9(i32 %6)
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ tabTransp(int);
void IF_TabTranspT(void) { tabTransp(-1); }


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

x86 assembly (clang, -O2):
<IF_TabTranspT>:
mov    $0xffffffff,%edi
jmp    1030 <tabTransp@plt>

LLVM IR (-O0):
define void @IF_TabTranspT() {
%1 = call i32 @tabTransp(i32 -1)
ret void
}

LLVM IR (-O2):
define void @IF_TabTranspT() {
%1 = tail call i32 @tabTransp(i32 -1)
ret void
}
void m_nohang(fd) int fd;
{}


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

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

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

LLVM IR (-O2):
define void @m_nohang(i32 %0) {
ret void
}
int funcao(int *x) {
  *x = 20;
  return x;
}


x86 assembly (clang, -O0):
<funcao>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x14,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<funcao>:
mov    %rdi,%rax
movl   $0x14,(%rdi)
ret

LLVM IR (-O0):
define i32 @funcao(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
store i32 20, i32* %3
%4 = load i32*, i32** %2
%5 = ptrtoint i32* %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @funcao(i32* %0) {
store i32 20, i32* %0
%2 = ptrtoint i32* %0 to i64
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
char *strncpy(char *, char const *, size_t);
char *strncpy0(char *strDest, const char *strSource, size_t count) {
  char *rval;
  if ((strDest == NULL) || (strSource == NULL) || (count < 0))
    return (NULL);
  rval = strncpy(strDest, strSource, count);
  strDest[count - 1] = 0;
  return (rval);
}


x86 assembly (clang, -O0):
<strncpy0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1145 <strncpy0+0x35>
cmpq   $0x0,-0x18(%rbp)
je     1145 <strncpy0+0x35>
cmpq   $0x0,-0x20(%rbp)
jae    1152 <strncpy0+0x42>
movq   $0x0,-0x8(%rbp)
jmp    117f <strncpy0+0x6f>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <strncpy@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncpy0>:
xor    %eax,%eax
test   %rdi,%rdi
je     113b <strncpy0+0x2b>
test   %rsi,%rsi
je     113b <strncpy0+0x2b>
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <strncpy@plt>
movb   $0x0,-0x1(%r14,%rbx,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strncpy0(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %17, label %11
11: ; preds = %3
%12 = load i8*, i8** %6
%13 = icmp eq i8* %12, null
br i1 %13, label %17, label %14
14: ; preds = %11
%15 = load i64, i64* %7
%16 = icmp ult i64 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %14, %11, %3
store i8* null, i8** %4
br label %28
18: ; preds = %14
%19 = load i8*, i8** %5
%20 = load i8*, i8** %6
%21 = load i64, i64* %7
%22 = call i8* @strncpy(i8* %19, i8* %20, i64 %21)
store i8* %22, i8** %8
%23 = load i8*, i8** %5
%24 = load i64, i64* %7
%25 = sub i64 %24, 1
%26 = getelementptr inbounds i8, i8* %23, i64 %25
store i8 0, i8* %26
%27 = load i8*, i8** %8
store i8* %27, i8** %4
br label %28
28: ; preds = %18, %17
%29 = load i8*, i8** %4
ret i8* %29
}

LLVM IR (-O2):
define i8* @strncpy0(i8* %0, i8* %1, i64 %2) {
%4 = icmp eq i8* %0, null
%5 = icmp eq i8* %1, null
%6 = or i1 %4, %5
br i1 %6, label %11, label %7
7: ; preds = %3
%8 = tail call i8* @strncpy(i8* dereferenceable(1) %0, i8* %1, i64 %2)
%9 = add i64 %2, -1
%10 = getelementptr inbounds i8, i8* %0, i64 %9
store i8 0, i8* %10
br label %11
11: ; preds = %3, %7
%12 = phi i8* [ %0, %7 ], [ null, %3 ]
ret i8* %12
}
void g_log_remove_handler() {}


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

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

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

LLVM IR (-O2):
define void @g_log_remove_handler() {
ret void
}
/* Variables and functions */
int ioCanSetFileTypeOfSize(char *, int);
int secCanSetFileTypeOfSize(char *fileName, int fileNameSize) {
  return ioCanSetFileTypeOfSize(fileName, fileNameSize);
}


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

x86 assembly (clang, -O2):
<secCanSetFileTypeOfSize>:
jmp    1030 <ioCanSetFileTypeOfSize@plt>

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

LLVM IR (-O2):
define i32 @secCanSetFileTypeOfSize(i8* %0, i32 %1) {
%3 = tail call i32 @ioCanSetFileTypeOfSize(i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ pbnumbase(int, int, int /*<<< orphan*/);
void pbnum(int n) { pbnumbase(n, 10, 0); }


x86 assembly (clang, -O0):
<pbnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xa,%esi
xor    %edx,%edx
call   1030 <pbnumbase@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pbnum>:
mov    $0xa,%esi
xor    %edx,%edx
jmp    1030 <pbnumbase@plt>

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

LLVM IR (-O2):
define void @pbnum(i32 %0) {
%2 = tail call i32 @pbnumbase(i32 %0, i32 10, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void sim_free(void *ptr) { free(ptr); }


x86 assembly (clang, -O0):
<sim_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):
<sim_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @sim_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 @sim_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int rwrite(fd, a, len) const int fd;
const void *const a;
const int len;
{ return write(fd, a, len); }


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

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

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

LLVM IR (-O2):
define i32 @rwrite(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i32, ...)*)(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
int cmp(const void *x, const void *y) { return (int)(*(char *)x - *(char *)y); }


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

x86 assembly (clang, -O2):
<cmp>:
movsbl (%rdi),%eax
movsbl (%rsi),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmp(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* %5
%7 = sext i8 %6 to i32
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = sext i8 %3 to i32
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
char charToHex(char);
char charsToHex(char c1, char c2) {
  char hex1 = charToHex(c1);
  char hex2 = charToHex(c2);
  return (hex1 << 4) + hex2;
}


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

x86 assembly (clang, -O2):
<charsToHex>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
call   1030 <charToHex@plt>
mov    %eax,%ebx
mov    %ebp,%edi
call   1030 <charToHex@plt>
shl    $0x4,%bl
add    %bl,%al
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define signext i8 @charsToHex(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%7 = load i8, i8* %3
%8 = call signext i8 @charToHex(i8 signext %7)
store i8 %8, i8* %5
%9 = load i8, i8* %4
%10 = call signext i8 @charToHex(i8 signext %9)
store i8 %10, i8* %6
%11 = load i8, i8* %5
%12 = sext i8 %11 to i32
%13 = shl i32 %12, 4
%14 = load i8, i8* %6
%15 = sext i8 %14 to i32
%16 = add nsw i32 %13, %15
%17 = trunc i32 %16 to i8
ret i8 %17
}

LLVM IR (-O2):
define signext i8 @charsToHex(i8 signext %0, i8 signext %1) {
%3 = tail call signext i8 @charToHex(i8 signext %0)
%4 = tail call signext i8 @charToHex(i8 signext %1)
%5 = shl i8 %3, 4
%6 = add i8 %5, %4
ret i8 %6
}
/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ stdout;
void logpath(unsigned depth, const char *name) {
  for (unsigned d = 0; d < depth; ++d)
    fputc('\t', stdout);
  printf("%s\n", name);
}


x86 assembly (clang, -O0):
<logpath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    1163 <logpath+0x43>
mov    0x2e97(%rip),%rax
mov    (%rax),%esi
mov    $0x9,%edi
call   1040 <fputc@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1136 <logpath+0x16>
mov    -0x10(%rbp),%rsi
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logpath>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
test   %edi,%edi
je     1151 <logpath+0x31>
mov    %edi,%ebp
mov    0x2eac(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%rbx),%esi
mov    $0x9,%edi
call   1040 <fputc@plt>
add    $0xffffffff,%ebp
jne    1140 <logpath+0x20>
lea    0xea8(%rip),%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @logpath(i32 %0, i8* %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %6, %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
6: ; preds = %2, %6
%7 = phi i32 [ %10, %6 ], [ 0, %2 ]
%8 = load i32, i32* @stdout
%9 = tail call i32 @fputc(i8 signext 9, i32 %8)
%10 = add nuw i32 %7, 1
%11 = icmp eq i32 %10, %0
br i1 %11, label %4, label %6
}
/* Variables and functions */
int /*<<< orphan*/ debug_warning(char *);
int /*<<< orphan*/ h_free(void *);
void component_enemy_blob_free(void *handle) {
  if (!handle) {
    debug_warning("[component_enemy_blob_free] handle cannot be NULL");
    return;
  }
  h_free(handle);
}


x86 assembly (clang, -O0):
<component_enemy_blob_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1148 <component_enemy_blob_free+0x28>
lea    0xec2(%rip),%rdi
call   1040 <debug_warning@plt>
jmp    1151 <component_enemy_blob_free+0x31>
mov    -0x8(%rbp),%rdi
call   1030 <h_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<component_enemy_blob_free>:
test   %rdi,%rdi
je     112a <component_enemy_blob_free+0xa>
jmp    1030 <h_free@plt>
lea    0xecf(%rip),%rdi
jmp    1040 <debug_warning@plt>

LLVM IR (-O0):
@.str = [50 x i8] c"[component_enemy_blob_free] handle cannot be NULL\00"
define void @component_enemy_blob_free(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 %7, label %5
5: ; preds = %1
%6 = call i32 @debug_warning(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
br label %10
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 @h_free(i8* %8)
br label %10
10: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str = [50 x i8] c"[component_enemy_blob_free] handle cannot be NULL\00"
define void @component_enemy_blob_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @debug_warning(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %1
%6 = tail call i32 @h_free(i8* %0)
br label %7
7: ; preds = %5, %3
ret void
}
/* Type definitions */
struct user_regs_struct {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ exec_by_all_variants(int, int *);
void sys_futex(int variant_count, int *child, struct user_regs_struct *regs) {
  exec_by_all_variants(variant_count, child);
}


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

x86 assembly (clang, -O2):
<sys_futex>:
jmp    1030 <exec_by_all_variants@plt>

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

LLVM IR (-O2):
%struct.user_regs_struct = type { i32 }
define void @sys_futex(i32 %0, i32* %1, %struct.user_regs_struct* nocapture readnone %2) {
%4 = tail call i32 @exec_by_all_variants(i32 %0, i32* %1)
ret void
}
/* Type definitions */
struct UPnPService {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *, char *, char *);
void RNDResponseSink_AVTransport_GetTransportInfo(struct UPnPService *Service,
                                                  int ErrorCode, void *User,
                                                  char *CurrentTransportState,
                                                  char *CurrentTransportStatus,
                                                  char *CurrentSpeed) {
  printf("RND Invoke Response: "
         "AVTransport/GetTransportInfo[ErrorCode:%d](%s,%s,%s)\r\n",
         ErrorCode, CurrentTransportState, CurrentTransportStatus,
         CurrentSpeed);
}


x86 assembly (clang, -O0):
<RNDResponseSink_AVTransport_GetTransportInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RNDResponseSink_AVTransport_GetTransportInfo>:
lea    0xee9(%rip),%rdi
mov    %rcx,%rdx
mov    %r8,%rcx
mov    %r9,%r8
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.UPnPService = type { i32 }
@.str = [76 x i8] c"RND Invoke Response: AVTransport/GetTransportInfo[ErrorCode:%d](%s,%s,%s)\0D\0A\00"
define void @RNDResponseSink_AVTransport_GetTransportInfo(%struct.UPnPService* %0, i32 %1, i8* %2, i8* %3, i8* %4, i8* %5) {
%7 = alloca %struct.UPnPService*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
store %struct.UPnPService* %0, %struct.UPnPService** %7
store i32 %1, i32* %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i8* %4, i8** %11
store i8* %5, i8** %12
%13 = load i32, i32* %8
%14 = load i8*, i8** %10
%15 = load i8*, i8** %11
%16 = load i8*, i8** %12
%17 = call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i32 %13, i8* %14, i8* %15, i8* %16)
ret void
}

LLVM IR (-O2):
%struct.UPnPService = type { i32 }
@.str = [76 x i8] c"RND Invoke Response: AVTransport/GetTransportInfo[ErrorCode:%d](%s,%s,%s)\0D\0A\00"
define void @RNDResponseSink_AVTransport_GetTransportInfo(%struct.UPnPService* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i8* %3, i8* %4, i8* %5) {
%7 = tail call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %3, i8* %4, i8* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AL_writeRegister(int, int /*<<< orphan*/);
void fmStopTone(int channel) { AL_writeRegister((0XB0 + (channel)), 0); }


x86 assembly (clang, -O0):
<fmStopTone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
add    $0xb0,%edi
xor    %esi,%esi
call   1030 <AL_writeRegister@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmStopTone>:
add    $0xb0,%edi
xor    %esi,%esi
jmp    1030 <AL_writeRegister@plt>

LLVM IR (-O0):
define void @fmStopTone(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 176, %3
%5 = call i32 @AL_writeRegister(i32 %4, i32 0)
ret void
}

LLVM IR (-O2):
define void @fmStopTone(i32 %0) {
%2 = add nsw i32 %0, 176
%3 = tail call i32 @AL_writeRegister(i32 %2, i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ array;

/* Variables and functions */
int /*<<< orphan*/ es5(float *, int);
int main() {
  float array[] = {1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8, 9.9, 10.1};
  es5(array, sizeof(array) / sizeof(array[0]));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x28,%edx
call   1030 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1040 <es5@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xf05(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xa,%esi
call   1030 <es5@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.array = [10 x float] [float 0x3FF19999A0000000, float 0x40019999A0000000, float 0x400A666660000000, float 0x40119999A0000000, float 5.500000e+00, float 0x401A666660000000, float 0x401ECCCCC0000000, float 0x40219999A0000000, float 0x4023CCCCC0000000, float 0x4024333340000000]
define i32 @main() {
%1 = alloca [10 x float]
%2 = bitcast [10 x float]* %1 to i8*
%3 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 0
%4 = call i32 @es5(float* %3, i32 10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.array = [10 x float] [float 0x3FF19999A0000000, float 0x40019999A0000000, float 0x400A666660000000, float 0x40119999A0000000, float 5.500000e+00, float 0x401A666660000000, float 0x401ECCCCC0000000, float 0x40219999A0000000, float 0x4023CCCCC0000000, float 0x4024333340000000]
define i32 @main() {
%1 = alloca [10 x float]
%2 = bitcast [10 x float]* %1 to i8*
%3 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 0
%4 = call i32 @es5(float* %3, i32 10)
ret i32 0
}
void setLeds(unsigned char ledMask) {
  unsigned int *data = ((unsigned int *)0x50023FFC);
  *data = ~(ledMask << 1) & ~1;
}


x86 assembly (clang, -O0):
<setLeds>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x50023ffc,%eax
mov    %rax,-0x10(%rbp)
movzbl -0x1(%rbp),%ecx
shl    $0x1,%ecx
xor    $0xffffffff,%ecx
and    $0xfffffffe,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setLeds>:
not    %edi
add    %edi,%edi
mov    %edi,0x50023ffc
ret

LLVM IR (-O0):
define void @setLeds(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i32*
store i8 %0, i8* %2
store i32* inttoptr (i64 1342324732 to i32*), i32** %3
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = shl i32 %5, 1
%7 = xor i32 %6, -1
%8 = and i32 %7, -2
%9 = load i32*, i32** %3
store i32 %8, i32* %9
ret void
}

LLVM IR (-O2):
define void @setLeds(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = xor i32 %2, -1
%4 = shl nsw i32 %3, 1
store i32 %4, i32* inttoptr (i64 1342324732 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char const *argv[]) {
  int jane, tarzan, cheeta;
  cheeta = tarzan = jane = 68;
  printf("                  cheeta tarzan jane\n");
  printf("First round score %4d %6d %5d\nf", cheeta, tarzan, jane);
  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)
movl   $0x44,-0x14(%rbp)
movl   $0x44,-0x18(%rbp)
movl   $0x44,-0x1c(%rbp)
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef8(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
mov    $0x44,%esi
mov    $0x44,%edx
mov    $0x44,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [38 x i8] c" cheeta tarzan jane\0A\00"
@.str.1 = [32 x i8] c"First round score %4d %6d %5d\0Af\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 68, i32* %6
store i32 68, i32* %7
store i32 68, i32* %8
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* %8
%11 = load i32, i32* %7
%12 = load i32, i32* %6
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %10, i32 %11, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [32 x i8] c"First round score %4d %6d %5d\0Af\00"
@str = [37 x i8] c" cheeta tarzan jane\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 68, i32 68, i32 68)
ret i32 0
}