xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "usage:type $%s -h for help\n", "sws");
  exit(EXIT_FAILURE);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"usage:type $%s -h for help\0A\00"
@.str.1 = [4 x i8] c"sws\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"usage:type $%s -h for help\0A\00"
@.str.1 = [4 x i8] c"sws\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
char *fgfsread(int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *);
void fgfsflush(int sock) {
  const char *p;
  while ((p = fgfsread(sock, 0)) != NULL) {
    printf("IGNORE: \t<%s>\n", p);
  }
}


x86 assembly (clang, -O0):
<fgfsflush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1030 <fgfsread@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1158 <fgfsflush+0x38>
mov    -0x10(%rbp),%rsi
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
jmp    112b <fgfsflush+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgfsflush>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %esi,%esi
call   1030 <fgfsread@plt>
test   %rax,%rax
je     1159 <fgfsflush+0x39>
lea    0xec7(%rip),%r14
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %ebx,%edi
xor    %esi,%esi
call   1030 <fgfsread@plt>
test   %rax,%rax
jne    1140 <fgfsflush+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [15 x i8] c"IGNORE: \09<%s>\0A\00"
define void @fgfsflush(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
br label %4
4: ; preds = %8, %1
%5 = load i32, i32* %2
%6 = call i8* @fgfsread(i32 %5, i32 0)
store i8* %6, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = load i8*, i8** %3
%10 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %4
11: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"IGNORE: \09<%s>\0A\00"
define void @fgfsflush(i32 %0) {
%2 = tail call i8* @fgfsread(i32 %0, i32 0)
%3 = icmp eq i8* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %7, %4 ], [ %2, %1 ]
%6 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = tail call i8* @fgfsread(i32 %0, i32 0)
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %4
9: ; preds = %4, %1
ret void
}
int isinf(double x) { return __builtin_isinf_sign(x); }


