xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ orgfx_triangle3d(int, int, int /*<<< orphan*/, int, int,
                                    int /*<<< orphan*/, int, int,
                                    int /*<<< orphan*/, unsigned int);
void orgfx_triangle(int x0, int y0, int x1, int y1, int x2, int y2,
                    unsigned int interpolate) {
  orgfx_triangle3d(x0, y0, 0, x1, y1, 0, x2, y2, 0, interpolate);
}


x86 assembly (clang, -O0):
<orgfx_triangle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0x14(%rbp),%r11d
mov    -0x18(%rbp),%r10d
mov    0x10(%rbp),%eax
xor    %r9d,%r9d
mov    %r9d,%edx
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
movl   $0x0,0x10(%rsp)
mov    %eax,0x18(%rsp)
call   1030 <orgfx_triangle3d@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<orgfx_triangle>:
push   %rax
mov    %r9d,%eax
mov    %r8d,%r10d
mov    %ecx,%r8d
mov    %edx,%ecx
mov    0x10(%rsp),%r11d
xor    %edx,%edx
xor    %r9d,%r9d
push   %r11
push   $0x0
push   %rax
push   %r10
call   1030 <orgfx_triangle3d@plt>
add    $0x20,%rsp
pop    %rax
ret

LLVM IR (-O0):
define void @orgfx_triangle(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = 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
store i32 %6, i32* %14
%15 = load i32, i32* %8
%16 = load i32, i32* %9
%17 = load i32, i32* %10
%18 = load i32, i32* %11
%19 = load i32, i32* %12
%20 = load i32, i32* %13
%21 = load i32, i32* %14
%22 = call i32 @orgfx_triangle3d(i32 %15, i32 %16, i32 0, i32 %17, i32 %18, i32 0, i32 %19, i32 %20, i32 0, i32 %21)
ret void
}

LLVM IR (-O2):
define void @orgfx_triangle(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = tail call i32 @orgfx_triangle3d(i32 %0, i32 %1, i32 0, i32 %2, i32 %3, i32 0, i32 %4, i32 %5, i32 0, i32 %6)
ret void
}
/* Variables and functions */
char *parseChars(char const *, int, int);
char *parseHTTPVersion(const char *request, int pos) {
  return parseChars(request, pos, 9);
}


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

x86 assembly (clang, -O2):
<parseHTTPVersion>:
mov    $0x9,%edx
jmp    1030 <parseChars@plt>

LLVM IR (-O0):
define i8* @parseHTTPVersion(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 i8* @parseChars(i8* %5, i32 %6, i32 9)
ret i8* %7
}

