xunge/DecIR huggingface dataset:
/* Variables and functions */
void strcat(char *original, char appended) {
  while (*original++)
    ;
  *original--;
  *original = appended;
  *original++;
  *original = '\0';
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     112b <strcat+0x2b>
jmp    110e <strcat+0xe>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1100 <strcat>
mov    %sil,-0x1(%rdi)
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @strcat(i8* nocapture %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %5, %3 ]
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %4
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3
store i8 %1, i8* %4
store i8 0, i8* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
long _printRecursive(long EV_num, long EV_rec) {
  if ((EV_rec == 0)) {
    return EV_num;
  } else {
    printf("%ld\n", (long)EV_num);
    EV_rec = (EV_rec - 1);
    return _printRecursive(EV_num, EV_rec);
  }
}


x86 assembly (clang, -O0):
<_printRecursive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1148 <_printRecursive+0x28>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1175 <_printRecursive+0x55>
mov    -0x10(%rbp),%rsi
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <_printRecursive@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_printRecursive>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %rsi,%rsi
je     1141 <_printRecursive+0x31>
mov    %rsi,%rbx
lea    0xed9(%rip),%r15
nopw   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
add    $0xffffffffffffffff,%rbx
jne    1130 <_printRecursive+0x20>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

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


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ z80_ix_iy_bit_instruction(int /*<<< orphan*/);
uint16_t z80_ix_iy_cb_prefix(uint16_t ix) {
  z80_ix_iy_bit_instruction(ix);
  return ix;
}


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

x86 assembly (clang, -O2):
<z80_ix_iy_cb_prefix>:
push   %rbx
mov    %edi,%ebx
call   1030 <z80_ix_iy_bit_instruction@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @z80_ix_iy_cb_prefix(i32 returned %0) {
%2 = tail call i32 @z80_ix_iy_bit_instruction(i32 %0)
ret i32 %0
}
void ms_delay(int ms) {
  while (ms-- > 0) {
    volatile int x = 500;
    while (x-- > 0)
      __asm("nop");
  }
}


x86 assembly (clang, -O0):
<ms_delay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
jle    1141 <ms_delay+0x41>
movl   $0x1f4,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
jle    113c <ms_delay+0x3c>
nop
jmp    1122 <ms_delay+0x22>
jmp    1107 <ms_delay+0x7>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ms_delay>:
test   %edi,%edi
jg     111a <ms_delay+0x1a>
ret
cs nopw 0x0(%rax,%rax,1)
nop
lea    -0x1(%rdi),%eax
cmp    $0x1,%edi
mov    %eax,%edi
jle    1104 <ms_delay+0x4>
movl   $0x1f4,-0x4(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    -0x4(%rsp),%eax
lea    -0x1(%rax),%ecx
mov    %ecx,-0x4(%rsp)
test   %eax,%eax
jle    1110 <ms_delay+0x10>
nop
jmp    1130 <ms_delay+0x30>

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

LLVM IR (-O2):
define void @ms_delay(i32 %0) {
%2 = alloca i32
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %18
4: ; preds = %1
%5 = bitcast i32* %2 to i8*
br label %6
6: ; preds = %4, %16
%7 = phi i32 [ %0, %4 ], [ %8, %16 ]
%8 = add nsw i32 %7, -1
store volatile i32 500, i32* %2
%9 = load volatile i32, i32* %2
%10 = add nsw i32 %9, -1
store volatile i32 %10, i32* %2
%11 = icmp sgt i32 %9, 0
br i1 %11, label %12, label %16
12: ; preds = %6, %12
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
%13 = load volatile i32, i32* %2
%14 = add nsw i32 %13, -1
store volatile i32 %14, i32* %2
%15 = icmp sgt i32 %13, 0
br i1 %15, label %12, label %16
16: ; preds = %12, %6
%17 = icmp sgt i32 %7, 1
br i1 %17, label %6, label %18
18: ; preds = %16, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ MSG_DONTWAIT;
int /*<<< orphan*/ recv(int, unsigned char *, size_t, int /*<<< orphan*/);
ssize_t packet_socket_recv(int fd, unsigned char *buffer, size_t bufsize) {
  return recv(fd, buffer, bufsize, MSG_DONTWAIT);
}


x86 assembly (clang, -O0):
<packet_socket_recv>:
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
mov    0x2eab(%rip),%rax
mov    (%rax),%ecx
call   1030 <recv@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<packet_socket_recv>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%ecx
jmp    1030 <recv@plt>

LLVM IR (-O0):
@MSG_DONTWAIT = global i32 0
define i32 @packet_socket_recv(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = load i32, i32* @MSG_DONTWAIT
%11 = call i32 @recv(i32 %7, i8* %8, i64 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
@MSG_DONTWAIT = global i32 0
define i32 @packet_socket_recv(i32 %0, i8* %1, i64 %2) {
%4 = load i32, i32* @MSG_DONTWAIT
%5 = tail call i32 @recv(i32 %0, i8* %1, i64 %2, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int age;
  int height = 72;
  printf("I am %d years old.\n", age);
  printf("I am %d inches tall.\n", height);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x48,-0x18(%rbp)
mov    -0x14(%rbp),%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [20 x i8] c"I am %d years old.\0A\00"
@.str.1 = [22 x i8] c"I am %d inches tall.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 72, i32* %7
%8 = load i32, i32* %6
%9 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %7
%11 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"I am %d years old.\0A\00"
@.str.1 = [22 x i8] c"I am %d inches tall.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 undef)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 72)
ret i32 0
}
unsigned int msb(unsigned int x) {
  x |= x >> 1;
  x |= x >> 2;
  x |= x >> 4;
  x |= x >> 8;
  x |= x >> 16;
  return x & ~(x >> 1);
}


x86 assembly (clang, -O0):
<msb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x2,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x4,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x1,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<msb>:
mov    %edi,%eax
shr    %eax
or     %edi,%eax
mov    %eax,%ecx
shr    $0x2,%ecx
or     %eax,%ecx
mov    %ecx,%eax
shr    $0x4,%eax
or     %ecx,%eax
mov    %eax,%ecx
shr    $0x8,%ecx
or     %eax,%ecx
mov    %ecx,%edx
shr    $0x10,%edx
or     %ecx,%edx
mov    %edx,%eax
shr    %eax
not    %eax
and    %edx,%eax
ret

LLVM IR (-O0):
define i32 @msb(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 1
%5 = load i32, i32* %2
%6 = or i32 %5, %4
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = lshr i32 %7, 2
%9 = load i32, i32* %2
%10 = or i32 %9, %8
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = lshr i32 %11, 4
%13 = load i32, i32* %2
%14 = or i32 %13, %12
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = lshr i32 %15, 8
%17 = load i32, i32* %2
%18 = or i32 %17, %16
store i32 %18, i32* %2
%19 = load i32, i32* %2
%20 = lshr i32 %19, 16
%21 = load i32, i32* %2
%22 = or i32 %21, %20
store i32 %22, i32* %2
%23 = load i32, i32* %2
%24 = load i32, i32* %2
%25 = lshr i32 %24, 1
%26 = xor i32 %25, -1
%27 = and i32 %23, %26
ret i32 %27
}

LLVM IR (-O2):
define i32 @msb(i32 %0) {
%2 = lshr i32 %0, 1
%3 = or i32 %2, %0
%4 = lshr i32 %3, 2
%5 = or i32 %4, %3
%6 = lshr i32 %5, 4
%7 = or i32 %6, %5
%8 = lshr i32 %7, 8
%9 = or i32 %8, %7
%10 = lshr i32 %9, 16
%11 = or i32 %10, %9
%12 = lshr i32 %11, 1
%13 = xor i32 %12, -1
%14 = and i32 %11, %13
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ ft_putendl(char *);
int /*<<< orphan*/ ft_putnbr(int);
int /*<<< orphan*/ ft_putstr(char *);
void ft_putnbrendl_err(int nb) {
  ft_putstr("\x1B[31m");
  ft_putnbr(nb);
  ft_putendl("\x1B[0m");
}


x86 assembly (clang, -O0):
<ft_putnbrendl_err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1050 <ft_putstr@plt>
mov    -0x4(%rbp),%edi
call   1040 <ft_putnbr@plt>
lea    0xeb0(%rip),%rdi
call   1030 <ft_putendl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putnbrendl_err>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rdi
call   1050 <ft_putstr@plt>
mov    %ebx,%edi
call   1040 <ft_putnbr@plt>
lea    0xeb9(%rip),%rdi
pop    %rbx
jmp    1030 <ft_putendl@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"\1B[31m\00"
@.str.1 = [5 x i8] c"\1B[0m\00"
define void @ft_putnbrendl_err(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @ft_putstr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @ft_putnbr(i32 %4)
%6 = call i32 @ft_putendl(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[31m\00"
@.str.1 = [5 x i8] c"\1B[0m\00"
define void @ft_putnbrendl_err(i32 %0) {
%2 = tail call i32 @ft_putstr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @ft_putnbr(i32 %0)
%4 = tail call i32 @ft_putendl(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}
char *xsplit(char **ppos, int sep) {
  char *res = *ppos;
  char *pos = *ppos;
  for (; *pos != 0; ++pos) {
    if (*pos == sep) {
      *pos++ = 0;
      break;
    }
  }
  *ppos = pos;
  return res;
}


x86 assembly (clang, -O0):
<xsplit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     116e <xsplit+0x6e>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    -0xc(%rbp),%eax
jne    1158 <xsplit+0x58>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movb   $0x0,(%rax)
jmp    116e <xsplit+0x6e>
jmp    115d <xsplit+0x5d>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1121 <xsplit+0x21>
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xsplit>:
mov    (%rdi),%rax
mov    (%rax),%dl
mov    %rax,%rcx
test   %dl,%dl
je     1125 <xsplit+0x25>
lea    0x1(%rax),%r8
mov    %r8,%rcx
movsbl %dl,%edx
cmp    %esi,%edx
je     1129 <xsplit+0x29>
movzbl (%rcx),%edx
lea    0x1(%rcx),%r8
test   %dl,%dl
jne    1110 <xsplit+0x10>
mov    %rcx,(%rdi)
ret
movb   $0x0,-0x1(%rcx)
mov    %rcx,(%rdi)
ret

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

LLVM IR (-O2):
define i8* @xsplit(i8** nocapture %0, i32 %1) {
%3 = load i8*, i8** %0
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %16, label %6
6: ; preds = %2, %13
%7 = phi i8 [ %14, %13 ], [ %4, %2 ]
%8 = phi i8* [ %11, %13 ], [ %3, %2 ]
%9 = sext i8 %7 to i32
%10 = icmp eq i32 %9, %1
%11 = getelementptr inbounds i8, i8* %8, i64 1
br i1 %10, label %12, label %13
12: ; preds = %6
store i8 0, i8* %8
br label %16
13: ; preds = %6
%14 = load i8, i8* %11
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %6
16: ; preds = %13, %2, %12
%17 = phi i8* [ %11, %12 ], [ %3, %2 ], [ %11, %13 ]
store i8* %17, i8** %0
ret i8* %3
}
int vrednostCrke(char c) { return c - 'A' + 1; }


x86 assembly (clang, -O0):
<vrednostCrke>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x41,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vrednostCrke>:
lea    -0x40(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @vrednostCrke(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 65
%6 = add nsw i32 %5, 1
ret i32 %6
}

LLVM IR (-O2):
define i32 @vrednostCrke(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -64
ret i32 %3
}
/* Type definitions */
struct vector {
  int dummy;
};

/* Variables and functions */
float vec_dot_product(struct vector const *, struct vector const *);
float vec_length_squared(const struct vector *a) {
  return vec_dot_product(a, a);
}


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

x86 assembly (clang, -O2):
<vec_length_squared>:
mov    %rdi,%rsi
jmp    1030 <vec_dot_product@plt>

LLVM IR (-O0):
%struct.vector = type { i32 }
define float @vec_length_squared(%struct.vector* %0) {
%2 = alloca %struct.vector*
store %struct.vector* %0, %struct.vector** %2
%3 = load %struct.vector*, %struct.vector** %2
%4 = load %struct.vector*, %struct.vector** %2
%5 = call float @vec_dot_product(%struct.vector* %3, %struct.vector* %4)
ret float %5
}

LLVM IR (-O2):
%struct.vector = type { i32 }
define float @vec_length_squared(%struct.vector* %0) {
%2 = tail call float @vec_dot_product(%struct.vector* %0, %struct.vector* %0)
ret float %2
}
/* Type definitions */
struct termpair {
  int dummy;
};
struct termp {
  int dummy;
};
struct mdoc_node {
  int dummy;
};
struct mdoc_meta {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ term_newln(struct termp *);
void termp_fd_post(struct termp *p, struct termpair *pair,
                   const struct mdoc_meta *meta, struct mdoc_node *n) {
  term_newln(p);
}


x86 assembly (clang, -O0):
<termp_fd_post>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <term_newln@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<termp_fd_post>:
jmp    1030 <term_newln@plt>

LLVM IR (-O0):
%struct.termp = type { i32 }
%struct.termpair = type { i32 }
%struct.mdoc_meta = type { i32 }
%struct.mdoc_node = type { i32 }
define void @termp_fd_post(%struct.termp* %0, %struct.termpair* %1, %struct.mdoc_meta* %2, %struct.mdoc_node* %3) {
%5 = alloca %struct.termp*
%6 = alloca %struct.termpair*
%7 = alloca %struct.mdoc_meta*
%8 = alloca %struct.mdoc_node*
store %struct.termp* %0, %struct.termp** %5
store %struct.termpair* %1, %struct.termpair** %6
store %struct.mdoc_meta* %2, %struct.mdoc_meta** %7
store %struct.mdoc_node* %3, %struct.mdoc_node** %8
%9 = load %struct.termp*, %struct.termp** %5
%10 = call i32 @term_newln(%struct.termp* %9)
ret void
}

LLVM IR (-O2):
%struct.termp = type { i32 }
%struct.termpair = type { i32 }
%struct.mdoc_meta = type { i32 }
%struct.mdoc_node = type { i32 }
define void @termp_fd_post(%struct.termp* %0, %struct.termpair* nocapture readnone %1, %struct.mdoc_meta* nocapture readnone %2, %struct.mdoc_node* nocapture readnone %3) {
%5 = tail call i32 @term_newln(%struct.termp* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ metal_machine_cache_invalidate(void *, unsigned int);
void metal_cache_invalidate(void *addr, unsigned int len) {
  metal_machine_cache_invalidate(addr, len);
}


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

x86 assembly (clang, -O2):
<metal_cache_invalidate>:
jmp    1030 <metal_machine_cache_invalidate@plt>

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

LLVM IR (-O2):
define void @metal_cache_invalidate(i8* %0, i32 %1) {
%3 = tail call i32 @metal_machine_cache_invalidate(i8* %0, i32 %1)
ret void
}
void foo621(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo621(i32 %0) {
ret void
}
/* Variables and functions */
int mlt(int, int);
int mltn(int n, int x) {
  int i, j;
  i = x;
  for (j = 0; j < n - 1; j++)
    i = mlt(i, x);
  return i;
}


x86 assembly (clang, -O0):
<mltn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1158 <mltn+0x48>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <mlt@plt>
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112b <mltn+0x1b>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mltn>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
cmp    $0x2,%edi
jl     1140 <mltn+0x30>
mov    %edi,%ebp
add    $0xffffffff,%ebp
mov    %ebx,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %eax,%edi
mov    %ebx,%esi
call   1030 <mlt@plt>
add    $0xffffffff,%ebp
jne    1130 <mltn+0x20>
jmp    1142 <mltn+0x32>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @mltn(i32 %0, i32 %1) {
%3 = add i32 %0, -1
%4 = icmp sgt i32 %0, 1
br i1 %4, label %5, label %11
5: ; preds = %2, %5
%6 = phi i32 [ %9, %5 ], [ 0, %2 ]
%7 = phi i32 [ %8, %5 ], [ %1, %2 ]
%8 = tail call i32 @mlt(i32 %7, i32 %1)
%9 = add nuw nsw i32 %6, 1
%10 = icmp eq i32 %9, %3
br i1 %10, label %11, label %5
11: ; preds = %5, %2
%12 = phi i32 [ %1, %2 ], [ %8, %5 ]
ret i32 %12
}
int test_imm_54int16_mem(short *val) {
  return ((*val) & (-0x54 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_54int16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0xffffffac,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_54int16_mem>:
movzwl (%rdi),%eax
test   $0xffac,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_54int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -84
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ bubble_sort();
int /*<<< orphan*/ inputData();
int main() {
  inputData();
  bubble_sort();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @inputData()
%2 = tail call i32 (...) @bubble_sort()
ret i32 0
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMR62_set(void) { return U_WMRCORENONE_set("U_WMR62"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR62\00"
define i8* @U_WMR62_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR62\00"
define i8* @U_WMR62_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
int test_imm_57int8_reg(signed char val) {
  return ((val) & (-0x57 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_57int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffffa9,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_57int8_reg(i8 signext %0) {
%2 = and i8 %0, -87
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int GetThreadLocale(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @GetThreadLocale() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t bin_segbase(int32_t segment) { return segment; }


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

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

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

LLVM IR (-O2):
define i32 @bin_segbase(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
double cal(double, double);
int /*<<< orphan*/ printf(char *, double);
int scanf(char *, double *, double *);
int main(void) {
  double a, b;
  while (scanf("%lf%lf", &a, &b) == 2)
    printf("%f\n", cal(a, b));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
cmp    $0x2,%eax
jne    117c <main+0x4c>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1050 <cal@plt>
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xebe(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1040 <scanf@plt>
cmp    $0x2,%eax
jne    119c <main+0x6c>
lea    0xeaa(%rip),%r14
lea    0xe9c(%rip),%r15
lea    0x10(%rsp),%r12
lea    0x8(%rsp),%rbx
xchg   %ax,%ax
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1050 <cal@plt>
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1040 <scanf@plt>
cmp    $0x2,%eax
je     1170 <main+0x40>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%lf%lf\00"
@.str.1 = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = bitcast double* %1 to i8*
%4 = bitcast double* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double* %1, double* %2)
%6 = icmp eq i32 %5, 2
br i1 %6, label %7, label %14
7: ; preds = %0, %7
%8 = load double, double* %1
%9 = load double, double* %2
%10 = call double @cal(double %8, double %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %10)
%12 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double* %1, double* %2)
%13 = icmp eq i32 %12, 2
br i1 %13, label %7, label %14
14: ; preds = %7, %0
ret i32 0
}
/* Variables and functions */
bool nog(bool s, bool c) {
  if (c)
    return !s;
  else
    return s;
}


x86 assembly (clang, -O0):
<nog>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     112a <nog+0x2a>
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1130 <nog+0x30>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nog>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
test   %esi,%esi
cmove  %edi,%eax
ret

LLVM IR (-O0):
define i32 @nog(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* %5
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
store i32 %12, i32* %3
br label %15
13: ; preds = %2
%14 = load i32, i32* %4
store i32 %14, i32* %3
br label %15
15: ; preds = %13, %8
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @nog(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = icmp eq i32 %0, 0
%5 = zext i1 %4 to i32
%6 = select i1 %3, i32 %0, i32 %5
ret i32 %6
}
/* Variables and functions */
int add(int, int);
int main(int argc, char *argv[]) {
  int x = 5;
  int y = 10;
  return add(x, y);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x5,-0x14(%rbp)
movl   $0xa,-0x18(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1030 <add@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x5,%edi
mov    $0xa,%esi
jmp    1030 <add@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 5, i32* %6
store i32 10, i32* %7
%8 = load i32, i32* %6
%9 = load i32, i32* %7
%10 = call i32 @add(i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @add(i32 5, i32 10)
ret i32 %3
}
/* Variables and functions */
int partition(int *, int, int);
void __quick_sort(int arr[], int low, int high) {
  int pivot;
  if (low < high) {
    pivot = partition(arr, low, high);
    __quick_sort(arr, low, pivot - 1);
    __quick_sort(arr, pivot + 1, high);
  }
}


x86 assembly (clang, -O0):
<__quick_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <__quick_sort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <__quick_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <__quick_sort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__quick_sort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <__quick_sort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <__quick_sort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <__quick_sort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @__quick_sort(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %24
11: ; preds = %3
%12 = load i32*, i32** %4
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = call i32 @partition(i32* %12, i32 %13, i32 %14)
store i32 %15, i32* %7
%16 = load i32*, i32** %4
%17 = load i32, i32* %5
%18 = load i32, i32* %7
%19 = sub nsw i32 %18, 1
%20 = load i32*, i32** %4
%21 = load i32, i32* %7
%22 = add nsw i32 %21, 1
%23 = load i32, i32* %6
br label %24
24: ; preds = %11, %3
ret void
}

LLVM IR (-O2):
define void @__quick_sort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @__quick_sort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
long SIO1_shutdown(void) { return 0; }


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

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

LLVM IR (-O0):
define i64 @SIO1_shutdown() {
ret i64 0
}

LLVM IR (-O2):
define i64 @SIO1_shutdown() {
ret i64 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ _syscall(int, int /*<<< orphan*/, int /*<<< orphan*/,
                            int /*<<< orphan*/);
pid_t getpid(void) { return _syscall(20, 0, 0, 0); }


x86 assembly (clang, -O0):
<getpid>:
push   %rbp
mov    %rsp,%rbp
mov    $0x14,%edi
xor    %ecx,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <_syscall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<getpid>:
mov    $0x14,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <_syscall@plt>

LLVM IR (-O0):
define i32 @getpid() {
%1 = call i32 @_syscall(i32 20, i32 0, i32 0, i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @getpid() {
%1 = tail call i32 @_syscall(i32 20, i32 0, i32 0, i32 0)
ret i32 %1
}
int test_imm_E7uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0xE7 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_E7uint64_highword_mem>:
testb  $0xe7,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_E7uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 992137445376
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void foo519() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ di_drop_weak_ref(struct di_weak_object **);
void di_drop_weak_ref_rvalue(struct di_weak_object *weak) {
  di_drop_weak_ref(&weak);
}


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

x86 assembly (clang, -O2):
<di_drop_weak_ref_rvalue>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
call   1030 <di_drop_weak_ref@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.di_weak_object = type { i32 }
define void @di_drop_weak_ref_rvalue(%struct.di_weak_object* %0) {
%2 = alloca %struct.di_weak_object*
store %struct.di_weak_object* %0, %struct.di_weak_object** %2
%3 = call i32 @di_drop_weak_ref(%struct.di_weak_object** %2)
ret void
}

LLVM IR (-O2):
%struct.di_weak_object = type { i32 }
define void @di_drop_weak_ref_rvalue(%struct.di_weak_object* %0) {
%2 = alloca %struct.di_weak_object*
store %struct.di_weak_object* %0, %struct.di_weak_object** %2
%3 = call i32 @di_drop_weak_ref(%struct.di_weak_object** %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ system(char *);
int main() {
  char a = 'a';
  printf("%c", a);
  system("pause");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@.str.1 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext 97)
%2 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
double Q_w(double Q_w_convection, double Q_w_gradp, double Q_w_time,
           double Q_w_viscous) {
  return Q_w_convection + Q_w_gradp + Q_w_time + Q_w_viscous;
}


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

x86 assembly (clang, -O2):
<Q_w>:
addsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
addsd  %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @Q_w(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %6
%11 = fadd double %9, %10
%12 = load double, double* %7
%13 = fadd double %11, %12
%14 = load double, double* %8
%15 = fadd double %13, %14
ret double %15
}

LLVM IR (-O2):
define double @Q_w(double %0, double %1, double %2, double %3) {
%5 = fadd double %0, %1
%6 = fadd double %5, %2
%7 = fadd double %6, %3
ret double %7
}
int ackermann(int m, int n) {
  if (m == 0)
    return n + 1;
  else if (n == 0)
    return ackermann(m - 1, 1);
  else
    return ackermann(m - 1, ackermann(m, n - 1));
}


x86 assembly (clang, -O0):
<ackermann>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1136 <ackermann+0x26>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    117c <ackermann+0x6c>
cmpl   $0x0,-0xc(%rbp)
jne    1158 <ackermann+0x48>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    $0x1,%esi
call   1030 <ackermann@plt>
mov    %eax,-0x4(%rbp)
jmp    117c <ackermann+0x6c>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <ackermann@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
call   1030 <ackermann@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ackermann>:
push   %rbx
mov    %esi,%eax
test   %edi,%edi
je     113f <ackermann+0x2f>
mov    %edi,%ebx
jmp    112a <ackermann+0x1a>
nopl   0x0(%rax,%rax,1)
mov    $0x1,%eax
add    $0xffffffff,%ebx
je     113f <ackermann+0x2f>
test   %eax,%eax
je     1120 <ackermann+0x10>
add    $0xffffffff,%eax
mov    %ebx,%edi
mov    %eax,%esi
call   1030 <ackermann@plt>
add    $0xffffffff,%ebx
jne    112a <ackermann+0x1a>
add    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ackermann(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 = icmp eq i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* %5
%10 = add nsw i32 %9, 1
store i32 %10, i32* %3
br label %26
11: ; preds = %2
%12 = load i32, i32* %5
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %11
%15 = load i32, i32* %4
%16 = sub nsw i32 %15, 1
%17 = call i32 @ackermann(i32 %16, i32 1)
store i32 %17, i32* %3
br label %26
18: ; preds = %11
%19 = load i32, i32* %4
%20 = sub nsw i32 %19, 1
%21 = load i32, i32* %4
%22 = load i32, i32* %5
%23 = sub nsw i32 %22, 1
%24 = call i32 @ackermann(i32 %21, i32 %23)
%25 = call i32 @ackermann(i32 %20, i32 %24)
store i32 %25, i32* %3
br label %26
26: ; preds = %18, %14, %8
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @ackermann(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %7
4: ; preds = %11, %2
%5 = phi i32 [ %1, %2 ], [ %12, %11 ]
%6 = add nsw i32 %5, 1
ret i32 %6
7: ; preds = %2, %11
%8 = phi i32 [ %12, %11 ], [ %1, %2 ]
%9 = phi i32 [ %13, %11 ], [ %0, %2 ]
%10 = icmp eq i32 %8, 0
br i1 %10, label %11, label %15
11: ; preds = %7, %15
%12 = phi i32 [ %17, %15 ], [ 1, %7 ]
%13 = add nsw i32 %9, -1
%14 = icmp eq i32 %13, 0
br i1 %14, label %4, label %7
15: ; preds = %7
%16 = add nsw i32 %8, -1
%17 = tail call i32 @ackermann(i32 %9, i32 %16)
br label %11
}
unsigned long long int ulmax(unsigned long long int a,
                             unsigned long long int b) {
  return a > b ? a : b;
}


x86 assembly (clang, -O0):
<ulmax>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    1127 <ulmax+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <ulmax+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ulmax>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmova  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @ulmax(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp ugt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @ulmax(i64 %0, i64 %1) {
%3 = icmp ugt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ au_dbg_blocked();
scalar_t__ au_wkq_test();
void au_dbg_verify_kthread(void) {
  if (au_wkq_test()) {
    au_dbg_blocked();
  }
}


x86 assembly (clang, -O0):
<au_dbg_verify_kthread>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <au_wkq_test@plt>
cmp    $0x0,%rax
je     113c <au_dbg_verify_kthread+0x1c>
mov    $0x0,%al
call   1040 <au_dbg_blocked@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<au_dbg_verify_kthread>:
push   %rax
xor    %eax,%eax
call   1030 <au_wkq_test@plt>
test   %rax,%rax
je     1135 <au_dbg_verify_kthread+0x15>
xor    %eax,%eax
pop    %rcx
jmp    1040 <au_dbg_blocked@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @au_dbg_verify_kthread() {
%1 = call i64 (...) @au_wkq_test()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @au_dbg_blocked()
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @au_dbg_verify_kthread() {
%1 = tail call i64 (...) @au_wkq_test()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @au_dbg_blocked()
br label %5
5: ; preds = %3, %0
ret void
}