xunge/DecIR huggingface dataset:
/* Variables and functions */
int access(char const *, int);
int file_access(const char *zFilename, int flags) {
  int rc = access(zFilename, flags);
  return rc;
}


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

x86 assembly (clang, -O2):
<file_access>:
jmp    1030 <access@plt>

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

LLVM IR (-O2):
define i32 @file_access(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @access(i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: qsort -sSEED -nSIZE -[123]\n");
  exit(2);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"Usage: qsort -sSEED -nSIZE -[123]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"Usage: qsort -sSEED -nSIZE -[123]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 2)
unreachable
}
/* Variables and functions */
char *strtok(char *, char *);
int num_splits(char s[]) {
  char *f;
  int i = 0;
  f = strtok(s, " ");
  while (f != NULL) {
    ++i;
    f = strtok(NULL, " ");
  }
  return i;
}


x86 assembly (clang, -O0):
<num_splits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed2(%rip),%rsi
call   1030 <strtok@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1164 <num_splits+0x54>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xeaa(%rip),%rsi
call   1030 <strtok@plt>
mov    %rax,-0x10(%rbp)
jmp    1137 <num_splits+0x27>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_splits>:
push   %r14
push   %rbx
push   %rax
lea    0xee5(%rip),%rsi
call   1030 <strtok@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     1142 <num_splits+0x32>
lea    0xed2(%rip),%r14
xchg   %ax,%ax
add    $0x1,%ebx
xor    %edi,%edi
mov    %r14,%rsi
call   1030 <strtok@plt>
test   %rax,%rax
jne    1130 <num_splits+0x20>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define i32 @num_splits(i8* %0) {
%2 = tail call i8* @strtok(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %6, %4 ], [ 0, %1 ]
%6 = add nuw nsw i32 %5, 1
%7 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %4
9: ; preds = %4, %1
%10 = phi i32 [ 0, %1 ], [ %6, %4 ]
ret i32 %10
}
int isbisiesto(int ano) {
  int flag = 0;
  if (ano % 4 == 0) {
    flag = 1;
    if (ano % 100 == 0)
      flag = 0;
    if (ano % 400 == 0)
      flag = 1;
  }
}


