xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int join(int join) {
  if (join < 0 || join > 2)
    return (1);
  printf("K%d\n", join);
  return (0);
}


x86 assembly (clang, -O0):
<join>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     112f <join+0x1f>
cmpl   $0x2,-0x8(%rbp)
jle    113b <join+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    1151 <join+0x41>
mov    -0x8(%rbp),%esi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<join>:
mov    $0x1,%eax
cmp    $0x2,%edi
ja     112f <join+0x1f>
push   %rax
mov    %edi,%esi
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"K%d\0A\00"
define i32 @join(i32 %0) {
%2 = icmp ugt i32 %0, 2
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ 0, %3 ], [ 1, %1 ]
ret i32 %6
}
void AmiSetQword56ToLe(void *pAddr_p, long long int qwQwordVal_p) {
  ((unsigned long int *)pAddr_p)[0] = ((unsigned long int *)&qwQwordVal_p)[0];
  ((unsigned short int *)pAddr_p)[2] = ((unsigned short int *)&qwQwordVal_p)[2];
  ((unsigned char *)pAddr_p)[6] = ((unsigned char *)&qwQwordVal_p)[6];
}


x86 assembly (clang, -O0):
<AmiSetQword56ToLe>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0xc(%rbp),%cx
mov    -0x8(%rbp),%rax
mov    %cx,0x4(%rax)
mov    -0xa(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x6(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<AmiSetQword56ToLe>:
mov    %rsi,%rax
shr    $0x20,%rax
mov    %rsi,(%rdi)
shr    $0x30,%rsi
mov    %ax,0x4(%rdi)
mov    %sil,0x6(%rdi)
ret

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

LLVM IR (-O2):
define void @AmiSetQword56ToLe(i8* nocapture writeonly %0, i64 %1) {
%3 = lshr i64 %1, 32
%4 = trunc i64 %3 to i16
%5 = lshr i64 %1, 48
%6 = trunc i64 %5 to i8
%7 = bitcast i8* %0 to i64*
store i64 %1, i64* %7
%8 = getelementptr inbounds i8, i8* %0, i64 4
%9 = bitcast i8* %8 to i16*
store i16 %4, i16* %9
%10 = getelementptr inbounds i8, i8* %0, i64 6
store i8 %6, i8* %10
ret void
}
_Noreturn void forever(void) {
  int i = 0;
  while (1)
    i++;
}


x86 assembly (clang, -O0):
<forever>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    %eax,-0x4(%rbp)
jmp    110b <forever+0xb>

x86 assembly (clang, -O2):
<forever>:
jmp    1100 <forever>

LLVM IR (-O0):
define void @forever() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = load i32, i32* %1
%4 = add nsw i32 %3, 1
store i32 %4, i32* %1
br label %2
}

LLVM IR (-O2):
define void @forever() {
br label %1
1: ; preds = %1, %0
br label %1
}
void test___atomic_fetch_xor_0(char *mem) { __atomic_fetch_xor(mem, -1, 4); }


x86 assembly (clang, -O0):
<test___atomic_fetch_xor_0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movb   $0xff,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    %cl,-0xc(%rbp)
mov    (%rax),%al
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%al
mov    -0x18(%rbp),%rcx
mov    -0xc(%rbp),%sil
mov    %al,%dl
xor    %sil,%dl
lock cmpxchg %dl,(%rcx)
sete   %cl
mov    %al,-0x19(%rbp)
test   $0x1,%cl
mov    %al,-0xb(%rbp)
jne    114a <test___atomic_fetch_xor_0+0x4a>
jmp    111f <test___atomic_fetch_xor_0+0x1f>
mov    -0x19(%rbp),%al
mov    %al,-0xa(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test___atomic_fetch_xor_0>:
lock xorb $0xff,(%rdi)
ret

LLVM IR (-O0):
define void @test___atomic_fetch_xor_0(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i8
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8 -1, i8* %3
%6 = load i8, i8* %3
%7 = atomicrmw xor i8* %5, i8 %6 acq_rel
store i8 %7, i8* %4
%8 = load i8, i8* %4
ret void
}

LLVM IR (-O2):
define void @test___atomic_fetch_xor_0(i8* nocapture %0) {
%2 = atomicrmw xor i8* %0, i8 -1 acq_rel
ret void
}
int count_of_char(char *s, char c) {
  int count = 0;
  while (*s) {
    if (c == *s) {
      count++;
    }
    s++;
  }
  return count;
}


x86 assembly (clang, -O0):
<count_of_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114f <count_of_char+0x4f>
movsbl -0x9(%rbp),%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    113e <count_of_char+0x3e>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1115 <count_of_char+0x15>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_of_char>:
mov    (%rdi),%cl
test   %cl,%cl
je     1126 <count_of_char+0x26>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
xor    %edx,%edx
cmp    %sil,%cl
sete   %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <count_of_char+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @count_of_char(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i32 [ %11, %5 ], [ 0, %2 ]
%8 = phi i8* [ %12, %5 ], [ %0, %2 ]
%9 = icmp eq i8 %6, %1
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %7, %10
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ 0, %2 ], [ %11, %5 ]
ret i32 %16
}
void apr_unix_setup_time(void) {}


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

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

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

LLVM IR (-O2):
define void @apr_unix_setup_time() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sig_usr2_handler(int signo) { printf("[sig user2] xxxxx\n"); }


x86 assembly (clang, -O0):
<sig_usr2_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [18 x i8] c"[sig user2] xxxxx\00"
define void @sig_usr2_handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int tty_init();
int module_tty_init(void) { return tty_init(); }


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

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

LLVM IR (-O0):
define i32 @module_tty_init() {
%1 = call i32 (...) @tty_init()
ret i32 %1
}

LLVM IR (-O2):
define i32 @module_tty_init() {
%1 = tail call i32 (...) @tty_init()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ loopParCollapse();
int main(int argc, char *argv[]) { loopParCollapse(); }


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @loopParCollapse()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @loopParCollapse()
ret i32 0
}
void *test9_0_0() {
  char *c = 0;
  *c = 0;
  return c;
}


x86 assembly (clang, -O0):
<test9_0_0>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i8* @test9_0_0() {
%1 = alloca i8*
store i8* null, i8** %1
%2 = load i8*, i8** %1
store i8 0, i8* %2
%3 = load i8*, i8** %1
ret i8* %3
}

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ openssl_lock(int, int);
void openssl_locking_callback(int mode, int n, const char *file, int line) {
  openssl_lock(mode, n);
}


x86 assembly (clang, -O0):
<openssl_locking_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <openssl_lock@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<openssl_locking_callback>:
jmp    1030 <openssl_lock@plt>

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

LLVM IR (-O2):
define void @openssl_locking_callback(i32 %0, i32 %1, i8* nocapture readnone %2, i32 %3) {
%5 = tail call i32 @openssl_lock(i32 %0, i32 %1)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void QEIPositionSet(uint32_t ui32Base, uint32_t ui32Position) {
  ASSERT((ui32Base == 0x4002C000) || (ui32Base == 0x4002D000));
  (*((volatile uint32_t *)(ui32Base + 0x00000008))) = ui32Position;
}


x86 assembly (clang, -O0):
<QEIPositionSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x1,%al
cmpl   $0x4002c000,-0x4(%rbp)
mov    %al,-0x9(%rbp)
je     113d <QEIPositionSet+0x2d>
cmpl   $0x4002d000,-0x4(%rbp)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x8,%eax
cltq
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<QEIPositionSet>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %edi,%eax
and    $0xffffefff,%eax
xor    %edi,%edi
cmp    $0x4002c000,%eax
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebp,%rax
mov    %ebx,0x8(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @QEIPositionSet(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 = icmp eq i32 %5, 1073922048
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 1073926144
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ true, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @ASSERT(i32 %12)
%14 = load i32, i32* %4
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 8
%17 = sext i32 %16 to i64
%18 = inttoptr i64 %17 to i32*
store volatile i32 %14, i32* %18
ret void
}

LLVM IR (-O2):
define void @QEIPositionSet(i32 %0, i32 %1) {
%3 = and i32 %0, -4097
%4 = icmp eq i32 %3, 1073922048
%5 = zext i1 %4 to i32
%6 = tail call i32 @ASSERT(i32 %5)
%7 = add nsw i32 %0, 8
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store volatile i32 %1, i32* %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ b2(int);
void b1(int n) { b2(n); }


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

x86 assembly (clang, -O2):
<b1>:
jmp    1030 <b2@plt>

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

LLVM IR (-O2):
define void @b1(i32 %0) {
%2 = tail call i32 @b2(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ op_to_dn(char *, int /*<<< orphan*/, int /*<<< orphan*/);
void i_cmp_dn(void) { op_to_dn("cmp", 0, 0); }


x86 assembly (clang, -O0):
<i_cmp_dn>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <op_to_dn@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<i_cmp_dn>:
lea    0xee9(%rip),%rdi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <op_to_dn@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"cmp\00"
define void @i_cmp_dn() {
%1 = tail call i32 @op_to_dn(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0, i32 0)
ret void
}
char isSharp(char c) { return c == '#'; }


x86 assembly (clang, -O0):
<isSharp>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x23,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSharp>:
cmp    $0x23,%dil
sete   %al
ret

LLVM IR (-O0):
define signext i8 @isSharp(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 35
%6 = zext i1 %5 to i32
%7 = trunc i32 %6 to i8
ret i8 %7
}

LLVM IR (-O2):
define signext i8 @isSharp(i8 signext %0) {
%2 = icmp eq i8 %0, 35
%3 = zext i1 %2 to i8
ret i8 %3
}
/* Type definitions */
struct pkt_buff {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ tprintf(char *);
void no_next_header_less(struct pkt_buff *pkt __attribute__((__unused__))) {
  tprintf(" No Next Header");
}


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

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

LLVM IR (-O0):
%struct.pkt_buff = type { i32 }
@.str = [16 x i8] c" No Next Header\00"
define void @no_next_header_less(%struct.pkt_buff* %0) {
%2 = alloca %struct.pkt_buff*
store %struct.pkt_buff* %0, %struct.pkt_buff** %2
%3 = call i32 @tprintf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.pkt_buff = type { i32 }
@.str = [16 x i8] c" No Next Header\00"
define void @no_next_header_less(%struct.pkt_buff* nocapture readnone %0) {
%2 = tail call i32 @tprintf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int u_long;
typedef int u_char;

/* Variables and functions */
int putlong(u_long l, u_char *msgp) {
  msgp[3] = l;
  msgp[2] = (l >>= 8);
  msgp[1] = (l >>= 8);
  msgp[0] = l >> 8;
}


x86 assembly (clang, -O0):
<putlong>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    -0x8(%rbp),%ecx
sar    $0x8,%ecx
mov    %ecx,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x8(%rbp),%ecx
sar    $0x8,%ecx
mov    %ecx,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x8(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<putlong>:
mov    %edi,0xc(%rsi)
mov    %edi,%eax
sar    $0x8,%eax
mov    %eax,0x8(%rsi)
mov    %edi,%eax
sar    $0x10,%eax
mov    %eax,0x4(%rsi)
sar    $0x18,%edi
mov    %edi,(%rsi)
ret

LLVM IR (-O0):
define i32 @putlong(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 = getelementptr inbounds i32, i32* %7, i64 3
store i32 %6, i32* %8
%9 = load i32, i32* %4
%10 = ashr i32 %9, 8
store i32 %10, i32* %4
%11 = load i32*, i32** %5
%12 = getelementptr inbounds i32, i32* %11, i64 2
store i32 %10, i32* %12
%13 = load i32, i32* %4
%14 = ashr i32 %13, 8
store i32 %14, i32* %4
%15 = load i32*, i32** %5
%16 = getelementptr inbounds i32, i32* %15, i64 1
store i32 %14, i32* %16
%17 = load i32, i32* %4
%18 = ashr i32 %17, 8
%19 = load i32*, i32** %5
%20 = getelementptr inbounds i32, i32* %19, i64 0
store i32 %18, i32* %20
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @putlong(i32 %0, i32* nocapture writeonly %1) {
%3 = getelementptr inbounds i32, i32* %1, i64 3
store i32 %0, i32* %3
%4 = ashr i32 %0, 8
%5 = getelementptr inbounds i32, i32* %1, i64 2
store i32 %4, i32* %5
%6 = ashr i32 %0, 16
%7 = getelementptr inbounds i32, i32* %1, i64 1
store i32 %6, i32* %7
%8 = ashr i32 %0, 24
store i32 %8, i32* %1
ret i32 undef
}
void foo1(int *pointer) { *pointer = 9; }


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

x86 assembly (clang, -O2):
<foo1>:
movl   $0x9,(%rdi)
ret

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

LLVM IR (-O2):
define void @foo1(i32* nocapture writeonly %0) {
store i32 9, i32* %0
ret void
}
/* Variables and functions */
unsigned int armv8_pmu_pmcr_read();
int /*<<< orphan*/ armv8_pmu_pmcr_write(unsigned int);
void reset_all_counters(void) {
  unsigned int val;
  val = armv8_pmu_pmcr_read();
  val |= (1 << 1) | (1 << 2);
  armv8_pmu_pmcr_write(val);
}


x86 assembly (clang, -O0):
<reset_all_counters>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <armv8_pmu_pmcr_read@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     $0x6,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <armv8_pmu_pmcr_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_all_counters>:
push   %rax
xor    %eax,%eax
call   1040 <armv8_pmu_pmcr_read@plt>
or     $0x6,%eax
mov    %eax,%edi
pop    %rax
jmp    1030 <armv8_pmu_pmcr_write@plt>

LLVM IR (-O0):
define void @reset_all_counters() {
%1 = alloca i32
%2 = call i32 (...) @armv8_pmu_pmcr_read()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = or i32 %3, 6
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = call i32 @armv8_pmu_pmcr_write(i32 %5)
ret void
}

LLVM IR (-O2):
define void @reset_all_counters() {
%1 = tail call i32 (...) @armv8_pmu_pmcr_read()
%2 = or i32 %1, 6
%3 = tail call i32 @armv8_pmu_pmcr_write(i32 %2)
ret void
}
int glutBitmapStringWidth(void *fontface, const char *str) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @glutBitmapStringWidth(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
int intcmp(int *x1, int *x2) {
  while (*x1 && *x1 == *x2)
    x1++, x2++;
  return *x1 - *x2;
}


x86 assembly (clang, -O0):
<intcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmpl   $0x0,(%rcx)
mov    %al,-0x11(%rbp)
je     1130 <intcmp+0x30>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1140 <intcmp+0x40>
jmp    115d <intcmp+0x5d>
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <intcmp+0xc>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intcmp>:
mov    (%rdi),%ecx
xor    %eax,%eax
test   %ecx,%ecx
je     1122 <intcmp+0x22>
add    $0x4,%rdi
nopl   0x0(%rax)
cmp    (%rsi),%ecx
jne    1125 <intcmp+0x25>
add    $0x4,%rsi
mov    (%rdi),%ecx
add    $0x4,%rdi
test   %ecx,%ecx
jne    1110 <intcmp+0x10>
sub    (%rsi),%eax
ret
mov    %ecx,%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @intcmp(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
br label %5
5: ; preds = %17, %2
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = load i32*, i32** %3
%11 = load i32, i32* %10
%12 = load i32*, i32** %4
%13 = load i32, i32* %12
%14 = icmp eq i32 %11, %13
br label %15
15: ; preds = %9, %5
%16 = phi i1 [ false, %5 ], [ %14, %9 ]
br i1 %16, label %17, label %22
17: ; preds = %15
%18 = load i32*, i32** %3
%19 = getelementptr inbounds i32, i32* %18, i32 1
store i32* %19, i32** %3
%20 = load i32*, i32** %4
%21 = getelementptr inbounds i32, i32* %20, i32 1
store i32* %21, i32** %4
br label %5
22: ; preds = %15
%23 = load i32*, i32** %3
%24 = load i32, i32* %23
%25 = load i32*, i32** %4
%26 = load i32, i32* %25
%27 = sub nsw i32 %24, %26
ret i32 %27
}

LLVM IR (-O2):
define i32 @intcmp(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = icmp eq i32 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %11
%6 = phi i32 [ %14, %11 ], [ %3, %2 ]
%7 = phi i32* [ %13, %11 ], [ %1, %2 ]
%8 = phi i32* [ %12, %11 ], [ %0, %2 ]
%9 = load i32, i32* %7
%10 = icmp eq i32 %6, %9
br i1 %10, label %11, label %16
11: ; preds = %5
%12 = getelementptr inbounds i32, i32* %8, i64 1
%13 = getelementptr inbounds i32, i32* %7, i64 1
%14 = load i32, i32* %12
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %11, %2
%17 = phi i32* [ %1, %2 ], [ %13, %11 ], [ %7, %5 ]
%18 = phi i32 [ 0, %2 ], [ 0, %11 ], [ %6, %5 ]
%19 = load i32, i32* %17
%20 = sub nsw i32 %18, %19
ret i32 %20
}
void catch (int sig __attribute__((unused))) {}


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

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

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

LLVM IR (-O2):
define void @catch(i32 %0) {
ret void
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int write(int, void const *, size_t);
ssize_t xwrite(int fd, const void *buf, size_t count) {
  int ret = write(fd, buf, count);
  if (count != ret) {
    ;
  }
  return ret;
}


x86 assembly (clang, -O0):
<xwrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <write@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
cmp    %rcx,%rax
je     114c <xwrite+0x3c>
jmp    114c <xwrite+0x3c>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @xwrite(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
unsigned int f30(unsigned int);
unsigned int f31(unsigned int a) { return f30(f30(a)); }


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

x86 assembly (clang, -O2):
<f31>:
push   %rax
call   1030 <f30@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <f30@plt>

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

LLVM IR (-O2):
define i32 @f31(i32 %0) {
%2 = tail call i32 @f30(i32 %0)
%3 = tail call i32 @f30(i32 %2)
ret i32 %3
}
/* Variables and functions */
unsigned int bswap32(unsigned int);
unsigned int cpu_to_be32(unsigned int x) { return bswap32(x); }


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

x86 assembly (clang, -O2):
<cpu_to_be32>:
jmp    1030 <bswap32@plt>

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

LLVM IR (-O2):
define i32 @cpu_to_be32(i32 %0) {
%2 = tail call i32 @bswap32(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ val;
struct udcFile {
  int dummy;
};

/* Variables and functions */
unsigned long long byteSwap64(unsigned long long);
int /*<<< orphan*/ udcMustRead(struct udcFile *, unsigned long long *, int);
unsigned long long udcReadBits64(struct udcFile *file, int isSwapped) {
  unsigned long long val;
  udcMustRead(file, &val, sizeof(val));
  if (isSwapped)
    val = byteSwap64(val);
  return val;
}


x86 assembly (clang, -O0):
<udcReadBits64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x8,%edx
call   1040 <udcMustRead@plt>
cmpl   $0x0,-0xc(%rbp)
je     1158 <udcReadBits64+0x38>
mov    -0x18(%rbp),%rdi
call   1030 <byteSwap64@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<udcReadBits64>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
lea    0x8(%rsp),%rsi
mov    $0x8,%edx
call   1040 <udcMustRead@plt>
mov    0x8(%rsp),%rax
test   %ebx,%ebx
je     1147 <udcReadBits64+0x27>
mov    %rax,%rdi
call   1030 <byteSwap64@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.udcFile = type { i32 }
define i64 @udcReadBits64(%struct.udcFile* %0, i32 %1) {
%3 = alloca %struct.udcFile*
%4 = alloca i32
%5 = alloca i64
store %struct.udcFile* %0, %struct.udcFile** %3
store i32 %1, i32* %4
%6 = load %struct.udcFile*, %struct.udcFile** %3
%7 = call i32 @udcMustRead(%struct.udcFile* %6, i64* %5, i32 8)
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i64, i64* %5
%12 = call i64 @byteSwap64(i64 %11)
store i64 %12, i64* %5
br label %13
13: ; preds = %10, %2
%14 = load i64, i64* %5
ret i64 %14
}

LLVM IR (-O2):
%struct.udcFile = type { i32 }
define i64 @udcReadBits64(%struct.udcFile* %0, i32 %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = call i32 @udcMustRead(%struct.udcFile* %0, i64* %3, i32 8)
%6 = icmp eq i32 %1, 0
%7 = load i64, i64* %3
br i1 %6, label %10, label %8
8: ; preds = %2
%9 = call i64 @byteSwap64(i64 %7)
br label %10
10: ; preds = %2, %8
%11 = phi i64 [ %9, %8 ], [ %7, %2 ]
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ italy();
int /*<<< orphan*/ printf(char *);
main() {
  printf("I am in main.\n");
  italy();
  printf("I am back in main.\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <italy@plt>
lea    0xed1(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"I am in main.\0A\00"
@.str.1 = [20 x i8] c"I am back in main.\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @italy()
%3 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"I am in main.\00"
@str.2 = [19 x i8] c"I am back in main.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @italy()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printSeznam(int *tab, int n) {
  for (int i = 0; i < n; ++i) {
    printf("%d ", tab[i]);
  }
  printf("\n");
}


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

x86 assembly (clang, -O2):
<printSeznam>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <printSeznam+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printSeznam+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printSeznam(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @putchar(i32 10)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %13, %8 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %8
}
void rbs_reset() {}


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

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

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

LLVM IR (-O2):
define void @rbs_reset() {
ret void
}
void ADCSequenceEnable(unsigned long ulBase, unsigned long ulSequenceNum) {
  ;
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000000))) |= 1 << ulSequenceNum;
}


x86 assembly (clang, -O0):
<ADCSequenceEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
movslq %eax,%rdx
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
or     %rdx,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCSequenceEnable>:
mov    %rsi,%rcx
mov    $0x1,%eax
shl    %cl,%eax
cltq
or     %rax,(%rdi)
ret

LLVM IR (-O0):
define void @ADCSequenceEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = shl i32 1, %6
%8 = sext i32 %7 to i64
%9 = load i64, i64* %3
%10 = add i64 %9, 0
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
%13 = or i64 %12, %8
store volatile i64 %13, i64* %11
ret void
}

LLVM IR (-O2):
define void @ADCSequenceEnable(i64 %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = shl nuw i32 1, %3
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %0 to i64*
%7 = load volatile i64, i64* %6
%8 = or i64 %7, %5
store volatile i64 %8, i64* %6
ret void
}
/* Variables and functions */
scalar_t__ __isleap(int);
int dysize(int year) { return __isleap(year) ? 366 : 365; }


x86 assembly (clang, -O0):
<dysize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <__isleap@plt>
mov    %rax,%rdx
mov    $0x16d,%eax
mov    $0x16e,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dysize>:
push   %rax
call   1030 <__isleap@plt>
cmp    $0x1,%rax
mov    $0x16e,%eax
sbb    $0x0,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @dysize(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @__isleap(i32 %3)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 366, i32 365
ret i32 %7
}

LLVM IR (-O2):
define i32 @dysize(i32 %0) {
%2 = tail call i64 @__isleap(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 365, i32 366
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t ev3_button_is_pressed(int32_t key) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ev3_button_is_pressed(i32 %0) {
ret i32 0
}
int main(void) {
  *((int *)42);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* inttoptr (i64 42 to i32*)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ bubbleSort(int, int *);
int /*<<< orphan*/ getArr(int, int *);
int /*<<< orphan*/ getInt(int, int *);
int /*<<< orphan*/ prnArr(int, int *);
int main() {
  int size, arr[10000];
  getInt(1, &size);
  getArr(size, arr);
  bubbleSort(size, arr);
  prnArr(size, arr);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x9c50,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
lea    -0x8(%rbp),%rsi
call   1060 <getInt@plt>
mov    -0x8(%rbp),%edi
lea    -0x9c50(%rbp),%rsi
call   1040 <getArr@plt>
mov    -0x8(%rbp),%edi
lea    -0x9c50(%rbp),%rsi
call   1030 <bubbleSort@plt>
mov    -0x8(%rbp),%edi
lea    -0x9c50(%rbp),%rsi
call   1050 <prnArr@plt>
mov    0x2e4c(%rip),%rax
mov    (%rax),%eax
add    $0x9c50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x9c50,%rsp
lea    0xc(%rsp),%rsi
mov    $0x1,%edi
call   1060 <getInt@plt>
mov    0xc(%rsp),%edi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
call   1040 <getArr@plt>
mov    0xc(%rsp),%edi
mov    %rbx,%rsi
call   1030 <bubbleSort@plt>
mov    0xc(%rsp),%edi
mov    %rbx,%rsi
call   1050 <prnArr@plt>
mov    0x2e59(%rip),%rax
mov    (%rax),%eax
add    $0x9c50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [10000 x i32]
store i32 0, i32* %1
%4 = call i32 @getInt(i32 1, i32* %2)
%5 = load i32, i32* %2
%6 = getelementptr inbounds [10000 x i32], [10000 x i32]* %3, i64 0, i64 0
%7 = call i32 @getArr(i32 %5, i32* %6)
%8 = load i32, i32* %2
%9 = getelementptr inbounds [10000 x i32], [10000 x i32]* %3, i64 0, i64 0
%10 = call i32 @bubbleSort(i32 %8, i32* %9)
%11 = load i32, i32* %2
%12 = getelementptr inbounds [10000 x i32], [10000 x i32]* %3, i64 0, i64 0
%13 = call i32 @prnArr(i32 %11, i32* %12)
%14 = load i32, i32* @EXIT_SUCCESS
ret i32 %14
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [10000 x i32]
%3 = bitcast i32* %1 to i8*
%4 = bitcast [10000 x i32]* %2 to i8*
%5 = call i32 @getInt(i32 1, i32* %1)
%6 = load i32, i32* %1
%7 = getelementptr inbounds [10000 x i32], [10000 x i32]* %2, i64 0, i64 0
%8 = call i32 @getArr(i32 %6, i32* %7)
%9 = load i32, i32* %1
%10 = call i32 @bubbleSort(i32 %9, i32* %7)
%11 = load i32, i32* %1
%12 = call i32 @prnArr(i32 %11, i32* %7)
%13 = load i32, i32* @EXIT_SUCCESS
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ test_memcpy(char *);
void __run_test_memcpy__(void) {
  test_memcpy("");
  test_memcpy("from");
  test_memcpy("la la la la");
}


x86 assembly (clang, -O0):
<__run_test_memcpy__>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rdi
call   1030 <test_memcpy@plt>
lea    0xed9(%rip),%rdi
call   1030 <test_memcpy@plt>
lea    0xed2(%rip),%rdi
call   1030 <test_memcpy@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__run_test_memcpy__>:
push   %rax
lea    0xef8(%rip),%rdi
call   1030 <test_memcpy@plt>
lea    0xedc(%rip),%rdi
call   1030 <test_memcpy@plt>
lea    0xed5(%rip),%rdi
pop    %rax
jmp    1030 <test_memcpy@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [5 x i8] c"from\00"
@.str.2 = [12 x i8] c"la la la la\00"
define void @__run_test_memcpy__() {
%1 = call i32 @test_memcpy(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @test_memcpy(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @test_memcpy(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [5 x i8] c"from\00"
@.str.2 = [12 x i8] c"la la la la\00"
define void @__run_test_memcpy__() {
%1 = tail call i32 @test_memcpy(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @test_memcpy(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @test_memcpy(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
ret void
}
void wifi_rsp_flash_ps_erase(const struct wifi_msg_flash_ps_erase_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.wifi_msg_flash_ps_erase_rsp_t = type opaque
define void @wifi_rsp_flash_ps_erase(%struct.wifi_msg_flash_ps_erase_rsp_t* nocapture %0) {
ret void
}
int large_literal_rshift(int w) { return 0xF0000000 >> w; }


x86 assembly (clang, -O0):
<large_literal_rshift>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0xf0000000,%eax
shr    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<large_literal_rshift>:
mov    %edi,%ecx
mov    $0xf0000000,%eax
shr    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @large_literal_rshift(i32 %0) {
%2 = lshr i32 -268435456, %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello World!\n");
  printf("Hello Sathwik!");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World!\0A\00"
@.str.1 = [15 x i8] c"Hello Sathwik!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [15 x i8] c"Hello Sathwik!\00"
@str = [13 x i8] c"Hello World!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int UINT_MAX;
int /*<<< orphan*/ printf(char *, int);
int uadd_ok(int, int);
int main() {
  int x1 = UINT_MAX - 100;
  int y1 = 200;
  int y2 = 10;
  printf("uadd_ok(UINT_MAX-100, 200) = %d\n", uadd_ok(UINT_MAX - 100, 200));
  printf("uadd_ok(UINT_MAX-100, 10 = %d\n", uadd_ok(UINT_MAX - 100, 10));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%eax
sub    $0x64,%eax
mov    %eax,-0x8(%rbp)
movl   $0xc8,-0xc(%rbp)
movl   $0xa,-0x10(%rbp)
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
sub    $0x64,%edi
mov    $0xc8,%esi
call   1040 <uadd_ok@plt>
mov    %eax,%esi
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e71(%rip),%rax
mov    (%rax),%edi
sub    $0x64,%edi
mov    $0xa,%esi
call   1040 <uadd_ok@plt>
mov    %eax,%esi
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ec0(%rip),%rbx
mov    (%rbx),%edi
add    $0xffffff9c,%edi
mov    $0xc8,%esi
call   1040 <uadd_ok@plt>
lea    0xec2(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    (%rbx),%edi
add    $0xffffff9c,%edi
mov    $0xa,%esi
call   1040 <uadd_ok@plt>
lea    0xec6(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@UINT_MAX = global i32 0
@.str = [33 x i8] c"uadd_ok(UINT_MAX-100, 200) = %d\0A\00"
@.str.1 = [31 x i8] c"uadd_ok(UINT_MAX-100, 10 = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = load i32, i32* @UINT_MAX
%6 = sub nsw i32 %5, 100
store i32 %6, i32* %2
store i32 200, i32* %3
store i32 10, i32* %4
%7 = load i32, i32* @UINT_MAX
%8 = sub nsw i32 %7, 100
%9 = call i32 @uadd_ok(i32 %8, i32 200)
%10 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* @UINT_MAX
%12 = sub nsw i32 %11, 100
%13 = call i32 @uadd_ok(i32 %12, i32 10)
%14 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %13)
ret i32 0
}

LLVM IR (-O2):
@UINT_MAX = global i32 0
@.str = [33 x i8] c"uadd_ok(UINT_MAX-100, 200) = %d\0A\00"
@.str.1 = [31 x i8] c"uadd_ok(UINT_MAX-100, 10 = %d\0A\00"
define i32 @main() {
%1 = load i32, i32* @UINT_MAX
%2 = add nsw i32 %1, -100
%3 = tail call i32 @uadd_ok(i32 %2, i32 200)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @UINT_MAX
%6 = add nsw i32 %5, -100
%7 = tail call i32 @uadd_ok(i32 %6, i32 10)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}
int f(int t) {
  int z = t;
  return z;
}


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

x86 assembly (clang, -O2):
<f>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int second_chance(int8_t **page_table, int num_pages, int prev_page,
                  int fifo_frm, int num_frames, int clock) {
  return -1;
}


x86 assembly (clang, -O0):
<second_chance>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @second_chance(i32** %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32**
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32** %0, i32*** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
ret i32 -1
}

LLVM IR (-O2):
define i32 @second_chance(i32** nocapture readnone %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
ret i32 -1
}