xunge/DecIR huggingface dataset:
int main() {
  unsigned long long n;
  int b;
  scanf("%llu %d", &n, &b);
  printf(n > (1LLU << (b + 1)) - 1 ? "no\n" : "yes\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,%eax
mov    %eax,%ecx
mov    $0x1,%edx
shl    %cl,%rdx
mov    -0x20(%rbp),%rcx
sub    $0x1,%rdx
lea    0xe9e(%rip),%rdi
lea    0xe93(%rip),%rax
cmp    %rdx,%rcx
cmova  %rax,%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x10(%rsp),%rax
mov    0xc(%rsp),%cl
add    $0x1,%cl
shr    %cl,%rax
test   %rax,%rax
lea    0xeb7(%rip),%rax
lea    0xeac(%rip),%rdi
cmove  %rax,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%llu %d\00"
@.str.1 = [4 x i8] c"no\0A\00"
@.str.2 = [5 x i8] c"yes\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64* %2, i32* %3)
%5 = load i64, i64* %2
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 1
%8 = zext i32 %7 to i64
%9 = shl i64 1, %8
%10 = sub i64 %9, 1
%11 = icmp ugt i64 %5, %10
%12 = zext i1 %11 to i64
%13 = select i1 %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0)
%14 = call i32 (i8*, ...) @printf(i8* %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%llu %d\00"
@.str.1 = [4 x i8] c"no\0A\00"
@.str.2 = [5 x i8] c"yes\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i32
%3 = bitcast i64* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64* %1, i32* %2)
%6 = load i64, i64* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
%9 = zext i32 %8 to i64
%10 = lshr i64 %6, %9
%11 = icmp eq i64 %10, 0
%12 = select i1 %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %12)
ret i32 0
}
void gtk_icon_theme_new() {}


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

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

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

