xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ err_bin(int);
int /*<<< orphan*/ err_string(int);
int /*<<< orphan*/ f_help(int, unsigned char **, float *, unsigned int, char *,
                          int /*<<< orphan*/ *, char const *);
int f_h(int mode, unsigned char **sec, float *data, unsigned int ndata,
        char *inv_out, void **local) {
  const char *arg1 = "most";
  mode = -1;
  f_help(mode, sec, data, ndata, inv_out, NULL, arg1);
  err_bin(1);
  err_string(1);
  return 1;
}


x86 assembly (clang, -O0):
<f_h>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
lea    0xeab(%rip),%rax
mov    %rax,-0x38(%rbp)
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x28(%rbp),%r8
mov    -0x38(%rbp),%rax
xor    %r9d,%r9d
mov    %rax,(%rsp)
call   1040 <f_help@plt>
mov    $0x1,%edi
call   1050 <err_bin@plt>
mov    $0x1,%edi
call   1030 <err_string@plt>
mov    $0x1,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_h>:
push   %rax
lea    0xec8(%rip),%rax
mov    %rax,(%rsp)
mov    $0xffffffff,%edi
xor    %r9d,%r9d
call   1040 <f_help@plt>
mov    $0x1,%edi
call   1050 <err_bin@plt>
mov    $0x1,%edi
call   1030 <err_string@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"most\00"
define i32 @f_h(i32 %0, i8** %1, float* %2, i32 %3, i8* %4, i8** %5) {
%7 = alloca i32
%8 = alloca i8**
%9 = alloca float*
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i8**
%13 = alloca i8*
store i32 %0, i32* %7
store i8** %1, i8*** %8
store float* %2, float** %9
store i32 %3, i32* %10
store i8* %4, i8** %11
store i8** %5, i8*** %12
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %13
store i32 -1, i32* %7
%14 = load i32, i32* %7
%15 = load i8**, i8*** %8
%16 = load float*, float** %9
%17 = load i32, i32* %10
%18 = load i8*, i8** %11
%19 = load i8*, i8** %13
%20 = call i32 @f_help(i32 %14, i8** %15, float* %16, i32 %17, i8* %18, i32* null, i8* %19)
%21 = call i32 @err_bin(i32 1)
%22 = call i32 @err_string(i32 1)
ret i32 1
}

