xunge/DecIR huggingface dataset:
void tests() {
  testUkp(13 + 23 + 15, 26, (int[]){12, 7, 11, 8, 9},
          (int[]){24, 13, 23, 15, 16}, 5);
  puts("tests() done.");
}


x86 assembly (clang, -O0):
<tests>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x2f01(%rip),%rax
mov    %rax,-0x14(%rbp)
mov    0x2efe(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0x2efc(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0x14(%rbp),%rdx
mov    0x2ef2(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0x2eef(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2eed(%rip),%eax
mov    %eax,-0x18(%rbp)
lea    -0x28(%rbp),%rcx
mov    $0x33,%edi
mov    $0x1a,%esi
mov    $0x5,%r8d
mov    $0x0,%al
call   1040 <testUkp@plt>
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tests>:
sub    $0x38,%rsp
mov    0xee6(%rip),%eax
mov    %eax,0x30(%rsp)
movups 0xecb(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movups 0xed3(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    0xed9(%rip),%eax
mov    %eax,0x10(%rsp)
lea    0x20(%rsp),%rdx
mov    %rsp,%rcx
mov    $0x33,%edi
mov    $0x1a,%esi
mov    $0x5,%r8d
xor    %eax,%eax
call   1040 <testUkp@plt>
lea    0xeb3(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
@constinit = private global [5 x i32] [i32 12, i32 7, i32 11, i32 8, i32 9]
@constinit.1 = private global [5 x i32] [i32 24, i32 13, i32 23, i32 15, i32 16]
@.str = [14 x i8] c"tests() done.\00"
define void @tests() {
%1 = alloca [5 x i32]
%2 = alloca [5 x i32]
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = bitcast [5 x i32]* %1 to i8*
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%7 = bitcast [5 x i32]* %2 to i8*
%8 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%9 = call i32 (i32, i32, i32*, i32*, i32, ...) bitcast (i32 (...)* @testUkp to i32 (i32, i32, i32*, i32*, i32, ...)*)(i32 51, i32 26, i32* %5, i32* %8, i32 5)
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@constinit = [5 x i32] [i32 12, i32 7, i32 11, i32 8, i32 9]
@constinit.1 = [5 x i32] [i32 24, i32 13, i32 23, i32 15, i32 16]
@.str = [14 x i8] c"tests() done.\00"
define void @tests() {
%1 = alloca [5 x i32]
%2 = alloca [5 x i32]
%3 = bitcast [5 x i32]* %1 to i8*
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%5 = bitcast [5 x i32]* %2 to i8*
%6 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%7 = call i32 (i32, i32, i32*, i32*, i32, ...) bitcast (i32 (...)* @testUkp to i32 (i32, i32, i32*, i32*, i32, ...)*)(i32 51, i32 26, i32* %4, i32* %6, i32 5)
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  printf("Course: EG1302A-Spring 2014\n");
  printf("Name: Bella Ndabarushimana\n");
  printf("Date Created:%d/%d/%d\n", 1, 28, 2014);
  printf("Assignment:Assignment 05\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef7(%rip),%rdi
mov    $0x1,%esi
mov    $0x1c,%edx
mov    $0x7de,%ecx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeef(%rip),%rdi
call   1030 <puts@plt>
lea    0xeff(%rip),%rdi
call   1030 <puts@plt>
lea    0xec0(%rip),%rdi
mov    $0x1,%esi
mov    $0x1c,%edx
mov    $0x7de,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xef1(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Course: EG1302A-Spring 2014\0A\00"
@.str.1 = [28 x i8] c"Name: Bella Ndabarushimana\0A\00"
@.str.2 = [23 x i8] c"Date Created:%d/%d/%d\0A\00"
@.str.3 = [26 x i8] c"Assignment:Assignment 05\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 1, i32 28, i32 2014)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [23 x i8] c"Date Created:%d/%d/%d\0A\00"
@str = [28 x i8] c"Course: EG1302A-Spring 2014\00"
@str.4 = [27 x i8] c"Name: Bella Ndabarushimana\00"
@str.5 = [25 x i8] c"Assignment:Assignment 05\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 1, i32 28, i32 2014)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.5, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
testPlus() { printf("%d + %d = %d\n", 10, 4, 10 + 4); }


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"%d + %d = %d\0A\00"
define i32 @testPlus() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 10, i32 4, i32 14)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M245_f(char *s) {
  debug("M245_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M245_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M245_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M245_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M245_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M245_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M245_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int next_utf8(char const *, int *);
int fn_ch_108(const char *text) {
  int pos = 0;
  if (next_utf8(text, &pos) == 108)
    return pos;
  return -1;
}


x86 assembly (clang, -O0):
<fn_ch_108>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1030 <next_utf8@plt>
cmp    $0x6c,%eax
jne    1144 <fn_ch_108+0x34>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114b <fn_ch_108+0x3b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_ch_108>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rsi
call   1030 <next_utf8@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    $0x6c,%ecx
jne    1133 <fn_ch_108+0x23>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @fn_ch_108(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 @next_utf8(i8* %5, i32* %4)
%7 = icmp eq i32 %6, 108
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i32, i32* %4
store i32 %9, i32* %2
br label %11
10: ; preds = %1
store i32 -1, i32* %2
br label %11
11: ; preds = %10, %8
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @fn_ch_108(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call i32 @next_utf8(i8* %0, i32* %2)
%5 = icmp eq i32 %4, 108
%6 = load i32, i32* %2
%7 = select i1 %5, i32 %6, i32 -1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, int /*<<< orphan*/, int);
void cook_buf(void) {
  int ch, gobble, prev;
  for (; gobble ? 0 : 1; prev = ch) {
    if (prev) {
      ch = 0;
      fprintf(0, 0, gobble);
      if (1)
        break;
    }
  }
}


x86 assembly (clang, -O0):
<cook_buf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x8(%rbp),%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
cmp    $0x0,%eax
je     1163 <cook_buf+0x53>
cmpl   $0x0,-0xc(%rbp)
je     1153 <cook_buf+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%edx
xor    %esi,%esi
mov    %esi,%edi
call   1030 <fprintf@plt>
jmp    1163 <cook_buf+0x53>
jmp    1158 <cook_buf+0x48>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1118 <cook_buf+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @cook_buf() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
br label %4
4: ; preds = %17, %0
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 0, i32 1
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %19
10: ; preds = %4
%11 = load i32, i32* %3
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %10
store i32 0, i32* %1
%14 = load i32, i32* %2
%15 = call i32 @fprintf(i32 0, i32 0, i32 %14)
br label %19
16: ; preds = %10
br label %17
17: ; preds = %16
%18 = load i32, i32* %1
store i32 %18, i32* %3
br label %4
19: ; preds = %13, %4
ret void
}

LLVM IR (-O2):
void ucase(register char *cp) {
  for (; *cp; cp++)
    *cp = ((((*cp) >= 'a') && ((*cp) <= 'z')) ? (*cp - 32) : *cp);
}


x86 assembly (clang, -O0):
<ucase>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     116d <ucase+0x6d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x61,%eax
jl     1147 <ucase+0x47>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7a,%eax
jg     1147 <ucase+0x47>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x20,%eax
mov    %eax,-0xc(%rbp)
jmp    1151 <ucase+0x51>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <ucase+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ucase>:
mov    (%rdi),%al
test   %al,%al
je     1130 <ucase+0x30>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
lea    -0x61(%rax),%ecx
lea    -0x20(%rax),%edx
cmp    $0x1a,%cl
movzbl %al,%eax
movzbl %dl,%ecx
cmovae %eax,%ecx
mov    %cl,-0x1(%rdi)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <ucase+0x10>
ret

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

LLVM IR (-O2):
define void @ucase(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 i8* [ %11, %4 ], [ %0, %1 ]
%7 = add i8 %5, -97
%8 = icmp ult i8 %7, 26
%9 = add nsw i8 %5, -32
%10 = select i1 %8, i8 %9, i8 %5
store i8 %10, i8* %6
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *strdup(char const *);
void cparse_replace_str(char **a, const char *b) {
  if (!a) {
    return;
  }
  if (*a) {
    free(*a);
  }
  (*a) = strdup(b);
}


x86 assembly (clang, -O0):
<cparse_replace_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1140 <cparse_replace_str+0x20>
jmp    116d <cparse_replace_str+0x4d>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     115a <cparse_replace_str+0x3a>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cparse_replace_str>:
test   %rdi,%rdi
je     114e <cparse_replace_str+0x2e>
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     113c <cparse_replace_str+0x1c>
call   1030 <free@plt>
mov    %r14,%rdi
call   1040 <strdup@plt>
mov    %rax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @cparse_replace_str(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 = icmp ne i8** %5, null
br i1 %6, label %8, label %7
7: ; preds = %2
br label %20
8: ; preds = %2
%9 = load i8**, i8*** %3
%10 = load i8*, i8** %9
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %16
12: ; preds = %8
%13 = load i8**, i8*** %3
%14 = load i8*, i8** %13
%15 = call i32 @free(i8* %14)
br label %16
16: ; preds = %12, %8
%17 = load i8*, i8** %4
%18 = call i8* @strdup(i8* %17)
%19 = load i8**, i8*** %3
store i8* %18, i8** %19
br label %20
20: ; preds = %16, %7
ret void
}

LLVM IR (-O2):
define void @cparse_replace_str(i8** %0, i8* nocapture %1) {
%3 = icmp eq i8** %0, null
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = load i8*, i8** %0
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @free(i8* %5)
br label %9
9: ; preds = %7, %4
%10 = tail call i8* @strdup(i8* %1)
store i8* %10, i8** %0
br label %11
11: ; preds = %2, %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverse(char *);
int main(void) {
  char s[] = "Reverse that amazing";
  reverse(s);
  printf("%s\n", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xec0(%rip),%al
mov    %al,-0xc(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <reverse@plt>
lea    -0x20(%rbp),%rsi
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xed4(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x676e697a616d61,%rax
mov    %rax,0xd(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <reverse@plt>
lea    0xec4(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@__const.main.s = [21 x i8] c"Reverse that amazing\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [21 x i8]
%2 = getelementptr inbounds [21 x i8], [21 x i8]* %1, i64 0, i64 0
%3 = call i32 @reverse(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
const char *zlib_zlibVersion(void) { return "1.2.7"; }


x86 assembly (clang, -O0):
<zlib_zlibVersion>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"1.2.7\00"
define i8* @zlib_zlibVersion() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"1.2.7\00"
define i8* @zlib_zlibVersion() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ s2scir(int, int);
void s2scir_(int *col1, int *col2) { s2scir(*col1, *col2); }


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

x86 assembly (clang, -O2):
<s2scir_>:
mov    (%rdi),%edi
mov    (%rsi),%esi
jmp    1030 <s2scir@plt>

LLVM IR (-O0):
define void @s2scir_(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* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = call i32 @s2scir(i32 %6, i32 %8)
ret void
}

LLVM IR (-O2):
define void @s2scir_(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = tail call i32 @s2scir(i32 %3, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0x42() {
  Assert_real((islower(66) == 0),
              "/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_islower.c",
              335, ("islower should be 0 for B"));
}


x86 assembly (clang, -O0):
<t_islower_0x42>:
push   %rbp
mov    %rsp,%rbp
mov    $0x42,%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x14f,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_islower_0x42>:
push   %rax
mov    $0x42,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x14f,%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_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 0 for B\00"
define void @t_islower_0x42() {
%1 = call i64 @islower(i32 66)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 335, i8* getelementptr inbounds ([26 x i8], [26 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_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 0 for B\00"
define void @t_islower_0x42() {
%1 = tail call i64 @islower(i32 66)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 335, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int get_max(int array[], int left, int right, int root) {
  int max_child = 0;
  if (array[left] > array[root]) {
    max_child = left;
  } else {
    max_child = root;
  }
  if (array[right] > array[max_child]) {
    max_child = right;
  }
  return max_child;
}


x86 assembly (clang, -O0):
<get_max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x8(%rbp),%rcx
movslq -0x14(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jle    113f <get_max+0x3f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1145 <get_max+0x45>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x8(%rbp),%rcx
movslq -0x18(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jle    1167 <get_max+0x67>
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_max>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%esi
movslq %ecx,%rcx
cmp    (%rdi,%rcx,4),%esi
cmovg  %eax,%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
movslq %ecx,%rax
cmp    (%rdi,%rax,4),%esi
cmovg  %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @get_max(i32* nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = sext i32 %3 to i64
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = icmp sgt i32 %7, %10
%12 = select i1 %11, i32 %1, i32 %3
%13 = sext i32 %2 to i64
%14 = getelementptr inbounds i32, i32* %0, i64 %13
%15 = load i32, i32* %14
%16 = sext i32 %12 to i64
%17 = getelementptr inbounds i32, i32* %0, i64 %16
%18 = load i32, i32* %17
%19 = icmp sgt i32 %15, %18
%20 = select i1 %19, i32 %2, i32 %12
ret i32 %20
}
/* Variables and functions */
unsigned char *generate_command_packet(int, unsigned char, int /*<<< orphan*/,
                                       unsigned char *, size_t);
unsigned char *op_nonce(size_t cnt, unsigned char *data) {
  unsigned char USE_MODE = 0x03;
  return generate_command_packet(0x16, USE_MODE, 0, data, cnt);
}


x86 assembly (clang, -O0):
<op_nonce>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x3,-0x11(%rbp)
mov    -0x11(%rbp),%al
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%r8
mov    $0x16,%edi
xor    %edx,%edx
movzbl %al,%esi
call   1030 <generate_command_packet@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_nonce>:
mov    %rsi,%rcx
mov    %rdi,%r8
mov    $0x16,%edi
mov    $0x3,%esi
xor    %edx,%edx
jmp    1030 <generate_command_packet@plt>

LLVM IR (-O0):
define i8* @op_nonce(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i8
store i64 %0, i64* %3
store i8* %1, i8** %4
store i8 3, i8* %5
%6 = load i8, i8* %5
%7 = load i8*, i8** %4
%8 = load i64, i64* %3
%9 = call i8* @generate_command_packet(i32 22, i8 zeroext %6, i32 0, i8* %7, i64 %8)
ret i8* %9
}

LLVM IR (-O2):
define i8* @op_nonce(i64 %0, i8* %1) {
%3 = tail call i8* @generate_command_packet(i32 22, i8 zeroext 3, i32 0, i8* %1, i64 %0)
ret i8* %3
}
long function(int test[]) { return test; }


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

x86 assembly (clang, -O2):
<function>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @function(i32* %0) {
%2 = ptrtoint i32* %0 to i64
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ popen(char *, char *);
void backlight_of() { popen("echo 0 > /proc/easy_backlight", "w"); }


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

x86 assembly (clang, -O2):
<backlight_of>:
lea    0xee9(%rip),%rdi
lea    0xf00(%rip),%rsi
jmp    1030 <popen@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"echo 0 > /proc/easy_backlight\00"
@.str.1 = [2 x i8] c"w\00"
define void @backlight_of() {
%1 = call i32 @popen(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"echo 0 > /proc/easy_backlight\00"
@.str.1 = [2 x i8] c"w\00"
define void @backlight_of() {
%1 = tail call i32 @popen(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int initialize_temphumidity_sensor(struct ssp_data *data) { return 0; }


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

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

LLVM IR (-O0):
%struct.ssp_data = type opaque
define i32 @initialize_temphumidity_sensor(%struct.ssp_data* %0) {
%2 = alloca %struct.ssp_data*
store %struct.ssp_data* %0, %struct.ssp_data** %2
ret i32 0
}

LLVM IR (-O2):
%struct.ssp_data = type opaque
define i32 @initialize_temphumidity_sensor(%struct.ssp_data* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fortchartoc(char *);
int /*<<< orphan*/ gmvwrite_openfile_cxir(int /*<<< orphan*/, int, int);
void fgmvwrite_openfile_cxir_(char *filnam, int *isize, int *rsize) {
  gmvwrite_openfile_cxir(fortchartoc(filnam), *isize, *rsize);
}


x86 assembly (clang, -O0):
<fgmvwrite_openfile_cxir_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fortchartoc@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
call   1040 <gmvwrite_openfile_cxir@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgmvwrite_openfile_cxir_>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
call   1030 <fortchartoc@plt>
mov    (%rbx),%esi
mov    (%r14),%edx
mov    %eax,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <gmvwrite_openfile_cxir@plt>

LLVM IR (-O0):
define void @fgmvwrite_openfile_cxir_(i8* %0, i32* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = call i32 @fortchartoc(i8* %7)
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = load i32*, i32** %6
%12 = load i32, i32* %11
%13 = call i32 @gmvwrite_openfile_cxir(i32 %8, i32 %10, i32 %12)
ret void
}

LLVM IR (-O2):
define void @fgmvwrite_openfile_cxir_(i8* %0, i32* nocapture %1, i32* nocapture %2) {
%4 = tail call i32 @fortchartoc(i8* %0)
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = tail call i32 @gmvwrite_openfile_cxir(i32 %4, i32 %5, i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hgoto(double);
int /*<<< orphan*/ vgoto(double);
void movehv(double h, double v) {
  hgoto(h);
  vgoto(v);
}


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

x86 assembly (clang, -O2):
<movehv>:
push   %rax
movsd  %xmm1,(%rsp)
call   1030 <hgoto@plt>
movsd  (%rsp),%xmm0
pop    %rax
jmp    1040 <vgoto@plt>

LLVM IR (-O0):
define void @movehv(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = call i32 @hgoto(double %5)
%7 = load double, double* %4
%8 = call i32 @vgoto(double %7)
ret void
}

LLVM IR (-O2):
define void @movehv(double %0, double %1) {
%3 = tail call i32 @hgoto(double %0)
%4 = tail call i32 @vgoto(double %1)
ret void
}
/* Variables and functions */
int wrdchg(int);
worduper(void) { return (wrdchg(1)); }


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

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

LLVM IR (-O0):
define i32 @worduper() {
%1 = call i32 @wrdchg(i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @worduper() {
%1 = tail call i32 @wrdchg(i32 1)
ret i32 %1
}
/* Variables and functions */
void *malloc(long);
void *system_malloc(long size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<system_malloc>:
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @system_malloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @malloc(i64 %3)
ret i8* %4
}

LLVM IR (-O2):
define noalias i8* @system_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
int git_online_cpus(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @git_online_cpus() {
ret i32 1
}

LLVM IR (-O2):
define i32 @git_online_cpus() {
ret i32 1
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
unsigned _get_slck_rate(void) {
  uint32_t supc_sr = *((volatile uint32_t *)(((0x400e1410) + 0x14)));
  if (supc_sr & (1 << 7)) {
    return (32768);
  } else {
    return (32000);
  }
}


x86 assembly (clang, -O0):
<_get_slck_rate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400e1424,%eax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     112b <_get_slck_rate+0x2b>
movl   $0x8000,-0x4(%rbp)
jmp    1132 <_get_slck_rate+0x32>
movl   $0x7d00,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_get_slck_rate>:
testl  $0x80,0x400e1424
mov    $0x7d00,%ecx
mov    $0x8000,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @_get_slck_rate() {
%1 = alloca i32
%2 = alloca i32
%3 = load volatile i32, i32* inttoptr (i64 1074664484 to i32*)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, 128
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %0
store i32 32768, i32* %1
br label %9
8: ; preds = %0
store i32 32000, i32* %1
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @_get_slck_rate() {
%1 = load volatile i32, i32* inttoptr (i64 1074664484 to i32*)
%2 = and i32 %1, 128
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 32000, i32 32768
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint32_t;

/* Variables and functions */
uint32_t ip_get_dstaddr(const uint8_t *p_ip) {
  return (p_ip[16] << 24) | (p_ip[17] << 16) | (p_ip[18] << 8) | p_ip[19];
}


x86 assembly (clang, -O0):
<ip_get_dstaddr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x40(%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    0x44(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x48(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
or     0x4c(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ip_get_dstaddr>:
mov    0x40(%rdi),%eax
mov    0x44(%rdi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x48(%rdi),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0x4c(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @ip_get_dstaddr(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 16
%5 = load i32, i32* %4
%6 = shl i32 %5, 24
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 17
%9 = load i32, i32* %8
%10 = shl i32 %9, 16
%11 = or i32 %6, %10
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 18
%14 = load i32, i32* %13
%15 = shl i32 %14, 8
%16 = or i32 %11, %15
%17 = load i32*, i32** %2
%18 = getelementptr inbounds i32, i32* %17, i64 19
%19 = load i32, i32* %18
%20 = or i32 %16, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @ip_get_dstaddr(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 16
%3 = load i32, i32* %2
%4 = shl i32 %3, 24
%5 = getelementptr inbounds i32, i32* %0, i64 17
%6 = load i32, i32* %5
%7 = shl i32 %6, 16
%8 = or i32 %7, %4
%9 = getelementptr inbounds i32, i32* %0, i64 18
%10 = load i32, i32* %9
%11 = shl i32 %10, 8
%12 = or i32 %8, %11
%13 = getelementptr inbounds i32, i32* %0, i64 19
%14 = load i32, i32* %13
%15 = or i32 %12, %14
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ do_nasty(char *);
int /*<<< orphan*/ free(char *);
scalar_t__ getenv(char *);
char *malloc(int);
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  char *ten = malloc(10);
  if (getenv("TEST_ENV")) {
    do_nasty(ten);
    printf("TEST_ENV is set.\n");
  }
  free(ten);
  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)
mov    $0xa,%edi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
lea    0xe85(%rip),%rdi
call   1030 <getenv@plt>
cmp    $0x0,%rax
je     119f <main+0x4f>
mov    -0x18(%rbp),%rdi
call   1070 <do_nasty@plt>
lea    0xe6f(%rip),%rdi
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1040 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xa,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
lea    0xe9b(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     1183 <main+0x33>
mov    %rbx,%rdi
call   1070 <do_nasty@plt>
lea    0xe8b(%rip),%rdi
call   1050 <puts@plt>
mov    %rbx,%rdi
call   1040 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"TEST_ENV\00"
@.str.1 = [18 x i8] c"TEST_ENV is set.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i8* @malloc(i32 10)
store i8* %7, i8** %6
%8 = call i64 @getenv(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i8*, i8** %6
%12 = call i32 @do_nasty(i8* %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %10, %2
%15 = load i8*, i8** %6
%16 = call i32 @free(i8* %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"TEST_ENV\00"
@str = [17 x i8] c"TEST_ENV is set.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%4 = tail call i64 @getenv(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = tail call i32 @do_nasty(i8* %3)
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
br label %9
9: ; preds = %6, %2
%10 = tail call i32 @free(i8* %3)
ret i32 0
}
/* Type definitions */
typedef int __u_char;

/* Variables and functions */
int /*<<< orphan*/ _IO(int, int);
int ioctl(int, int /*<<< orphan*/, int);
int cbmarch_close(int f, __u_char dev, __u_char secadr) {
  return ioctl(f, _IO(0xcb, 5), (dev << 8) | secadr);
}


x86 assembly (clang, -O0):
<cbmarch_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0xcb,%edi
mov    $0x5,%esi
call   1030 <_IO@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
mov    -0x8(%rbp),%edx
shl    $0x8,%edx
or     -0xc(%rbp),%edx
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbmarch_close>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%ebp
mov    %edi,%r14d
mov    $0xcb,%edi
mov    $0x5,%esi
call   1030 <_IO@plt>
shl    $0x8,%ebp
or     %ebp,%ebx
mov    %r14d,%edi
mov    %eax,%esi
mov    %ebx,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
define i32 @cbmarch_close(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 = call i32 @_IO(i32 203, i32 5)
%9 = load i32, i32* %5
%10 = shl i32 %9, 8
%11 = load i32, i32* %6
%12 = or i32 %10, %11
%13 = call i32 @ioctl(i32 %7, i32 %8, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @cbmarch_close(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @_IO(i32 203, i32 5)
%5 = shl i32 %1, 8
%6 = or i32 %5, %2
%7 = tail call i32 @ioctl(i32 %0, i32 %4, i32 %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ Round400(void *, int);
int /*<<< orphan*/ add_Byte(void *, int, int);
void Ketje_step(void *state, int block_size, unsigned char padding) {
  add_Byte(state, padding, block_size);
  add_Byte(state, 0x08, 4);
  int i = 0;
  for (i = (20 - 1); i < 20; i++) {
    Round400(state, i);
  }
}


x86 assembly (clang, -O0):
<Ketje_step>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rdi
movzbl -0xd(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <add_Byte@plt>
mov    -0x8(%rbp),%rdi
mov    $0x8,%esi
mov    $0x4,%edx
call   1030 <add_Byte@plt>
movl   $0x0,-0x14(%rbp)
movl   $0x13,-0x14(%rbp)
cmpl   $0x14,-0x14(%rbp)
jge    1189 <Ketje_step+0x69>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <Round400@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1165 <Ketje_step+0x45>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Ketje_step>:
push   %rbx
mov    %esi,%eax
mov    %rdi,%rbx
mov    %edx,%esi
mov    %eax,%edx
call   1030 <add_Byte@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
mov    $0x4,%edx
call   1030 <add_Byte@plt>
mov    %rbx,%rdi
mov    $0x13,%esi
pop    %rbx
jmp    1040 <Round400@plt>

LLVM IR (-O0):
define void @Ketje_step(i8* %0, i32 %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8 %2, i8* %6
%8 = load i8*, i8** %4
%9 = load i8, i8* %6
%10 = zext i8 %9 to i32
%11 = load i32, i32* %5
%12 = call i32 @add_Byte(i8* %8, i32 %10, i32 %11)
%13 = load i8*, i8** %4
%14 = call i32 @add_Byte(i8* %13, i32 8, i32 4)
store i32 0, i32* %7
store i32 19, i32* %7
br label %15
15: ; preds = %22, %3
%16 = load i32, i32* %7
%17 = icmp slt i32 %16, 20
br i1 %17, label %18, label %25
18: ; preds = %15
%19 = load i8*, i8** %4
%20 = load i32, i32* %7
%21 = call i32 @Round400(i8* %19, i32 %20)
br label %22
22: ; preds = %18
%23 = load i32, i32* %7
%24 = add nsw i32 %23, 1
store i32 %24, i32* %7
br label %15
25: ; preds = %15
ret void
}

LLVM IR (-O2):
define void @Ketje_step(i8* %0, i32 %1, i8 zeroext %2) {
%4 = zext i8 %2 to i32
%5 = tail call i32 @add_Byte(i8* %0, i32 %4, i32 %1)
%6 = tail call i32 @add_Byte(i8* %0, i32 8, i32 4)
%7 = tail call i32 @Round400(i8* %0, i32 19)
ret void
}
/* Variables and functions */
void impulse(size_t width, unsigned char *state, int type) {
  state[(width >> type) - 1] = 1;
}


x86 assembly (clang, -O0):
<impulse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
mov    -0x14(%rbp),%ecx
shr    %cl,%rdx
mov    %rdx,%rcx
sub    $0x1,%rcx
movb   $0x1,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<impulse>:
mov    %edx,%ecx
shr    %cl,%rdi
movb   $0x1,-0x1(%rdi,%rsi,1)
ret

LLVM IR (-O0):
define void @impulse(i64 %0, i8* %1, i32 %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i32
store i64 %0, i64* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load i64, i64* %4
%9 = load i32, i32* %6
%10 = zext i32 %9 to i64
%11 = lshr i64 %8, %10
%12 = sub i64 %11, 1
%13 = getelementptr inbounds i8, i8* %7, i64 %12
store i8 1, i8* %13
ret void
}

LLVM IR (-O2):
define void @impulse(i64 %0, i8* nocapture writeonly %1, i32 %2) {
%4 = zext i32 %2 to i64
%5 = lshr i64 %0, %4
%6 = add i64 %5, -1
%7 = getelementptr inbounds i8, i8* %1, i64 %6
store i8 1, i8* %7
ret void
}
void foo_2_1_2_1_2_1_2_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_2_1_2_1_2_1_1() {
ret void
}
void _jkiss_init_omp() {}


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

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

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

LLVM IR (-O2):
define void @_jkiss_init_omp() {
ret void
}
/* Variables and functions */
unsigned char *blake2b_buffer(unsigned char *, unsigned char const *, size_t,
                              int /*<<< orphan*/ *, int /*<<< orphan*/);
unsigned char *hash_buffer_blake2b(unsigned char *out, const unsigned char *in,
                                   size_t in_len) {
  return blake2b_buffer(out, in, in_len, NULL, 0);
}


x86 assembly (clang, -O0):
<hash_buffer_blake2b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%ecx
xor    %r8d,%r8d
call   1030 <blake2b_buffer@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_buffer_blake2b>:
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <blake2b_buffer@plt>

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

LLVM IR (-O2):
define i8* @hash_buffer_blake2b(i8* %0, i8* %1, i64 %2) {
%4 = tail call i8* @blake2b_buffer(i8* %0, i8* %1, i64 %2, i32* null, i32 0)
ret i8* %4
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ rand();
int RandomInteger(int low, int high) {
  int k;
  double d;
  d = (double)rand() / ((double)RAND_MAX + 1);
  k = d * (high - low + 1);
  return (low + k);
}


x86 assembly (clang, -O0):
<RandomInteger>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2eb7(%rip),%rax
cvtsi2sdq (%rax),%xmm1
movsd  0xec2(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomInteger>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ebe(%rip),%rax
cvtsi2sdq (%rax),%xmm1
addsd  0xec9(%rip),%xmm1
divsd  %xmm1,%xmm0
sub    %ebp,%ebx
add    $0x1,%ebx
xorps  %xmm1,%xmm1
cvtsi2sd %ebx,%xmm1
mulsd  %xmm0,%xmm1
cvttsd2si %xmm1,%eax
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define i32 @RandomInteger(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca double
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = call i64 (...) @rand()
%8 = sitofp i64 %7 to double
%9 = load i64, i64* @RAND_MAX
%10 = sitofp i64 %9 to double
%11 = fadd double %10, 1.000000e+00
%12 = fdiv double %8, %11
store double %12, double* %6
%13 = load double, double* %6
%14 = load i32, i32* %4
%15 = load i32, i32* %3
%16 = sub nsw i32 %14, %15
%17 = add nsw i32 %16, 1
%18 = sitofp i32 %17 to double
%19 = fmul double %13, %18
%20 = fptosi double %19 to i32
store i32 %20, i32* %5
%21 = load i32, i32* %3
%22 = load i32, i32* %5
%23 = add nsw i32 %21, %22
ret i32 %23
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define i32 @RandomInteger(i32 %0, i32 %1) {
%3 = tail call i64 (...) @rand()
%4 = sitofp i64 %3 to double
%5 = load i64, i64* @RAND_MAX
%6 = sitofp i64 %5 to double
%7 = fadd double %6, 1.000000e+00
%8 = fdiv double %4, %7
%9 = sub i32 1, %0
%10 = add i32 %9, %1
%11 = sitofp i32 %10 to double
%12 = fmul double %8, %11
%13 = fptosi double %12 to i32
%14 = add nsw i32 %13, %0
ret i32 %14
}