LLVM IR (-O2):
define i8* @parseHTTPVersion(i8* %0, i32 %1) {
%3 = tail call i8* @parseChars(i8* %0, i32 %1, i32 9)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *load_input(int /*<<< orphan*/);
int /*<<< orphan*/ rpn(char *);
int /*<<< orphan*/ stdin;
int main(void) {
  char *input = load_input((stdin));
  rpn(input);
  free(input);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1050 <load_input@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <rpn@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
call   1050 <load_input@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <rpn@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@stdin = global i32 0
define i32 @main() {
%1 = load i32, i32* @stdin
%2 = tail call i8* @load_input(i32 %1)
%3 = tail call i32 @rpn(i8* %2)
%4 = tail call i32 @free(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void crt_set_cursor(int pos) {
  outb(0x3D4, 0x0E);
  outb(0x3D5, (pos >> 8) & 0x0FF);
  outb(0x3D4, 0x0F);
  outb(0x3D5, pos & 0xFF);
}


x86 assembly (clang, -O0):
<crt_set_cursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1030 <outb@plt>
mov    -0x4(%rbp),%esi
sar    $0x8,%esi
and    $0xff,%esi
mov    $0x3d5,%edi
call   1030 <outb@plt>
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1030 <outb@plt>
mov    -0x4(%rbp),%esi
and    $0xff,%esi
mov    $0x3d5,%edi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crt_set_cursor>:
push   %rbx
mov    %edi,%ebx
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1030 <outb@plt>
movzbl %bh,%esi
mov    $0x3d5,%edi
call   1030 <outb@plt>
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1030 <outb@plt>
movzbl %bl,%esi
mov    $0x3d5,%edi
pop    %rbx
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @crt_set_cursor(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @outb(i32 980, i32 14)
%4 = load i32, i32* %2
%5 = ashr i32 %4, 8
%6 = and i32 %5, 255
%7 = call i32 @outb(i32 981, i32 %6)
%8 = call i32 @outb(i32 980, i32 15)
%9 = load i32, i32* %2
%10 = and i32 %9, 255
%11 = call i32 @outb(i32 981, i32 %10)
ret void
}

LLVM IR (-O2):
define void @crt_set_cursor(i32 %0) {
%2 = tail call i32 @outb(i32 980, i32 14)
%3 = lshr i32 %0, 8
%4 = and i32 %3, 255
%5 = tail call i32 @outb(i32 981, i32 %4)
%6 = tail call i32 @outb(i32 980, i32 15)
%7 = and i32 %0, 255
%8 = tail call i32 @outb(i32 981, i32 %7)
ret void
}
const char *file_cache_id(void) { return "file"; }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"file\00"
define i8* @file_cache_id() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int asprintf(char **, char *, char *, char *);
char *copy(char *str, char *suf) {
  char *new;
  if (asprintf(&new, "%s%s", str, suf ? suf : "") == -1)
    return NULL;
  return new;
}


x86 assembly (clang, -O0):
<copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1140 <copy+0x30>
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    1150 <copy+0x40>
lea    0xebd(%rip),%rax
mov    %rax,-0x30(%rbp)
jmp    1150 <copy+0x40>
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%rcx
lea    -0x20(%rbp),%rdi
lea    0xe9d(%rip),%rsi
call   1030 <asprintf@plt>
cmp    $0xffffffff,%eax
jne    117e <copy+0x6e>
movq   $0x0,-0x8(%rbp)
jmp    1186 <copy+0x76>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy>:
push   %rax
mov    %rdi,%rdx
test   %rsi,%rsi
lea    0xee6(%rip),%rcx
cmovne %rsi,%rcx
lea    0xed7(%rip),%rsi
mov    %rsp,%rdi
call   1030 <asprintf@plt>
cmp    $0xffffffff,%eax
je     113c <copy+0x2c>
mov    (%rsp),%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%s%s\00"
@.str.1 = [1 x i8] zeroinitializer
define i8* @copy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i8*, i8** %5
br label %13
12: ; preds = %2
br label %13
13: ; preds = %12, %10
%14 = phi i8* [ %11, %10 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %12 ]
%15 = call i32 @asprintf(i8** %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %14)
%16 = icmp eq i32 %15, -1
br i1 %16, label %17, label %18
17: ; preds = %13
store i8* null, i8** %3
br label %20
18: ; preds = %13
%19 = load i8*, i8** %6
store i8* %19, i8** %3
br label %20
20: ; preds = %18, %17
%21 = load i8*, i8** %3
ret i8* %21
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s%s\00"
@.str.1 = [1 x i8] zeroinitializer
define i8* @copy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = icmp eq i8* %1, null
%6 = select i1 %5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* %1
%7 = call i32 @asprintf(i8** %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %6)
%8 = icmp eq i32 %7, -1
%9 = load i8*, i8** %3
%10 = select i1 %8, i8* null, i8* %9
ret i8* %10
}
/* Variables and functions */
int c(int);
int f(int);
int k(int);
int g(int i) { return f(i) + c(i) + k(i); }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <f@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <c@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <k@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
call   1030 <f@plt>
mov    %eax,%r14d
mov    %ebx,%edi
call   1040 <c@plt>
mov    %eax,%ebp
add    %r14d,%ebp
mov    %ebx,%edi
call   1050 <k@plt>
add    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @g(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @f(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @c(i32 %5)
%7 = add nsw i32 %4, %6
%8 = load i32, i32* %2
%9 = call i32 @k(i32 %8)
%10 = add nsw i32 %7, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @g(i32 %0) {
%2 = tail call i32 @f(i32 %0)
%3 = tail call i32 @c(i32 %0)
%4 = add nsw i32 %3, %2
%5 = tail call i32 @k(i32 %0)
%6 = add nsw i32 %4, %5
ret i32 %6
}
int factorial(int n) {
  if (n < 0) {
    return (-1);
  }
  if (n == 0) {
    return (0);
  }
  return (n * factorial(n - 1));
}


x86 assembly (clang, -O0):
<factorial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1131 <factorial+0x21>
movl   $0xffffffff,-0x4(%rbp)
jmp    1163 <factorial+0x53>
cmpl   $0x0,-0x8(%rbp)
jne    1147 <factorial+0x37>
movl   $0x0,-0x4(%rbp)
jmp    1163 <factorial+0x53>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <factorial@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<factorial>:
mov    %edi,%eax
sar    $0x1f,%eax
ret

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

LLVM IR (-O2):
define i32 @factorial(i32 %0) {
%2 = ashr i32 %0, 31
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ *findRootDirPath(char const *);
int isRootDirPath(const char *path) { return findRootDirPath(path) != NULL; }


x86 assembly (clang, -O0):
<isRootDirPath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <findRootDirPath@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isRootDirPath>:
push   %rax
call   1030 <findRootDirPath@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @isRootDirPath(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32* @findRootDirPath(i8* %3)
%5 = icmp ne i32* %4, null
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @isRootDirPath(i8* %0) {
%2 = tail call i32* @findRootDirPath(i8* %0)
%3 = icmp ne i32* %2, null
%4 = zext i1 %3 to i32
ret i32 %4
}
void csv_log_teardown(struct _nlTestSuite *inSuite, int inResult, int inWidth) {
  printf("'#4:','%-*s','%s'\n", inWidth, "Teardown",
         inResult == -1 ? "FAILED" : "PASSED");
}


x86 assembly (clang, -O0):
<csv_log_teardown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xef4(%rip),%rcx
lea    0xee6(%rip),%rax
cmp    $0xffffffff,%edx
cmove  %rax,%rcx
lea    0xebc(%rip),%rdi
lea    0xec8(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<csv_log_teardown>:
cmp    $0xffffffff,%esi
lea    0xf02(%rip),%rax
lea    0xf02(%rip),%rcx
cmove  %rax,%rcx
lea    0xed4(%rip),%rdi
lea    0xee0(%rip),%rax
mov    %edx,%esi
mov    %rax,%rdx
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct._nlTestSuite = type opaque
@.str = [19 x i8] c"':','%-*s','%s'\0A\00"
@.str.1 = [9 x i8] c"Teardown\00"
@.str.2 = [7 x i8] c"FAILED\00"
@.str.3 = [7 x i8] c"PASSED\00"
define void @csv_log_teardown(%struct._nlTestSuite* %0, i32 %1, i32 %2) {
%4 = alloca %struct._nlTestSuite*
%5 = alloca i32
%6 = alloca i32
store %struct._nlTestSuite* %0, %struct._nlTestSuite** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, -1
%10 = zext i1 %9 to i64
%11 = select i1 %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %7, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %11)
ret void
}

LLVM IR (-O2):
%struct._nlTestSuite = type opaque
@.str = [19 x i8] c"':','%-*s','%s'\0A\00"
@.str.1 = [9 x i8] c"Teardown\00"
@.str.2 = [7 x i8] c"FAILED\00"
@.str.3 = [7 x i8] c"PASSED\00"
define void @csv_log_teardown(%struct._nlTestSuite* nocapture readnone %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, -1
%5 = select i1 %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %5)
ret void
}
/* Variables and functions */
int executeRawApplescript(char *);
int /*<<< orphan*/ sprintf(char *, char *, char const *, char const *);
int executeApplescript(const char *application, const char *command) {
  char toExec[1024];
  sprintf(toExec, "tell application \"%s\" to %s", application, command);
  return executeRawApplescript(toExec);
}


x86 assembly (clang, -O0):
<executeApplescript>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xeb7(%rip),%rsi
call   1030 <sprintf@plt>
lea    -0x410(%rbp),%rdi
call   1040 <executeRawApplescript@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<executeApplescript>:
push   %rbx
sub    $0x400,%rsp
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xecb(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <executeRawApplescript@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"tell application \22%s\22 to %s\00"
define i32 @executeApplescript(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [1024 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8)
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%11 = call i32 @executeRawApplescript(i8* %10)
ret i32 %11
}

LLVM IR (-O2):
@.str = [28 x i8] c"tell application \22%s\22 to %s\00"
define i32 @executeApplescript(i8* %0, i8* %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%6 = call i32 @executeRawApplescript(i8* %4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void closeTap(int fd) { close(fd); }


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

x86 assembly (clang, -O2):
<closeTap>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @closeTap(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *ucfree(void *ptr) {
  if (ptr)
    free(ptr);
}


x86 assembly (clang, -O0):
<ucfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1130 <ucfree+0x20>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ucfree>:
test   %rdi,%rdi
je     111f <ucfree+0xf>
push   %rax
call   1030 <free@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define noalias i8* @ucfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret i8* undef
}
/* Variables and functions */
double vector_magnitude_2d(double *);
void vector_normalize_2d(double v[2]) {
  double mag = vector_magnitude_2d(v);
  v[0] /= mag;
  v[1] /= mag;
}


x86 assembly (clang, -O0):
<vector_normalize_2d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <vector_magnitude_2d@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm1
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
movsd  -0x10(%rbp),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector_normalize_2d>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vector_magnitude_2d@plt>
movupd (%rbx),%xmm1
unpcklpd %xmm0,%xmm0
divpd  %xmm0,%xmm1
movupd %xmm1,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @vector_normalize_2d(double* %0) {
%2 = alloca double*
%3 = alloca double
store double* %0, double** %2
%4 = load double*, double** %2
%5 = call double @vector_magnitude_2d(double* %4)
store double %5, double* %3
%6 = load double, double* %3
%7 = load double*, double** %2
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = load double, double* %8
%10 = fdiv double %9, %6
store double %10, double* %8
%11 = load double, double* %3
%12 = load double*, double** %2
%13 = getelementptr inbounds double, double* %12, i64 1
%14 = load double, double* %13
%15 = fdiv double %14, %11
store double %15, double* %13
ret void
}

LLVM IR (-O2):
define void @vector_normalize_2d(double* %0) {
%2 = tail call double @vector_magnitude_2d(double* %0)
%3 = bitcast double* %0 to <2 x double>*
%4 = load <2 x double>, <2 x double>* %3
%5 = insertelement <2 x double> poison, double %2, i64 0
%6 = shufflevector <2 x double> %5, <2 x double> poison, <2 x i32> zeroinitializer
%7 = fdiv <2 x double> %4, %6
%8 = bitcast double* %0 to <2 x double>*
store <2 x double> %7, <2 x double>* %8
ret void
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ printf(char *, char);
main() {
  char m;
  m = getchar();
  printf("%c", m);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = tail call signext i8 (...) @getchar()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %1)
ret i32 0
}
AR0I1(r0, r1, x0, x1, p0, p1) float r0, r1;
float *p0, *p1;
{ (p0[10000000]) = 33; }


x86 assembly (clang, -O0):
<AR0I1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm1,-0x30(%rbp)
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movss  0xec3(%rip),%xmm0
movss  %xmm0,0x2625a00(%rax)
02
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AR0I1>:
movl   $0x42040000,0x2625a00(%rdx)
ret

LLVM IR (-O0):
define i32 @AR0I1(double %0, double %1, i32 %2, i32 %3, float* %4, float* %5) {
%7 = alloca i32
%8 = alloca float
%9 = alloca float
%10 = alloca i32
%11 = alloca i32
%12 = alloca float*
%13 = alloca float*
%14 = fptrunc double %0 to float
%15 = fptrunc double %1 to float
store float %14, float* %8
store float %15, float* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store float* %4, float** %12
store float* %5, float** %13
%16 = load float*, float** %12
%17 = getelementptr inbounds float, float* %16, i64 10000000
store float 3.300000e+01, float* %17
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
define i32 @AR0I1(double %0, double %1, i32 %2, i32 %3, float* nocapture writeonly %4, float* nocapture readnone %5) {
%7 = getelementptr inbounds float, float* %4, i64 10000000
store float 3.300000e+01, float* %7
ret i32 undef
}
/* Type definitions */
struct mdoc_node {
  int dummy;
};
struct mdoc_meta {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ font_pop();
void post_font(const struct mdoc_meta *meta, const struct mdoc_node *n) {
  font_pop();
}


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

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

LLVM IR (-O0):
%struct.mdoc_meta = type { i32 }
%struct.mdoc_node = type { i32 }
define void @post_font(%struct.mdoc_meta* %0, %struct.mdoc_node* %1) {
%3 = alloca %struct.mdoc_meta*
%4 = alloca %struct.mdoc_node*
store %struct.mdoc_meta* %0, %struct.mdoc_meta** %3
store %struct.mdoc_node* %1, %struct.mdoc_node** %4
%5 = call i32 (...) @font_pop()
ret void
}

LLVM IR (-O2):
%struct.mdoc_meta = type { i32 }
%struct.mdoc_node = type { i32 }
define void @post_font(%struct.mdoc_meta* nocapture readnone %0, %struct.mdoc_node* nocapture readnone %1) {
%3 = tail call i32 (...) @font_pop()
ret void
}
/* Variables and functions */
void *memmset(void *s, int c, register size_t n) {
  while (n--)
    *(unsigned char *)s++ = (unsigned char)c;
  return s;
}


x86 assembly (clang, -O0):
<memmset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
cmp    $0x0,%rax
je     1143 <memmset+0x43>
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    110f <memmset+0xf>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memmset>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
test   %rdx,%rdx
je     112a <memmset+0x1a>
mov    %rdx,%r14
mov    %rbx,%rdi
call   1030 <memset@plt>
add    %r14,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @memmset(i8* writeonly %0, i32 %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = trunc i32 %1 to i8
%7 = getelementptr i8, i8* %0, i64 %2
br label %8
8: ; preds = %5, %3
%9 = phi i8* [ %0, %3 ], [ %7, %5 ]
ret i8* %9
}
void swap(char rev[], int x, int y) {
  int temp;
  temp = rev[x];
  rev[x] = rev[y];
  rev[y] = temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,1),%sil
movslq %edx,%rdx
mov    (%rdi,%rdx,1),%cl
mov    %cl,(%rdi,%rax,1)
mov    %sil,(%rdi,%rdx,1)
ret

LLVM IR (-O0):
define void @swap(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
store i32 %13, i32* %7
%14 = load i8*, i8** %4
%15 = load i32, i32* %6
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = load i8*, i8** %4
%20 = load i32, i32* %5
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %19, i64 %21
store i8 %18, i8* %22
%23 = load i32, i32* %7
%24 = trunc i32 %23 to i8
%25 = load i8*, i8** %4
%26 = load i32, i32* %6
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8, i8* %25, i64 %27
store i8 %24, i8* %28
ret void
}

LLVM IR (-O2):
define void @swap(i8* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
store i8 %9, i8* %5
store i8 %6, i8* %8
ret void
}
/* Variables and functions */
scalar_t__ isspace(char);
int empty_line(char *line) {
  while (isspace(*line)) {
    line++;
  }
  return *line == 0;
}


x86 assembly (clang, -O0):
<empty_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1143 <empty_line+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <empty_line+0xc>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<empty_line>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl (%rbx),%edi
call   1030 <isspace@plt>
add    $0x1,%rbx
test   %rax,%rax
jne    1120 <empty_line+0x10>
xor    %eax,%eax
cmpb   $0x0,-0x1(%rbx)
sete   %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @empty_line(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isspace(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = load i8, i8* %3
%10 = icmp eq i8 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}
void test12(char *b) {
  unsigned char buf[4];
  printf("%.4s\n", buf);
  printf("%.4s\n", &buf);
  asprintf(&b, "%d", "asprintf");
}


x86 assembly (clang, -O0):
<test12>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rsi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebb(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x8(%rbp),%rdi
lea    0xeab(%rip),%rsi
lea    0xea7(%rip),%rdx
mov    $0x0,%al
call   1040 <asprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test12>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdi,0x8(%rsp)
lea    0xecd(%rip),%r14
lea    0x14(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xead(%rip),%rsi
lea    0xea9(%rip),%rdx
lea    0x8(%rsp),%rdi
xor    %eax,%eax
call   1040 <asprintf@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%.4s\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [9 x i8] c"asprintf\00"
define void @test12(i8* %0) {
%2 = alloca i8*
%3 = alloca [4 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), [4 x i8]* %3)
%7 = call i32 (i8**, i8*, i8*, ...) bitcast (i32 (...)* @asprintf to i32 (i8**, i8*, i8*, ...)*)(i8** %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%.4s\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [9 x i8] c"asprintf\00"
define void @test12(i8* %0) {
%2 = alloca i8*
%3 = alloca [4 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), [4 x i8]* %3)
%7 = call i32 (i8**, i8*, i8*, ...) bitcast (i32 (...)* @asprintf to i32 (i8**, i8*, i8*, ...)*)(i8** %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret void
}
void foo398() {}


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

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

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

LLVM IR (-O2):
define void @foo398() {
ret void
}
__attribute__((visibility("default"))) void empty(void) {}


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

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

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

LLVM IR (-O2):
define void @empty() {
ret void
}
int any_even_one(unsigned x) { return (x & 0x55555555u) != 0u; }


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

x86 assembly (clang, -O2):
<any_even_one>:
xor    %eax,%eax
test   $0x55555555,%edi
setne  %al
ret

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

LLVM IR (-O2):
define i32 @any_even_one(i32 %0) {
%2 = and i32 %0, 1431655765
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct hdr_histogram {
  int dummy;
};
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int hdr_record_values(struct hdr_histogram *, int /*<<< orphan*/, int);
bool hdr_record_value(struct hdr_histogram *h, int64_t value) {
  return hdr_record_values(h, value, 1);
}


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

x86 assembly (clang, -O2):
<hdr_record_value>:
mov    $0x1,%edx
jmp    1030 <hdr_record_values@plt>

LLVM IR (-O0):
%struct.hdr_histogram = type { i32 }
define i32 @hdr_record_value(%struct.hdr_histogram* %0, i32 %1) {
%3 = alloca %struct.hdr_histogram*
%4 = alloca i32
store %struct.hdr_histogram* %0, %struct.hdr_histogram** %3
store i32 %1, i32* %4
%5 = load %struct.hdr_histogram*, %struct.hdr_histogram** %3
%6 = load i32, i32* %4
%7 = call i32 @hdr_record_values(%struct.hdr_histogram* %5, i32 %6, i32 1)
ret i32 %7
}

LLVM IR (-O2):
%struct.hdr_histogram = type { i32 }
define i32 @hdr_record_value(%struct.hdr_histogram* %0, i32 %1) {
%3 = tail call i32 @hdr_record_values(%struct.hdr_histogram* %0, i32 %1, i32 1)
ret i32 %3
}
/* Variables and functions */
int foo(int);
int obj3func2(int a) { return foo(a) + 42; }


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

x86 assembly (clang, -O2):
<obj3func2>:
push   %rax
call   1030 <foo@plt>
add    $0x2a,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @obj3func2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @foo(i32 %3)
%5 = add nsw i32 %4, 42
ret i32 %5
}

LLVM IR (-O2):
define i32 @obj3func2(i32 %0) {
%2 = tail call i32 @foo(i32 %0)
%3 = add nsw i32 %2, 42
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ luaL_opt_number(int, int /*<<< orphan*/);
int /*<<< orphan*/ lua_collectgarbage(int /*<<< orphan*/);
int /*<<< orphan*/ lua_pushnumber(int /*<<< orphan*/);
void luaI_collectgarbage(void) {
  lua_pushnumber(lua_collectgarbage(luaL_opt_number(1, 0)));
}


x86 assembly (clang, -O0):
<luaI_collectgarbage>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <luaL_opt_number@plt>
mov    %eax,%edi
call   1050 <lua_collectgarbage@plt>
mov    %eax,%edi
call   1040 <lua_pushnumber@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<luaI_collectgarbage>:
push   %rax
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <luaL_opt_number@plt>
mov    %eax,%edi
call   1050 <lua_collectgarbage@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <lua_pushnumber@plt>

LLVM IR (-O0):
define void @luaI_collectgarbage() {
%1 = call i32 @luaL_opt_number(i32 1, i32 0)
%2 = call i32 @lua_collectgarbage(i32 %1)
%3 = call i32 @lua_pushnumber(i32 %2)
ret void
}

LLVM IR (-O2):
define void @luaI_collectgarbage() {
%1 = tail call i32 @luaL_opt_number(i32 1, i32 0)
%2 = tail call i32 @lua_collectgarbage(i32 %1)
%3 = tail call i32 @lua_pushnumber(i32 %2)
ret void
}
int nand_wait_rb_mode(void) { return 0 ? 1 : 0; }


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

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

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

LLVM IR (-O2):
define i32 @nand_wait_rb_mode() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, unsigned char *);
int /*<<< orphan*/ stderr;
void error(unsigned char *Message) {
  fprintf(stderr, Message);
  abort();
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %rdi,%rsi
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
define void @error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* %0)
%4 = tail call i32 (...) @abort()
unreachable
}
int test_imm_9Aint64_highword_reg(long long val) {
  return ((val >> 32) & (0x9A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_9Aint64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x20,%rdx
and    $0x9a,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_9Aint64_highword_reg>:
movabs $0x9a00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_9Aint64_highword_reg(i64 %0) {
%2 = and i64 %0, 661424963584
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int get_line(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverse(char *);
main() {
  int len;
  char line[1000];
  int i;
  while ((len = get_line(line, 1000)) > 0) {
    reverse(line);
    printf("%s", line);
  }
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @get_line(i8* %2, i32 1000)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %0, %5
%6 = call i32 @reverse(i8* %2)
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%8 = call i32 @get_line(i8* %2, i32 1000)
%9 = icmp sgt i32 %8, 0
br i1 %9, label %5, label %10
10: ; preds = %5, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abs(int);
scalar_t__ log10(int /*<<< orphan*/);
int get_decimal_size(int input) {
  int result;
  result = (int)log10(abs(input)) + 1;
  return result;
}


x86 assembly (clang, -O0):
<get_decimal_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,%edi
call   1040 <log10@plt>
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_decimal_size>:
push   %rax
mov    %edi,%eax
neg    %eax
cmovns %eax,%edi
call   1030 <log10@plt>
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @get_decimal_size(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @abs(i32 %4)
%6 = call i64 @log10(i32 %5)
%7 = trunc i64 %6 to i32
%8 = add nsw i32 %7, 1
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @get_decimal_size(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%3 = tail call i64 @log10(i32 %2)
%4 = trunc i64 %3 to i32
%5 = add nsw i32 %4, 1
ret i32 %5
}
void XGetRGBColormaps() {}


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

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

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

LLVM IR (-O2):
define void @XGetRGBColormaps() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ bar(unsigned char);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ foo(unsigned char *);
int main() {
  unsigned char b;
  foo(&b);
  if (b & 0x80) {
    bar(b & 0x7f);
    exit(0);
  } else {
    bar(b & 1);
    abort();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x5(%rbp),%rdi
call   1050 <foo@plt>
movzbl -0x5(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1180 <main+0x40>
movzbl -0x5(%rbp),%eax
and    $0x7f,%eax
movzbl %al,%edi
call   1040 <bar@plt>
xor    %edi,%edi
call   1060 <exit@plt>
movzbl -0x5(%rbp),%eax
and    $0x1,%eax
movzbl %al,%edi
call   1040 <bar@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x7(%rsp),%rdi
call   1050 <foo@plt>
mov    0x7(%rsp),%al
test   %al,%al
js     1164 <main+0x24>
and    $0x1,%al
movzbl %al,%edi
call   1040 <bar@plt>
xor    %eax,%eax
call   1030 <abort@plt>
and    $0x7f,%al
movzbl %al,%edi
call   1040 <bar@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 @foo(i8* %2)
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = and i32 %5, 128
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %0
%9 = load i8, i8* %2
%10 = zext i8 %9 to i32
%11 = and i32 %10, 127
%12 = trunc i32 %11 to i8
%13 = call i32 @bar(i8 zeroext %12)
%14 = call i32 @exit(i32 0)
unreachable
15: ; preds = %0
%16 = load i8, i8* %2
%17 = zext i8 %16 to i32
%18 = and i32 %17, 1
%19 = trunc i32 %18 to i8
%20 = call i32 @bar(i8 zeroext %19)
%21 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i8
%2 = call i32 @foo(i8* %1)
%3 = load i8, i8* %1
%4 = icmp sgt i8 %3, -1
br i1 %4, label %9, label %5
5: ; preds = %0
%6 = and i8 %3, 127
%7 = call i32 @bar(i8 zeroext %6)
%8 = call i32 @exit(i32 0)
unreachable
9: ; preds = %0
%10 = and i8 %3, 1
%11 = call i32 @bar(i8 zeroext %10)
%12 = call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ teardown_reader();
void teardown() { teardown_reader(); }


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

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

LLVM IR (-O0):
define void @teardown() {
%1 = call i32 (...) @teardown_reader()
ret void
}

LLVM IR (-O2):
define void @teardown() {
%1 = tail call i32 (...) @teardown_reader()
ret void
}
char *realpath(const char *path, char *resolved_path) {
  printf("tcl>>> %s\n", __func__);
  return (char *)0;
}


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"tcl>>> %s\0A\00"
@__func__.realpath = [9 x i8] c"realpath\00"
define i8* @realpath(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__func__.realpath, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@.str = [11 x i8] c"tcl>>> %s\0A\00"
@__func__.realpath = [9 x i8] c"realpath\00"
define noalias i8* @realpath(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__func__.realpath, i64 0, i64 0))
ret i8* null
}