x86 assembly (clang, -O0):
<isbisiesto>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1164 <isbisiesto+0x64>
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1144 <isbisiesto+0x44>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    115f <isbisiesto+0x5f>
movl   $0x1,-0xc(%rbp)
jmp    1164 <isbisiesto+0x64>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @isbisiesto(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 0, i32* %4
%5 = load i32, i32* %3
%6 = srem i32 %5, 4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %19
8: ; preds = %1
store i32 1, i32* %4
%9 = load i32, i32* %3
%10 = srem i32 %9, 100
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 0, i32* %4
br label %13
13: ; preds = %12, %8
%14 = load i32, i32* %3
%15 = srem i32 %14, 400
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %13
store i32 1, i32* %4
br label %18
18: ; preds = %17, %13
br label %19
19: ; preds = %18, %1
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @isbisiesto(i32 %0) {
ret i32 undef
}
int my_memcmp(char *ptr1, char *ptr2, int len) {
  while (len--)
    if (*(ptr1++) ^ *(ptr2++))
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<my_memcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x1c(%rbp)
cmp    $0x0,%eax
je     1163 <my_memcmp+0x63>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
xor    %ecx,%eax
cmp    $0x0,%eax
je     115e <my_memcmp+0x5e>
movl   $0x1,-0x4(%rbp)
jmp    116a <my_memcmp+0x6a>
jmp    110f <my_memcmp+0xf>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_memcmp>:
mov    %edx,%r8d
xor    %eax,%eax
xor    %edx,%edx
nopw   0x0(%rax,%rax,1)
cmp    %edx,%r8d
je     112c <my_memcmp+0x2c>
movzbl (%rdi,%rdx,1),%r9d
lea    0x1(%rdx),%rcx
cmp    (%rsi,%rdx,1),%r9b
mov    %rcx,%rdx
je     1110 <my_memcmp+0x10>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @my_memcmp(i8* nocapture %0, i8* nocapture %1, i32 %2) {
br label %4
4: ; preds = %9, %3
%5 = phi i8* [ %0, %3 ], [ %11, %9 ]
%6 = phi i8* [ %1, %3 ], [ %13, %9 ]
%7 = phi i32 [ %2, %3 ], [ %10, %9 ]
%8 = icmp eq i32 %7, 0
br i1 %8, label %16, label %9
9: ; preds = %4
%10 = add nsw i32 %7, -1
%11 = getelementptr inbounds i8, i8* %5, i64 1
%12 = load i8, i8* %5
%13 = getelementptr inbounds i8, i8* %6, i64 1
%14 = load i8, i8* %6
%15 = icmp eq i8 %12, %14
br i1 %15, label %4, label %16
16: ; preds = %4, %9
%17 = phi i32 [ 1, %9 ], [ 0, %4 ]
ret i32 %17
}
double min3(double x1, double x2, double x3) {
  double x = x1 < x2 ? x1 : x2;
  return x < x3 ? x : x3;
}


x86 assembly (clang, -O0):
<min3>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1136 <min3+0x36>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    1140 <min3+0x40>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    116d <min3+0x6d>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    1177 <min3+0x77>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<min3>:
minsd  %xmm1,%xmm0
minsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @min3(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %4
%9 = load double, double* %5
%10 = fcmp olt double %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load double, double* %4
br label %15
13: ; preds = %3
%14 = load double, double* %5
br label %15
15: ; preds = %13, %11
%16 = phi double [ %12, %11 ], [ %14, %13 ]
store double %16, double* %7
%17 = load double, double* %7
%18 = load double, double* %6
%19 = fcmp olt double %17, %18
br i1 %19, label %20, label %22
20: ; preds = %15
%21 = load double, double* %7
br label %24
22: ; preds = %15
%23 = load double, double* %6
br label %24
24: ; preds = %22, %20
%25 = phi double [ %21, %20 ], [ %23, %22 ]
ret double %25
}

LLVM IR (-O2):
define double @min3(double %0, double %1, double %2) {
%4 = fcmp olt double %0, %1
%5 = select i1 %4, double %0, double %1
%6 = fcmp olt double %5, %2
%7 = select i1 %6, double %5, double %2
ret double %7
}
int main(void) {
  int *p;
  int i = 2;
  p = 0;
  p[i] = 3;
  return p[2];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x14(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movl   $0x3,(%rax,%rcx,4)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %3
store i32* null, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %3
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i32, i32* %4, i64 %6
store i32 3, i32* %7
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 2
%10 = load i32, i32* %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @main() {
store i32 3, i32* inttoptr (i64 8 to i32*)
ret i32 3
}
const char *type_minify_identity(const char *s) { return s; }


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

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

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

LLVM IR (-O2):
define i8* @type_minify_identity(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int INT_MIN;
int main(void) {
  volatile int min = INT_MIN;
  volatile int zero = 0;
  INT_MIN / -1;
  min / -1;
  min / (10 * zero - (2 - 1));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rsp)
movl   $0x0,-0x4(%rsp)
mov    -0x8(%rsp),%eax
mov    -0x8(%rsp),%eax
mov    -0x4(%rsp),%eax
xor    %eax,%eax
ret

LLVM IR (-O0):
@INT_MIN = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = load i32, i32* @INT_MIN
store volatile i32 %4, i32* %2
store volatile i32 0, i32* %3
%5 = load i32, i32* @INT_MIN
%6 = sdiv i32 %5, -1
%7 = load volatile i32, i32* %2
%8 = sdiv i32 %7, -1
%9 = load volatile i32, i32* %2
%10 = load volatile i32, i32* %3
%11 = mul nsw i32 10, %10
%12 = sub nsw i32 %11, 1
%13 = sdiv i32 %9, %12
ret i32 0
}

LLVM IR (-O2):
@INT_MIN = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = load i32, i32* @INT_MIN
store volatile i32 %4, i32* %1
%5 = bitcast i32* %2 to i8*
store volatile i32 0, i32* %2
%6 = load volatile i32, i32* %1
%7 = load volatile i32, i32* %1
%8 = load volatile i32, i32* %2
ret i32 0
}
void f(void) {
  int i;
  int a[100];
#pragma hlt unroll(11)
  for (i = 0; i < 100; i++) {
    a[i] = i;
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    1138 <f+0x38>
mov    -0x4(%rbp),%ecx
movslq -0x4(%rbp),%rax
mov    %ecx,-0x1a0(%rbp,%rax,4)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1112 <f+0x12>
add    $0x120,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ execve(char *, char **, char **);
int main(void) {
  char *null_filename = NULL;
  char *bad[2] = {(char *)1, NULL};
  char *good[1] = {NULL};
  execve(null_filename, bad, bad);
  execve("/bin/true", good, good);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    0xec2(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xebf(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x28(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
lea    -0x20(%rbp),%rdx
call   1040 <execve@plt>
lea    -0x28(%rbp),%rsi
lea    -0x28(%rbp),%rdx
lea    0xe93(%rip),%rdi
call   1040 <execve@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
lea    0x10(%rsp),%rdx
xor    %edi,%edi
mov    %rdx,%rsi
call   1030 <execve@plt>
lea    0xed1(%rip),%rdi
lea    0x8(%rsp),%rdx
mov    %rdx,%rsi
call   1030 <execve@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.bad = [2 x i8*] [i8* inttoptr (i64 1 to i8*), i8* null]
@.str = [10 x i8] c"/bin/true\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca [2 x i8*]
%4 = alloca [1 x i8*]
store i32 0, i32* %1
store i8* null, i8** %2
%5 = bitcast [2 x i8*]* %3 to i8*
%6 = bitcast [1 x i8*]* %4 to i8*
%7 = load i8*, i8** %2
%8 = getelementptr inbounds [2 x i8*], [2 x i8*]* %3, i64 0, i64 0
%9 = getelementptr inbounds [2 x i8*], [2 x i8*]* %3, i64 0, i64 0
%10 = call i32 @execve(i8* %7, i8** %8, i8** %9)
%11 = getelementptr inbounds [1 x i8*], [1 x i8*]* %4, i64 0, i64 0
%12 = getelementptr inbounds [1 x i8*], [1 x i8*]* %4, i64 0, i64 0
%13 = call i32 @execve(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %11, i8** %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.bad = [2 x i8*] [i8* inttoptr (i64 1 to i8*), i8* null]
@.str = [10 x i8] c"/bin/true\00"
define i32 @main() {
%1 = alloca [2 x i8*]
%2 = alloca [1 x i8*]
%3 = bitcast [2 x i8*]* %1 to i8*
%4 = bitcast [1 x i8*]* %2 to i8*
%5 = bitcast [1 x i8*]* %2 to i64*
store i64 0, i64* %5
%6 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
%7 = call i32 @execve(i8* null, i8** %6, i8** %6)
%8 = getelementptr inbounds [1 x i8*], [1 x i8*]* %2, i64 0, i64 0
%9 = call i32 @execve(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %8, i8** %8)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
scalar_t__ wcslen(int /*<<< orphan*/ const *);
int /*<<< orphan*/ *wmempmove(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                              scalar_t__);
wchar_t *wcpmove(wchar_t *whither, const wchar_t *whence) {
  return wmempmove(whither, whence, wcslen(whence) + 1) - 1;
}


x86 assembly (clang, -O0):
<wcpmove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <wcslen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
call   1040 <wmempmove@plt>
add    $0xfffffffffffffffc,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcpmove>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <wcslen@plt>
lea    0x1(%rax),%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <wmempmove@plt>
add    $0xfffffffffffffffc,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32* @wcpmove(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 = load i32*, i32** %4
%8 = call i64 @wcslen(i32* %7)
%9 = add nsw i64 %8, 1
%10 = call i32* @wmempmove(i32* %5, i32* %6, i64 %9)
%11 = getelementptr inbounds i32, i32* %10, i64 -1
ret i32* %11
}

LLVM IR (-O2):
define i32* @wcpmove(i32* %0, i32* %1) {
%3 = tail call i64 @wcslen(i32* %1)
%4 = add nsw i64 %3, 1
%5 = tail call i32* @wmempmove(i32* %0, i32* %1, i64 %4)
%6 = getelementptr inbounds i32, i32* %5, i64 -1
ret i32* %6
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void comparator_swap(uint32_t *i, uint32_t *j) {
  if (*j < *i) {
    uint32_t tmp = *i;
    *i = *j;
    *j = tmp;
  }
}


x86 assembly (clang, -O0):
<comparator_swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x8(%rbp),%rcx
cmp    (%rcx),%rax
jge    1144 <comparator_swap+0x44>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<comparator_swap>:
mov    (%rsi),%rax
mov    (%rdi),%rcx
cmp    %rcx,%rax
jge    1111 <comparator_swap+0x11>
mov    %rax,(%rdi)
mov    %rcx,(%rsi)
ret

LLVM IR (-O0):
define void @comparator_swap(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca i64
store i64* %0, i64** %3
store i64* %1, i64** %4
%6 = load i64*, i64** %4
%7 = load i64, i64* %6
%8 = load i64*, i64** %3
%9 = load i64, i64* %8
%10 = icmp slt i64 %7, %9
br i1 %10, label %11, label %19
11: ; preds = %2
%12 = load i64*, i64** %3
%13 = load i64, i64* %12
store i64 %13, i64* %5
%14 = load i64*, i64** %4
%15 = load i64, i64* %14
%16 = load i64*, i64** %3
store i64 %15, i64* %16
%17 = load i64, i64* %5
%18 = load i64*, i64** %4
store i64 %17, i64* %18
br label %19
19: ; preds = %11, %2
ret void
}

LLVM IR (-O2):
define void @comparator_swap(i64* nocapture %0, i64* nocapture %1) {
%3 = load i64, i64* %1
%4 = load i64, i64* %0
%5 = icmp slt i64 %3, %4
br i1 %5, label %6, label %7
6: ; preds = %2
store i64 %3, i64* %0
store i64 %4, i64* %1
br label %7
7: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ wmove(int /*<<< orphan*/ *, int, int);
int /*<<< orphan*/ wprintw(int /*<<< orphan*/ *, char *, char const *);
void add_line(WINDOW *win, const char *line, int *i) {
  wmove(win, *i, 2);
  wprintw(win, "%s", line);
  (*i)++;
}


x86 assembly (clang, -O0):
<add_line>:
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    -0x18(%rbp),%rax
mov    (%rax),%esi
mov    $0x2,%edx
call   1040 <wmove@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xea9(%rip),%rsi
call   1030 <wprintw@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_line>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdx),%esi
mov    $0x2,%edx
call   1040 <wmove@plt>
lea    0xebf(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1030 <wprintw@plt>
addl   $0x1,(%r15)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @add_line(i32* %0, i8* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32*
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %4
%8 = load i32*, i32** %6
%9 = load i32, i32* %8
%10 = call i32 @wmove(i32* %7, i32 %9, i32 2)
%11 = load i32*, i32** %4
%12 = load i8*, i8** %5
%13 = call i32 @wprintw(i32* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = load i32*, i32** %6
%15 = load i32, i32* %14
%16 = add nsw i32 %15, 1
store i32 %16, i32* %14
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @add_line(i32* %0, i8* %1, i32* nocapture %2) {
%4 = load i32, i32* %2
%5 = tail call i32 @wmove(i32* %0, i32 %4, i32 2)
%6 = tail call i32 @wprintw(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
store i32 %8, i32* %2
ret void
}
unsigned xrop3_230_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = T & S;
  stk3 = ~stk3;
  stk2 = D & stk3;
  stk1 = S ^ stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_230_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_230_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
and    %edi,%esi
not    %sil
movzbl %sil,%ecx
not    %eax
and    %ecx,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_230_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %7
%24 = load i32, i32* %6
%25 = and i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %10
%27 = xor i32 %26, -1
store i32 %27, i32* %10
%28 = load i32, i32* %5
%29 = load i32, i32* %10
%30 = and i32 %28, %29
store i32 %30, i32* %9
%31 = load i32, i32* %6
%32 = load i32, i32* %9
%33 = xor i32 %31, %32
store i32 %33, i32* %8
%34 = load i32, i32* %8
%35 = load i32, i32* %6
%36 = xor i32 %35, -1
%37 = and i32 %34, %36
%38 = load i32, i32* %5
%39 = load i32, i32* %6
%40 = and i32 %38, %39
%41 = or i32 %37, %40
ret i32 %41
}

LLVM IR (-O2):
define i32 @xrop3_230_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = and i8 %1, %0
%6 = xor i8 %5, -1
%7 = zext i8 %6 to i32
%8 = xor i32 %4, -1
%9 = and i32 %7, %8
%10 = or i32 %9, %3
ret i32 %10
}
int do_546() { return 546; }


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

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

LLVM IR (-O0):
define i32 @do_546() {
ret i32 546
}

LLVM IR (-O2):
define i32 @do_546() {
ret i32 546
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int /*<<< orphan*/ __syscall_getuid();
uid_t getuid(void) { return (__syscall_getuid()); }


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

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

LLVM IR (-O0):
define i32 @getuid() {
%1 = call i32 (...) @__syscall_getuid()
ret i32 %1
}

LLVM IR (-O2):
define i32 @getuid() {
%1 = tail call i32 (...) @__syscall_getuid()
ret i32 %1
}
int test_05(unsigned short *x) { return x[9000]; }


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

x86 assembly (clang, -O2):
<test_05>:
movzwl 0x4650(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @test_05(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = getelementptr inbounds i16, i16* %3, i64 9000
%5 = load i16, i16* %4
%6 = zext i16 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @test_05(i16* nocapture %0) {
%2 = getelementptr inbounds i16, i16* %0, i64 9000
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
ret i32 %4
}
void music_debug() {}


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

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

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

LLVM IR (-O2):
define void @music_debug() {
ret void
}
long nellnm1(long a) { return -(a != -1); }


x86 assembly (clang, -O0):
<nellnm1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0xffffffffffffffff,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%ecx
xor    %eax,%eax
sub    %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<nellnm1>:
xor    %eax,%eax
cmp    $0xffffffffffffffff,%rdi
setne  %al
neg    %rax
ret

LLVM IR (-O0):
define i64 @nellnm1(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ne i64 %3, -1
%5 = zext i1 %4 to i32
%6 = sub nsw i32 0, %5
%7 = sext i32 %6 to i64
ret i64 %7
}

LLVM IR (-O2):
define i64 @nellnm1(i64 %0) {
%2 = icmp ne i64 %0, -1
%3 = sext i1 %2 to i64
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ ASL_();
int /*<<< orphan*/ c64_memZero();
void ASL_zp(void) {
  c64_memZero();
  ASL_();
}


x86 assembly (clang, -O0):
<ASL_zp>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <c64_memZero@plt>
mov    $0x0,%al
call   1040 <ASL_@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ASL_zp>:
push   %rax
xor    %eax,%eax
call   1030 <c64_memZero@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <ASL_@plt>

LLVM IR (-O0):
define void @ASL_zp() {
%1 = call i32 (...) @c64_memZero()
%2 = call i32 (...) @ASL_()
ret void
}

LLVM IR (-O2):
define void @ASL_zp() {
%1 = tail call i32 (...) @c64_memZero()
%2 = tail call i32 (...) @ASL_()
ret void
}
unsigned xrop3_251_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~S;
  stk2 = T | stk3;
  stk1 = D | stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_251_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_251_0_0>:
mov    %edi,%eax
shl    $0x8,%eax
shl    $0x8,%esi
not    %eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_251_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %6
%24 = xor i32 %23, -1
store i32 %24, i32* %10
%25 = load i32, i32* %7
%26 = load i32, i32* %10
%27 = or i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %5
%29 = load i32, i32* %9
%30 = or i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
ret i32 %31
}

LLVM IR (-O2):
define i32 @xrop3_251_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = zext i8 %1 to i32
%6 = shl nuw nsw i32 %5, 8
%7 = xor i32 %4, -1
%8 = or i32 %6, %7
ret i32 %8
}
void recurser(int x) {
  int local_x;
  if (x > 0)
    recurser(x - 1);
  local_x = x;
}


x86 assembly (clang, -O0):
<recurser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1130 <recurser+0x20>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <recurser@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @recurser(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 1
br label %9
9: ; preds = %6, %1
%10 = load i32, i32* %2
store i32 %10, i32* %3
ret void
}

LLVM IR (-O2):
define void @recurser(i32 %0) {
ret void
}
/* Variables and functions */
int strlen(char *);
int GetStringLength(char *p) {
  if (p) {
    return strlen(p);
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<GetStringLength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1138 <GetStringLength+0x28>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x4(%rbp)
jmp    113f <GetStringLength+0x2f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

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

/* Variables and functions */
int /*<<< orphan*/ serial_write(int /*<<< orphan*/, int /*<<< orphan*/ *, int);
void serial_write_str(uint16_t port, const char *text) {
  while (*text) {
    serial_write(port, (uint8_t *)text, 1);
    text++;
  }
}


x86 assembly (clang, -O0):
<serial_write_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <serial_write_str+0x3e>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <serial_write@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111f <serial_write_str+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_write_str>:
push   %rbp
push   %rbx
push   %rax
cmpb   $0x0,(%rsi)
je     1139 <serial_write_str+0x29>
mov    %rsi,%rbx
mov    %edi,%ebp
nopl   (%rax)
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <serial_write@plt>
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1120 <serial_write_str+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @serial_write_str(i32 %0, i8* %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %9, %5 ], [ %1, %2 ]
%7 = bitcast i8* %6 to i32*
%8 = tail call i32 @serial_write(i32 %0, i32* %7, i32 1)
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0x1e() {
  Assert_real((islower(30) == 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",
              155, ("islower should be 0 for 0x1e"));
}


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

x86 assembly (clang, -O2):
<t_islower_0x1e>:
push   %rax
mov    $0x1e,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x9b,%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 = [29 x i8] c"islower should be 0 for 0x1e\00"
define void @t_islower_0x1e() {
%1 = call i64 @islower(i32 30)
%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 155, 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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0x1e\00"
define void @t_islower_0x1e() {
%1 = tail call i64 @islower(i32 30)
%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 155, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void gtk_ui_manager_add_ui_from_string() {}


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

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

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

LLVM IR (-O2):
define void @gtk_ui_manager_add_ui_from_string() {
ret void
}
/* Variables and functions */
scalar_t__ sqrt(int);
int isprime(int num) {
  int maxdiv = (int)sqrt(num);
  for (int div = 3; div <= maxdiv; div += 2) {
    if (num % div == 0) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<isprime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <sqrt@plt>
mov    %eax,-0xc(%rbp)
movl   $0x3,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1168 <isprime+0x58>
mov    -0x8(%rbp),%eax
cltd
idivl  -0x10(%rbp)
cmp    $0x0,%edx
jne    1155 <isprime+0x45>
movl   $0x0,-0x4(%rbp)
jmp    116f <isprime+0x5f>
jmp    115a <isprime+0x4a>
mov    -0x10(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <isprime+0x1d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprime>:
push   %rbx
mov    %edi,%ebx
call   1030 <sqrt@plt>
mov    %rax,%rcx
mov    $0x1,%eax
cmp    $0x3,%ecx
jl     114c <isprime+0x3c>
mov    $0x5,%esi
nopw   0x0(%rax,%rax,1)
lea    -0x2(%rsi),%edi
mov    %ebx,%eax
cltd
idiv   %edi
test   %edx,%edx
je     1145 <isprime+0x35>
lea    0x2(%rsi),%eax
cmp    %ecx,%esi
mov    %eax,%esi
jle    1130 <isprime+0x20>
xor    %eax,%eax
test   %edx,%edx
setne  %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @isprime(i32 %0) {
%2 = tail call i64 @sqrt(i32 %0)
%3 = trunc i64 %2 to i32
%4 = icmp slt i32 %3, 3
br i1 %4, label %15, label %5
5: ; preds = %1, %5
%6 = phi i32 [ %9, %5 ], [ 3, %1 ]
%7 = srem i32 %0, %6
%8 = icmp eq i32 %7, 0
%9 = add nuw nsw i32 %6, 2
%10 = icmp sgt i32 %9, %3
%11 = select i1 %8, i1 true, i1 %10
br i1 %11, label %12, label %5
12: ; preds = %5
%13 = xor i1 %8, true
%14 = zext i1 %13 to i32
br label %15
15: ; preds = %12, %1
%16 = phi i32 [ 1, %1 ], [ %14, %12 ]
ret i32 %16
}
/* Variables and functions */
unsigned int mk_rnd_ipv4(int);
unsigned int mk_rnd_european_ipv4() { return mk_rnd_ipv4(194); }


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

x86 assembly (clang, -O2):
<mk_rnd_european_ipv4>:
mov    $0xc2,%edi
jmp    1030 <mk_rnd_ipv4@plt>

LLVM IR (-O0):
define i32 @mk_rnd_european_ipv4() {
%1 = call i32 @mk_rnd_ipv4(i32 194)
ret i32 %1
}

LLVM IR (-O2):
define i32 @mk_rnd_european_ipv4() {
%1 = tail call i32 @mk_rnd_ipv4(i32 194)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ write_lines(char *);
int main(int argc, char *argv[]) {
  int i;
  for (i = 1; i < argc; i++) {
    write_lines(argv[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1158 <main+0x48>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <write_lines@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
cmp    $0x2,%edi
jl     1142 <main+0x32>
mov    %rsi,%r14
mov    %edi,%r15d
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r14,%rbx,8),%rdi
call   1030 <write_lines@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 1, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @write_lines(i8* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ api_end();
int /*<<< orphan*/ puts(char *);
void HariMain(void) {
  puts("Hello, world!\n");
  api_end();
}


x86 assembly (clang, -O0):
<HariMain>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <puts@plt>
mov    $0x0,%al
call   1030 <api_end@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, world!\0A\00"
define void @HariMain() {
%1 = call i32 @puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @api_end()
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"Hello, world!\0A\00"
define void @HariMain() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @api_end()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ errno;
int kill(int /*<<< orphan*/, int);
int killpg(pid_t pgid, int sig) {
  if (pgid < 0) {
    errno = EINVAL;
    return -1;
  }
  return kill(-pgid, sig);
}


x86 assembly (clang, -O0):
<killpg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1146 <killpg+0x36>
mov    0x2ea9(%rip),%rax
mov    (%rax),%ecx
mov    0x2ea8(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    1156 <killpg+0x46>
xor    %edi,%edi
sub    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <kill@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<killpg>:
test   %edi,%edi
js     111b <killpg+0xb>
neg    %edi
jmp    1030 <kill@plt>
mov    0x2eb6(%rip),%rax
mov    (%rax),%eax
mov    0x2eb5(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
@errno = global i32 0
define i32 @killpg(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* @EINVAL
store i32 %9, i32* @errno
store i32 -1, i32* %3
br label %15
10: ; preds = %2
%11 = load i32, i32* %4
%12 = sub nsw i32 0, %11
%13 = load i32, i32* %5
%14 = call i32 @kill(i32 %12, i32 %13)
store i32 %14, i32* %3
br label %15
15: ; preds = %10, %8
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@EINVAL = global i32 0
@errno = global i32 0
define i32 @killpg(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = load i32, i32* @EINVAL
store i32 %5, i32* @errno
br label %9
6: ; preds = %2
%7 = sub nsw i32 0, %0
%8 = tail call i32 @kill(i32 %7, i32 %1)
br label %9
9: ; preds = %6, %4
%10 = phi i32 [ -1, %4 ], [ %8, %6 ]
ret i32 %10
}
/* Type definitions */
struct token {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ update_token(struct token *, char, char *, char *,
                                int /*<<< orphan*/, int);
void parse_pair_separator(struct token *token) {
  char value[3] = {':', ' ', '\0'};
  update_token(token, ':', "\x1b[33m", value, 0, 1);
}


x86 assembly (clang, -O0):
<parse_pair_separator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0xedd(%rip),%ax
mov    %ax,-0xb(%rbp)
mov    0xed5(%rip),%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xb(%rbp),%rcx
mov    $0x3a,%esi
lea    0xebf(%rip),%rdx
xor    %r8d,%r8d
mov    $0x1,%r9d
call   1030 <update_token@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_pair_separator>:
push   %rax
movb   $0x0,0x6(%rsp)
movw   $0x203a,0x4(%rsp)
lea    0xedf(%rip),%rdx
lea    0x4(%rsp),%rcx
mov    $0x3a,%esi
xor    %r8d,%r8d
mov    $0x1,%r9d
call   1030 <update_token@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.token = type { i32 }
@__const.parse_pair_separator.value = [3 x i8] c": \00"
@.str = [6 x i8] c"\1B[33m\00"
define void @parse_pair_separator(%struct.token* %0) {
%2 = alloca %struct.token*
%3 = alloca [3 x i8]
store %struct.token* %0, %struct.token** %2
%4 = bitcast [3 x i8]* %3 to i8*
%5 = load %struct.token*, %struct.token** %2
%6 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%7 = call i32 @update_token(%struct.token* %5, i8 signext 58, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %6, i32 0, i32 1)
ret void
}

LLVM IR (-O2):
%struct.token = type { i32 }
@__const.parse_pair_separator.value = [3 x i8] c": \00"
@.str = [6 x i8] c"\1B[33m\00"
define void @parse_pair_separator(%struct.token* %0) {
%2 = alloca [3 x i8]
%3 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%4 = call i32 @update_token(%struct.token* %0, i8 signext 58, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %3, i32 0, i32 1)
ret void
}
const char *picosat_version(void) { return "959"; }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"959\00"
define i8* @picosat_version() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}