xunge/DecIR huggingface dataset:
reg0adr1(r0, r1, x0, x1, p0, p1) unsigned short r0, r1;
unsigned short *p0, *p1;
{
  if (r0 <= (*((unsigned short *)11111111)))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<reg0adr1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movzwl -0x6(%rbp),%eax
mov    $0xa98ac7,%ecx
movzwl (%rcx),%ecx
cmp    %ecx,%eax
jg     113f <reg0adr1+0x3f>
movl   $0x1,-0x4(%rbp)
jmp    1146 <reg0adr1+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reg0adr1>:
movzwl %di,%ecx
movzwl 0xa98ac7,%edx
xor    %eax,%eax
cmp    %edx,%ecx
setbe  %al
ret

LLVM IR (-O0):
define i32 @reg0adr1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16, i16* %8
%17 = zext i16 %16 to i32
%18 = load i16, i16* inttoptr (i64 11111111 to i16*)
%19 = zext i16 %18 to i32
%20 = icmp sle i32 %17, %19
br i1 %20, label %21, label %22
21: ; preds = %6
store i32 1, i32* %7
br label %23
22: ; preds = %6
store i32 0, i32* %7
br label %23
23: ; preds = %22, %21
%24 = load i32, i32* %7
ret i32 %24
}

LLVM IR (-O2):
define i32 @reg0adr1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture readnone %5) {
%7 = and i32 %0, 65535
%8 = load i16, i16* inttoptr (i64 11111111 to i16*)
%9 = zext i16 %8 to i32
%10 = icmp ule i32 %7, %9
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ close2(int, int);
int /*<<< orphan*/ close3(int, int, int);
void close5(int fd1, int fd2, int fd3, int fd4, int fd5) {
  close3(fd1, fd2, fd3);
  close2(fd4, fd5);
}


x86 assembly (clang, -O0):
<close5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <close3@plt>
mov    -0x10(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <close2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close5>:
push   %rbp
push   %rbx
push   %rax
mov    %r8d,%ebx
mov    %ecx,%ebp
call   1040 <close3@plt>
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <close2@plt>

LLVM IR (-O0):
define void @close5(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i32 @close3(i32 %11, i32 %12, i32 %13)
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = call i32 @close2(i32 %15, i32 %16)
ret void
}

LLVM IR (-O2):
define void @close5(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @close3(i32 %0, i32 %1, i32 %2)
%7 = tail call i32 @close2(i32 %3, i32 %4)
ret void
}
int delayDuration() { return 1000; }


x86 assembly (clang, -O0):
<delayDuration>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3e8,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @delayDuration() {
ret i32 1000
}

LLVM IR (-O2):
define i32 @delayDuration() {
ret i32 1000
}
unsigned int loop05(int n) {
  static unsigned int ucnt = 0;
  if (n > 0) {
    ucnt++;
    --n;
    loop05(n);
  }
  return ucnt;
}


x86 assembly (clang, -O0):
<loop05>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1145 <loop05+0x35>
mov    0x2f01(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ef8(%rip)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <loop05@plt>
mov    0x2ee1(%rip),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loop05>:
push   %rax
test   %edi,%edi
jle    1124 <loop05+0x14>
addl   $0x1,0x2f10(%rip)
add    $0xffffffff,%edi
call   1030 <loop05@plt>
mov    0x2f02(%rip),%eax
pop    %rcx
ret

LLVM IR (-O0):
@loop05.ucnt = internal global i32 0
define i32 @loop05(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i32, i32* @loop05.ucnt
%7 = add i32 %6, 1
store i32 %7, i32* @loop05.ucnt
%8 = load i32, i32* %2
%9 = add nsw i32 %8, -1
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = call i32 @loop05(i32 %10)
br label %12
12: ; preds = %5, %1
%13 = load i32, i32* @loop05.ucnt
ret i32 %13
}

LLVM IR (-O2):
@loop05.ucnt = internal unnamed_addr global i32 0
define i32 @loop05(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1
%4 = load i32, i32* @loop05.ucnt
%5 = add i32 %4, 1
store i32 %5, i32* @loop05.ucnt
%6 = add nsw i32 %0, -1
%7 = tail call i32 @loop05(i32 %6)
br label %8
8: ; preds = %3, %1
%9 = load i32, i32* @loop05.ucnt
ret i32 %9
}
/* Type definitions */
struct fh_p_stmt {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fh_free_stmt_children(struct fh_p_stmt *);
int /*<<< orphan*/ free(struct fh_p_stmt *);
void fh_free_stmt(struct fh_p_stmt *stmt) {
  if (stmt) {
    fh_free_stmt_children(stmt);
    free(stmt);
  }
}


x86 assembly (clang, -O0):
<fh_free_stmt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1149 <fh_free_stmt+0x29>
mov    -0x8(%rbp),%rdi
call   1040 <fh_free_stmt_children@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fh_free_stmt>:
test   %rdi,%rdi
je     1137 <fh_free_stmt+0x17>
push   %rbx
mov    %rdi,%rbx
call   1040 <fh_free_stmt_children@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.fh_p_stmt = type { i32 }
define void @fh_free_stmt(%struct.fh_p_stmt* %0) {
%2 = alloca %struct.fh_p_stmt*
store %struct.fh_p_stmt* %0, %struct.fh_p_stmt** %2
%3 = load %struct.fh_p_stmt*, %struct.fh_p_stmt** %2
%4 = icmp ne %struct.fh_p_stmt* %3, null
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load %struct.fh_p_stmt*, %struct.fh_p_stmt** %2
%7 = call i32 @fh_free_stmt_children(%struct.fh_p_stmt* %6)
%8 = load %struct.fh_p_stmt*, %struct.fh_p_stmt** %2
%9 = call i32 @free(%struct.fh_p_stmt* %8)
br label %10
10: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
%struct.fh_p_stmt = type { i32 }
define void @fh_free_stmt(%struct.fh_p_stmt* %0) {
%2 = icmp eq %struct.fh_p_stmt* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @fh_free_stmt_children(%struct.fh_p_stmt* %0)
%5 = tail call i32 @free(%struct.fh_p_stmt* %0)
br label %6
6: ; preds = %3, %1
ret void
}
int func(void) {
  int n = 3;
  int m = 5;
  n % m;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @func() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strtok(char *, char *);
char *tl_strdup(char const *);
char *tl_tokenise_Newick(const char *nwk) {
  char *tknNwk = tl_strdup(nwk);
  strtok(tknNwk, "+(,);");
  return tknNwk;
}


x86 assembly (clang, -O0):
<tl_tokenise_Newick>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <tl_strdup@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xebc(%rip),%rsi
call   1040 <strtok@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tl_tokenise_Newick>:
push   %rbx
call   1030 <tl_strdup@plt>
mov    %rax,%rbx
lea    0xed0(%rip),%rsi
mov    %rax,%rdi
call   1040 <strtok@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"+(,);\00"
define i8* @tl_tokenise_Newick(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @tl_strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @strtok(i8* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
@.str = [6 x i8] c"+(,);\00"
define i8* @tl_tokenise_Newick(i8* %0) {
%2 = tail call i8* @tl_strdup(i8* %0)
%3 = tail call i32 @strtok(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ output_line(char *);
void code_segment_gtext(void) {
  output_line("\t.area  SMALLC_GENERATED  (REL,CON,CSEG)");
}


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

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

LLVM IR (-O0):
@.str = [41 x i8] c"\09.area SMALLC_GENERATED (REL,CON,CSEG)\00"
define void @code_segment_gtext() {
%1 = call i32 @output_line(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"\09.area SMALLC_GENERATED (REL,CON,CSEG)\00"
define void @code_segment_gtext() {
%1 = tail call i32 @output_line(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
int dup(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, int);
void cmd_dup(int argc, char *argv[]) {
  int new_fd;
  if ((new_fd = dup(atoi(argv[1]))) == -1)
    perror("dup");
  printf("%i\n", new_fd);
}


x86 assembly (clang, -O0):
<cmd_dup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,%edi
call   1040 <dup@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
jne    117b <cmd_dup+0x3b>
lea    0xe8a(%rip),%rdi
call   1050 <perror@plt>
mov    -0x14(%rbp),%esi
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_dup>:
push   %rbx
mov    0x8(%rsi),%rdi
call   1060 <atoi@plt>
mov    %eax,%edi
call   1040 <dup@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
je     1167 <cmd_dup+0x27>
lea    0xea5(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <printf@plt>
lea    0xe92(%rip),%rdi
call   1050 <perror@plt>
jmp    1158 <cmd_dup+0x18>

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

LLVM IR (-O2):
@.str = [4 x i8] c"dup\00"
@.str.1 = [4 x i8] c"%i\0A\00"
define void @cmd_dup(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = tail call i32 @dup(i32 %5)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @perror(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret void
}
/* Variables and functions */
int fn_sq_ch_69_ch_113_ch_117_ch_105_ch_118_ch_97_ch_108_ch_101_ch_110_ch_116_ch_67_ch_108_ch_97_ch_115_ch_115_ch_101_ch_115(
    char const *);
int fn_al_sq_ch_69_ch_113_ch_117_ch_105_ch_118_ch_97_ch_108_ch_101_ch_110_ch_116_ch_67_ch_108_ch_97_ch_115_ch_115_ch_101_ch_115(
    const char *text) {
  int pos = 0;
  pos =
      fn_sq_ch_69_ch_113_ch_117_ch_105_ch_118_ch_97_ch_108_ch_101_ch_110_ch_116_ch_67_ch_108_ch_97_ch_115_ch_115_ch_101_ch_115(
          text);
  if (pos != -1)
    return pos;
  return -1;
}


x86 assembly (clang, -O0):
<fn_al_sq_ch_69_ch_113_ch_117_ch_105_ch_118_ch_97_ch_108_ch_101_ch_110_ch_116_ch_67_ch_108_ch_97_ch_115_ch_115_ch_101_ch_115>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fn_sq_ch_69_ch_113_ch_117_ch_105_ch_118_ch_97_ch_108_ch_101_ch_110_ch_116_ch_67_ch_108_ch_97_ch_115_ch_115_ch_101_ch_115@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
je     1144 <fn_al_sq_ch_69_ch_113_ch_117_ch_105_ch_118_ch_97_ch_108_ch_101_ch_110_ch_116_ch_67_ch_108_ch_97_ch_115_ch_115_ch_101_ch_115+0x34>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114b <fn_al_sq_ch_69_ch_113_ch_117_ch_105_ch_118_ch_97_ch_108_ch_101_ch_110_ch_116_ch_67_ch_108_ch_97_ch_115_ch_115_ch_101_ch_115+0x3b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_al_sq_ch_69_ch_113_ch_117_ch_105_ch_118_ch_97_ch_108_ch_101_ch_110_ch_116_ch_67_ch_108_ch_97_ch_115_ch_115_ch_101_ch_115>:
jmp    1030 <fn_sq_ch_69_ch_113_ch_117_ch_105_ch_118_ch_97_ch_108_ch_101_ch_110_ch_116_ch_67_ch_108_ch_97_ch_115_ch_115_ch_101_ch_115@plt>

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

LLVM IR (-O2):
define i32 @fn_al_sq_ch_69_ch_113_ch_117_ch_105_ch_118_ch_97_ch_108_ch_101_ch_110_ch_116_ch_67_ch_108_ch_97_ch_115_ch_115_ch_101_ch_115(i8* %0) {
%2 = tail call i32 @fn_sq_ch_69_ch_113_ch_117_ch_105_ch_118_ch_97_ch_108_ch_101_ch_110_ch_116_ch_67_ch_108_ch_97_ch_115_ch_115_ch_101_ch_115(i8* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct ts_tdt {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ts_tdt_alloc();
struct ts_tdt *ts_tdt_init_empty(int /*<<< orphan*/, int /*<<< orphan*/, int);
struct ts_tdt *ts_tot_alloc_init(time_t ts) {
  return ts_tdt_init_empty(ts_tdt_alloc(), ts, 1);
}


x86 assembly (clang, -O0):
<ts_tot_alloc_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <ts_tdt_alloc@plt>
mov    %eax,%edi
mov    -0x4(%rbp),%esi
mov    $0x1,%edx
call   1040 <ts_tdt_init_empty@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts_tot_alloc_init>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <ts_tdt_alloc@plt>
mov    %eax,%edi
mov    %ebx,%esi
mov    $0x1,%edx
pop    %rbx
jmp    1040 <ts_tdt_init_empty@plt>

LLVM IR (-O0):
%struct.ts_tdt = type { i32 }
define %struct.ts_tdt* @ts_tot_alloc_init(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @ts_tdt_alloc()
%4 = load i32, i32* %2
%5 = call %struct.ts_tdt* @ts_tdt_init_empty(i32 %3, i32 %4, i32 1)
ret %struct.ts_tdt* %5
}

LLVM IR (-O2):
%struct.ts_tdt = type { i32 }
define %struct.ts_tdt* @ts_tot_alloc_init(i32 %0) {
%2 = tail call i32 (...) @ts_tdt_alloc()
%3 = tail call %struct.ts_tdt* @ts_tdt_init_empty(i32 %2, i32 %0, i32 1)
ret %struct.ts_tdt* %3
}
int test_imm_B4int16_reg(short val) {
  return ((val) & (0xB4 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B4int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xb4,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_B4int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 180
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_B4int16_reg(i16 signext %0) {
%2 = and i16 %0, 180
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
__attribute__((__always___)) void memory_fence(void) { __sync_synchronize(); }


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

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

LLVM IR (-O0):
define void @memory_fence() {
fence seq_cst
ret void
}

LLVM IR (-O2):
define void @memory_fence() {
fence seq_cst
ret void
}
int test_imm_A3int64_midword_reg(long long val) {
  return ((val >> 16) & (0xA3 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_A3int64_midword_reg>:
test   $0xa30000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_A3int64_midword_reg(i64 %0) {
%2 = and i64 %0, 10682368
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fputc(int, int /*<<< orphan*/ *);
int putc(int c, FILE *f) { return fputc(c, f); }


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

x86 assembly (clang, -O2):
<putc>:
jmp    1030 <fputc@plt>

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

LLVM IR (-O2):
define i32 @putc(i32 %0, i32* nocapture %1) {
%3 = tail call i32 @fputc(i32 %0, i32* %1)
ret i32 %3
}
int getBps(int sampleRate, int bitLength, int numberOfChannels) {
  return sampleRate * bitLength * numberOfChannels;
}


x86 assembly (clang, -O0):
<getBps>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getBps>:
mov    %edi,%eax
imul   %esi,%eax
imul   %edx,%eax
ret

LLVM IR (-O0):
define i32 @getBps(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = mul nsw i32 %7, %8
%10 = load i32, i32* %6
%11 = mul nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @getBps(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %1, %0
%5 = mul nsw i32 %4, %2
ret i32 %5
}
/* Variables and functions */
scalar_t__ f();
int main(void) { f() + 0; }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <f@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i64 (...) @f()
%2 = add nsw i64 %1, 0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @f()
ret i32 0
}
/* Variables and functions */
int rxp__match(char const *, int, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
               int /*<<< orphan*/ *);
int rxp_match(const char *s) { return (rxp__match(s, 1, NULL, NULL, NULL)); }


x86 assembly (clang, -O0):
<rxp_match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rdx
mov    %r8,%rcx
call   1030 <rxp__match@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rxp_match>:
mov    $0x1,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <rxp__match@plt>

LLVM IR (-O0):
define i32 @rxp_match(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @rxp__match(i8* %3, i32 1, i32* null, i32* null, i32* null)
ret i32 %4
}

LLVM IR (-O2):
define i32 @rxp_match(i8* %0) {
%2 = tail call i32 @rxp__match(i8* %0, i32 1, i32* null, i32* null, i32* null)
ret i32 %2
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ prg8setBank2(int);
void vrc1setParamsC000(uint16_t addr, uint8_t val) {
  (void)addr;
  prg8setBank2((val & 0xF) << 13);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
and    $0xf,%edi
shl    $0xd,%edi
call   1030 <prg8setBank2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    %esi,%edi
and    $0xf,%edi
shl    $0xd,%edi
jmp    1030 <prg8setBank2@plt>

LLVM IR (-O0):
define void @vrc1setParamsC000(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 = and i32 %6, 15
%8 = shl i32 %7, 13
%9 = call i32 @prg8setBank2(i32 %8)
ret void
}

LLVM IR (-O2):
define void @vrc1setParamsC000(i32 %0, i32 %1) {
%3 = shl i32 %1, 13
%4 = and i32 %3, 122880
%5 = tail call i32 @prg8setBank2(i32 %4)
ret void
}
void _dlstart() { _Exit(1); }


x86 assembly (clang, -O0):
<_dlstart>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <_Exit@plt>

x86 assembly (clang, -O2):
<_dlstart>:
push   %rax
mov    $0x1,%edi
call   1030 <_Exit@plt>

LLVM IR (-O0):
define void @_dlstart() {
unreachable
}

LLVM IR (-O2):
define void @_dlstart() {
tail call void @_Exit(i32 1)
unreachable
}
int os_sched_yield(int *rc) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @os_sched_yield(i32* nocapture readnone %0) {
ret i32 -1
}
void test6_Y_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test6_Y_targetInit__I() {
ret void
}
/* Variables and functions */
int getenv(char *);
int /*<<< orphan*/ printf(char *, char *, int);
int main(void) {
  printf("%s address: 0x%x\n", "EGG", getenv("EGG"));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeea(%rip),%rbx
mov    %rbx,%rdi
call   1030 <getenv@plt>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [18 x i8] c"%s address: 0x%x\0A\00"
@.str.1 = [4 x i8] c"EGG\00"
define i32 @main() {
%1 = tail call i32 @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  int a = -1;
  if (a < sizeof(a))
    printf("-1 less than sizeof(a)\n");
  else if (a > sizeof(a))
    printf("-1 greate than sizeof(a)\n");
  else
    printf("-1 equals to sizeof(a)\n");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
movslq -0x8(%rbp),%rax
cmp    $0x4,%rax
jae    1145 <main+0x35>
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
jmp    1175 <main+0x65>
movslq -0x8(%rbp),%rax
cmp    $0x4,%rax
jbe    1164 <main+0x54>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
jmp    1170 <main+0x60>
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
jmp    1175 <main+0x65>
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 = [24 x i8] c"-1 less than sizeof(a)\0A\00"
@.str.1 = [26 x i8] c"-1 greate than sizeof(a)\0A\00"
@.str.2 = [24 x i8] c"-1 equals to sizeof(a)\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 -1, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = icmp ult i64 %4, 4
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %17
8: ; preds = %0
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = icmp ugt i64 %10, 4
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
br label %16
14: ; preds = %8
%15 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
br label %16
16: ; preds = %14, %12
br label %17
17: ; preds = %16, %6
ret i32 0
}

LLVM IR (-O2):
@str = [25 x i8] c"-1 greate than sizeof(a)\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ kill_this_task();
int /*<<< orphan*/ playsound(int, int, int, int /*<<< orphan*/,
                             int /*<<< orphan*/);
void main(void) {
  playsound(30, 21050, 4000, 0, 0);
  kill_this_task();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1e,%edi
mov    $0x523a,%esi
mov    $0xfa0,%edx
xor    %r8d,%r8d
mov    %r8d,%ecx
call   1040 <playsound@plt>
mov    $0x0,%al
call   1030 <kill_this_task@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1e,%edi
mov    $0x523a,%esi
mov    $0xfa0,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1040 <playsound@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <kill_this_task@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 @playsound(i32 30, i32 21050, i32 4000, i32 0, i32 0)
%2 = call i32 (...) @kill_this_task()
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @playsound(i32 30, i32 21050, i32 4000, i32 0, i32 0)
%2 = tail call i32 (...) @kill_this_task()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int fseek(int /*<<< orphan*/ *, long, int /*<<< orphan*/);
int c_rewind(void *stream) { return fseek((FILE *)stream, 0L, SEEK_SET); }


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

x86 assembly (clang, -O2):
<c_rewind>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
jmp    1030 <fseek@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
define i32 @c_rewind(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* @SEEK_SET
%6 = call i32 @fseek(i32* %4, i64 0, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define i32 @c_rewind(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* @SEEK_SET
%4 = tail call i32 @fseek(i32* %2, i64 0, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ sort(int, int *);
int main() {
  int array[] = {1, 2, 34, 5, 67, 3, 23, 12, 13, 10};
  sort(10, array);
}


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   1040 <memcpy@plt>
lea    -0x30(%rbp),%rsi
mov    $0xa,%edi
call   1030 <sort@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,%rsi
mov    $0xa,%edi
call   1030 <sort@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.array = [10 x i32] [i32 1, i32 2, i32 34, i32 5, i32 67, i32 3, i32 23, i32 12, i32 13, i32 10]
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @sort(i32 10, i32* %3)
ret i32 0
}

LLVM IR (-O2):
@__const.main.array = [10 x i32] [i32 1, i32 2, i32 34, i32 5, i32 67, i32 3, i32 23, i32 12, i32 13, i32 10]
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @sort(i32 10, i32* %3)
ret i32 0
}
void sanitize_env_name(char *name) {
  for (; *name; name++)
    if (*name == '=')
      *name = '_';
}


x86 assembly (clang, -O0):
<sanitize_env_name>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1142 <sanitize_env_name+0x42>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3d,%eax
jne    112c <sanitize_env_name+0x2c>
mov    -0x8(%rbp),%rax
movb   $0x5f,(%rax)
jmp    1131 <sanitize_env_name+0x31>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <sanitize_env_name+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sanitize_env_name>:
jmp    1117 <sanitize_env_name+0x17>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movb   $0x5f,(%rdi)
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0x3d,%al
je     1110 <sanitize_env_name+0x10>
test   %al,%al
jne    1113 <sanitize_env_name+0x13>
ret

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

LLVM IR (-O2):
define void @sanitize_env_name(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
switch i8 %4, label %6 [
i8 0, label %8
i8 61, label %5
]
5: ; preds = %2
store i8 95, i8* %3
br label %6
6: ; preds = %2, %5
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
8: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void *task(void *p) {
  sleep(30);
  return NULL;
}


x86 assembly (clang, -O0):
<task>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1e,%edi
call   1030 <sleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<task>:
push   %rax
mov    $0x1e,%edi
call   1030 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @task(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @sleep(i32 30)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @task(i8* nocapture readnone %0) {
%2 = tail call i32 @sleep(i32 30)
ret i8* null
}
double sqrhingeinv(double lp) { return lp; }


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

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

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

LLVM IR (-O2):
define double @sqrhingeinv(double returned %0) {
ret double %0
}
/* Variables and functions */
unsigned int sad_mx_n_c(unsigned char *, int, unsigned char *, int, int, int);
unsigned int vp8_sad16x8_c(unsigned char *src_ptr, int src_stride,
                           unsigned char *ref_ptr, int ref_stride,
                           int max_sad) {
  return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, 16, 8);
}


x86 assembly (clang, -O0):
<vp8_sad16x8_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    $0x10,%r8d
mov    $0x8,%r9d
call   1030 <sad_mx_n_c@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vp8_sad16x8_c>:
mov    $0x10,%r8d
mov    $0x8,%r9d
jmp    1030 <sad_mx_n_c@plt>

LLVM IR (-O0):
define i32 @vp8_sad16x8_c(i8* %0, i32 %1, i8* %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i8*, i8** %8
%14 = load i32, i32* %9
%15 = call i32 @sad_mx_n_c(i8* %11, i32 %12, i8* %13, i32 %14, i32 16, i32 8)
ret i32 %15
}

LLVM IR (-O2):
define i32 @vp8_sad16x8_c(i8* %0, i32 %1, i8* %2, i32 %3, i32 %4) {
%6 = tail call i32 @sad_mx_n_c(i8* %0, i32 %1, i8* %2, i32 %3, i32 16, i32 8)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ iscntrl(int);
void t_iscntrl_0x10() {
  Assert_real((iscntrl(16)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              85, ("iscntrl should be 1 for 0x10"));
}


x86 assembly (clang, -O0):
<t_iscntrl_0x10>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10,%edi
call   1030 <iscntrl@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x55,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_iscntrl_0x10>:
push   %rax
mov    $0x10,%edi
call   1030 <iscntrl@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x55,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 1 for 0x10\00"
define void @t_iscntrl_0x10() {
%1 = call i32 @iscntrl(i32 16)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 85, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 1 for 0x10\00"
define void @t_iscntrl_0x10() {
%1 = tail call i32 @iscntrl(i32 16)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 85, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
float pow(double, float);
float Activator_SigmoidBase(float Input) {
  return 1.0f / (1.0f + pow(2.718281828459, -Input));
}


x86 assembly (clang, -O0):
<Activator_SigmoidBase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
movsd  0xed1(%rip),%xmm0
call   1030 <pow@plt>
movss  0xebc(%rip),%xmm1
addss  %xmm0,%xmm1
movss  0xeb0(%rip),%xmm0
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Activator_SigmoidBase>:
push   %rax
movaps %xmm0,%xmm1
xorps  0xee5(%rip),%xmm1
movsd  0xeed(%rip),%xmm0
call   1030 <pow@plt>
movss  0xee8(%rip),%xmm1
addss  %xmm1,%xmm0
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @Activator_SigmoidBase(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fneg float %3
%5 = call float @pow(double 0x4005BF0A8B145703, float %4)
%6 = fadd float 1.000000e+00, %5
%7 = fdiv float 1.000000e+00, %6
ret float %7
}

LLVM IR (-O2):
define float @Activator_SigmoidBase(float %0) {
%2 = fneg float %0
%3 = tail call float @pow(double 0x4005BF0A8B145703, float %2)
%4 = fadd float %3, 1.000000e+00
%5 = fdiv float 1.000000e+00, %4
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void addspace(int i) {
  int j;
  for (j = 0; j < i; j++) {
    printf("       ");
  }
}


x86 assembly (clang, -O0):
<addspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <addspace+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <addspace+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addspace>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    113d <addspace+0x2d>
mov    %edi,%ebx
lea    0xedf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
jne    1130 <addspace+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c" \00"
define void @addspace(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ handle_34(int /*<<< orphan*/);
int gen_34(void) {
  handle_34(0);
  return 0;
}


x86 assembly (clang, -O0):
<gen_34>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <handle_34@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_34>:
push   %rax
xor    %edi,%edi
call   1030 <handle_34@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @gen_34() {
%1 = call i32 @handle_34(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_34() {
%1 = tail call i32 @handle_34(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ DATA_INPUT(char *, char *);
int /*<<< orphan*/ eeprom_write_block_safe(char *, char *, int);
void data_set_eeprom_char(char *val, const char *data_param) {
  char tmp;
  DATA_INPUT("%"
             "c",
             &tmp);
  eeprom_write_block_safe(&tmp, val, sizeof tmp);
}


x86 assembly (clang, -O0):
<data_set_eeprom_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rdi
lea    -0x11(%rbp),%rsi
call   1030 <DATA_INPUT@plt>
mov    -0x8(%rbp),%rsi
lea    -0x11(%rbp),%rdi
mov    $0x1,%edx
call   1040 <eeprom_write_block_safe@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<data_set_eeprom_char>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed2(%rip),%rdi
lea    0x7(%rsp),%r14
mov    %r14,%rsi
call   1030 <DATA_INPUT@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <eeprom_write_block_safe@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @data_set_eeprom_char(i8* %0, i8* nocapture readnone %1) {
%3 = alloca i8
%4 = call i32 @DATA_INPUT(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @eeprom_write_block_safe(i8* %3, i8* %0, i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *, char *);
void wrong_location(char *text, FILE *infile, FILE *outfile, char *filename) {
  printf("%s found at wrong location in %s\n", text, filename);
  fclose(infile);
  fclose(outfile);
}


x86 assembly (clang, -O0):
<wrong_location>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrong_location>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0xecc(%rip),%rdi
mov    %rcx,%rdx
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"%s found at wrong location in %s\0A\00"
define void @wrong_location(i8* %0, i32* %1, i32* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i8*
store i8* %0, i8** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %8
%11 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10)
%12 = load i32*, i32** %6
%13 = call i32 @fclose(i32* %12)
%14 = load i32*, i32** %7
%15 = call i32 @fclose(i32* %14)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"%s found at wrong location in %s\0A\00"
define void @wrong_location(i8* %0, i32* nocapture %1, i32* nocapture %2, i8* %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %3)
%6 = tail call i32 @fclose(i32* %1)
%7 = tail call i32 @fclose(i32* %2)
ret void
}
unsigned int string_char_count(const char *string, const char character) {
  unsigned int count = 0;
  const char *s = string;
  while (*s) {
    if (*s++ == character) {
      count++;
    }
  }
  return count;
}


x86 assembly (clang, -O0):
<string_char_count>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <string_char_count+0x56>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1151 <string_char_count+0x51>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    111d <string_char_count+0x1d>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

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

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