xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print(int arr[], int n) {
  for (int i = 0; i < n; ++i)
    printf("%d ", arr[i]);
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @print(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 %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
unsigned int *get_sign(float f) {
  unsigned int *fi = &f;
  unsigned int exp = (*fi & 0x80000000);
  return exp;
}


x86 assembly (clang, -O0):
<get_sign>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
and    $0x80000000,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_sign>:
movmskps %xmm0,%eax
shl    $0x1f,%eax
ret

LLVM IR (-O0):
define i32* @get_sign(float %0) {
%2 = alloca float
%3 = alloca i32*
%4 = alloca i32
store float %0, float* %2
%5 = bitcast float* %2 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = and i32 %7, -2147483648
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = zext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
define i32* @get_sign(float %0) {
%2 = bitcast float %0 to i32
%3 = and i32 %2, -2147483648
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
/* Type definitions */
struct epoll_event {
  int dummy;
};

/* Variables and functions */
int syscall(int, int, int, int, struct epoll_event *);
int epoll_ctl(int fd, int op, int fd2, struct epoll_event *ev) {
  return syscall(255, fd, op, fd2, ev);
}


x86 assembly (clang, -O0):
<epoll_ctl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%r8
mov    $0xff,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<epoll_ctl>:
mov    %rcx,%r8
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
mov    $0xff,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.epoll_event = type { i32 }
define i32 @epoll_ctl(i32 %0, i32 %1, i32 %2, %struct.epoll_event* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca %struct.epoll_event*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store %struct.epoll_event* %3, %struct.epoll_event** %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load %struct.epoll_event*, %struct.epoll_event** %8
%13 = call i32 @syscall(i32 255, i32 %9, i32 %10, i32 %11, %struct.epoll_event* %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.epoll_event = type { i32 }
define i32 @epoll_ctl(i32 %0, i32 %1, i32 %2, %struct.epoll_event* %3) {
%5 = tail call i32 @syscall(i32 255, i32 %0, i32 %1, i32 %2, %struct.epoll_event* %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
int /*<<< orphan*/ HibernateWriteComplete();
void HibernateIntDisable(unsigned long ulIntFlags) {
  DEBUG_ASSERT(!(ulIntFlags & ~(0x00000008 | 0x00000004 | 0x00000001 |
                                0x00000002 | 0x00000010)));
  (*((volatile unsigned long *)(0x400FC014))) &= ~ulIntFlags;
  HibernateWriteComplete();
}


x86 assembly (clang, -O0):
<HibernateIntDisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0xffffffffffffffe0,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
xor    $0xffffffffffffffff,%rax
mov    $0x400fc014,%ecx
mov    (%rcx),%rcx
and    %rax,%rcx
mov    $0x400fc014,%eax
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <HibernateWriteComplete@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateIntDisable>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
cmp    $0x20,%rbx
setb   %dil
call   1040 <DEBUG_ASSERT@plt>
not    %rbx
and    %rbx,0x400fc014
40
xor    %eax,%eax
pop    %rbx
jmp    1030 <HibernateWriteComplete@plt>

LLVM IR (-O0):
define void @HibernateIntDisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, -32
%5 = icmp ne i64 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
%8 = call i32 @DEBUG_ASSERT(i32 %7)
%9 = load i64, i64* %2
%10 = xor i64 %9, -1
%11 = load volatile i64, i64* inttoptr (i64 1074774036 to i64*)
%12 = and i64 %11, %10
store volatile i64 %12, i64* inttoptr (i64 1074774036 to i64*)
%13 = call i32 (...) @HibernateWriteComplete()
ret void
}

LLVM IR (-O2):
define void @HibernateIntDisable(i64 %0) {
%2 = icmp ult i64 %0, 32
%3 = zext i1 %2 to i32
%4 = tail call i32 @DEBUG_ASSERT(i32 %3)
%5 = xor i64 %0, -1
%6 = load volatile i64, i64* inttoptr (i64 1074774036 to i64*)
%7 = and i64 %6, %5
store volatile i64 %7, i64* inttoptr (i64 1074774036 to i64*)
%8 = tail call i32 (...) @HibernateWriteComplete()
ret void
}
int open(const char *path, int flags) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @open(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
scalar_t__ isPrime(unsigned long);
int /*<<< orphan*/ printf(char *, unsigned long);
int main() {
  unsigned long int count = 1, number = 2;
  while (count != 10001) {
    number++;
    if (isPrime(number))
      count++;
  }
  printf("%ld", number);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x1,-0x10(%rbp)
movq   $0x2,-0x18(%rbp)
cmpq   $0x2711,-0x10(%rbp)
je     117d <main+0x5d>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <isPrime@plt>
cmp    $0x0,%rax
je     1178 <main+0x58>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    113f <main+0x1f>
mov    -0x18(%rbp),%rsi
lea    0xe78(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
mov    $0x2,%r14d
nop
add    $0x1,%r14
mov    %r14,%rdi
call   1040 <isPrime@plt>
cmp    $0x1,%rax
sbb    $0xffffffffffffffff,%rbx
cmp    $0x2711,%rbx
jne    1130 <main+0x10>
lea    0xeac(%rip),%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i64 [ 2, %0 ], [ %4, %1 ]
%3 = phi i64 [ 1, %0 ], [ %8, %1 ]
%4 = add i64 %2, 1
%5 = tail call i64 @isPrime(i64 %4)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = add i64 %3, %7
%9 = icmp eq i64 %8, 10001
br i1 %9, label %10, label %1
10: ; preds = %1
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %4)
ret i32 0
}
void foo_1_1_2_1_2_2_2_1_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_2_1_2_2_2_1_2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ callrts(char *);
void DoubSwap(void) { callrts("dswap"); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"dswap\00"
define void @DoubSwap() {
%1 = tail call i32 @callrts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
char uc(char c) {
  switch (c) {
  case 'A':
  case 'a':
    return 'A';
  case 'C':
  case 'c':
    return 'C';
  case 'G':
  case 'g':
    return 'G';
  case 'T':
  case 't':
    return 'T';
  case '@':
    return '@';
  case '$':
    return '$';
  default:
    return 'N';
  }
}


x86 assembly (clang, -O0):
<uc>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
add    $0xffffffdc,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x50,%eax
ja     116a <uc+0x6a>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x41,-0x1(%rbp)
jmp    116e <uc+0x6e>
movb   $0x43,-0x1(%rbp)
jmp    116e <uc+0x6e>
movb   $0x47,-0x1(%rbp)
jmp    116e <uc+0x6e>
movb   $0x54,-0x1(%rbp)
jmp    116e <uc+0x6e>
movb   $0x40,-0x1(%rbp)
jmp    116e <uc+0x6e>
movb   $0x24,-0x1(%rbp)
jmp    116e <uc+0x6e>
movb   $0x4e,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uc>:
add    $0xffffffdc,%edi
cmp    $0x50,%edi
ja     1126 <uc+0x26>
mov    $0x41,%al
lea    0xeef(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x43,%al
ret
mov    $0x47,%al
ret
mov    $0x54,%al
ret
mov    $0x24,%al
ret
mov    $0x4e,%al
ret
mov    $0x40,%al
ret

LLVM IR (-O0):
define signext i8 @uc(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %12 [
i32 65, label %6
i32 97, label %6
i32 67, label %7
i32 99, label %7
i32 71, label %8
i32 103, label %8
i32 84, label %9
i32 116, label %9
i32 64, label %10
i32 36, label %11
]
6: ; preds = %1, %1
store i8 65, i8* %2
br label %13
7: ; preds = %1, %1
store i8 67, i8* %2
br label %13
8: ; preds = %1, %1
store i8 71, i8* %2
br label %13
9: ; preds = %1, %1
store i8 84, i8* %2
br label %13
10: ; preds = %1
store i8 64, i8* %2
br label %13
11: ; preds = %1
store i8 36, i8* %2
br label %13
12: ; preds = %1
store i8 78, i8* %2
br label %13
13: ; preds = %12, %11, %10, %9, %8, %7, %6
%14 = load i8, i8* %2
ret i8 %14
}

LLVM IR (-O2):
define signext i8 @uc(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %8 [
i32 65, label %9
i32 97, label %9
i32 67, label %3
i32 99, label %3
i32 71, label %4
i32 103, label %4
i32 84, label %5
i32 116, label %5
i32 64, label %6
i32 36, label %7
]
3: ; preds = %1, %1
br label %9
4: ; preds = %1, %1
br label %9
5: ; preds = %1, %1
br label %9
6: ; preds = %1
br label %9
7: ; preds = %1
br label %9
8: ; preds = %1
br label %9
9: ; preds = %1, %1, %8, %7, %6, %5, %4, %3
%10 = phi i8 [ 78, %8 ], [ 36, %7 ], [ 64, %6 ], [ 84, %5 ], [ 71, %4 ], [ 67, %3 ], [ 65, %1 ], [ 65, %1 ]
ret i8 %10
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int palindrom(char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  char in[1025];
  gets(in);
  printf("%d\n", palindrom(in));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x410,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <gets@plt>
mov    %rbx,%rdi
call   1050 <palindrom@plt>
lea    0xeae(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [1025 x i8]
%2 = getelementptr inbounds [1025 x i8], [1025 x i8]* %1, i64 0, i64 0
%3 = call i32 @gets(i8* %2)
%4 = call i32 @palindrom(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, int, int, int);
void draw_initial_edge(FILE *fp, int x, int tx, int ty, int neg, int inv) {
  fprintf(fp, "(%s) %d %d %d edge\n", neg ? "n" : "p", x, tx, ty);
}


x86 assembly (clang, -O0):
<draw_initial_edge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
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    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%ecx
lea    0xedb(%rip),%rdx
lea    0xed2(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0x14(%rbp),%r9d
lea    0xea5(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_initial_edge>:
mov    %ecx,%r9d
mov    %edx,%eax
mov    %esi,%ecx
test   %r8d,%r8d
lea    0xef5(%rip),%rsi
lea    0xeec(%rip),%rdx
cmove  %rsi,%rdx
lea    0xecd(%rip),%rsi
mov    %eax,%r8d
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"(%s) %d %d %d edge\0A\00"
@.str.1 = [2 x i8] c"n\00"
@.str.2 = [2 x i8] c"p\00"
define void @draw_initial_edge(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
%13 = load i32*, i32** %7
%14 = load i32, i32* %11
%15 = icmp ne i32 %14, 0
%16 = zext i1 %15 to i64
%17 = select i1 %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0)
%18 = load i32, i32* %8
%19 = load i32, i32* %9
%20 = load i32, i32* %10
%21 = call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %17, i32 %18, i32 %19, i32 %20)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"(%s) %d %d %d edge\0A\00"
@.str.1 = [2 x i8] c"n\00"
@.str.2 = [2 x i8] c"p\00"
define void @draw_initial_edge(i32* nocapture %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = icmp eq i32 %4, 0
%8 = select i1 %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
%9 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %1, i32 %2, i32 %3)
ret void
}
float testClosureVrF(float (*closure)(void)) { return (*closure)(); }


x86 assembly (clang, -O0):
<testClosureVrF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureVrF>:
jmp    *%rdi

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

LLVM IR (-O2):
define float @testClosureVrF(float ()* nocapture %0) {
%2 = tail call float %0()
ret float %2
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ mymemset(char *, char, int);
int /*<<< orphan*/ printf(char *, char);
int main() {
  char *p = (char *)malloc(5);
  *(p + 5) = 'c';
  printf("%c\n", *(p + 5));
  mymemset(p, 'a', 10);
  printf("%c\n", *(p + 7));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x5,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x63,0x5(%rax)
mov    -0x8(%rbp),%rax
lea    0xea7(%rip),%rdi
movsbl 0x5(%rax),%esi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x61,%esi
mov    $0xa,%edx
call   1050 <mymemset@plt>
mov    -0x8(%rbp),%rax
lea    0xe80(%rip),%rdi
movsbl 0x7(%rax),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x5,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
movb   $0x63,0x5(%rax)
lea    0xeb4(%rip),%r14
mov    %r14,%rdi
mov    $0x63,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x61,%esi
mov    $0xa,%edx
call   1050 <mymemset@plt>
movsbl 0x7(%rbx),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = alloca i8*
%2 = call i64 @malloc(i32 5)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = getelementptr inbounds i8, i8* %4, i64 5
store i8 99, i8* %5
%6 = load i8*, i8** %1
%7 = getelementptr inbounds i8, i8* %6, i64 5
%8 = load i8, i8* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %8)
%10 = load i8*, i8** %1
%11 = call i32 @mymemset(i8* %10, i8 signext 97, i32 10)
%12 = load i8*, i8** %1
%13 = getelementptr inbounds i8, i8* %12, i64 7
%14 = load i8, i8* %13
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = tail call i64 @malloc(i32 5)
%2 = inttoptr i64 %1 to i8*
%3 = getelementptr inbounds i8, i8* %2, i64 5
store i8 99, i8* %3
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext 99)
%5 = tail call i32 @mymemset(i8* %2, i8 signext 97, i32 10)
%6 = getelementptr inbounds i8, i8* %2, i64 7
%7 = load i8, i8* %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %7)
ret i32 0
}
/* Variables and functions */
long GPUclose();
long ZN_GPUclose() { return GPUclose(); }


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

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

LLVM IR (-O0):
define i64 @ZN_GPUclose() {
%1 = call i64 (...) @GPUclose()
ret i64 %1
}

LLVM IR (-O2):
define i64 @ZN_GPUclose() {
%1 = tail call i64 (...) @GPUclose()
ret i64 %1
}
int test_imm_FEint32_reg(int val) { return ((val) & (0xFE << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_FEint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xfe,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_FEint32_reg>:
test   $0xfe,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_FEint32_reg(i32 %0) {
%2 = and i32 %0, 254
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void SetStringHighBit(char *s) {
  while (*s)
    *s++ |= 128;
}


x86 assembly (clang, -O0):
<SetStringHighBit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1134 <SetStringHighBit+0x34>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%ecx
or     $0x80,%ecx
mov    %cl,(%rax)
jmp    1108 <SetStringHighBit+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetStringHighBit>:
mov    (%rdi),%al
test   %al,%al
je     1120 <SetStringHighBit+0x20>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
or     $0x80,%al
mov    %al,-0x1(%rdi)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <SetStringHighBit+0x10>
ret

LLVM IR (-O0):
define void @SetStringHighBit(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 %14
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 = sext i8 %10 to i32
%12 = or i32 %11, 128
%13 = trunc i32 %12 to i8
store i8 %13, i8* %8
br label %3
14: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @SetStringHighBit(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = or i8 %5, -128
store i8 %8, i8* %6
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint_least32_t;
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ endian_32(int /*<<< orphan*/ const, int /*<<< orphan*/ const,
                             int /*<<< orphan*/ const,
                             int /*<<< orphan*/ const);
uint_least32_t endian_little32(const uint8_t ptr[4]) {
  return endian_32(ptr[3], ptr[2], ptr[1], ptr[0]);
}


x86 assembly (clang, -O0):
<endian_little32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%edi
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%esi
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
call   1030 <endian_32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<endian_little32>:
mov    0xc(%rdi),%eax
mov    0x8(%rdi),%esi
mov    (%rdi),%ecx
mov    0x4(%rdi),%edx
mov    %eax,%edi
jmp    1030 <endian_32@plt>

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

LLVM IR (-O2):
define i32 @endian_little32(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 3
%3 = load i32, i32* %2
%4 = getelementptr inbounds i32, i32* %0, i64 2
%5 = load i32, i32* %4
%6 = getelementptr inbounds i32, i32* %0, i64 1
%7 = load i32, i32* %6
%8 = load i32, i32* %0
%9 = tail call i32 @endian_32(i32 %3, i32 %5, i32 %7, i32 %8)
ret i32 %9
}
/* Variables and functions */
int date_get_last_month_day(int, int);
int date_days_in_month(int month, int year) {
  return date_get_last_month_day(month, year);
}


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

x86 assembly (clang, -O2):
<date_days_in_month>:
jmp    1030 <date_get_last_month_day@plt>

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

LLVM IR (-O2):
define i32 @date_days_in_month(i32 %0, i32 %1) {
%3 = tail call i32 @date_get_last_month_day(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;
struct list_head {
  int dummy;
};

/* Variables and functions */
uint8_t update_t10k_encryption_mode(struct list_head *m, void *p, int value) {
  ;
  return 0x00;
}


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

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

LLVM IR (-O0):
%struct.list_head = type { i32 }
define i32 @update_t10k_encryption_mode(%struct.list_head* %0, i8* %1, i32 %2) {
%4 = alloca %struct.list_head*
%5 = alloca i8*
%6 = alloca i32
store %struct.list_head* %0, %struct.list_head** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define i32 @update_t10k_encryption_mode(%struct.list_head* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
long long get_and_set(long long *ptr, long long val) {
  return __atomic_exchange_n(ptr, val, 5);
}


x86 assembly (clang, -O0):
<get_and_set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
xchg   %rax,(%rcx)
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_and_set>:
mov    %rsi,%rax
xchg   %rax,(%rdi)
ret

LLVM IR (-O0):
define i64 @get_and_set(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%7 = load i64*, i64** %3
%8 = load i64, i64* %4
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = atomicrmw xchg i64* %7, i64 %9 seq_cst
store i64 %10, i64* %6
%11 = load i64, i64* %6
ret i64 %11
}

LLVM IR (-O2):
define i64 @get_and_set(i64* nocapture %0, i64 %1) {
%3 = atomicrmw xchg i64* %0, i64 %1 seq_cst
ret i64 %3
}
/* Variables and functions */
int SIGRTMIN;
int /*<<< orphan*/ error(char *);
int /*<<< orphan*/ getpid();
int kill(int /*<<< orphan*/, int);
void send_user_interrupt(int intrsrc) {
  int signo = SIGRTMIN + intrsrc;
  int r = kill(getpid(), signo);
  if (r)
    error("send_software_interrupt kill");
}


x86 assembly (clang, -O0):
<send_user_interrupt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%esi
call   1040 <kill@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1174 <send_user_interrupt+0x44>
lea    0xe91(%rip),%rdi
call   1050 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_user_interrupt>:
push   %rbx
mov    %edi,%ebx
mov    0x2ea6(%rip),%rax
add    (%rax),%ebx
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%edi
mov    %ebx,%esi
call   1040 <kill@plt>
test   %eax,%eax
je     115d <send_user_interrupt+0x2d>
lea    0xea9(%rip),%rdi
pop    %rbx
jmp    1050 <error@plt>
pop    %rbx
ret

LLVM IR (-O0):
@SIGRTMIN = global i32 0
@.str = [29 x i8] c"send_software_interrupt kill\00"
define void @send_user_interrupt(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* @SIGRTMIN
%6 = load i32, i32* %2
%7 = add nsw i32 %5, %6
store i32 %7, i32* %3
%8 = call i32 (...) @getpid()
%9 = load i32, i32* %3
%10 = call i32 @kill(i32 %8, i32 %9)
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %1
%14 = call i32 @error(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %1
ret void
}

LLVM IR (-O2):
@SIGRTMIN = global i32 0
@.str = [29 x i8] c"send_software_interrupt kill\00"
define void @send_user_interrupt(i32 %0) {
%2 = load i32, i32* @SIGRTMIN
%3 = add nsw i32 %2, %0
%4 = tail call i32 (...) @getpid()
%5 = tail call i32 @kill(i32 %4, i32 %3)
%6 = icmp eq i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @error(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
ret void
}
void outp(unsigned short port, unsigned char value) {
  asm volatile("outb %%al,%%dx" : : "dN"(port), "a"(value));
}


x86 assembly (clang, -O0):
<outp>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    -0x2(%rbp),%dx
mov    -0x3(%rbp),%al
out    %al,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outp>:
mov    %esi,%eax
mov    %edi,%edx
out    %al,(%dx)
ret

LLVM IR (-O0):
define void @outp(i16 zeroext %0, i8 zeroext %1) {
%3 = alloca i16
%4 = alloca i8
store i16 %0, i16* %3
store i8 %1, i8* %4
%5 = load i16, i16* %3
%6 = load i8, i8* %4
ret void
}

LLVM IR (-O2):
define void @outp(i16 zeroext %0, i8 zeroext %1) {
tail call void asm sideeffect "outb %al,%dx", "{dx}N,{ax},~{dirflag},~{fpsr},~{flags}"(i16 %0, i8 %1)
ret void
}
/* Type definitions */
struct timespec {
  scalar_t__ tv_nsec;
  scalar_t__ tv_sec;
};
typedef int int64_t;

/* Variables and functions */
int64_t calcdiff(struct timespec t1, struct timespec t2) {
  int64_t diff;
  diff = 1000000 * (long long)((int)t1.tv_sec - (int)t2.tv_sec);
  diff += ((int)t1.tv_nsec - (int)t2.tv_nsec) / 1000;
  return diff;
}


x86 assembly (clang, -O0):
<calcdiff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    %ecx,%eax
cltq
imul   $0xf4240,%rax,%rax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
sub    %ecx,%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
add    -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcdiff>:
sub    %ecx,%esi
imul   $0xf4240,%esi,%ecx
sub    %edx,%edi
movslq %edi,%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define i32 @calcdiff(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca %struct.timespec
%6 = alloca %struct.timespec
%7 = alloca i32
%8 = bitcast %struct.timespec* %5 to { i64, i64 }*
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 0
store i64 %0, i64* %9
%10 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 1
store i64 %1, i64* %10
%11 = bitcast %struct.timespec* %6 to { i64, i64 }*
%12 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %11, i32 0, i32 0
store i64 %2, i64* %12
%13 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %11, i32 0, i32 1
store i64 %3, i64* %13
%14 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 1
%15 = load i64, i64* %14
%16 = trunc i64 %15 to i32
%17 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i32 0, i32 1
%18 = load i64, i64* %17
%19 = trunc i64 %18 to i32
%20 = sub nsw i32 %16, %19
%21 = sext i32 %20 to i64
%22 = mul nsw i64 1000000, %21
%23 = trunc i64 %22 to i32
store i32 %23, i32* %7
%24 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 0
%25 = load i64, i64* %24
%26 = trunc i64 %25 to i32
%27 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i32 0, i32 0
%28 = load i64, i64* %27
%29 = trunc i64 %28 to i32
%30 = sub nsw i32 %26, %29
%31 = sdiv i32 %30, 1000
%32 = load i32, i32* %7
%33 = add nsw i32 %32, %31
store i32 %33, i32* %7
%34 = load i32, i32* %7
ret i32 %34
}

LLVM IR (-O2):
define i32 @calcdiff(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = sub i64 %1, %3
%6 = trunc i64 %5 to i32
%7 = mul i32 %6, 1000000
%8 = trunc i64 %0 to i32
%9 = trunc i64 %2 to i32
%10 = sub nsw i32 %8, %9
%11 = sdiv i32 %10, 1000
%12 = add nsw i32 %7, %11
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, char *);
void THEN(char *text) {
  printf("%s      then:%s %s\n", "\x1B[33m", "\x1B[0m", text);
}


x86 assembly (clang, -O0):
<THEN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
lea    0xed9(%rip),%rdi
lea    0xee6(%rip),%rsi
lea    0xee5(%rip),%rdx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [20 x i8] c"%s then:%s %s\0A\00"
@.str.1 = [6 x i8] c"\1B[33m\00"
@.str.2 = [5 x i8] c"\1B[0m\00"
define void @THEN(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"%s then:%s %s\0A\00"
@.str.1 = [6 x i8] c"\1B[33m\00"
@.str.2 = [5 x i8] c"\1B[0m\00"
define void @THEN(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %0)
ret void
}
unsigned plus_2_mod_3(const unsigned x) {
  const unsigned y = (x - 1) & 3u;
  return y ^ (y >> 1);
}


x86 assembly (clang, -O0):
<plus_2_mod_3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
and    $0x3,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    $0x1,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<plus_2_mod_3>:
lea    -0x1(%rdi),%ecx
and    $0x3,%ecx
mov    %ecx,%eax
shr    %eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @plus_2_mod_3(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sub i32 %4, 1
%6 = and i32 %5, 3
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = load i32, i32* %3
%9 = lshr i32 %8, 1
%10 = xor i32 %7, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @plus_2_mod_3(i32 %0) {
%2 = add i32 %0, 3
%3 = and i32 %2, 3
%4 = lshr i32 %3, 1
%5 = xor i32 %4, %3
ret i32 %5
}
void _kernel_initialize_sections(void) {}


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

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

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

LLVM IR (-O2):
define void @_kernel_initialize_sections() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ str;

/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ perror(char *);
int send(int, char const *, int, int /*<<< orphan*/);
void do_use_fd(int client_fd) {
  const char str[] = "God bless you!/n";
  if (send(client_fd, str, sizeof(str), 0) == -1)
    perror("send");
  close(client_fd);
}


x86 assembly (clang, -O0):
<do_use_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    0xebe(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xebb(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeb9(%rip),%al
mov    %al,-0x10(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0x11,%edx
xor    %ecx,%ecx
call   1030 <send@plt>
cmp    $0xffffffff,%eax
jne    1182 <do_use_fd+0x52>
lea    0xe94(%rip),%rdi
call   1050 <perror@plt>
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_use_fd>:
push   %rbx
sub    $0x20,%rsp
mov    %edi,%ebx
movaps 0xec2(%rip),%xmm0
movaps %xmm0,(%rsp)
movb   $0x0,0x10(%rsp)
mov    %rsp,%rsi
mov    $0x11,%edx
xor    %ecx,%ecx
call   1030 <send@plt>
cmp    $0xffffffff,%eax
je     1168 <do_use_fd+0x38>
mov    %ebx,%edi
call   1040 <close@plt>
add    $0x20,%rsp
pop    %rbx
ret
lea    0xea2(%rip),%rdi
call   1050 <perror@plt>
jmp    115b <do_use_fd+0x2b>

LLVM IR (-O0):
@__const.do_use_fd.str = [17 x i8] c"God bless you!/n\00"
@.str = [5 x i8] c"send\00"
define void @do_use_fd(i32 %0) {
%2 = alloca i32
%3 = alloca [17 x i8]
store i32 %0, i32* %2
%4 = bitcast [17 x i8]* %3 to i8*
%5 = load i32, i32* %2
%6 = getelementptr inbounds [17 x i8], [17 x i8]* %3, i64 0, i64 0
%7 = call i32 @send(i32 %5, i8* %6, i32 17, i32 0)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
%12 = load i32, i32* %2
%13 = call i32 @close(i32 %12)
ret void
}

LLVM IR (-O2):
@__const.do_use_fd.str = [17 x i8] c"God bless you!/n\00"
@.str = [5 x i8] c"send\00"
define void @do_use_fd(i32 %0) {
%2 = alloca [17 x i8]
%3 = getelementptr inbounds [17 x i8], [17 x i8]* %2, i64 0, i64 0
%4 = call i32 @send(i32 %0, i8* %3, i32 17, i32 0)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
%9 = call i32 @close(i32 %0)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int _byte_mod25(int);
uint8_t _hex_nib(uint8_t nib) { return _byte_mod25((nib & 0x1f) + 9); }


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

x86 assembly (clang, -O2):
<_hex_nib>:
and    $0x1f,%edi
add    $0x9,%edi
jmp    1030 <_byte_mod25@plt>

LLVM IR (-O0):
define i32 @_hex_nib(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 31
%5 = add nsw i32 %4, 9
%6 = call i32 @_byte_mod25(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @_hex_nib(i32 %0) {
%2 = and i32 %0, 31
%3 = add nuw nsw i32 %2, 9
%4 = tail call i32 @_byte_mod25(i32 %3)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void usage(FILE *fp, int argc, char **argv) {
  fprintf(fp,
          "Usage: %s [options]\n\n"
          "Options:\n"
          "-d | --device name       Video device name [/dev/video0]\n"
          "-h | --help              Print this message\n"
          "-s | --server address    Server [ip address/hostname]\n"
          "-p | --port port number  Port [8888]\n"
          "",
          argv[0]);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%rdx
lea    0xecb(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [223 x i8] c"Usage: %s [options]\0A\0AOptions:\0A-d | --device name Video device name [/dev/video0]\0A-h | --help Print this message\0A-s | --server address Server [ip address/hostname]\0A-p | --port port number Port [8888]\0A\00"
define void @usage(i32* %0, i32 %1, i8** %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8**
store i32* %0, i32** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%7 = load i32*, i32** %4
%8 = load i8**, i8*** %6
%9 = getelementptr inbounds i8*, i8** %8, i64 0
%10 = load i8*, i8** %9
%11 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([223 x i8], [223 x i8]* @.str, i64 0, i64 0), i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [223 x i8] c"Usage: %s [options]\0A\0AOptions:\0A-d | --device name Video device name [/dev/video0]\0A-h | --help Print this message\0A-s | --server address Server [ip address/hostname]\0A-p | --port port number Port [8888]\0A\00"
define void @usage(i32* nocapture %0, i32 %1, i8** nocapture %2) {
%4 = load i8*, i8** %2
%5 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([223 x i8], [223 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}
/* Variables and functions */
char *dupstrn(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
char *dupstr(const char *s) { return dupstrn(s, strlen(s)); }


x86 assembly (clang, -O0):
<dupstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1030 <dupstrn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dupstr>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <dupstrn@plt>

LLVM IR (-O0):
define i8* @dupstr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i8* @dupstrn(i8* %3, i32 %5)
ret i8* %6
}

LLVM IR (-O2):
define i8* @dupstr(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i8* @dupstrn(i8* %0, i32 %2)
ret i8* %3
}
char *AdmAdvance(char *pt) {
  while (*pt && (*pt == ' ' || *pt == '\t'))
    pt++;
  return pt;
}


x86 assembly (clang, -O0):
<AdmAdvance>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1148 <AdmAdvance+0x48>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0xa(%rbp)
je     1142 <AdmAdvance+0x42>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1158 <AdmAdvance+0x58>
jmp    1169 <AdmAdvance+0x69>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <AdmAdvance+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AdmAdvance>:
mov    %rdi,%rax
jmp    1114 <AdmAdvance+0x14>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rax
movzbl (%rax),%ecx
cmp    $0x20,%cl
je     1110 <AdmAdvance+0x10>
cmp    $0x9,%cl
je     1110 <AdmAdvance+0x10>
ret

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

LLVM IR (-O2):
define i8* @AdmAdvance(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 9, label %5
i8 32, label %5
]
5: ; preds = %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
ret i8* %3
}
double OP_Mult(double op1, double op2) { return op1 * op2; }


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

x86 assembly (clang, -O2):
<OP_Mult>:
mulsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @OP_Mult(double %0, double %1) {
%3 = fmul double %0, %1
ret double %3
}