LLVM IR (-O2):
define void @gtk_icon_theme_new() {
ret void
}
/* Variables and functions */
int my_total(int, int, int, int, ...);
int /*<<< orphan*/ printf(char *, int);
main() {
  printf("T1=%d\n", my_total(3, 1, 10, 100));
  printf("T1=%d\n", my_total(5, 1, 10, 100, 1000, 1));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
mov    $0x1,%esi
mov    $0xa,%edx
mov    $0x64,%ecx
mov    $0x0,%al
call   1040 <my_total@plt>
mov    %eax,%esi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    $0x5,%edi
mov    $0x1,%r9d
mov    $0xa,%edx
mov    $0x64,%ecx
mov    $0x3e8,%r8d
mov    %r9d,%esi
mov    $0x0,%al
call   1040 <my_total@plt>
mov    %eax,%esi
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x3,%edi
mov    $0x1,%esi
mov    $0xa,%edx
mov    $0x64,%ecx
xor    %eax,%eax
call   1040 <my_total@plt>
lea    0xebd(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x5,%edi
mov    $0x1,%esi
mov    $0xa,%edx
mov    $0x64,%ecx
mov    $0x3e8,%r8d
mov    $0x1,%r9d
xor    %eax,%eax
call   1040 <my_total@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"T1=%d\0A\00"
define i32 @main() {
%1 = call i32 (i32, i32, i32, i32, ...) @my_total(i32 3, i32 1, i32 10, i32 100)
%2 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 (i32, i32, i32, i32, ...) @my_total(i32 5, i32 1, i32 10, i32 100, i32 1000, i32 1)
%4 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"T1=%d\0A\00"
define i32 @main() {
%1 = tail call i32 (i32, i32, i32, i32, ...) @my_total(i32 3, i32 1, i32 10, i32 100)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (i32, i32, i32, i32, ...) @my_total(i32 5, i32 1, i32 10, i32 100, i32 1000, i32 1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ OpenSSL_add_all_algorithms();
int /*<<< orphan*/ SSL_library_init();
int /*<<< orphan*/ SSL_load_error_strings();
void zopenssl_init(void) {
  SSL_library_init();
  OpenSSL_add_all_algorithms();
  SSL_load_error_strings();
}


x86 assembly (clang, -O0):
<zopenssl_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <SSL_library_init@plt>
mov    $0x0,%al
call   1040 <OpenSSL_add_all_algorithms@plt>
mov    $0x0,%al
call   1050 <SSL_load_error_strings@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<zopenssl_init>:
push   %rax
xor    %eax,%eax
call   1030 <SSL_library_init@plt>
xor    %eax,%eax
call   1040 <OpenSSL_add_all_algorithms@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <SSL_load_error_strings@plt>

LLVM IR (-O0):
define void @zopenssl_init() {
%1 = call i32 (...) @SSL_library_init()
%2 = call i32 (...) @OpenSSL_add_all_algorithms()
%3 = call i32 (...) @SSL_load_error_strings()
ret void
}

LLVM IR (-O2):
define void @zopenssl_init() {
%1 = tail call i32 (...) @SSL_library_init()
%2 = tail call i32 (...) @OpenSSL_add_all_algorithms()
%3 = tail call i32 (...) @SSL_load_error_strings()
ret void
}
int _mpyhl(int src1, int src2) { return (short)(src1 >> 16) * (short)(src2); }


x86 assembly (clang, -O0):
<_mpyhl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
cwtl
mov    -0x8(%rbp),%ecx
movswl %cx,%ecx
imul   %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mpyhl>:
sar    $0x10,%edi
movswl %si,%eax
imul   %edi,%eax
ret

LLVM IR (-O0):
define i32 @_mpyhl(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = ashr i32 %5, 16
%7 = trunc i32 %6 to i16
%8 = sext i16 %7 to i32
%9 = load i32, i32* %4
%10 = trunc i32 %9 to i16
%11 = sext i16 %10 to i32
%12 = mul nsw i32 %8, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @_mpyhl(i32 %0, i32 %1) {
%3 = ashr i32 %0, 16
%4 = shl i32 %1, 16
%5 = ashr exact i32 %4, 16
%6 = mul nsw i32 %5, %3
ret i32 %6
}
void initializeStack(int *stack, int *top) {
  stack[0] = -999;
  *top = -1;
}


x86 assembly (clang, -O0):
<initializeStack>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movl   $0xfffffc19,(%rax)
mov    -0x10(%rbp),%rax
movl   $0xffffffff,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<initializeStack>:
movl   $0xfffffc19,(%rdi)
movl   $0xffffffff,(%rsi)
ret

LLVM IR (-O0):
define void @initializeStack(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = getelementptr inbounds i32, i32* %5, i64 0
store i32 -999, i32* %6
%7 = load i32*, i32** %4
store i32 -1, i32* %7
ret void
}

LLVM IR (-O2):
define void @initializeStack(i32* nocapture writeonly %0, i32* nocapture writeonly %1) {
store i32 -999, i32* %0
store i32 -1, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exec(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main(int argc, const char *argv[]) {
  char cmd[50];
  printf("Welcome to Arm4x VM\n\n");
  printf("[avm]$ ");
  scanf("%49s", cmd);
  exec(cmd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
lea    -0x50(%rbp),%rsi
lea    0xeb5(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x50(%rbp),%rdi
call   1050 <exec@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
lea    0xea4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1060 <exec@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Welcome to Arm4x VM\0A\0A\00"
@.str.1 = [8 x i8] c"[avm]$ \00"
@.str.2 = [5 x i8] c"%49s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [50 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%9 = getelementptr inbounds [50 x i8], [50 x i8]* %6, i64 0, i64 0
%10 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %9)
%11 = getelementptr inbounds [50 x i8], [50 x i8]* %6, i64 0, i64 0
%12 = call i32 @exec(i8* %11)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [8 x i8] c"[avm]$ \00"
@.str.2 = [5 x i8] c"%49s\00"
@str = [21 x i8] c"Welcome to Arm4x VM\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [50 x i8]
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %4)
%8 = call i32 @exec(i8* %4)
ret i32 0
}
/* Variables and functions */
int sum(int, int);
int main() { int value = sum(1, 2); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <sum@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @sum(i32 1, i32 2)
ret i32 0
}
unsigned long int strtoul(nptr, endptr, base) const char *nptr;
char **endptr;
int base;
{ return __strtoul_internal(nptr, endptr, base, 0); }


x86 assembly (clang, -O0):
<strtoul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
mov    $0x0,%al
call   1030 <__strtoul_internal@plt>
cltq
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtoul>:
push   %rax
xor    %ecx,%ecx
xor    %eax,%eax
call   1030 <__strtoul_internal@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @strtoul(i8* %0, i8** %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i32
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8**, i8*** %5
%9 = load i32, i32* %6
%10 = call i32 (i8*, i8**, i32, i32, ...) bitcast (i32 (...)* @__strtoul_internal to i32 (i8*, i8**, i32, i32, ...)*)(i8* %7, i8** %8, i32 %9, i32 0)
%11 = sext i32 %10 to i64
ret i64 %11
}

LLVM IR (-O2):
define i64 @strtoul(i8* %0, i8** %1, i32 %2) {
%4 = tail call i32 (i8*, i8**, i32, i32, ...) bitcast (i32 (...)* @__strtoul_internal to i32 (i8*, i8**, i32, i32, ...)*)(i8* %0, i8** %1, i32 %2, i32 0)
%5 = sext i32 %4 to i64
ret i64 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
char *strchr(char *, char);
char *supctime(time_t *loc) {
  char *p, *x = ctime(loc);
  if ((p = strchr(x, '\n')))
    *p = '\0';
  return x;
}


x86 assembly (clang, -O0):
<supctime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ctime@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0xa,%esi
call   1040 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     115c <supctime+0x3c>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<supctime>:
push   %rbx
call   1030 <ctime@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0xa,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     113e <supctime+0x1e>
movb   $0x0,(%rax)
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @supctime(i32* %0) {
%2 = tail call i8* @ctime(i32* %0)
%3 = tail call i8* @strchr(i8* dereferenceable(1) %2, i8 signext 10)
%4 = icmp eq i8* %3, null
br i1 %4, label %6, label %5
5: ; preds = %1
store i8 0, i8* %3
br label %6
6: ; preds = %5, %1
ret i8* %2
}
int test_d(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @test_d() {
ret i32 2
}

LLVM IR (-O2):
define i32 @test_d() {
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ f(int *, int);
int /*<<< orphan*/ printf(char *);
int main(void) {
  int a[10] = {32, 27, 64, 18, 95, 14, 90, 70, 60, 37};
  printf("The value in the array are:\n");
  f(a, 10);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x28,%edx
call   1050 <memcpy@plt>
lea    0xecd(%rip),%rdi
call   1040 <printf@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1030 <f@plt>
lea    0xece(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xee5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xead(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xeca(%rip),%rdi
call   1040 <puts@plt>
mov    %rsp,%rdi
mov    $0xa,%esi
call   1050 <f@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [10 x i32] [i32 32, i32 27, i32 64, i32 18, i32 95, i32 14, i32 90, i32 70, i32 60, i32 37]
@.str = [29 x i8] c"The value in the array are:\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
store i32 0, i32* %1
%3 = bitcast [10 x i32]* %2 to i8*
%4 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%6 = call i32 @f(i32* %5, i32 10)
%7 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [10 x i32] [i32 32, i32 27, i32 64, i32 18, i32 95, i32 14, i32 90, i32 70, i32 60, i32 37]
@str = [28 x i8] c"The value in the array are:\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%5 = call i32 @f(i32* %4, i32 10)
%6 = call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int maind() {
  double pi = 3.141592653589793;
  double d = 30.0;
  double a = d * pi;
  printf("%16.16f\n", a);
  return 0;
}


x86 assembly (clang, -O0):
<maind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  0xee8(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xed3(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<maind>:
push   %rax
lea    0xef0(%rip),%rdi
movsd  0xee0(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%16.16f\0A\00"
define i32 @maind() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
store double 0x400921FB54442D18, double* %1
store double 3.000000e+01, double* %2
%4 = load double, double* %2
%5 = load double, double* %1
%6 = fmul double %4, %5
store double %6, double* %3
%7 = load double, double* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%16.16f\0A\00"
define i32 @maind() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double 0x40578FDB9EFFEA46)
ret i32 0
}
int os2_nettoc(int c) { return (-1); }


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

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

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

LLVM IR (-O2):
define i32 @os2_nettoc(i32 %0) {
ret i32 -1
}
int min_integer(int i1, int i2) {
  if (i1 < i2)
    return i1;
  return i2;
}


x86 assembly (clang, -O0):
<min_integer>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1121 <min_integer+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <min_integer+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min_integer>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @min_integer(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int json_parser(char *json_string, uint8_t len) {
  json_string = json_string;
  len = len;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @json_parser(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
void set_fpu_precision(void) {
  unsigned int fpu_control;
  __asm__ __volatile__("fnstcw %0\n\t"
                       "mov %0, %%ax\n\t"
                       "and $0xfc, %%ah\n\t"
                       "or $0x2, %%ah\n\t"
                       "mov %%ax, %0\n\t"
                       "fldcw %0\n\t"
                       : "+m"(fpu_control)
                       :
                       : "eax");
}


x86 assembly (clang, -O0):
<set_fpu_precision>:
push   %rbp
mov    %rsp,%rbp
fnstcw -0x4(%rbp)
mov    -0x4(%rbp),%ax
and    $0xfc,%ah
or     $0x2,%ah
mov    %ax,-0x4(%rbp)
fldcw  -0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_fpu_precision>:
fnstcw -0x4(%rsp)
mov    -0x4(%rsp),%ax
and    $0xfc,%ah
or     $0x2,%ah
mov    %ax,-0x4(%rsp)
fldcw  -0x4(%rsp)
ret

LLVM IR (-O0):
define void @set_fpu_precision() {
%1 = alloca i32
ret void
}

LLVM IR (-O2):
define void @set_fpu_precision() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int get_pidof(char *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  if (argc < 2) {
    printf("usage: %s process_name\n", argv[0]);
    exit(1);
  }
  printf("%d\n", get_pidof(argv[1]));
  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)
cmpl   $0x2,-0x8(%rbp)
jge    116f <main+0x3f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <get_pidof@plt>
mov    %eax,%esi
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jle    1153 <main+0x23>
mov    0x8(%rsi),%rdi
call   1040 <get_pidof@plt>
lea    0xed2(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    (%rsi),%rsi
lea    0xea3(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"usage: %s process_name\0A\00"
@.str.1 = [4 x i8] c"%d\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 = load i32, i32* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call i32 @get_pidof(i8* %17)
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %18)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"usage: %s process_name\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @get_pidof(i8* %10)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %11)
ret i32 0
}
vberrh(errnum, errsev) int *errnum, *errsev;
{}


x86 assembly (clang, -O0):
<vberrh>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @vberrh(i32* nocapture readnone %0, i32* nocapture readnone %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ DMA3_DriverIRQHandler();
__attribute__((weak)) void DMA3_IRQHandler(void) { DMA3_DriverIRQHandler(); }


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

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

LLVM IR (-O0):
define weak void @DMA3_IRQHandler() {
%1 = call i32 (...) @DMA3_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @DMA3_IRQHandler() {
%1 = tail call i32 (...) @DMA3_DriverIRQHandler()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ pthread_detach(int /*<<< orphan*/);
int /*<<< orphan*/ pthread_exit(char *);
int /*<<< orphan*/ pthread_self();
void *thread_entry(void *arg) {
  pthread_t tid = pthread_self();
  pthread_detach(tid);
  printf("hello thread!\n");
  char *val = "HELLO";
  pthread_exit(val);
}


x86 assembly (clang, -O0):
<thread_entry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1060 <pthread_self@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <pthread_detach@plt>
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
lea    0xe9e(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_entry>:
push   %rax
xor    %eax,%eax
call   1060 <pthread_self@plt>
mov    %eax,%edi
call   1050 <pthread_detach@plt>
lea    0xeb0(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9e(%rip),%rdi
pop    %rax
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"hello thread!\0A\00"
@.str.1 = [6 x i8] c"HELLO\00"
define i8* @thread_entry(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
%6 = call i32 (...) @pthread_self()
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = call i32 @pthread_detach(i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %5
%10 = load i8*, i8** %5
%11 = call i32 @pthread_exit(i8* %10)
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"HELLO\00"
@str = [14 x i8] c"hello thread!\00"
define noalias i8* @thread_entry(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @pthread_self()
%3 = tail call i32 @pthread_detach(i32 %2)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @pthread_exit(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i8* undef
}
extern int gui_ksys_get_mouse_ruler_state(void) {
  int value;
  __asm__ __volatile__("int $0x40" : "=a"(value) : "a"(37), "b"(7));
  return (value);
}


x86 assembly (clang, -O0):
<gui_ksys_get_mouse_ruler_state>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    $0x25,%eax
mov    $0x7,%ebx
int    $0x40
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_ksys_get_mouse_ruler_state>:
push   %rbx
mov    $0x25,%eax
mov    $0x7,%ebx
int    $0x40
pop    %rbx
ret

LLVM IR (-O0):
define i32 @gui_ksys_get_mouse_ruler_state() {
%1 = alloca i32
%2 = call i32 asm sideeffect "int $$0x40", "={ax},{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 37, i32 7)
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @gui_ksys_get_mouse_ruler_state() {
%1 = tail call i32 asm sideeffect "int $$0x40", "={ax},{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 37, i32 7)
ret i32 %1
}
int main(int n) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0) {
ret i32 0
}
/* Variables and functions */
scalar_t__ time(int /*<<< orphan*/ *);
int /*<<< orphan*/ warnx(char *, int, long);
void whine(int sig) { warnx("caught signal %d at %ld", sig, (long)time(NULL)); }


x86 assembly (clang, -O0):
<whine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    -0x8(%rbp),%esi
mov    %rax,%rdx
lea    0xeb9(%rip),%rdi
call   1030 <warnx@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<whine>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
call   1040 <time@plt>
lea    0xecf(%rip),%rdi
mov    %ebx,%esi
mov    %rax,%rdx
pop    %rbx
jmp    1030 <warnx@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"caught signal %d at %ld\00"
define void @whine(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @time(i32* null)
%5 = call i32 @warnx(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %3, i64 %4)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"caught signal %d at %ld\00"
define void @whine(i32 %0) {
%2 = tail call i64 @time(i32* null)
%3 = tail call i32 @warnx(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %0, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stdout;
int main() {
  int x = 0;
  while (x < 20000000) {
    printf("..");
    fflush(stdout);
    sleep(3);
    x++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x1312d00,-0x8(%rbp)
jge    1185 <main+0x55>
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0x3,%edi
call   1050 <sleep@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1146 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    $0x1312d00,%ebp
lea    0xec0(%rip),%r14
mov    0x2e99(%rip),%rbx
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
mov    (%rbx),%edi
call   1040 <fflush@plt>
mov    $0x3,%edi
call   1050 <sleep@plt>
add    $0xffffffff,%ebp
jne    1150 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"..\00"
@stdout = global i32 0
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %7, %1 ]
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
%6 = tail call i32 @sleep(i32 3)
%7 = add nuw nsw i32 %2, 1
%8 = icmp eq i32 %7, 20000000
br i1 %8, label %9, label %1
9: ; preds = %1
ret i32 0
}
void init_dummy() { return; }


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

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

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

LLVM IR (-O2):
define void @init_dummy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ format_int(char *, int, unsigned int, int);
void itoa(char *str, unsigned n) { format_int(str, 15, n, 10); }


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

x86 assembly (clang, -O2):
<itoa>:
mov    %esi,%edx
mov    $0xf,%esi
mov    $0xa,%ecx
jmp    1030 <format_int@plt>

LLVM IR (-O0):
define void @itoa(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 @format_int(i8* %5, i32 15, i32 %6, i32 10)
ret void
}

LLVM IR (-O2):
define void @itoa(i8* %0, i32 %1) {
%3 = tail call i32 @format_int(i8* %0, i32 15, i32 %1, i32 10)
ret void
}
void sub() {
  asm volatile("popq %%rax\n\t"
               "subq %%rax, 0x8(%%rsp)\n\t" ::
                   :);
}


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

x86 assembly (clang, -O2):
<sub>:
pop    %rax
sub    %rax,0x8(%rsp)
ret

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

LLVM IR (-O2):
define void @sub() {
tail call void asm sideeffect "popq %rax\0A\09subq %rax, 0x8(%rsp)\0A\09", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("sizeof __int64_t = %d\n", sizeof(__int64_t));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"sizeof __int64_t = %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"sizeof __int64_t = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}
double linearInterpolation(double s, double e, double t) {
  return s + (e - s) * t;
}


x86 assembly (clang, -O0):
<linearInterpolation>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<linearInterpolation>:
subsd  %xmm0,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @linearInterpolation(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = load double, double* %4
%10 = fsub double %8, %9
%11 = load double, double* %6
%12 = call double @llvm.fmuladd.f64(double %10, double %11, double %7)
ret double %12
}

LLVM IR (-O2):
define double @linearInterpolation(double %0, double %1, double %2) {
%4 = fsub double %1, %0
%5 = tail call double @llvm.fmuladd.f64(double %4, double %2, double %0)
ret double %5
}
void foo610() {}


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

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

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

LLVM IR (-O2):
define void @foo610() {
ret void
}
int is_sorted(const int *ids, int n) {
  int i;
  if (n > 1) {
    for (i = 0; i < n - 1; i++) {
      if (ids[i] >= ids[i + 1]) {
        return 0;
      }
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_sorted>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jle    1172 <is_sorted+0x72>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    116d <is_sorted+0x6d>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
cmp    (%rcx,%rdx,4),%eax
jl     115a <is_sorted+0x5a>
movl   $0x0,-0x4(%rbp)
jmp    1179 <is_sorted+0x79>
jmp    115f <is_sorted+0x5f>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    111c <is_sorted+0x1c>
jmp    1172 <is_sorted+0x72>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_sorted>:
mov    $0x1,%eax
cmp    $0x2,%esi
jl     1129 <is_sorted+0x29>
add    $0xffffffff,%esi
xor    %ecx,%ecx
nop
cmp    %rcx,%rsi
je     1129 <is_sorted+0x29>
mov    (%rdi,%rcx,4),%r8d
lea    0x1(%rcx),%rdx
cmp    0x4(%rdi,%rcx,4),%r8d
mov    %rdx,%rcx
jl     1110 <is_sorted+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @is_sorted(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %17
4: ; preds = %2
%5 = add nsw i32 %1, -1
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %4, %10
%8 = phi i64 [ 0, %4 ], [ %13, %10 ]
%9 = icmp eq i64 %8, %6
br i1 %9, label %17, label %10
10: ; preds = %7
%11 = getelementptr inbounds i32, i32* %0, i64 %8
%12 = load i32, i32* %11
%13 = add nuw nsw i64 %8, 1
%14 = getelementptr inbounds i32, i32* %0, i64 %13
%15 = load i32, i32* %14
%16 = icmp slt i32 %12, %15
br i1 %16, label %7, label %17
17: ; preds = %7, %10, %2
%18 = phi i32 [ 1, %2 ], [ 1, %7 ], [ 0, %10 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printArray(long *arr, long n) {
  long i;
  for (i = 0; i < n; i++) {
    printf("%ld ", arr[i]);
  }
  printf("\n\n");
}


x86 assembly (clang, -O0):
<printArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1161 <printArray+0x51>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <printArray+0x18>
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
jle    1157 <printArray+0x37>
mov    %rsi,%r12
mov    %rdi,%r14
lea    0xec6(%rip),%r15
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printArray+0x20>
lea    0xea7(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%ld \00"
@str = [2 x i8] c"\0A\00"
define void @printArray(i64* nocapture %0, i64 %1) {
%3 = icmp sgt i64 %1, 0
br i1 %3, label %4, label %11
4: ; preds = %2, %4
%5 = phi i64 [ %9, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds i64, i64* %0, i64 %5
%7 = load i64, i64* %6
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %7)
%9 = add nuw nsw i64 %5, 1
%10 = icmp eq i64 %9, %1
br i1 %10, label %11, label %4
11: ; preds = %4, %2
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret void
}
int strcmp(const char *s1, const char *s2) {
  int d0, d1;
  register int __res;
  __asm__ __volatile__("1:\tlodsb\n\t"
                       "scasb\n\t"
                       "jne 2f\n\t"
                       "testb %%al,%%al\n\t"
                       "jne 1b\n\t"
                       "xorl %%eax,%%eax\n\t"
                       "jmp 3f\n"
                       "2:\tsbbl %%eax,%%eax\n\t"
                       "orb $1,%%al\n"
                       "3:"
                       : "=a"(__res), "=&S"(d0), "=&D"(d1)
                       : "1"(s1), "2"(s2));
  return __res;
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdi
lods   %ds:(%rsi),%al
scas   %es:(%rdi),%al
jne    112b <strcmp+0x2b>
test   %al,%al
jne    1114 <strcmp+0x14>
xor    %eax,%eax
jmp    112f <strcmp+0x2f>
sbb    %eax,%eax
or     $0x1,%al
mov    %eax,-0x1c(%rbp)
mov    %esi,%eax
mov    %eax,-0x14(%rbp)
mov    %edi,%eax
mov    %eax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
mov    %rsi,%rax
mov    %rdi,%rsi
mov    %rax,%rdi
lods   %ds:(%rsi),%al
scas   %es:(%rdi),%al
jne    1115 <strcmp+0x15>
test   %al,%al
jne    1109 <strcmp+0x9>
xor    %eax,%eax
jmp    1119 <strcmp+0x19>
sbb    %eax,%eax
or     $0x1,%al
ret

LLVM IR (-O0):
define i32 @strcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = call { i32, i8*, i8* } asm sideeffect "1:\09lodsb\0A\09scasb\0A\09jne 2f\0A\09testb %al,%al\0A\09jne 1b\0A\09xorl %eax,%eax\0A\09jmp 3f\0A2:\09sbbl %eax,%eax\0A\09orb $$1,%al\0A3:", "={ax},=&{si},=&{di},1,2,~{dirflag},~{fpsr},~{flags}"(i8* %8, i8* %9)
%11 = extractvalue { i32, i8*, i8* } %10, 0
%12 = extractvalue { i32, i8*, i8* } %10, 1
%13 = extractvalue { i32, i8*, i8* } %10, 2
store i32 %11, i32* %7
%14 = ptrtoint i8* %12 to i64
%15 = trunc i64 %14 to i32
store i32 %15, i32* %5
%16 = ptrtoint i8* %13 to i64
%17 = trunc i64 %16 to i32
store i32 %17, i32* %6
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
define i32 @strcmp(i8* %0, i8* %1) {
%3 = tail call { i32, i8*, i8* } asm sideeffect "1:\09lodsb\0A\09scasb\0A\09jne 2f\0A\09testb %al,%al\0A\09jne 1b\0A\09xorl %eax,%eax\0A\09jmp 3f\0A2:\09sbbl %eax,%eax\0A\09orb $$1,%al\0A3:", "={ax},=&{si},=&{di},1,2,~{dirflag},~{fpsr},~{flags}"(i8* %0, i8* %1)
%4 = extractvalue { i32, i8*, i8* } %3, 0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ err_sys(char *);
scalar_t__ listen(int, int);
void Listen(int sockfd, int backlog) {
  if (listen(sockfd, backlog) < 0)
    err_sys("listen error");
}


x86 assembly (clang, -O0):
<Listen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <listen@plt>
cmp    $0x0,%rax
jge    114f <Listen+0x2f>
lea    0xeb6(%rip),%rdi
call   1030 <err_sys@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Listen>:
push   %rax
call   1040 <listen@plt>
test   %rax,%rax
js     112d <Listen+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1030 <err_sys@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"listen error\00"
define void @Listen(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i64 @listen(i32 %5, i32 %6)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @err_sys(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"listen error\00"
define void @Listen(i32 %0, i32 %1) {
%3 = tail call i64 @listen(i32 %0, i32 %1)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @err_sys(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
scalar_t__ getline_(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverse_(char *);
int main() {
  char line[256];
  while (getline_(line, 256) > 0) {
    reverse_(line);
    printf("%s", line);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x110(%rbp),%rdi
mov    $0x100,%esi
call   1050 <getline_@plt>
cmp    $0x0,%rax
jle    1181 <main+0x51>
lea    -0x110(%rbp),%rdi
call   1040 <reverse_@plt>
lea    -0x110(%rbp),%rsi
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
jmp    1142 <main+0x12>
mov    -0x4(%rbp),%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %rsp,%rdi
mov    $0x100,%esi
call   1050 <getline_@plt>
test   %rax,%rax
jle    1185 <main+0x55>
mov    %rsp,%rbx
lea    0xeaa(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1040 <reverse_@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x100,%esi
call   1050 <getline_@plt>
test   %rax,%rax
jg     1160 <main+0x30>
xor    %eax,%eax
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i64 @getline_(i8* %2, i32 256)
%4 = icmp sgt i64 %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 i64 @getline_(i8* %2, i32 256)
%9 = icmp sgt i64 %8, 0
br i1 %9, label %5, label %10
10: ; preds = %5, %0
ret i32 0
}