xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void DeleteArgV(int *pArgC, char *argV[32]) {
  for (int i = 0; i < *pArgC; ++i) {
    free(argV[i]);
  }
  *pArgC = 0;
}


x86 assembly (clang, -O0):
<DeleteArgV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    (%rcx),%eax
jge    1155 <DeleteArgV+0x45>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <DeleteArgV+0x17>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DeleteArgV>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
cmpl   $0x0,(%rdi)
jle    1145 <DeleteArgV+0x35>
mov    %rsi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
movslq (%r15),%rax
cmp    %rax,%rbx
jl     1130 <DeleteArgV+0x20>
movl   $0x0,(%r15)
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @DeleteArgV(i32* nocapture %0, i8** nocapture %1) {
%3 = load i32, i32* %0
%4 = icmp sgt i32 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %6, %2
store i32 0, i32* %0
ret void
6: ; preds = %2, %6
%7 = phi i64 [ %11, %6 ], [ 0, %2 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @free(i8* %9)
%11 = add nuw nsw i64 %7, 1
%12 = load i32, i32* %0
%13 = sext i32 %12 to i64
%14 = icmp slt i64 %11, %13
br i1 %14, label %6, label %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print(char *str) { printf("%s\n", str); }


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

x86 assembly (clang, -O2):
<print>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

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

/* Variables and functions */
int wscanw(int /*<<< orphan*/ *, char *, long *);
int l_wscanw(WINDOW *win, char *fmt, long *i) { return (wscanw(win, fmt, i)); }


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

x86 assembly (clang, -O2):
<l_wscanw>:
jmp    1030 <wscanw@plt>

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

LLVM IR (-O2):
define i32 @l_wscanw(i32* %0, i8* %1, i64* %2) {
%4 = tail call i32 @wscanw(i32* %0, i8* %1, i64* %2)
ret i32 %4
}
void palm27x_mmc_init(int detect, int ro, int power, int power_inverted) {}


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

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

LLVM IR (-O0):
define void @palm27x_mmc_init(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
define void @palm27x_mmc_init(i32 %0, i32 %1, i32 %2, i32 %3) {
ret void
}
int usage(char *progname) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @usage(i8* nocapture readnone %0) {
ret i32 1
}
/* Type definitions */
struct rusage {
  int dummy;
};

/* Variables and functions */
int getrusage(int /*<<< orphan*/, struct rusage *);
int /*<<< orphan*/ printf(char *, int);
main() {
  struct rusage a;
  printf("%d", getrusage(0, &a));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
lea    -0x8(%rbp),%rsi
call   1040 <getrusage@plt>
mov    %eax,%esi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rsi
xor    %edi,%edi
call   1040 <getrusage@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.rusage = type { i32 }
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca %struct.rusage
%2 = call i32 @getrusage(i32 0, %struct.rusage* %1)
%3 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
%struct.rusage = type { i32 }
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca %struct.rusage
%2 = bitcast %struct.rusage* %1 to i8*
%3 = call i32 @getrusage(i32 0, %struct.rusage* %1)
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int cputs(const char *s) {
  char c;
  while (c = *s++) {
    if (c == '\n')
      putchar('\r');
    putchar(c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<cputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x9(%rbp)
cmp    $0x0,%al
je     115d <cputs+0x4d>
movsbl -0x9(%rbp),%eax
cmp    $0xa,%eax
jne    114f <cputs+0x3f>
mov    $0xd,%edi
call   1030 <putchar@plt>
movsbl -0x9(%rbp),%edi
call   1030 <putchar@plt>
jmp    111c <cputs+0xc>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cputs>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
jmp    1136 <cputs+0x26>
nopl   0x0(%rax)
mov    $0xd,%edi
call   1030 <putchar@plt>
add    $0x1,%r14
movsbl %bl,%edi
call   1030 <putchar@plt>
movzbl (%r14),%ebx
cmp    $0xa,%bl
je     1120 <cputs+0x10>
test   %bl,%bl
jne    112a <cputs+0x1a>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @cputs(i8* nocapture %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %4, %8 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %3
switch i8 %5, label %8 [
i8 0, label %10
i8 10, label %6
]
6: ; preds = %2
%7 = tail call i32 @putchar(i8 signext 13)
br label %8
8: ; preds = %2, %6
%9 = tail call i32 @putchar(i8 signext %5)
br label %2
10: ; preds = %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ stdout;
char posix_reader() {
  char str;
  fflush(stdout);
  scanf("%c", &str);
  return str;
}


x86 assembly (clang, -O0):
<posix_reader>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
lea    0xec3(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<posix_reader>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
lea    0xeca(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x7(%rsp),%al
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [3 x i8] c"%c\00"
define signext i8 @posix_reader() {
%1 = alloca i8
%2 = load i32, i32* @stdout
%3 = call i32 @fflush(i32 %2)
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%5 = load i8, i8* %1
ret i8 %5
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [3 x i8] c"%c\00"
define signext i8 @posix_reader() {
%1 = alloca i8
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%5 = load i8, i8* %1
ret i8 %5
}
char toUpp(char c) {
  char up = c - 32;
  return up;
}


x86 assembly (clang, -O0):
<toUpp>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x20,%eax
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toUpp>:
lea    -0x20(%rdi),%eax
ret

LLVM IR (-O0):
define signext i8 @toUpp(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = sub nsw i32 %5, 32
%7 = trunc i32 %6 to i8
store i8 %7, i8* %3
%8 = load i8, i8* %3
ret i8 %8
}

LLVM IR (-O2):
define signext i8 @toUpp(i8 signext %0) {
%2 = add i8 %0, -32
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ parser_main(int, char **);
int main(int argc, char **argv) {
  parser_main(argc, argv);
  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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <parser_main@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <parser_main@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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @parser_main(i32 %6, i8** %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @parser_main(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
int fatt(long);
int nPk(long, long);
long long nCk(long n, long k) { return nPk(n, k) * 1 / fatt(k); }


x86 assembly (clang, -O0):
<nCk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <nPk@plt>
shl    $0x0,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fatt@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cltd
idiv   %ecx
cltq
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nCk>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1040 <nPk@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <fatt@plt>
mov    %eax,%ecx
mov    %ebp,%eax
cltd
idiv   %ecx
cltq
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i64 @nCk(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = call i32 @nPk(i64 %5, i64 %6)
%8 = mul nsw i32 %7, 1
%9 = load i64, i64* %4
%10 = call i32 @fatt(i64 %9)
%11 = sdiv i32 %8, %10
%12 = sext i32 %11 to i64
ret i64 %12
}

LLVM IR (-O2):
define i64 @nCk(i64 %0, i64 %1) {
%3 = tail call i32 @nPk(i64 %0, i64 %1)
%4 = tail call i32 @fatt(i64 %1)
%5 = sdiv i32 %3, %4
%6 = sext i32 %5 to i64
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int add(int, int, int, int, int, int, int, int, int, int, int, int, int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(void) {
  if (add(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13) != 91)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
mov    $0x6,%r9d
movl   $0x7,(%rsp)
movl   $0x8,0x8(%rsp)
movl   $0x9,0x10(%rsp)
movl   $0xa,0x18(%rsp)
movl   $0xb,0x20(%rsp)
movl   $0xc,0x28(%rsp)
movl   $0xd,0x30(%rsp)
call   1040 <add@plt>
cmp    $0x5b,%eax
je     11ab <main+0x7b>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
sub    $0x8,%rsp
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
mov    $0x6,%r9d
push   $0xd
push   $0xc
push   $0xb
push   $0xa
push   $0x9
push   $0x8
push   $0x7
call   1040 <add@plt>
add    $0x40,%rsp
cmp    $0x5b,%eax
jne    1178 <main+0x48>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @add(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13)
%3 = icmp ne i32 %2, 91
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @add(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13)
%2 = icmp eq i32 %1, 91
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @exit(i32 0)
unreachable
}
int test_imm_D7int16_mem(short *val) {
  return ((*val) & (-0xD7 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_D7int16_mem>:
movzwl (%rdi),%eax
test   $0xff29,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_D7int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -215
%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_D7int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -215
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: revnetgroup -u | -h [-f netgroup_file]\n");
  exit(1);
}


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    $0x1,%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    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [47 x i8] c"usage: revnetgroup -u | -h [-f netgroup_file]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [47 x i8] c"usage: revnetgroup -u | -h [-f netgroup_file]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
int HelpItem159(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @HelpItem159() {
ret i32 0
}

LLVM IR (-O2):
define i32 @HelpItem159() {
ret i32 0
}
/* Variables and functions */
int write(int, void const *, int);
int cw_write(int fd, const void *buf, int count, int ssl) {
  return write(fd, buf, count);
}


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

x86 assembly (clang, -O2):
<cw_write>:
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define i32 @cw_write(i32 %0, i8* nocapture %1, i32 %2, i32 %3) {
%5 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ drawpolygon(int, int, int, int);
void colorcube() {
  drawpolygon(0, 3, 2, 1);
  drawpolygon(2, 3, 7, 6);
  drawpolygon(0, 4, 7, 3);
  drawpolygon(0, 1, 5, 4);
  drawpolygon(1, 2, 6, 5);
  drawpolygon(4, 5, 6, 7);
}


x86 assembly (clang, -O0):
<colorcube>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x3,%esi
mov    $0x2,%edx
mov    $0x1,%ecx
call   1030 <drawpolygon@plt>
mov    $0x2,%edi
mov    $0x3,%esi
mov    $0x7,%edx
mov    $0x6,%ecx
call   1030 <drawpolygon@plt>
xor    %edi,%edi
mov    $0x4,%esi
mov    $0x7,%edx
mov    $0x3,%ecx
call   1030 <drawpolygon@plt>
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x5,%edx
mov    $0x4,%ecx
call   1030 <drawpolygon@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x6,%edx
mov    $0x5,%ecx
call   1030 <drawpolygon@plt>
mov    $0x4,%edi
mov    $0x5,%esi
mov    $0x6,%edx
mov    $0x7,%ecx
call   1030 <drawpolygon@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<colorcube>:
push   %rax
xor    %edi,%edi
mov    $0x3,%esi
mov    $0x2,%edx
mov    $0x1,%ecx
call   1030 <drawpolygon@plt>
mov    $0x2,%edi
mov    $0x3,%esi
mov    $0x7,%edx
mov    $0x6,%ecx
call   1030 <drawpolygon@plt>
xor    %edi,%edi
mov    $0x4,%esi
mov    $0x7,%edx
mov    $0x3,%ecx
call   1030 <drawpolygon@plt>
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x5,%edx
mov    $0x4,%ecx
call   1030 <drawpolygon@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x6,%edx
mov    $0x5,%ecx
call   1030 <drawpolygon@plt>
mov    $0x4,%edi
mov    $0x5,%esi
mov    $0x6,%edx
mov    $0x7,%ecx
pop    %rax
jmp    1030 <drawpolygon@plt>

LLVM IR (-O0):
define void @colorcube() {
%1 = call i32 @drawpolygon(i32 0, i32 3, i32 2, i32 1)
%2 = call i32 @drawpolygon(i32 2, i32 3, i32 7, i32 6)
%3 = call i32 @drawpolygon(i32 0, i32 4, i32 7, i32 3)
%4 = call i32 @drawpolygon(i32 0, i32 1, i32 5, i32 4)
%5 = call i32 @drawpolygon(i32 1, i32 2, i32 6, i32 5)
%6 = call i32 @drawpolygon(i32 4, i32 5, i32 6, i32 7)
ret void
}

LLVM IR (-O2):
define void @colorcube() {
%1 = tail call i32 @drawpolygon(i32 0, i32 3, i32 2, i32 1)
%2 = tail call i32 @drawpolygon(i32 2, i32 3, i32 7, i32 6)
%3 = tail call i32 @drawpolygon(i32 0, i32 4, i32 7, i32 3)
%4 = tail call i32 @drawpolygon(i32 0, i32 1, i32 5, i32 4)
%5 = tail call i32 @drawpolygon(i32 1, i32 2, i32 6, i32 5)
%6 = tail call i32 @drawpolygon(i32 4, i32 5, i32 6, i32 7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setplane_x(int);
int /*<<< orphan*/ setplane_y(int);
int /*<<< orphan*/ setplane_z(int);
void setplane(char axis, int i) {
  switch (axis) {
  case 1:
    setplane_x(i);
    break;
  case 2:
    setplane_y(i);
    break;
  case 3:
    setplane_z(i);
    break;
  }
}


x86 assembly (clang, -O0):
<setplane>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     1178 <setplane+0x48>
jmp    1156 <setplane+0x26>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     1185 <setplane+0x55>
jmp    1167 <setplane+0x37>
mov    -0xc(%rbp),%eax
sub    $0x3,%eax
je     1192 <setplane+0x62>
jmp    119a <setplane+0x6a>
mov    -0x8(%rbp),%edi
call   1050 <setplane_x@plt>
jmp    119a <setplane+0x6a>
mov    -0x8(%rbp),%edi
call   1030 <setplane_y@plt>
jmp    119a <setplane+0x6a>
mov    -0x8(%rbp),%edi
call   1040 <setplane_z@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setplane>:
cmp    $0x3,%edi
je     1146 <setplane+0x16>
cmp    $0x2,%edi
je     114d <setplane+0x1d>
cmp    $0x1,%edi
jne    1154 <setplane+0x24>
mov    %esi,%edi
jmp    1050 <setplane_x@plt>
mov    %esi,%edi
jmp    1040 <setplane_z@plt>
mov    %esi,%edi
jmp    1030 <setplane_y@plt>
ret

LLVM IR (-O0):
define void @setplane(i8 signext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
switch i32 %6, label %16 [
i32 1, label %7
i32 2, label %10
i32 3, label %13
]
7: ; preds = %2
%8 = load i32, i32* %4
%9 = call i32 @setplane_x(i32 %8)
br label %16
10: ; preds = %2
%11 = load i32, i32* %4
%12 = call i32 @setplane_y(i32 %11)
br label %16
13: ; preds = %2
%14 = load i32, i32* %4
%15 = call i32 @setplane_z(i32 %14)
br label %16
16: ; preds = %2, %13, %10, %7
ret void
}

LLVM IR (-O2):
define void @setplane(i8 signext %0, i32 %1) {
%3 = sext i8 %0 to i32
switch i32 %3, label %10 [
i32 1, label %4
i32 2, label %6
i32 3, label %8
]
4: ; preds = %2
%5 = tail call i32 @setplane_x(i32 %1)
br label %10
6: ; preds = %2
%7 = tail call i32 @setplane_y(i32 %1)
br label %10
8: ; preds = %2
%9 = tail call i32 @setplane_z(i32 %1)
br label %10
10: ; preds = %2, %8, %6, %4
ret void
}
/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
int read(int, char *, int);
int cuftpd_recv_msg(int fd, char buf[], int len) {
  int n;
  while (1) {
    n = read(fd, buf, len);
    if (n < 0) {
      if (errno == EINTR)
        continue;
      return n;
    }
    return n;
  }
}


x86 assembly (clang, -O0):
<cuftpd_recv_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <read@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    1168 <cuftpd_recv_msg+0x58>
mov    0x2e9b(%rip),%rax
mov    (%rax),%rax
mov    0x2e89(%rip),%rcx
cmp    (%rcx),%rax
jne    115d <cuftpd_recv_msg+0x4d>
jmp    1122 <cuftpd_recv_msg+0x12>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116e <cuftpd_recv_msg+0x5e>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cuftpd_recv_msg>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eb9(%rip),%r15
mov    0x2eaa(%rip),%r12
xchg   %ax,%ax
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1030 <read@plt>
test   %eax,%eax
jns    114a <cuftpd_recv_msg+0x3a>
mov    (%r15),%rcx
cmp    (%r12),%rcx
je     1130 <cuftpd_recv_msg+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i64 0
@EINTR = global i64 0
define i32 @cuftpd_recv_msg(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
br label %9
9: ; preds = %3, %20
%10 = load i32, i32* %5
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = call i32 @read(i32 %10, i8* %11, i32 %12)
store i32 %13, i32* %8
%14 = load i32, i32* %8
%15 = icmp slt i32 %14, 0
br i1 %15, label %16, label %23
16: ; preds = %9
%17 = load i64, i64* @errno
%18 = load i64, i64* @EINTR
%19 = icmp eq i64 %17, %18
br i1 %19, label %20, label %21
20: ; preds = %16
br label %9
21: ; preds = %16
%22 = load i32, i32* %8
store i32 %22, i32* %4
br label %25
23: ; preds = %9
%24 = load i32, i32* %8
store i32 %24, i32* %4
br label %25
25: ; preds = %23, %21
%26 = load i32, i32* %4
ret i32 %26
}

LLVM IR (-O2):
@errno = global i64 0
@EINTR = global i64 0
define i32 @cuftpd_recv_msg(i32 %0, i8* nocapture %1, i32 %2) {
br label %4
4: ; preds = %7, %3
%5 = tail call i32 @read(i32 %0, i8* %1, i32 %2)
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = load i64, i64* @errno
%9 = load i64, i64* @EINTR
%10 = icmp eq i64 %8, %9
br i1 %10, label %4, label %11
11: ; preds = %4, %7
ret i32 %5
}
int retrieve_bit(char *msg, int msg_len, int id) {
  int offset, byte_offset, bit_offset, bit;
  if (id == 0)
    return 0;
  offset = (id - 1) % (msg_len * 8);
  byte_offset = offset >> 3;
  bit_offset = offset & 0x7;
  bit = (msg[byte_offset] >> bit_offset) & 0x1;

  ;
  return bit;
}


x86 assembly (clang, -O0):
<retrieve_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jne    1124 <retrieve_bit+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1165 <retrieve_bit+0x65>
mov    -0x18(%rbp),%eax
sub    $0x1,%eax
mov    -0x14(%rbp),%ecx
shl    $0x3,%ecx
cltd
idiv   %ecx
mov    %edx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
sar    $0x3,%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
and    $0x7,%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x24(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<retrieve_bit>:
test   %edx,%edx
je     1125 <retrieve_bit+0x25>
add    $0xffffffff,%edx
shl    $0x3,%esi
mov    %edx,%eax
cltd
idiv   %esi
mov    %edx,%ecx
mov    %edx,%eax
sar    $0x3,%eax
cltq
movsbl (%rdi,%rax,1),%eax
and    $0x7,%cl
shr    %cl,%eax
and    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @retrieve_bit(i8* nocapture %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %17, label %5
5: ; preds = %3
%6 = add nsw i32 %2, -1
%7 = shl nsw i32 %1, 3
%8 = srem i32 %6, %7
%9 = ashr i32 %8, 3
%10 = and i32 %8, 7
%11 = sext i32 %9 to i64
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = lshr i32 %14, %10
%16 = and i32 %15, 1
br label %17
17: ; preds = %3, %5
%18 = phi i32 [ %16, %5 ], [ 0, %3 ]
ret i32 %18
}
IR0RX1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{ (*p0) = (p1[x1]); }


x86 assembly (clang, -O0):
<IR0RX1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IR0RX1>:
movslq %ecx,%rax
mov    (%r9,%rax,4),%eax
mov    %eax,(%r8)
ret

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

LLVM IR (-O2):
define i32 @IR0RX1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture writeonly %4, i32* nocapture %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %4
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char, char, char);
int main() {
  char a, b, c, d;
  a = '*';
  b = 'B';
  c = 'C';
  d = 'D';
  printf("A = %c\nB = %c\nC = %c\nD = %c\n", a, b, c, d);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x2a,-0x5(%rbp)
movb   $0x42,-0x6(%rbp)
movb   $0x43,-0x7(%rbp)
movb   $0x44,-0x8(%rbp)
mov    -0x5(%rbp),%dl
mov    -0x6(%rbp),%cl
mov    -0x7(%rbp),%al
lea    0xec1(%rip),%rdi
movsbl %dl,%esi
movsbl %cl,%edx
movsbl %al,%ecx
movsbl -0x8(%rbp),%r8d
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x2a,%esi
mov    $0x42,%edx
mov    $0x43,%ecx
mov    $0x44,%r8d
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"A = %c\0AB = %c\0AC = %c\0AD = %c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
store i32 0, i32* %1
store i8 42, i8* %2
store i8 66, i8* %3
store i8 67, i8* %4
store i8 68, i8* %5
%6 = load i8, i8* %2
%7 = load i8, i8* %3
%8 = load i8, i8* %4
%9 = load i8, i8* %5
%10 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8 signext %6, i8 signext %7, i8 signext %8, i8 signext %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"A = %c\0AB = %c\0AC = %c\0AD = %c\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8 signext 42, i8 signext 66, i8 signext 67, i8 signext 68)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("[BEGIN] dlopen-in-init\n");
  printf("[PASS]  dlopen-in-init\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"[BEGIN] dlopen-in-init\0A\00"
@.str.1 = [24 x i8] c"[PASS] dlopen-in-init\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [23 x i8] c"[BEGIN] dlopen-in-init\00"
@str.2 = [23 x i8] c"[PASS] dlopen-in-init\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ putc(int, int /*<<< orphan*/ *);
void putc_t() {
  FILE *fp;
  int ch;
  fp = fopen("file.txt", "w");
  for (ch = 33; ch <= 100; ch++) {
    putc(ch, fp);
  }
  fclose(fp);
}


x86 assembly (clang, -O0):
<putc_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xec3(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x8(%rbp)
movl   $0x21,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jg     117a <putc_t+0x4a>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1040 <putc@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1156 <putc_t+0x26>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putc_t>:
push   %rbp
push   %rbx
push   %rax
lea    0xec6(%rip),%rdi
lea    0xec8(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    $0x21,%ebp
xchg   %ax,%ax
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <putc@plt>
add    $0x1,%ebp
cmp    $0x65,%ebp
jne    1150 <putc_t+0x20>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"file.txt\00"
@.str.1 = [2 x i8] c"w\00"
define void @putc_t() {
%1 = alloca i32*
%2 = alloca i32
%3 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %1
store i32 33, i32* %2
br label %4
4: ; preds = %11, %0
%5 = load i32, i32* %2
%6 = icmp sle i32 %5, 100
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load i32, i32* %2
%9 = load i32*, i32** %1
%10 = call i32 @putc(i32 %8, i32* %9)
br label %11
11: ; preds = %7
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %4
14: ; preds = %4
%15 = load i32*, i32** %1
%16 = call i32 @fclose(i32* %15)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"file.txt\00"
@.str.1 = [2 x i8] c"w\00"
define void @putc_t() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
%3 = phi i32 [ 33, %0 ], [ %5, %2 ]
%4 = tail call i32 @putc(i32 %3, i32* %1)
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 101
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = tail call i32 @fclose(i32* %1)
ret void
}
void audiohw_postinit() {}


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

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

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

LLVM IR (-O2):
define void @audiohw_postinit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int x, y;
  if (&x + 1 == &y)
    printf("x and y are allocated adjacently\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rax
add    $0x4,%rax
lea    -0xc(%rbp),%rcx
cmp    %rcx,%rax
jne    1140 <main+0x30>
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [34 x i8] c"x and y are allocated adjacently\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = getelementptr inbounds i32, i32* %2, i64 1
%5 = icmp eq i32* %4, %3
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void create_file() {}


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

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

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

LLVM IR (-O2):
define void @create_file() {
ret void
}
/* Variables and functions */
int edit(char *, char *, int, int);
int /*<<< orphan*/ printf(char *, int);
int strlen(char *);
void main() {
  char str1[] = "hihello";
  char str2[] = "iohello";
  int len1 = strlen(str1);
  int len2 = strlen(str2);
  printf("Edit distance in two strings is %d", edit(str1, str2, len1, len2));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0xebe(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
lea    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x18(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1030 <edit@plt>
mov    %eax,%esi
lea    0xe8e(%rip),%rdi
call   1050 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
movabs $0x6f6c6c65686968,%rax
mov    %rax,0x8(%rsp)
or     $0x601,%rax
mov    %rax,(%rsp)
lea    0x8(%rsp),%r14
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %eax,%ebp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
mov    %eax,%ecx
call   1030 <edit@plt>
lea    0xe7f(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.str1 = [8 x i8] c"hihello\00"
@__const.main.str2 = [8 x i8] c"iohello\00"
@.str = [35 x i8] c"Edit distance in two strings is %d\00"
define void @main() {
%1 = alloca [8 x i8]
%2 = alloca [8 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = bitcast [8 x i8]* %1 to i8*
%6 = bitcast [8 x i8]* %2 to i8*
%7 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%8 = call i32 @strlen(i8* %7)
store i32 %8, i32* %3
%9 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%10 = call i32 @strlen(i8* %9)
store i32 %10, i32* %4
%11 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%12 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = call i32 @edit(i8* %11, i8* %12, i32 %13, i32 %14)
%16 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %15)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"Edit distance in two strings is %d\00"
define void @main() {
%1 = alloca i64
%2 = alloca i64
%3 = bitcast i64* %1 to i8*
store i64 31362935228492136, i64* %1
%4 = bitcast i64* %2 to i8*
store i64 31362935228493673, i64* %2
%5 = call i32 @strlen(i8* %3)
%6 = call i32 @strlen(i8* %4)
%7 = call i32 @edit(i8* %3, i8* %4, i32 %5, i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ iterms();
int /*<<< orphan*/ unary();
void hterm() {
  unary();
  iterms();
}


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

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

LLVM IR (-O0):
define void @hterm() {
%1 = call i32 (...) @unary()
%2 = call i32 (...) @iterms()
ret void
}

LLVM IR (-O2):
define void @hterm() {
%1 = tail call i32 (...) @unary()
%2 = tail call i32 (...) @iterms()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int const);
void DS_Sleep(const int millisecs) { usleep(millisecs * 1000); }


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

x86 assembly (clang, -O2):
<DS_Sleep>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @DS_Sleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000
%5 = call i32 @usleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @DS_Sleep(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
/* Variables and functions */
size_t hdr_base64_decoded_len(size_t encoded_size) {
  return (encoded_size / 4) * 3;
}


x86 assembly (clang, -O0):
<hdr_base64_decoded_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x2,%rax
imul   $0x3,%rax,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hdr_base64_decoded_len>:
shr    $0x2,%rdi
lea    (%rdi,%rdi,2),%rax
ret

LLVM IR (-O0):
define i64 @hdr_base64_decoded_len(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = udiv i64 %3, 4
%5 = mul i64 %4, 3
ret i64 %5
}

LLVM IR (-O2):
define i64 @hdr_base64_decoded_len(i64 %0) {
%2 = lshr i64 %0, 2
%3 = mul nuw i64 %2, 3
ret i64 %3
}
signed int MAKE_INT_8(unsigned int value) {
  return (value & 0x80) ? value | ~0xff : value & 0xff;
}


x86 assembly (clang, -O0):
<MAKE_INT_8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1128 <MAKE_INT_8+0x28>
mov    -0x4(%rbp),%eax
or     $0xffffff00,%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <MAKE_INT_8+0x33>
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MAKE_INT_8>:
movsbl %dil,%eax
movzbl %al,%ecx
and    $0xffffff00,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @MAKE_INT_8(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 128
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = or i32 %7, -256
br label %12
9: ; preds = %1
%10 = load i32, i32* %2
%11 = and i32 %10, 255
br label %12
12: ; preds = %9, %6
%13 = phi i32 [ %8, %6 ], [ %11, %9 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @MAKE_INT_8(i32 %0) {
%2 = and i32 %0, 128
%3 = icmp eq i32 %2, 0
%4 = and i32 %0, 255
%5 = select i1 %3, i32 0, i32 -256
%6 = or i32 %5, %4
ret i32 %6
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int celcon_get_point_in_cell(int n, int i, int j, int k, double *point) {
  int b[2], fail;
  b[0] = j;
  b[1] = k;
  fail = _ada_use_c2phc4c(89, &i, b, point, 0);
  return fail;
}


x86 assembly (clang, -O0):
<celcon_get_point_in_cell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
lea    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x59,%edi
lea    -0x8(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<celcon_get_point_in_cell>:
sub    $0x18,%rsp
mov    %esi,0xc(%rsp)
mov    %edx,0x10(%rsp)
mov    %ecx,0x14(%rsp)
lea    0xc(%rsp),%rsi
lea    0x10(%rsp),%rdx
mov    $0x59,%edi
mov    %r8,%rcx
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @celcon_get_point_in_cell(i32 %0, i32 %1, i32 %2, i32 %3, double* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca double*
%11 = alloca [2 x i32]
%12 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store double* %4, double** %10
%13 = load i32, i32* %8
%14 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 0
store i32 %13, i32* %14
%15 = load i32, i32* %9
%16 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 1
store i32 %15, i32* %16
%17 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 0
%18 = load double*, double** %10
%19 = call i32 @_ada_use_c2phc4c(i32 89, i32* %7, i32* %17, double* %18, i32 0)
store i32 %19, i32* %12
%20 = load i32, i32* %12
ret i32 %20
}

LLVM IR (-O2):
define i32 @celcon_get_point_in_cell(i32 %0, i32 %1, i32 %2, i32 %3, double* %4) {
%6 = alloca i32
%7 = alloca [2 x i32]
store i32 %1, i32* %6
%8 = bitcast [2 x i32]* %7 to i8*
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
store i32 %2, i32* %9
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
store i32 %3, i32* %10
%11 = call i32 @_ada_use_c2phc4c(i32 89, i32* %6, i32* %9, double* %4, i32 0)
ret i32 %11
}
/* Type definitions */
struct DynArr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pushDynArr(struct DynArr *, double);
void etonum(struct DynArr *stack) { pushDynArr(stack, 2.7182818); }


x86 assembly (clang, -O0):
<etonum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
movsd  0xed8(%rip),%xmm0
call   1030 <pushDynArr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<etonum>:
movsd  0xee8(%rip),%xmm0
jmp    1030 <pushDynArr@plt>

LLVM IR (-O0):
%struct.DynArr = type { i32 }
define void @etonum(%struct.DynArr* %0) {
%2 = alloca %struct.DynArr*
store %struct.DynArr* %0, %struct.DynArr** %2
%3 = load %struct.DynArr*, %struct.DynArr** %2
%4 = call i32 @pushDynArr(%struct.DynArr* %3, double 0x4005BF0A87427F01)
ret void
}

LLVM IR (-O2):
%struct.DynArr = type { i32 }
define void @etonum(%struct.DynArr* %0) {
%2 = tail call i32 @pushDynArr(%struct.DynArr* %0, double 0x4005BF0A87427F01)
ret void
}
void neg_s(const float *source, float *target) { *target = -(*source); }


x86 assembly (clang, -O0):
<neg_s>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<neg_s>:
movss  (%rdi),%xmm0
xorps  0xef5(%rip),%xmm0
movss  %xmm0,(%rsi)
ret

LLVM IR (-O0):
define void @neg_s(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = load float, float* %5
%7 = fneg float %6
%8 = load float*, float** %4
store float %7, float* %8
ret void
}

LLVM IR (-O2):
define void @neg_s(float* nocapture %0, float* nocapture writeonly %1) {
%3 = load float, float* %0
%4 = fneg float %3
store float %4, float* %1
ret void
}