xunge/DecIR huggingface dataset:
int CheckForHeader(const unsigned char *p) {
  if (p[0] == 'S' && p[1] == 'C' && p[2] == 'P' && p[3] == 'E') {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<CheckForHeader>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x53,%eax
jne    1157 <CheckForHeader+0x57>
mov    -0x10(%rbp),%rax
movzbl 0x1(%rax),%eax
cmp    $0x43,%eax
jne    1157 <CheckForHeader+0x57>
mov    -0x10(%rbp),%rax
movzbl 0x2(%rax),%eax
cmp    $0x50,%eax
jne    1157 <CheckForHeader+0x57>
mov    -0x10(%rbp),%rax
movzbl 0x3(%rax),%eax
cmp    $0x45,%eax
jne    1157 <CheckForHeader+0x57>
movl   $0x1,-0x4(%rbp)
jmp    115e <CheckForHeader+0x5e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CheckForHeader>:
cmpb   $0x53,(%rdi)
jne    111c <CheckForHeader+0x1c>
cmpb   $0x43,0x1(%rdi)
jne    111c <CheckForHeader+0x1c>
cmpb   $0x50,0x2(%rdi)
jne    111c <CheckForHeader+0x1c>
mov    $0x1,%eax
cmpb   $0x45,0x3(%rdi)
je     111e <CheckForHeader+0x1e>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @CheckForHeader(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = icmp eq i32 %7, 83
br i1 %8, label %9, label %28
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = icmp eq i32 %13, 67
br i1 %14, label %15, label %28
15: ; preds = %9
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 2
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = icmp eq i32 %19, 80
br i1 %20, label %21, label %28
21: ; preds = %15
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i64 3
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = icmp eq i32 %25, 69
br i1 %26, label %27, label %28
27: ; preds = %21
store i32 1, i32* %2
br label %29
28: ; preds = %21, %15, %9, %1
store i32 0, i32* %2
br label %29
29: ; preds = %28, %27
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
define i32 @CheckForHeader(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 83
br i1 %3, label %4, label %16
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 67
br i1 %7, label %8, label %16
8: ; preds = %4
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 80
br i1 %11, label %12, label %16
12: ; preds = %8
%13 = getelementptr inbounds i8, i8* %0, i64 3
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 69
br i1 %15, label %17, label %16
16: ; preds = %12, %8, %4, %1
br label %17
17: ; preds = %12, %16
%18 = phi i32 [ 0, %16 ], [ 1, %12 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ nsblk_spam_who(int);
void nsblk_spam_who8(void) { nsblk_spam_who(8); }


x86 assembly (clang, -O0):
<nsblk_spam_who8>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8,%edi
call   1030 <nsblk_spam_who@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nsblk_spam_who8>:
mov    $0x8,%edi
jmp    1030 <nsblk_spam_who@plt>

LLVM IR (-O0):
define void @nsblk_spam_who8() {
%1 = call i32 @nsblk_spam_who(i32 8)
ret void
}

LLVM IR (-O2):
define void @nsblk_spam_who8() {
%1 = tail call i32 @nsblk_spam_who(i32 8)
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
scalar_t__ _MULx(scalar_t__, scalar_t__);
uint8_t _MULxPOW(uint8_t V, uint8_t i, uint8_t c) {
  if (i == 0)
    return V;
  else
    return _MULx(_MULxPOW(V, i - 1, c), c);
}


x86 assembly (clang, -O0):
<_MULxPOW>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    114c <_MULxPOW+0x2c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1171 <_MULxPOW+0x51>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
sub    $0x1,%rsi
mov    -0x20(%rbp),%rdx
call   1030 <_MULxPOW@plt>
mov    %rax,%rdi
mov    -0x20(%rbp),%rsi
call   1040 <_MULx@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_MULxPOW>:
test   %rsi,%rsi
je     113e <_MULxPOW+0x1e>
push   %rbx
mov    %rdx,%rbx
add    $0xffffffffffffffff,%rsi
call   1030 <_MULxPOW@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <_MULx@plt>
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @_MULxPOW(i64 %0, i64 %1, i64 %2) {
%4 = icmp eq i64 %1, 0
br i1 %4, label %5, label %7
5: ; preds = %3, %7
%6 = phi i64 [ %10, %7 ], [ %0, %3 ]
ret i64 %6
7: ; preds = %3
%8 = add nsw i64 %1, -1
%9 = tail call i64 @_MULxPOW(i64 %0, i64 %8, i64 %2)
%10 = tail call i64 @_MULx(i64 %9, i64 %2)
br label %5
}
/* Variables and functions */
int /*<<< orphan*/ RAND_add(void const *, int, double);
void mongoc_rand_add(const void *buf, int num, double entropy) {
  RAND_add(buf, num, entropy);
}


x86 assembly (clang, -O0):
<mongoc_rand_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
movsd  -0x18(%rbp),%xmm0
call   1030 <RAND_add@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mongoc_rand_add>:
jmp    1030 <RAND_add@plt>

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

LLVM IR (-O2):
define void @mongoc_rand_add(i8* %0, i32 %1, double %2) {
%4 = tail call i32 @RAND_add(i8* %0, i32 %1, double %2)
ret void
}
void output_markup_string(s) char *s;
{
  while (*s)
    output_char((unsigned char)*s++, '!');
}


x86 assembly (clang, -O0):
<output_markup_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114c <output_markup_string+0x3c>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%edi
mov    $0x21,%esi
mov    $0x0,%al
call   1030 <output_char@plt>
jmp    111c <output_markup_string+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_markup_string>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     113a <output_markup_string+0x2a>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movzbl %al,%edi
mov    $0x21,%esi
xor    %eax,%eax
call   1030 <output_char@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <output_markup_string+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @output_markup_string(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %7, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %2
%10 = load i8, i8* %8
%11 = zext i8 %10 to i32
%12 = call i32 (i32, i32, ...) bitcast (i32 (...)* @output_char to i32 (i32, i32, ...)*)(i32 %11, i32 33)
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @output_markup_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = zext i8 %5 to i32
%9 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @output_char to i32 (i32, i32, ...)*)(i32 %8, i32 33)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sendCommand(unsigned char, int, unsigned char, unsigned char,
                               unsigned char);
void LivingColors_setLampColourHSV(unsigned char index, unsigned char h,
                                   unsigned char s, unsigned char v) {
  sendCommand(index, 0x03, h, s, v);
}


x86 assembly (clang, -O0):
<LivingColors_setLampColourHSV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cl,%al
mov    %dl,%cl
mov    %sil,%dl
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %dl,-0x2(%rbp)
mov    %cl,-0x3(%rbp)
mov    %al,-0x4(%rbp)
mov    -0x1(%rbp),%dl
mov    -0x2(%rbp),%cl
mov    -0x3(%rbp),%al
mov    $0x3,%esi
movzbl %dl,%edi
movzbl %cl,%edx
movzbl %al,%ecx
movzbl -0x4(%rbp),%r8d
call   1030 <sendCommand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LivingColors_setLampColourHSV>:
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    $0x3,%esi
jmp    1030 <sendCommand@plt>

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

LLVM IR (-O2):
define void @LivingColors_setLampColourHSV(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
%5 = tail call i32 @sendCommand(i8 zeroext %0, i32 3, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3)
ret void
}
/* Variables and functions */
size_t backtrace(void **, int);
int /*<<< orphan*/ backtrace_symbols_fd(void **, size_t, int);
void print_stack_trace(int fd) {
  void *array[256];
  size_t size;
  size = backtrace(array, 256);
  backtrace_symbols_fd(array, size, fd);
}


x86 assembly (clang, -O0):
<print_stack_trace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x820,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x810(%rbp),%rdi
mov    $0x100,%esi
call   1040 <backtrace@plt>
mov    %rax,-0x818(%rbp)
lea    -0x810(%rbp),%rdi
mov    -0x818(%rbp),%rsi
mov    -0x4(%rbp),%edx
call   1030 <backtrace_symbols_fd@plt>
add    $0x820,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_stack_trace>:
push   %r14
push   %rbx
sub    $0x808,%rsp
mov    %edi,%ebx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x100,%esi
call   1040 <backtrace@plt>
mov    %r14,%rdi
mov    %rax,%rsi
mov    %ebx,%edx
call   1030 <backtrace_symbols_fd@plt>
add    $0x808,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @print_stack_trace(i32 %0) {
%2 = alloca i32
%3 = alloca [256 x i8*]
%4 = alloca i64
store i32 %0, i32* %2
%5 = getelementptr inbounds [256 x i8*], [256 x i8*]* %3, i64 0, i64 0
%6 = call i64 @backtrace(i8** %5, i32 256)
store i64 %6, i64* %4
%7 = getelementptr inbounds [256 x i8*], [256 x i8*]* %3, i64 0, i64 0
%8 = load i64, i64* %4
%9 = load i32, i32* %2
%10 = call i32 @backtrace_symbols_fd(i8** %7, i64 %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @print_stack_trace(i32 %0) {
%2 = alloca [256 x i8*]
%3 = bitcast [256 x i8*]* %2 to i8*
%4 = getelementptr inbounds [256 x i8*], [256 x i8*]* %2, i64 0, i64 0
%5 = call i64 @backtrace(i8** %4, i32 256)
%6 = call i32 @backtrace_symbols_fd(i8** %4, i64 %5, i32 %0)
ret void
}
int getFrequency() { return (int)1000000; }


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

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

LLVM IR (-O0):
define i32 @getFrequency() {
ret i32 1000000
}

LLVM IR (-O2):
define i32 @getFrequency() {
ret i32 1000000
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void cierraSocket(void *numSocket) { close(*((int *)numSocket)); }


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

x86 assembly (clang, -O2):
<cierraSocket>:
mov    (%rdi),%edi
jmp    1030 <close@plt>

LLVM IR (-O0):
define void @cierraSocket(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = call i32 @close(i32 %5)
ret void
}

LLVM IR (-O2):
define void @cierraSocket(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @close(i32 %3)
ret void
}
/* Variables and functions */
int stub1();
bool testClosureVrZ(bool (*closure)(void)) {
  return closure != NULL ? (*closure)() : (bool)0;
}


x86 assembly (clang, -O0):
<testClosureVrZ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1122 <testClosureVrZ+0x22>
call   *-0x8(%rbp)
mov    %eax,-0xc(%rbp)
jmp    112c <testClosureVrZ+0x2c>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    112c <testClosureVrZ+0x2c>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureVrZ>:
test   %rdi,%rdi
je     1107 <testClosureVrZ+0x7>
jmp    *%rdi
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @testClosureVrZ(i32 ()* %0) {
%2 = icmp eq i32 ()* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 %0()
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
void RestoreThreadPriority(int priority) {}


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

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

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

LLVM IR (-O2):
define void @RestoreThreadPriority(i32 %0) {
ret void
}
void ARGBQuantizeRow_SSE2() {}


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

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

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

LLVM IR (-O2):
define void @ARGBQuantizeRow_SSE2() {
ret void
}
int inode_supports_fast_mode(struct inode *inode) { return 0; }


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

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

LLVM IR (-O0):
%struct.inode = type opaque
define i32 @inode_supports_fast_mode(%struct.inode* %0) {
%2 = alloca %struct.inode*
store %struct.inode* %0, %struct.inode** %2
ret i32 0
}

LLVM IR (-O2):
%struct.inode = type opaque
define i32 @inode_supports_fast_mode(%struct.inode* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
__attribute__((hotpatch(1))) __attribute__((always_)) void hp9(void) {
  printf("hello, world!\n");
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"hello, world!\0A\00"
define void @hp9() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [14 x i8] c"hello, world!\00"
define void @hp9() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
void flushWindows(depth) {
  if (depth == 0)
    return;
  flushWindows(depth - 1);
}


x86 assembly (clang, -O0):
<flushWindows>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    112a <flushWindows+0x1a>
jmp    1135 <flushWindows+0x25>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <flushWindows@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @flushWindows(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 1
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @flushWindows(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mpfr_srcptr;
typedef int /*<<< orphan*/ mpfr_ptr;

/* Variables and functions */
int /*<<< orphan*/ MPFR_RNDN;
int mpfr_pow(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
             int /*<<< orphan*/);
int p1788_fwd_pow_2(mpfr_ptr rop, mpfr_srcptr op, const void *env) {
  mpfr_srcptr op1 = (mpfr_srcptr)env;
  return mpfr_pow(rop, op1, op, MPFR_RNDN);
}


x86 assembly (clang, -O0):
<p1788_fwd_pow_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    0x2eaf(%rip),%rax
mov    (%rax),%ecx
call   1030 <mpfr_pow@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p1788_fwd_pow_2>:
mov    %esi,%eax
mov    0x2ecf(%rip),%rcx
mov    (%rcx),%ecx
mov    %edx,%esi
mov    %eax,%edx
jmp    1030 <mpfr_pow@plt>

LLVM IR (-O0):
@MPFR_RNDN = global i32 0
define i32 @p1788_fwd_pow_2(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = ptrtoint i8* %8 to i32
store i32 %9, i32* %7
%10 = load i32, i32* %4
%11 = load i32, i32* %7
%12 = load i32, i32* %5
%13 = load i32, i32* @MPFR_RNDN
%14 = call i32 @mpfr_pow(i32 %10, i32 %11, i32 %12, i32 %13)
ret i32 %14
}

LLVM IR (-O2):
@MPFR_RNDN = global i32 0
define i32 @p1788_fwd_pow_2(i32 %0, i32 %1, i8* %2) {
%4 = ptrtoint i8* %2 to i64
%5 = trunc i64 %4 to i32
%6 = load i32, i32* @MPFR_RNDN
%7 = tail call i32 @mpfr_pow(i32 %0, i32 %5, i32 %1, i32 %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void two(void) { printf("two\n"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"two\0A\00"
define void @two() {
%1 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [4 x i8] c"two\00"
define void @two() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void mat_dump32(const char *s, const uint32_t *vec, unsigned len) {
  ((void)s);
  ((void)vec);
  ((void)len);
}


x86 assembly (clang, -O0):
<mat_dump32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @mat_dump32(i8* nocapture %0, i32* nocapture %1, i32 %2) {
ret void
}
/* Variables and functions */
int _system(char *);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("%d\n", _system("ls -lah"));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [8 x i8] c"ls -lah\00"
define i32 @main() {
%1 = tail call i32 @_system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int iscntrl(const int c) { return (unsigned int)c < 0x20 || c == 0x7F; }


x86 assembly (clang, -O0):
<iscntrl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jb     1120 <iscntrl+0x20>
cmpl   $0x7f,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iscntrl>:
cmp    $0x20,%edi
setb   %al
cmp    $0x7f,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @iscntrl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ult i32 %3, 32
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 127
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @iscntrl(i32 %0) {
%2 = icmp ult i32 %0, 32
%3 = icmp eq i32 %0, 127
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int scanf(char *, int *);
int /*<<< orphan*/ stderr;
void checkInput(int *number) {
  if ((scanf("%d", number)) != 1) {
    fprintf(stderr, "Wrong input values!");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<checkInput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1040 <scanf@plt>
cmp    $0x1,%eax
je     1178 <checkInput+0x48>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
lea    0xe9e(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e67(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkInput>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    1147 <checkInput+0x17>
pop    %rax
ret
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xeac(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@stderr = global i32 0
@.str.1 = [20 x i8] c"Wrong input values!\00"
@EXIT_FAILURE = global i32 0
define void @checkInput(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%5 = icmp ne i32 %4, 1
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
11: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@stderr = global i32 0
@.str.1 = [20 x i8] c"Wrong input values!\00"
@EXIT_FAILURE = global i32 0
define void @checkInput(i32* %0) {
%2 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %0)
%3 = icmp eq i32 %2, 1
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret void
}
/* Variables and functions */
unsigned char tolower(unsigned char c) {
  if (((c) >= 'A' && (c) <= 'Z'))
    c -= 'A' - 'a';
  return c;
}


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     112e <tolower+0x2e>
movzbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
jg     112e <tolower+0x2e>
movzbl -0x1(%rbp),%eax
sub    $0xffffffe0,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
lea    -0x41(%rdi),%eax
lea    0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @tolower(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = icmp sle i32 %8, 90
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i8, i8* %2
%12 = zext i8 %11 to i32
%13 = sub nsw i32 %12, -32
%14 = trunc i32 %13 to i8
store i8 %14, i8* %2
br label %15
15: ; preds = %10, %6, %1
%16 = load i8, i8* %2
ret i8 %16
}

LLVM IR (-O2):
define zeroext i8 @tolower(i8 zeroext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, 32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
int drm_order(unsigned long size) {}


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

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

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

LLVM IR (-O2):
define i32 @drm_order(i64 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ setNoncanonicalMode(int /*<<< orphan*/, int);
void setRaceMode() { setNoncanonicalMode(0, 1); }


x86 assembly (clang, -O0):
<setRaceMode>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <setNoncanonicalMode@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setRaceMode>:
xor    %edi,%edi
mov    $0x1,%esi
jmp    1030 <setNoncanonicalMode@plt>

LLVM IR (-O0):
define void @setRaceMode() {
%1 = call i32 @setNoncanonicalMode(i32 0, i32 1)
ret void
}

LLVM IR (-O2):
define void @setRaceMode() {
%1 = tail call i32 @setNoncanonicalMode(i32 0, i32 1)
ret void
}
void module1_section3_topic9() {}


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

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

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

LLVM IR (-O2):
define void @module1_section3_topic9() {
ret void
}
/* Type definitions */
struct ev_loop {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ev_loop_run(struct ev_loop *);
void *thread_adapter(void *arg) {
  struct ev_loop *ev = (struct ev_loop *)arg;
  ev_loop_run(ev);
  return NULL;
}


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

x86 assembly (clang, -O2):
<thread_adapter>:
push   %rax
call   1030 <ev_loop_run@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.ev_loop = type { i32 }
define i8* @thread_adapter(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.ev_loop*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.ev_loop*
store %struct.ev_loop* %5, %struct.ev_loop** %3
%6 = load %struct.ev_loop*, %struct.ev_loop** %3
%7 = call i32 @ev_loop_run(%struct.ev_loop* %6)
ret i8* null
}

LLVM IR (-O2):
%struct.ev_loop = type { i32 }
define noalias i8* @thread_adapter(i8* %0) {
%2 = bitcast i8* %0 to %struct.ev_loop*
%3 = tail call i32 @ev_loop_run(%struct.ev_loop* %2)
ret i8* null
}
int findNextChar(const char *data, int len, char lookFor) {
  const char *start = data;
  while (len > 0) {
    if (*data == lookFor)
      return data - start;
    data++;
    len--;
  }
  return -1;
}


x86 assembly (clang, -O0):
<findNextChar>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %al,-0x15(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1162 <findNextChar+0x62>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x15(%rbp),%ecx
cmp    %ecx,%eax
jne    1148 <findNextChar+0x48>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x4(%rbp)
jmp    1169 <findNextChar+0x69>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1118 <findNextChar+0x18>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<findNextChar>:
mov    $0xffffffff,%eax
test   %esi,%esi
jle    1121 <findNextChar+0x21>
add    $0x1,%esi
xor    %ecx,%ecx
xchg   %ax,%ax
cmp    %dl,(%rdi,%rcx,1)
je     1122 <findNextChar+0x22>
add    $0x1,%rcx
add    $0xffffffff,%esi
cmp    $0x1,%esi
jg     1110 <findNextChar+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @findNextChar(i8* %0, i32 %1, i8 signext %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %19
5: ; preds = %3, %15
%6 = phi i8* [ %16, %15 ], [ %0, %3 ]
%7 = phi i32 [ %17, %15 ], [ %1, %3 ]
%8 = load i8, i8* %6
%9 = icmp eq i8 %8, %2
br i1 %9, label %10, label %15
10: ; preds = %5
%11 = ptrtoint i8* %6 to i64
%12 = ptrtoint i8* %0 to i64
%13 = sub i64 %11, %12
%14 = trunc i64 %13 to i32
br label %19
15: ; preds = %5
%16 = getelementptr inbounds i8, i8* %6, i64 1
%17 = add nsw i32 %7, -1
%18 = icmp sgt i32 %7, 1
br i1 %18, label %5, label %19
19: ; preds = %15, %3, %10
%20 = phi i32 [ %14, %10 ], [ -1, %3 ], [ -1, %15 ]
ret i32 %20
}
getdtablesize() { return 50; }


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

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

LLVM IR (-O0):
define i32 @getdtablesize() {
ret i32 50
}

LLVM IR (-O2):
define i32 @getdtablesize() {
ret i32 50
}
/* Variables and functions */
int /*<<< orphan*/ externFunction();
int /*<<< orphan*/ plainFunction();
int /*<<< orphan*/ privateExternFunction();
int /*<<< orphan*/ staticFunction();
int main() {
  plainFunction();
  externFunction();
  privateExternFunction();
  staticFunction();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <plainFunction@plt>
xor    %eax,%eax
call   1040 <externFunction@plt>
xor    %eax,%eax
call   1060 <privateExternFunction@plt>
xor    %eax,%eax
call   1050 <staticFunction@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @plainFunction()
%3 = call i32 (...) @externFunction()
%4 = call i32 (...) @privateExternFunction()
%5 = call i32 (...) @staticFunction()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @plainFunction()
%2 = tail call i32 (...) @externFunction()
%3 = tail call i32 (...) @privateExternFunction()
%4 = tail call i32 (...) @staticFunction()
ret i32 0
}
int IsInteger(double num) {
  return ((long long)num - num) < 0.000000001 &&
                 (num - (long long)num) < 0.000000001
             ? 1
             : 0;
}


x86 assembly (clang, -O0):
<IsInteger>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%rax
cvtsi2sd %rax,%xmm1
subsd  -0x8(%rbp),%xmm1
xor    %eax,%eax
movsd  0xedd(%rip),%xmm0
ucomisd %xmm1,%xmm0
mov    %al,-0x9(%rbp)
jbe    1156 <IsInteger+0x56>
movsd  -0x8(%rbp),%xmm1
cvttsd2si -0x8(%rbp),%rax
cvtsi2sd %rax,%xmm0
subsd  %xmm0,%xmm1
movsd  0xeb4(%rip),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsInteger>:
cvttsd2si %xmm0,%rax
cvtsi2sd %rax,%xmm1
movapd %xmm1,%xmm2
subsd  %xmm0,%xmm2
movsd  0xee6(%rip),%xmm3
ucomisd %xmm2,%xmm3
seta   %al
subsd  %xmm1,%xmm0
ucomisd %xmm0,%xmm3
seta   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @IsInteger(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptosi double %3 to i64
%5 = sitofp i64 %4 to double
%6 = load double, double* %2
%7 = fsub double %5, %6
%8 = fcmp olt double %7, 1.000000e-09
br i1 %8, label %9, label %16
9: ; preds = %1
%10 = load double, double* %2
%11 = load double, double* %2
%12 = fptosi double %11 to i64
%13 = sitofp i64 %12 to double
%14 = fsub double %10, %13
%15 = fcmp olt double %14, 1.000000e-09
br label %16
16: ; preds = %9, %1
%17 = phi i1 [ false, %1 ], [ %15, %9 ]
%18 = zext i1 %17 to i64
%19 = select i1 %17, i32 1, i32 0
ret i32 %19
}

LLVM IR (-O2):
define i32 @IsInteger(double %0) {
%2 = fptosi double %0 to i64
%3 = sitofp i64 %2 to double
%4 = fsub double %3, %0
%5 = fcmp olt double %4, 1.000000e-09
%6 = fsub double %0, %3
%7 = fcmp olt double %6, 1.000000e-09
%8 = and i1 %5, %7
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
char *strrchr(char const *, int);
int lastIndexOf(const char *s, int c) {
  char *last = strrchr(s, c);
  if (last)
    return last - s;
  else
    return -1;
}


x86 assembly (clang, -O0):
<lastIndexOf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <strrchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     114d <lastIndexOf+0x3d>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x4(%rbp)
jmp    1154 <lastIndexOf+0x44>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lastIndexOf>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strrchr@plt>
mov    %eax,%ecx
sub    %ebx,%ecx
cmp    $0x1,%rax
sbb    %eax,%eax
or     %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @lastIndexOf(i8* %0, i32 %1) {
%3 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i32 %1)
%4 = icmp eq i8* %3, null
%5 = ptrtoint i8* %3 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = trunc i64 %7 to i32
%9 = select i1 %4, i32 -1, i32 %8
ret i32 %9
}
/* Variables and functions */
int strlen(char *);
void str_chop(char *str) {
  if (strlen(str) > 0) {
    *(str + strlen(str) - 1) = '\0';
  }
}


x86 assembly (clang, -O0):
<str_chop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%eax
jle    114d <str_chop+0x3d>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
movb   $0x0,-0x1(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_chop>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
jle    112c <str_chop+0x1c>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
movb   $0x0,-0x1(%rbx,%rax,1)
pop    %rbx
ret

LLVM IR (-O0):
define void @str_chop(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strlen(i8* %3)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = load i8*, i8** %2
%9 = call i32 @strlen(i8* %8)
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %7, i64 %10
%12 = getelementptr inbounds i8, i8* %11, i64 -1
store i8 0, i8* %12
br label %13
13: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
define void @str_chop(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = tail call i32 @strlen(i8* %0)
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = getelementptr inbounds i8, i8* %7, i64 -1
store i8 0, i8* %8
br label %9
9: ; preds = %4, %1
ret void
}
/* Variables and functions */
long double unpack754(unsigned long long, int, int);
unsigned long long unpacku32(unsigned char *);
extern long double deserialize_float32(unsigned char *buf) {
  unsigned long long int fhold = unpacku32(buf);
  return ((unpack754((fhold), 32, 8)));
}


x86 assembly (clang, -O0):
<deserialize_float32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <unpacku32@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x20,%esi
mov    $0x8,%edx
call   1040 <unpack754@plt>
fld    %st(0)
fstp   %st(0)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deserialize_float32>:
push   %rax
call   1030 <unpacku32@plt>
mov    %rax,%rdi
mov    $0x20,%esi
mov    $0x8,%edx
pop    %rax
jmp    1040 <unpack754@plt>

LLVM IR (-O0):
define x86_fp80 @deserialize_float32(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @unpacku32(i8* %4)
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = call x86_fp80 @unpack754(i64 %6, i32 32, i32 8)
ret x86_fp80 %7
}

LLVM IR (-O2):
define x86_fp80 @deserialize_float32(i8* %0) {
%2 = tail call i64 @unpacku32(i8* %0)
%3 = tail call x86_fp80 @unpack754(i64 %2, i32 32, i32 8)
ret x86_fp80 %3
}
int HelpItem39(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem39() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_empty_graph();
int /*<<< orphan*/ test_simple_graph();
int main() {
  test_empty_graph();
  test_simple_graph();
  return 1;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_empty_graph()
%2 = tail call i32 (...) @test_simple_graph()
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
void Array2DTest(float *arr) {
  float x = *arr + *(arr + 1) + *(arr + 2) + *(arr + 3);
  printf("X is = %f ", x);
}


x86 assembly (clang, -O0):
<Array2DTest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
addss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
addss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
addss  0xc(%rax),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Array2DTest>:
movss  (%rdi),%xmm0
addss  0x4(%rdi),%xmm0
addss  0x8(%rdi),%xmm0
addss  0xc(%rdi),%xmm0
lea    0xed6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"X is = %f \00"
define void @Array2DTest(float* %0) {
%2 = alloca float*
%3 = alloca float
store float* %0, float** %2
%4 = load float*, float** %2
%5 = load float, float* %4
%6 = load float*, float** %2
%7 = getelementptr inbounds float, float* %6, i64 1
%8 = load float, float* %7
%9 = fadd float %5, %8
%10 = load float*, float** %2
%11 = getelementptr inbounds float, float* %10, i64 2
%12 = load float, float* %11
%13 = fadd float %9, %12
%14 = load float*, float** %2
%15 = getelementptr inbounds float, float* %14, i64 3
%16 = load float, float* %15
%17 = fadd float %13, %16
store float %17, float* %3
%18 = load float, float* %3
%19 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), float %18)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"X is = %f \00"
define void @Array2DTest(float* nocapture %0) {
%2 = load float, float* %0
%3 = getelementptr inbounds float, float* %0, i64 1
%4 = load float, float* %3
%5 = fadd float %2, %4
%6 = getelementptr inbounds float, float* %0, i64 2
%7 = load float, float* %6
%8 = fadd float %5, %7
%9 = getelementptr inbounds float, float* %0, i64 3
%10 = load float, float* %9
%11 = fadd float %8, %10
%12 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), float %11)
ret void
}
void swap(int *head, int i, int j) {
  int temp = head[i];
  head[i] = head[j];
  head[j] = 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
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void upper_hook_pre(char **s) { printf("to_upper called on '%s'\n", *s); }


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

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

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

LLVM IR (-O2):
@.str = [25 x i8] c"to_upper called on '%s'\0A\00"
define void @upper_hook_pre(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
int ft_strlen(char *str) {
  int index;
  index = 0;
  while (str[index] != '\0') {
    index++;
  }
  return (index);
}


x86 assembly (clang, -O0):
<ft_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <ft_strlen+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <ft_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <ft_strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @ft_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
void __RightAfterISR1Handler(void) {}


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

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

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

LLVM IR (-O2):
define void @__RightAfterISR1Handler() {
ret void
}