x86 assembly (clang, -O0):
<isinf>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movaps %xmm1,%xmm0
movaps 0xef8(%rip),%xmm2
pand   %xmm2,%xmm0
movq   %xmm1,%rdx
mov    $0x1,%ecx
mov    $0xffffffff,%eax
cmp    $0x0,%rdx
cmovl  %eax,%ecx
movsd  0xec6(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
setnp  %sil
sete   %dl
test   %sil,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isinf>:
movq   %xmm0,%rax
pand   0xef3(%rip),%xmm0
xor    %ecx,%ecx
test   %rax,%rax
setns  %cl
xor    %edx,%edx
ucomisd 0xef1(%rip),%xmm0
lea    -0x1(%rcx,%rcx,1),%eax
cmovb  %edx,%eax
ret

LLVM IR (-O0):
define i32 @isinf(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.fabs.f64(double %3)
%5 = fcmp oeq double %4, 0x7FF0000000000000
%6 = bitcast double %3 to i64
%7 = icmp slt i64 %6, 0
%8 = select i1 %7, i32 -1, i32 1
%9 = select i1 %5, i32 %8, i32 0
ret i32 %9
}

LLVM IR (-O2):
define i32 @isinf(double %0) {
%2 = tail call double @llvm.fabs.f64(double %0)
%3 = fcmp oeq double %2, 0x7FF0000000000000
%4 = bitcast double %0 to i64
%5 = icmp slt i64 %4, 0
%6 = select i1 %5, i32 -1, i32 1
%7 = select i1 %3, i32 %6, i32 0
ret i32 %7
}
/* Variables and functions */
scalar_t__ match_suffix(char *, char *);
int packbin(int, char **);
int unpackbin(int, char **);
int main(int argc, char *argv[]) {
  if (match_suffix(argv[0], "unpackbin") == 0)
    return unpackbin(argc, argv);
  return packbin(argc, argv);
}


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    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xeac(%rip),%rsi
call   1050 <match_suffix@plt>
cmp    $0x0,%rax
jne    1177 <main+0x47>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <unpackbin@plt>
mov    %eax,-0x4(%rbp)
jmp    1186 <main+0x56>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <packbin@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    (%rsi),%rdi
lea    0xebe(%rip),%rsi
call   1050 <match_suffix@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
test   %rax,%rax
je     115c <main+0x2c>
pop    %rbx
pop    %rbp
jmp    1030 <packbin@plt>
pop    %rbx
pop    %rbp
jmp    1040 <unpackbin@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"unpackbin\00"
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 i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = call i64 @match_suffix(i8* %8, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i32, i32* %4
%13 = load i8**, i8*** %5
%14 = call i32 @unpackbin(i32 %12, i8** %13)
store i32 %14, i32* %3
br label %19
15: ; preds = %2
%16 = load i32, i32* %4
%17 = load i8**, i8*** %5
%18 = call i32 @packbin(i32 %16, i8** %17)
store i32 %18, i32* %3
br label %19
19: ; preds = %15, %11
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@.str = [10 x i8] c"unpackbin\00"
define i32 @main(i32 %0, i8** %1) {
%3 = load i8*, i8** %1
%4 = tail call i64 @match_suffix(i8* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @unpackbin(i32 %0, i8** %1)
br label %10
8: ; preds = %2
%9 = tail call i32 @packbin(i32 %0, i8** %1)
br label %10
10: ; preds = %8, %6
%11 = phi i32 [ %7, %6 ], [ %9, %8 ]
ret i32 %11
}
int _0(int w) { return (3 * (w + 1) - ((w + 1) * 3 % 4) - 3 * w); }


x86 assembly (clang, -O0):
<_0>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
imul   $0x3,%eax,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
imul   $0x3,%eax,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%eax
sub    %edx,%eax
imul   $0x3,-0x4(%rbp),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_0>:
lea    (%rdi,%rdi,2),%ecx
lea    (%rdi,%rdi,2),%edx
add    $0x3,%edx
lea    (%rdi,%rdi,2),%eax
add    $0x6,%eax
test   %edx,%edx
cmovns %edx,%eax
and    $0xfffffffc,%eax
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @_0(i32 %0) {
%2 = mul i32 %0, 3
%3 = add i32 %2, 3
%4 = srem i32 %3, 4
%5 = mul i32 %0, -3
%6 = add i32 %3, %5
%7 = sub i32 %6, %4
ret i32 %7
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char **);
int /*<<< orphan*/ sortedPermutations(char *);
int main(int argc, char **argv) {
  char str[32] = "";
  printf("Enter Text : ");
  scanf("%s", &str);
  sortedPermutations(str);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1040 <memset@plt>
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rsi
lea    0xe91(%rip),%rdi
call   1060 <scanf@plt>
lea    -0x30(%rbp),%rdi
call   1050 <sortedPermutations@plt>
mov    0x2e4e(%rip),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
lea    0xeba(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1040 <sortedPermutations@plt>
mov    0x2e72(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Enter Text : \00"
@.str.1 = [3 x i8] c"%s\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [32 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [32 x i8]* %6 to i8*
%8 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%9 = bitcast [32 x i8]* %6 to i8**
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %9)
%11 = getelementptr inbounds [32 x i8], [32 x i8]* %6, i64 0, i64 0
%12 = call i32 @sortedPermutations(i8* %11)
%13 = load i32, i32* @EXIT_SUCCESS
ret i32 %13
}

LLVM IR (-O2):
@.str = [14 x i8] c"Enter Text : \00"
@.str.1 = [3 x i8] c"%s\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [32 x i8]
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%6 = bitcast [32 x i8]* %3 to i8**
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %6)
%8 = call i32 @sortedPermutations(i8* %4)
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}
void while_and_or(int p) {
  int i = 0;
  while (p == 1 || (i < 30 && i >= 0)) {
    i++;
  }
}


x86 assembly (clang, -O0):
<while_and_or>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x1,%al
cmpl   $0x1,-0x4(%rbp)
mov    %al,-0x9(%rbp)
je     113c <while_and_or+0x3c>
xor    %eax,%eax
cmpl   $0x1e,-0x8(%rbp)
mov    %al,-0xa(%rbp)
jge    1136 <while_and_or+0x36>
cmpl   $0x0,-0x8(%rbp)
setge  %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    114c <while_and_or+0x4c>
jmp    115a <while_and_or+0x5a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <while_and_or+0xe>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @while_and_or(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mcfi_sandbox_mask(int *);
int socketcall(int (*)(int, int, int, int *), int, int, int, int /*<<< orphan*/,
               int /*<<< orphan*/, int /*<<< orphan*/);
int socketpair(int domain, int type, int protocol, int fd[2]) {
  return socketcall(socketpair, domain, type, protocol, mcfi_sandbox_mask(fd),
                    0, 0);
}


x86 assembly (clang, -O0):
<socketpair>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <mcfi_sandbox_mask@plt>
mov    -0x24(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    -0x1c(%rbp),%ecx
mov    %eax,%r8d
mov    0x2e85(%rip),%rdi
xor    %r9d,%r9d
movl   $0x0,(%rsp)
call   1030 <socketcall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socketpair>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
mov    %rcx,%rdi
call   1040 <mcfi_sandbox_mask@plt>
movl   $0x0,(%rsp)
mov    0x2ea3(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %r14d,%ecx
mov    %eax,%r8d
xor    %r9d,%r9d
call   1030 <socketcall@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @socketpair(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
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32*, i32** %8
%13 = call i32 @mcfi_sandbox_mask(i32* %12)
%14 = call i32 @socketcall(i32 (i32, i32, i32, i32*)* @socketpair, i32 %9, i32 %10, i32 %11, i32 %13, i32 0, i32 0)
ret i32 %14
}

LLVM IR (-O2):
define i32 @socketpair(i32 %0, i32 %1, i32 %2, i32* %3) {
%5 = tail call i32 @mcfi_sandbox_mask(i32* %3)
%6 = tail call i32 @socketcall(i32 (i32, i32, i32, i32*)* @socketpair, i32 %0, i32 %1, i32 %2, i32 %5, i32 0, i32 0)
ret i32 %6
}
__int128_t foo(__int128_t *src) { return ~*src; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    (%rcx),%rax
mov    0x8(%rcx),%rcx
not    %rax
not    %rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    (%rdi),%rax
mov    0x8(%rdi),%rdx
not    %rax
not    %rdx
ret

LLVM IR (-O0):
define { i64, i64 } @foo(i128* %0) {
%2 = alloca i128
%3 = alloca i128*
store i128* %0, i128** %3
%4 = load i128*, i128** %3
%5 = load i128, i128* %4
%6 = xor i128 %5, -1
store i128 %6, i128* %2
%7 = bitcast i128* %2 to { i64, i64 }*
%8 = load { i64, i64 }, { i64, i64 }* %7
ret { i64, i64 } %8
}

LLVM IR (-O2):
define { i64, i64 } @foo(i128* nocapture %0) {
%2 = load i128, i128* %0
%3 = xor i128 %2, -1
%4 = trunc i128 %3 to i64
%5 = lshr i128 %3, 64
%6 = trunc i128 %5 to i64
%7 = insertvalue { i64, i64 } poison, i64 %4, 0
%8 = insertvalue { i64, i64 } %7, i64 %6, 1
ret { i64, i64 } %8
}
/* Variables and functions */
int /*<<< orphan*/ creat(char *, int);
int main(int argc, char **argv) {
  creat("/tmp/moo", 0666);
  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)
lea    0xed3(%rip),%rdi
mov    $0x1b6,%esi
call   1030 <creat@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"/tmp/moo\00"
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 @creat(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 438)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"/tmp/moo\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @creat(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 438)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ crc32_update(int /*<<< orphan*/, char const *, int);
uint32_t crc32_checksum(const char *buf, int len) {
  return crc32_update(0, buf, len);
}


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

x86 assembly (clang, -O2):
<crc32_checksum>:
mov    %esi,%edx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <crc32_update@plt>

LLVM IR (-O0):
define i32 @crc32_checksum(i8* %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 = load i32, i32* %4
%7 = call i32 @crc32_update(i32 0, i8* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @crc32_checksum(i8* %0, i32 %1) {
%3 = tail call i32 @crc32_update(i32 0, i8* %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int genrand_uint32();
uint32_t genrand_uint32_range(uint32_t a, uint32_t b) {
  return (genrand_uint32() % (b - a)) + a;
}


x86 assembly (clang, -O0):
<genrand_uint32_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <genrand_uint32@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genrand_uint32_range>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <genrand_uint32@plt>
sub    %ebp,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @genrand_uint32_range(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @genrand_uint32()
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = srem i32 %5, %8
%10 = load i32, i32* %3
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @genrand_uint32_range(i32 %0, i32 %1) {
%3 = tail call i32 (...) @genrand_uint32()
%4 = sub nsw i32 %1, %0
%5 = srem i32 %3, %4
%6 = add nsw i32 %5, %0
ret i32 %6
}
float vmir_vm_arg_flt(const void **rfp) {
  const void *rf = *rfp = *rfp - 4;
  return *(float *)rf;
}


x86 assembly (clang, -O0):
<vmir_vm_arg_flt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    $0xfffffffffffffffc,%rax
mov    -0x8(%rbp),%rcx
mov    %rax,(%rcx)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<vmir_vm_arg_flt>:
mov    (%rdi),%rax
lea    -0x4(%rax),%rcx
mov    %rcx,(%rdi)
movss  -0x4(%rax),%xmm0
ret

LLVM IR (-O0):
define float @vmir_vm_arg_flt(i8** %0) {
%2 = alloca i8**
%3 = alloca i8*
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = getelementptr i8, i8* %5, i64 -4
%7 = load i8**, i8*** %2
store i8* %6, i8** %7
store i8* %6, i8** %3
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to float*
%10 = load float, float* %9
ret float %10
}

LLVM IR (-O2):
define float @vmir_vm_arg_flt(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = getelementptr i8, i8* %2, i64 -4
store i8* %3, i8** %0
%4 = bitcast i8* %3 to float*
%5 = load float, float* %4
ret float %5
}
int label_not_needed(int level) {
  static int label_level = 0;
  if (level >= 0) {
    label_level = level;
  }
  return (label_level);
}


x86 assembly (clang, -O0):
<label_not_needed>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     111a <label_not_needed+0x1a>
mov    -0x4(%rbp),%eax
mov    %eax,0x2f0a(%rip)
mov    0x2f04(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<label_not_needed>:
test   %edi,%edi
js     110d <label_not_needed+0xd>
mov    %edi,%eax
mov    %edi,0x2f18(%rip)
ret
mov    0x2f11(%rip),%eax
ret

LLVM IR (-O0):
@label_not_needed.label_level = internal global i32 0
define i32 @label_not_needed(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i32, i32* %2
store i32 %6, i32* @label_not_needed.label_level
br label %7
7: ; preds = %5, %1
%8 = load i32, i32* @label_not_needed.label_level
ret i32 %8
}

LLVM IR (-O2):
@label_not_needed.label_level = internal unnamed_addr global i32 0
define i32 @label_not_needed(i32 %0) {
%2 = icmp sgt i32 %0, -1
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = load i32, i32* @label_not_needed.label_level
br label %6
5: ; preds = %1
store i32 %0, i32* @label_not_needed.label_level
br label %6
6: ; preds = %3, %5
%7 = phi i32 [ %4, %3 ], [ %0, %5 ]
ret i32 %7
}
/* Type definitions */
typedef size_t uint8_t;

/* Variables and functions */
char *mpw_charactersInClass(char);
size_t strlen(char const *);
const char mpw_characterFromClass(char characterClass, uint8_t seedByte) {
  const char *classCharacters = mpw_charactersInClass(characterClass);
  return classCharacters[seedByte % strlen(classCharacters)];
}


x86 assembly (clang, -O0):
<mpw_characterFromClass>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <mpw_charactersInClass@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
xor    %edx,%edx
div    %rcx
mov    -0x20(%rbp),%rax
movsbl (%rax,%rdx,1),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpw_characterFromClass>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1040 <mpw_charactersInClass@plt>
mov    %rax,%r14
mov    %rax,%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
or     %rbx,%rax
shr    $0x20,%rax
je     114d <mpw_characterFromClass+0x2d>
mov    %rbx,%rax
xor    %edx,%edx
div    %rcx
jmp    1153 <mpw_characterFromClass+0x33>
mov    %ebx,%eax
xor    %edx,%edx
div    %ecx
mov    (%r14,%rdx,1),%al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define signext i8 @mpw_characterFromClass(i8 signext %0, i64 %1) {
%3 = alloca i8
%4 = alloca i64
%5 = alloca i8*
store i8 %0, i8* %3
store i64 %1, i64* %4
%6 = load i8, i8* %3
%7 = call i8* @mpw_charactersInClass(i8 signext %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = load i64, i64* %4
%10 = load i8*, i8** %5
%11 = call i64 @strlen(i8* %10)
%12 = urem i64 %9, %11
%13 = getelementptr inbounds i8, i8* %8, i64 %12
%14 = load i8, i8* %13
ret i8 %14
}

LLVM IR (-O2):
define signext i8 @mpw_characterFromClass(i8 signext %0, i64 %1) {
%3 = tail call i8* @mpw_charactersInClass(i8 signext %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %3)
%5 = urem i64 %1, %4
%6 = getelementptr inbounds i8, i8* %3, i64 %5
%7 = load i8, i8* %6
ret i8 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void cmd_usage_edit(void) { printf("usage: mdp edit [-h] [-k key_id]\n"); }


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"usage: mdp edit [-h] [-k key_id]\0A\00"
define void @cmd_usage_edit() {
%1 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [33 x i8] c"usage: mdp edit [-h] [-k key_id]\00"
define void @cmd_usage_edit() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret void
}
void platform_startup() {}


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

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

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

LLVM IR (-O2):
define void @platform_startup() {
ret void
}
int __attribute__((no)) baz(int c) { return c != '@'; }


x86 assembly (clang, -O0):
<baz>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x40,-0x4(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<baz>:
xor    %eax,%eax
cmp    $0x40,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @baz(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 64
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @baz(i32 %0) {
%2 = icmp ne i32 %0, 64
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello from prog3.c\n");
  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)
lea    0xed3(%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>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Hello from prog3.c\0A\00"
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 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [19 x i8] c"Hello from prog3.c\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ResolveGroupElementExt(int, int /*<<< orphan*/);
void ResolveGroupElement(int group_element) {
  ResolveGroupElementExt(group_element, 0);
}


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

x86 assembly (clang, -O2):
<ResolveGroupElement>:
xor    %esi,%esi
jmp    1030 <ResolveGroupElementExt@plt>

LLVM IR (-O0):
define void @ResolveGroupElement(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ResolveGroupElementExt(i32 %3, i32 0)
ret void
}

LLVM IR (-O2):
define void @ResolveGroupElement(i32 %0) {
%2 = tail call i32 @ResolveGroupElementExt(i32 %0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isspace(int);
char *rev_strnpc(const char *stop, const char *start) {
  for (; start > stop; start--) {
    if (!isspace((int)*start)) {
      return (char *)start;
    }
  }
  return NULL;
}


x86 assembly (clang, -O0):
<rev_strnpc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    1166 <rev_strnpc+0x56>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
jne    1150 <rev_strnpc+0x40>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116e <rev_strnpc+0x5e>
jmp    1155 <rev_strnpc+0x45>
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
jmp    1120 <rev_strnpc+0x10>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rev_strnpc>:
push   %r14
push   %rbx
push   %rax
cmp    %rdi,%rsi
jbe    1135 <rev_strnpc+0x25>
mov    %rsi,%rbx
mov    %rdi,%r14
nop
movsbl (%rbx),%edi
call   1030 <isspace@plt>
test   %eax,%eax
je     1137 <rev_strnpc+0x27>
add    $0xffffffffffffffff,%rbx
cmp    %r14,%rbx
ja     1120 <rev_strnpc+0x10>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @rev_strnpc(i8* readnone %0, i8* %1) {
%3 = icmp ugt i8* %1, %0
br i1 %3, label %4, label %13
4: ; preds = %2, %10
%5 = phi i8* [ %11, %10 ], [ %1, %2 ]
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = tail call i32 @isspace(i32 %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %4
%11 = getelementptr inbounds i8, i8* %5, i64 -1
%12 = icmp ugt i8* %11, %0
br i1 %12, label %4, label %13
13: ; preds = %4, %10, %2
%14 = phi i8* [ null, %2 ], [ null, %10 ], [ %5, %4 ]
ret i8* %14
}
main() {
  int *p;
  p = (int[]){2, f()};
  return p[1];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x18(%rbp)
mov    $0x0,%al
call   1030 <f@plt>
mov    %eax,-0x14(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca [2 x i32]
store i32 0, i32* %1
%4 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
store i32 2, i32* %4
%5 = getelementptr inbounds i32, i32* %4, i64 1
%6 = call i32 (...) @f()
store i32 %6, i32* %5
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
store i32* %7, i32** %2
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 1
%10 = load i32, i32* %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f()
ret i32 %1
}
/* Variables and functions */
float sine_in(float, float, float);
float sine_f_in(float step, float max_steps, float max_val) {
  return sine_in(step, max_steps, max_val);
}


x86 assembly (clang, -O0):
<sine_f_in>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
call   1030 <sine_in@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sine_f_in>:
jmp    1030 <sine_in@plt>

LLVM IR (-O0):
define float @sine_f_in(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = load float, float* %6
%10 = call float @sine_in(float %7, float %8, float %9)
ret float %10
}

LLVM IR (-O2):
define float @sine_f_in(float %0, float %1, float %2) {
%4 = tail call float @sine_in(float %0, float %1, float %2)
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void die(char *msg) {
  printf("codegen: %s\n", msg);
  exit(2);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c"codegen: %s\0A\00"
define void @die(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 2)
unreachable
}
/* Type definitions */
struct timeval {
  long tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ FD_SETSIZE;
int /*<<< orphan*/ die(char *, int);
scalar_t__ select(int /*<<< orphan*/, int /*<<< orphan*/ *,
                  int /*<<< orphan*/ *, int /*<<< orphan*/ *, struct timeval *);
void procrastinate() {
  struct timeval tv;
  tv.tv_sec = (long)3;
  tv.tv_usec = 0;
  if (select(FD_SETSIZE, NULL, NULL, NULL, &tv) < 0)
    die("select\n", 10);
}


x86 assembly (clang, -O0):
<procrastinate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x3,-0x10(%rbp)
movq   $0x0,-0x8(%rbp)
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x10(%rbp),%r8
mov    %rcx,%rsi
mov    %rcx,%rdx
call   1030 <select@plt>
cmp    $0x0,%rax
jge    116f <procrastinate+0x4f>
lea    0xe9b(%rip),%rdi
mov    $0xa,%esi
call   1040 <die@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<procrastinate>:
sub    $0x18,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%r8
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <select@plt>
test   %rax,%rax
js     1150 <procrastinate+0x30>
add    $0x18,%rsp
ret
lea    0xeb9(%rip),%rdi
mov    $0xa,%esi
call   1040 <die@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
@FD_SETSIZE = global i32 0
@.str = [8 x i8] c"select\0A\00"
define void @procrastinate() {
%1 = alloca %struct.timeval
%2 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
store i64 3, i64* %2
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
store i64 0, i64* %3
%4 = load i32, i32* @FD_SETSIZE
%5 = call i64 @select(i32 %4, i32* null, i32* null, i32* null, %struct.timeval* %1)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @die(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 10)
br label %9
9: ; preds = %7, %0
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
@FD_SETSIZE = global i32 0
@.str = [8 x i8] c"select\0A\00"
define void @procrastinate() {
%1 = alloca <2 x i64>
%2 = bitcast <2 x i64>* %1 to %struct.timeval*
%3 = bitcast <2 x i64>* %1 to i8*
store <2 x i64> <i64 3, i64 0>, <2 x i64>* %1
%4 = load i32, i32* @FD_SETSIZE
%5 = call i64 @select(i32 %4, i32* null, i32* null, i32* null, %struct.timeval* %2)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @die(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 10)
br label %9
9: ; preds = %7, %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
void print_hint(FILE *stream, const char *program) {
  (void)fprintf(stream, "Try `%s --help' for more information.\n", program);
}


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

x86 assembly (clang, -O2):
<print_hint>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"Try `%s --help' for more information.\0A\00"
define void @print_hint(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i8*, i8** %4
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"Try `%s --help' for more information.\0A\00"
define void @print_hint(i32* nocapture %0, i8* %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
void *malloc(int /*<<< orphan*/);
void *faad_malloc(int32_t size) { return malloc(size); }


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

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

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

LLVM IR (-O2):
define noalias i8* @faad_malloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ PUT32(int, int);
void led_on() { PUT32(0x20200028, 1 << 16); }


x86 assembly (clang, -O0):
<led_on>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20200028,%edi
mov    $0x10000,%esi
call   1030 <PUT32@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<led_on>:
mov    $0x20200028,%edi
mov    $0x10000,%esi
jmp    1030 <PUT32@plt>

LLVM IR (-O0):
define void @led_on() {
%1 = call i32 @PUT32(i32 538968104, i32 65536)
ret void
}

LLVM IR (-O2):
define void @led_on() {
%1 = tail call i32 @PUT32(i32 538968104, i32 65536)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printArr(int *arr, int size) {
  int i;
  for (i = 0; i < size; ++i)
    printf("%d ", arr[i]);
}


x86 assembly (clang, -O0):
<printArr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1157 <printArr+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printArr+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArr>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <printArr+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <printArr+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
define void @printArr(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* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printArr(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_int32_read_write();
int /*<<< orphan*/ test_int64_read_write();
int /*<<< orphan*/ test_string_read_write();
int /*<<< orphan*/ test_uint32_read_write();
int /*<<< orphan*/ test_uint64_read_write();
int main(int argc, char *argv[]) {
  test_string_read_write();
  test_int32_read_write();
  test_uint32_read_write();
  test_int64_read_write();
  test_uint64_read_write();
  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   1070 <test_string_read_write@plt>
mov    $0x0,%al
call   1050 <test_int32_read_write@plt>
mov    $0x0,%al
call   1060 <test_uint32_read_write@plt>
mov    $0x0,%al
call   1030 <test_int64_read_write@plt>
mov    $0x0,%al
call   1040 <test_uint64_read_write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <test_string_read_write@plt>
xor    %eax,%eax
call   1050 <test_int32_read_write@plt>
xor    %eax,%eax
call   1060 <test_uint32_read_write@plt>
xor    %eax,%eax
call   1030 <test_int64_read_write@plt>
xor    %eax,%eax
call   1040 <test_uint64_read_write@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 (...) @test_string_read_write()
%7 = call i32 (...) @test_int32_read_write()
%8 = call i32 (...) @test_uint32_read_write()
%9 = call i32 (...) @test_int64_read_write()
%10 = call i32 (...) @test_uint64_read_write()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_string_read_write()
%4 = tail call i32 (...) @test_int32_read_write()
%5 = tail call i32 (...) @test_uint32_read_write()
%6 = tail call i32 (...) @test_int64_read_write()
%7 = tail call i32 (...) @test_uint64_read_write()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int feof(int /*<<< orphan*/ *);
__attribute__((__weak__, __always___)) int softboundmpx_feof(FILE *stream) {
  return feof(stream);
}


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

x86 assembly (clang, -O2):
<softboundmpx_feof>:
jmp    1030 <feof@plt>

LLVM IR (-O0):
define weak i32 @softboundmpx_feof(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @feof(i32* %3)
ret i32 %4
}

LLVM IR (-O2):
define weak i32 @softboundmpx_feof(i32* %0) {
%2 = tail call i32 @feof(i32* %0)
ret i32 %2
}
float fixed_to_float(int i) { return ((float)i / (1 << 16)); }


x86 assembly (clang, -O0):
<fixed_to_float>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
movss  0xeec(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fixed_to_float>:
cvtsi2ss %edi,%xmm0
mulss  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define float @fixed_to_float(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to float
%5 = fdiv float %4, 6.553600e+04
ret float %5
}

LLVM IR (-O2):
define float @fixed_to_float(i32 %0) {
%2 = sitofp i32 %0 to float
%3 = fmul float %2, 0x3EF0000000000000
ret float %3
}
extern void *aug_acqptr(void *volatile *ptr) {
  void *val = *ptr;
  __asm__ __volatile__("lfence" ::: "memory");
  return val;
}


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

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

LLVM IR (-O0):
define i8* @aug_acqptr(i8** %0) {
%2 = alloca i8**
%3 = alloca i8*
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = load volatile i8*, i8** %4
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define i8* @aug_acqptr(i8** %0) {
%2 = load volatile i8*, i8** %0
tail call void asm sideeffect "lfence", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret i8* %2
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ y;
};
struct TYPE_4__ {
  TYPE_1__ xgraphicsexpose;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xgraphicsexpose_y(void *_p) {
  return (int)((XEvent *)_p)->xgraphicsexpose.y;
}


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

x86 assembly (clang, -O2):
<get_XEvent_xgraphicsexpose_y>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i32 @get_XEvent_xgraphicsexpose_y(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @get_XEvent_xgraphicsexpose_y(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
void funca(void) {
  int i, n;
  for (i = 0; i < 100000; i++) {
    n++;
    n--;
  }
}


x86 assembly (clang, -O0):
<funca>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x186a0,-0x4(%rbp)
jge    1138 <funca+0x38>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <funca+0xb>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @funca() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %11, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 100000
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = add nsw i32 %9, -1
store i32 %10, i32* %2
br label %11
11: ; preds = %6
%12 = load i32, i32* %1
%13 = add nsw i32 %12, 1
store i32 %13, i32* %1
br label %3
14: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @funca() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void print_message_to_stderr(const char *message) {
  (void)fputs(message, stderr);
}


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

x86 assembly (clang, -O2):
<print_message_to_stderr>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @print_message_to_stderr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @stderr
%5 = call i32 @fputs(i8* %3, i32 %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
define void @print_message_to_stderr(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fputs(i8* %0, i32 %2)
ret void
}