LLVM IR (-O2):
@.str = [5 x i8] c"most\00"
define i32 @f_h(i32 %0, i8** %1, float* %2, i32 %3, i8* %4, i8** nocapture readnone %5) {
%7 = tail call i32 @f_help(i32 -1, i8** %1, float* %2, i32 %3, i8* %4, i32* null, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @err_bin(i32 1)
%9 = tail call i32 @err_string(i32 1)
ret i32 1
}
/* Type definitions */
struct in_addr {
  int dummy;
};

/* Variables and functions */
int _inetAtonDetail(int, size_t *, char const *, struct in_addr *);
int inet_pton4(const char *src, void *dst) {
  size_t numBytes;
  int ret = _inetAtonDetail(10, &numBytes, src, (struct in_addr *)dst);
  return (ret == 1 && numBytes == 3) ? 1 : 0;
}


x86 assembly (clang, -O0):
<inet_pton4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    $0xa,%edi
lea    -0x18(%rbp),%rsi
call   1030 <_inetAtonDetail@plt>
mov    %eax,-0x1c(%rbp)
xor    %eax,%eax
cmpl   $0x1,-0x1c(%rbp)
mov    %al,-0x1d(%rbp)
jne    1153 <inet_pton4+0x43>
cmpq   $0x3,-0x18(%rbp)
sete   %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inet_pton4>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    %rsp,%rsi
mov    $0xa,%edi
call   1030 <_inetAtonDetail@plt>
cmp    $0x1,%eax
sete   %al
cmpq   $0x3,(%rsp)
sete   %cl
and    %al,%cl
movzbl %cl,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.in_addr = type { i32 }
define i32 @inet_pton4(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to %struct.in_addr*
%10 = call i32 @_inetAtonDetail(i32 10, i64* %5, i8* %7, %struct.in_addr* %9)
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = load i64, i64* %5
%15 = icmp eq i64 %14, 3
br label %16
16: ; preds = %13, %2
%17 = phi i1 [ false, %2 ], [ %15, %13 ]
%18 = zext i1 %17 to i64
%19 = select i1 %17, i32 1, i32 0
ret i32 %19
}

LLVM IR (-O2):
%struct.in_addr = type { i32 }
define i32 @inet_pton4(i8* %0, i8* %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = bitcast i8* %1 to %struct.in_addr*
%6 = call i32 @_inetAtonDetail(i32 10, i64* %3, i8* %0, %struct.in_addr* %5)
%7 = icmp eq i32 %6, 1
%8 = load i64, i64* %3
%9 = icmp eq i64 %8, 3
%10 = select i1 %7, i1 %9, i1 false
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
bool fspath_is_dir(const char path[]) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @fspath_is_dir(i8* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
ssize_t readlink(const char *__path, char *__buf, size_t __buflen) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<readlink>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ed1(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb8(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<readlink>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @readlink(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 i32, i32* @ENOSYS
store i32 %7, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @readlink(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
%4 = load i32, i32* @ENOSYS
store i32 %4, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_header(void) {
  printf("Content-type: text/html; charset=utf-8\n\n");
  printf("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
         "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHMTL 1.1//EN\"\n"
         "          \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n"
         "<html xmlns=\"http://www.w3.org/1999/xhtml\""
         " xml:lang=\"en\">\n"
         "<head>\n"
         " <title>Log in</title>\n"
         " <link rel=\"stylesheet\" type=\"text/css\""
         " href=\"style.css\"/>\n"
         " <meta name=\"Author\" content=\"Adam Hooper\"/>\n"
         "</head>\n"
         "<body>\n");
}


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

x86 assembly (clang, -O2):
<print_header>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf04(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"Content-type: text/html; charset=utf-8\0A\0A\00"
@.str.1 = [355 x i8] c"<?xml version=\221.0\22 encoding=\22utf-8\22?>\0A<!DOCTYPE html PUBLIC \22-//W3C//DTD XHMTL 1.1//EN\22\0A \22http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\22>\0A<html xmlns=\22http://www.w3.org/1999/xhtml\22 xml:lang=\22en\22>\0A<head>\0A <title>Log in</title>\0A <link rel=\22stylesheet\22 type=\22text/css\22 href=\22style.css\22/>\0A <meta name=\22Author\22 content=\22Adam Hooper\22/>\0A</head>\0A<body>\0A\00"
define void @print_header() {
%1 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([355 x i8], [355 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [40 x i8] c"Content-type: text/html; charset=utf-8\0A\00"
@str.2 = [354 x i8] c"<?xml version=\221.0\22 encoding=\22utf-8\22?>\0A<!DOCTYPE html PUBLIC \22-//W3C//DTD XHMTL 1.1//EN\22\0A \22http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\22>\0A<html xmlns=\22http://www.w3.org/1999/xhtml\22 xml:lang=\22en\22>\0A<head>\0A <title>Log in</title>\0A <link rel=\22stylesheet\22 type=\22text/css\22 href=\22style.css\22/>\0A <meta name=\22Author\22 content=\22Adam Hooper\22/>\0A</head>\0A<body>\00"
define void @print_header() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([354 x i8], [354 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int mul3div4(int);
int main(int argc, char *argv[]) {
  int x = 0x87654321;
  assert(mul3div4(x) == x * 3 / 4);
  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   $0x87654321,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <mul3div4@plt>
mov    %eax,-0x18(%rbp)
imul   $0x3,-0x14(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x87654321,%edi
call   1040 <mul3div4@plt>
xor    %edi,%edi
cmp    $0xe58bf259,%eax
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
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 -2023406815, i32* %6
%7 = load i32, i32* %6
%8 = call i32 @mul3div4(i32 %7)
%9 = load i32, i32* %6
%10 = mul nsw i32 %9, 3
%11 = sdiv i32 %10, 4
%12 = icmp eq i32 %8, %11
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @mul3div4(i32 -2023406815)
%4 = icmp eq i32 %3, -443813287
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
ret i32 0
}
void fn2E1E() { return; }


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

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

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

LLVM IR (-O2):
define void @fn2E1E() {
ret void
}
/* Variables and functions */
int inreg(int, int);
int /*<<< orphan*/ outreg(int, int, int);
void serial_putc(int channel, int c) {
  int count = 0;
  while (((inreg(channel, 0x05) & 0x20) == 0) && (count++ < 100))
    ;
  outreg(channel, 0x00, c);
}


x86 assembly (clang, -O0):
<serial_putc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x5,%esi
call   1040 <inreg@plt>
mov    %eax,%ecx
and    $0x20,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
jne    1169 <serial_putc+0x49>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x64,%eax
setl   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1179 <serial_putc+0x59>
jmp    117e <serial_putc+0x5e>
jmp    1135 <serial_putc+0x15>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
xor    %esi,%esi
call   1030 <outreg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_putc>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebp
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    $0x5,%esi
call   1040 <inreg@plt>
test   $0x20,%al
jne    114a <serial_putc+0x2a>
lea    0x1(%rbx),%eax
cmp    $0x64,%ebx
mov    %eax,%ebx
jb     1130 <serial_putc+0x10>
mov    %ebp,%edi
xor    %esi,%esi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <outreg@plt>

LLVM IR (-O0):
define void @serial_putc(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %3
%8 = call i32 @inreg(i32 %7, i32 5)
%9 = and i32 %8, 32
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %6
%12 = load i32, i32* %5
%13 = add nsw i32 %12, 1
store i32 %13, i32* %5
%14 = icmp slt i32 %12, 100
br label %15
15: ; preds = %11, %6
%16 = phi i1 [ false, %6 ], [ %14, %11 ]
br i1 %16, label %17, label %18
17: ; preds = %15
br label %6
18: ; preds = %15
%19 = load i32, i32* %3
%20 = load i32, i32* %4
%21 = call i32 @outreg(i32 %19, i32 0, i32 %20)
ret void
}

LLVM IR (-O2):
define void @serial_putc(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ 0, %2 ], [ %8, %3 ]
%5 = tail call i32 @inreg(i32 %0, i32 5)
%6 = and i32 %5, 32
%7 = icmp eq i32 %6, 0
%8 = add nuw nsw i32 %4, 1
%9 = icmp ult i32 %4, 100
%10 = select i1 %7, i1 %9, i1 false
br i1 %10, label %3, label %11
11: ; preds = %3
%12 = tail call i32 @outreg(i32 %0, i32 0, i32 %1)
ret void
}
int f2(int x) { return x; }


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

x86 assembly (clang, -O2):
<f2>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @f2(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int copy_quaddobl_container_to_target_solutions(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(266, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<copy_quaddobl_container_to_target_solutions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x10a,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_quaddobl_container_to_target_solutions>:
mov    $0x10a,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @copy_quaddobl_container_to_target_solutions() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 266, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @copy_quaddobl_container_to_target_solutions() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 266, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
char *FirstWithinSymbols_internal(char *, char *, char const, char const,
                                  char const, char const);
char *FirstWithinSymbolsExcept(char *output, char *input, const char openSymbol,
                               const char closeSymbol,
                               const char openSymbolExcept,
                               const char closeSymbolExcept) {
  return FirstWithinSymbols_internal(output, input, openSymbol, closeSymbol,
                                     openSymbolExcept, closeSymbolExcept);
}


x86 assembly (clang, -O0):
<FirstWithinSymbolsExcept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %r8d,-0x2c(%rbp)
mov    %ecx,%eax
mov    -0x2c(%rbp),%ecx
mov    %eax,-0x28(%rbp)
mov    %edx,%eax
mov    -0x28(%rbp),%edx
mov    %eax,-0x24(%rbp)
mov    %rsi,%rax
mov    -0x24(%rbp),%esi
mov    %rax,-0x20(%rbp)
mov    %rdi,%r8
mov    -0x20(%rbp),%rdi
mov    %r9b,%al
mov    %r8,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %sil,-0x11(%rbp)
mov    %dl,-0x12(%rbp)
mov    %cl,-0x13(%rbp)
mov    %al,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x11(%rbp),%dl
mov    -0x12(%rbp),%cl
mov    -0x13(%rbp),%al
movsbl %dl,%edx
movsbl %cl,%ecx
movsbl %al,%r8d
movsbl -0x14(%rbp),%r9d
call   1030 <FirstWithinSymbols_internal@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FirstWithinSymbolsExcept>:
jmp    1030 <FirstWithinSymbols_internal@plt>

LLVM IR (-O0):
define i8* @FirstWithinSymbolsExcept(i8* %0, i8* %1, i8 signext %2, i8 signext %3, i8 signext %4, i8 signext %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8
%10 = alloca i8
%11 = alloca i8
%12 = alloca i8
store i8* %0, i8** %7
store i8* %1, i8** %8
store i8 %2, i8* %9
store i8 %3, i8* %10
store i8 %4, i8* %11
store i8 %5, i8* %12
%13 = load i8*, i8** %7
%14 = load i8*, i8** %8
%15 = load i8, i8* %9
%16 = load i8, i8* %10
%17 = load i8, i8* %11
%18 = load i8, i8* %12
%19 = call i8* @FirstWithinSymbols_internal(i8* %13, i8* %14, i8 signext %15, i8 signext %16, i8 signext %17, i8 signext %18)
ret i8* %19
}

LLVM IR (-O2):
define i8* @FirstWithinSymbolsExcept(i8* %0, i8* %1, i8 signext %2, i8 signext %3, i8 signext %4, i8 signext %5) {
%7 = tail call i8* @FirstWithinSymbols_internal(i8* %0, i8* %1, i8 signext %2, i8 signext %3, i8 signext %4, i8 signext %5)
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ init_hextable();
int /*<<< orphan*/ setup_matcher_engine();
int main() {
  setup_matcher_engine();
  init_hextable();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <setup_matcher_engine@plt>
mov    $0x0,%al
call   1030 <init_hextable@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @setup_matcher_engine()
%3 = call i32 (...) @init_hextable()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @setup_matcher_engine()
%2 = tail call i32 (...) @init_hextable()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0x15() {
  Assert_real((isalpha(21) == 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_isalpha.c",
              110, ("isalpha should be 0 for 0x15"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0x15>:
push   %rax
mov    $0x15,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x6e,%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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x15\00"
define void @t_isalpha_0x15() {
%1 = call i64 @isalpha(i32 21)
%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 110, 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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x15\00"
define void @t_isalpha_0x15() {
%1 = tail call i64 @isalpha(i32 21)
%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 110, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ free(char *);
char *malloc(int);
int main(void) {
  char *p;
  p = malloc(10);
  free(p);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
call   1030 <free@plt>
mov    0x2ea6(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @malloc(i32 10)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @free(i8* %4)
%6 = load i32, i32* @EXIT_SUCCESS
ret i32 %6
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%2 = tail call i32 @free(i8* %1)
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fork();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  for (int i = 1;; i++) {
    fork();
    printf("Forked %i children.\n", i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    $0x0,%al
call   1040 <fork@plt>
mov    -0x8(%rbp),%esi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
lea    0xed0(%rip),%r14
xor    %eax,%eax
call   1040 <fork@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
jmp    1130 <main+0x10>

LLVM IR (-O0):
@.str = [21 x i8] c"Forked %i children.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
br label %3
3: ; preds = %7, %0
%4 = call i32 (...) @fork()
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %7
7: ; preds = %3
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
store i32 %9, i32* %2
br label %3
}

LLVM IR (-O2):
@.str = [21 x i8] c"Forked %i children.\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 1, %0 ], [ %5, %1 ]
%3 = tail call i32 (...) @fork()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %2)
%5 = add nuw nsw i32 %2, 1
br label %1
}
/* Variables and functions */
char *strchr(char *, char);
int split_chr(char *str, char sep) {
  char *next;
  char *buf = str;
  int nbel = 0;
  while ((next = strchr(buf, sep)) != NULL) {
    nbel++;
    buf = next;
    buf[0] = '\0';
    buf++;
  }
  return nbel;
}


x86 assembly (clang, -O0):
<split_chr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1175 <split_chr+0x65>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1131 <split_chr+0x21>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<split_chr>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
call   1030 <strchr@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     1149 <split_chr+0x39>
movsbl %bpl,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%ebx
movb   $0x0,(%rax)
add    $0x1,%rax
mov    %rax,%rdi
mov    %ebp,%esi
call   1030 <strchr@plt>
test   %rax,%rax
jne    1130 <split_chr+0x20>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @split_chr(i8* %0, i8 signext %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %10, %5 ], [ %3, %2 ]
%7 = phi i32 [ %8, %5 ], [ 0, %2 ]
%8 = add nuw nsw i32 %7, 1
store i8 0, i8* %6
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = tail call i8* @strchr(i8* dereferenceable(1) %9, i8 signext %1)
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %5
12: ; preds = %5, %2
%13 = phi i32 [ 0, %2 ], [ %8, %5 ]
ret i32 %13
}
/* Type definitions */
struct string {
  int dummy;
};

/* Variables and functions */
struct string *string_init_data(char const *, size_t);
size_t strlen(char const *);
struct string *string_init(const char *cstr) {
  size_t size = strlen(cstr);
  return (string_init_data(cstr, size));
}


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

x86 assembly (clang, -O2):
<string_init>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1040 <string_init_data@plt>

LLVM IR (-O0):
%struct.string = type { i32 }
define %struct.string* @string_init(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
store i64 %5, i64* %3
%6 = load i8*, i8** %2
%7 = load i64, i64* %3
%8 = call %struct.string* @string_init_data(i8* %6, i64 %7)
ret %struct.string* %8
}

LLVM IR (-O2):
%struct.string = type { i32 }
define %struct.string* @string_init(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = tail call %struct.string* @string_init_data(i8* %0, i64 %2)
ret %struct.string* %3
}
/* Variables and functions */
int /*<<< orphan*/ endonion();
int /*<<< orphan*/ finalize();
int /*<<< orphan*/ fivesides();
int /*<<< orphan*/ onion();
int /*<<< orphan*/ opencscad_init();
int /*<<< orphan*/ pentacolumn(int, int);
int main(int argc, char *argv[]) {
  opencscad_init();
  fivesides();
  onion();
  pentacolumn(150, 50);
  endonion();
  finalize();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1060 <opencscad_init@plt>
mov    $0x0,%al
call   1070 <fivesides@plt>
mov    $0x0,%al
call   1040 <onion@plt>
mov    $0x96,%edi
mov    $0x32,%esi
call   1030 <pentacolumn@plt>
mov    $0x0,%al
call   1080 <endonion@plt>
mov    $0x0,%al
call   1050 <finalize@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <opencscad_init@plt>
xor    %eax,%eax
call   1070 <fivesides@plt>
xor    %eax,%eax
call   1040 <onion@plt>
mov    $0x96,%edi
mov    $0x32,%esi
call   1030 <pentacolumn@plt>
xor    %eax,%eax
call   1080 <endonion@plt>
xor    %eax,%eax
call   1050 <finalize@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @opencscad_init()
%7 = call i32 (...) @fivesides()
%8 = call i32 (...) @onion()
%9 = call i32 @pentacolumn(i32 150, i32 50)
%10 = call i32 (...) @endonion()
%11 = call i32 (...) @finalize()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @opencscad_init()
%4 = tail call i32 (...) @fivesides()
%5 = tail call i32 (...) @onion()
%6 = tail call i32 @pentacolumn(i32 150, i32 50)
%7 = tail call i32 (...) @endonion()
%8 = tail call i32 (...) @finalize()
ret i32 0
}
int hash_string(char *s) {
  int val = 0;
  int c;
  while ((c = *s++) != 0)
    val = ((val << 1) | ((val >> 31) & 0x1)) ^ c;
  return val;
}


x86 assembly (clang, -O0):
<hash_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
je     1149 <hash_string+0x49>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    -0xc(%rbp),%ecx
sar    $0x1f,%ecx
and    $0x1,%ecx
or     %ecx,%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <hash_string+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_string>:
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <hash_string+0x23>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
rol    %eax
xor    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_string+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @hash_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %5
5: ; preds = %11, %1
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %2
%8 = load i8, i8* %6
%9 = sext i8 %8 to i32
store i32 %9, i32* %4
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %20
11: ; preds = %5
%12 = load i32, i32* %3
%13 = shl i32 %12, 1
%14 = load i32, i32* %3
%15 = ashr i32 %14, 31
%16 = and i32 %15, 1
%17 = or i32 %13, %16
%18 = load i32, i32* %4
%19 = xor i32 %17, %18
store i32 %19, i32* %3
br label %5
20: ; preds = %5
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @hash_string(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* [ %9, %4 ], [ %0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = sext i8 %5 to i32
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = tail call i32 @llvm.fshl.i32(i32 %7, i32 %7, i32 1)
%11 = xor i32 %10, %8
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %15
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t htobe16(uint16_t v) {
  return (uint16_t)(((v & 0x00FF) << 8) | ((v & 0xFF00) >> 8));
}


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

x86 assembly (clang, -O2):
<htobe16>:
rol    $0x8,%di
movzwl %di,%eax
ret

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

LLVM IR (-O2):
define i32 @htobe16(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = tail call i16 @llvm.bswap.i16(i16 %2)
%4 = zext i16 %3 to i32
ret i32 %4
}
int _getpid(void) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @_getpid() {
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
FILE *fs_open(char *path, char *flags) { return fopen(path, flags); }


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

x86 assembly (clang, -O2):
<fs_open>:
jmp    1030 <fopen@plt>

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

LLVM IR (-O2):
define noalias i32* @fs_open(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  typedef enum { apple, pear, grapefruit } fruits;
  register int i;
  int array[grapefruit + 1];
  array[apple] = 24;
  array[pear] = 10;
  for (i = 0; i <= 1; i++) {
    printf("%i\n", array[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x18,-0x14(%rbp)
movl   $0xa,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     1160 <main+0x50>
movslq -0x8(%rbp),%rax
mov    -0x14(%rbp,%rax,4),%esi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1134 <main+0x24>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x18,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

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

/* Variables and functions */
int vsnprintf(char *, size_t, char const *, int /*<<< orphan*/);
int _vsnprintf(char *str, size_t size, const char *format, va_list ap) {
  return vsnprintf(str, size, format, ap);
}


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

x86 assembly (clang, -O2):
<_vsnprintf>:
jmp    1030 <vsnprintf@plt>

LLVM IR (-O0):
define i32 @_vsnprintf(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 @vsnprintf(i8* %9, i64 %10, i8* %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @_vsnprintf(i8* nocapture %0, i64 %1, i8* nocapture %2, i32 %3) {
%5 = tail call i32 @vsnprintf(i8* %0, i64 %1, i8* %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
scalar_t__ unlink(char *);
void joberr(char *job) {
  fprintf(stderr, "lpd: something is wrong with %s\n", job);
  if (unlink(job) < 0)
    fatal("can't remove it");
}


x86 assembly (clang, -O0):
<joberr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeb0(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <unlink@plt>
cmp    $0x0,%rax
jge    1174 <joberr+0x44>
lea    0xeb2(%rip),%rdi
call   1050 <fatal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<joberr>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
mov    %rbx,%rdi
call   1030 <unlink@plt>
test   %rax,%rax
js     115b <joberr+0x2b>
pop    %rbx
ret
lea    0xebf(%rip),%rdi
pop    %rbx
jmp    1050 <fatal@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"lpd: something is wrong with %s\0A\00"
@.str.1 = [16 x i8] c"can't remove it\00"
define void @joberr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i8*, i8** %2
%7 = call i64 @unlink(i8* %6)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @fatal(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"lpd: something is wrong with %s\0A\00"
@.str.1 = [16 x i8] c"can't remove it\00"
define void @joberr(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i64 @unlink(i8* %0)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @fatal(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ detab(char *);
int getline(char *, int);
int /*<<< orphan*/ printf(char *, char *);
main() {
  int len;
  char line[1000];
  while ((len = getline(line, 1000)) > 0) {
    detab(line);
    printf("%s", line);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1050 <getline@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1183 <main+0x53>
lea    -0x3f0(%rbp),%rdi
call   1030 <detab@plt>
lea    -0x3f0(%rbp),%rsi
lea    0xe87(%rip),%rdi
call   1040 <printf@plt>
jmp    1142 <main+0x12>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1050 <getline@plt>
test   %eax,%eax
jle    1184 <main+0x54>
mov    %rsp,%rbx
lea    0xeab(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
call   1030 <detab@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1050 <getline@plt>
test   %eax,%eax
jg     1160 <main+0x30>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @getline(i8* %2, i32 1000)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %0, %5
%6 = call i32 @detab(i8* %2)
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%8 = call i32 @getline(i8* %2, i32 1000)
%9 = icmp sgt i32 %8, 0
br i1 %9, label %5, label %10
10: ; preds = %5, %0
ret i32 0
}
/* Variables and functions */
scalar_t__ isspace(char);
unsigned int util_split(char *str) {
  unsigned int total = 1;
  while (*str) {
    if (isspace(*str)) {
      *str = '\0';
      total++;
    }
    str++;
  }
  return total;
}


x86 assembly (clang, -O0):
<util_split>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1167 <util_split+0x57>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1156 <util_split+0x46>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1123 <util_split+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_split>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1151 <util_split+0x41>
mov    %rdi,%rbx
add    $0x1,%rbx
mov    $0x1,%ebp
jmp    113b <util_split+0x2b>
nopw   0x0(%rax,%rax,1)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     1156 <util_split+0x46>
movsbl %al,%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     1130 <util_split+0x20>
movb   $0x0,-0x1(%rbx)
add    $0x1,%ebp
jmp    1130 <util_split+0x20>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @util_split(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %12
%5 = phi i8 [ %15, %12 ], [ %2, %1 ]
%6 = phi i32 [ %13, %12 ], [ 1, %1 ]
%7 = phi i8* [ %14, %12 ], [ %0, %1 ]
%8 = tail call i64 @isspace(i8 signext %5)
%9 = icmp eq i64 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %4
store i8 0, i8* %7
%11 = add i32 %6, 1
br label %12
12: ; preds = %10, %4
%13 = phi i32 [ %11, %10 ], [ %6, %4 ]
%14 = getelementptr inbounds i8, i8* %7, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %4
17: ; preds = %12, %1
%18 = phi i32 [ 1, %1 ], [ %13, %12 ]
ret i32 %18
}
int test_imm_34uint8_mem(unsigned char *val) {
  return ((*val) & (0x34 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_34uint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0x34,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_34uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 52
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ putchar(int);
int main(void) {
  int c;
  c = getchar();
  while (c != EOF) {
    putchar(c);
    c = getchar();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2ea5(%rip),%rcx
cmp    (%rcx),%eax
je     1162 <main+0x42>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
jmp    1139 <main+0x19>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rbx
cmp    (%rbx),%eax
je     1152 <main+0x32>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %10, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %7, %4 ], [ %1, %0 ]
%6 = tail call i32 @putchar(i32 %5)
%7 = tail call i32 (...) @getchar()
%8 = load i32, i32* @EOF
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %4
10: ; preds = %4, %0
ret i32 0
}