xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sph_helper_display_bits_u8(int /*<<< orphan*/);
void sph_helper_display_bits(void *a, size_t size) {
  size_t i;
  for (i = 0; (i < size); i = (1 + i)) {
    sph_helper_display_bits_u8((((uint8_t *)(a))[i]));
  };
  printf("\n");
}


x86 assembly (clang, -O0):
<sph_helper_display_bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1167 <sph_helper_display_bits+0x47>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1040 <sph_helper_display_bits_u8@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1138 <sph_helper_display_bits+0x18>
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sph_helper_display_bits>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     1152 <sph_helper_display_bits+0x32>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r14,%rbx,4),%edi
call   1040 <sph_helper_display_bits_u8@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1140 <sph_helper_display_bits+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @sph_helper_display_bits(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = bitcast i8* %0 to i32*
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @sph_helper_display_bits_u8(i32 %9)
%11 = add nuw i64 %7, 1
%12 = icmp eq i64 %11, %1
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int *, int *, int);
int main() {
  int x;
  int list[3];
  int *a;
  a = &x;
  list[1] = 2;
  *a = 35 + list[1];
  printf("%p %p %d\n", &x, list, x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x4(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
add    $0x23,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
lea    -0x10(%rbp),%rdx
mov    -0x4(%rbp),%ecx
lea    0xebf(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movl   $0x2,0x10(%rsp)
movl   $0x25,0x8(%rsp)
lea    0xed5(%rip),%rdi
lea    0x8(%rsp),%rsi
lea    0xc(%rsp),%rdx
mov    $0x25,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%p %p %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
%3 = alloca i32*
store i32* %1, i32** %3
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 1
store i32 2, i32* %4
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 1
%6 = load i32, i32* %5
%7 = add nsw i32 35, %6
%8 = load i32*, i32** %3
store i32 %7, i32* %8
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%10 = load i32, i32* %1
%11 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %9, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"%p %p %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
%3 = bitcast i32* %1 to i8*
%4 = bitcast [3 x i32]* %2 to i8*
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 1
store i32 2, i32* %5
store i32 37, i32* %1
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%7 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %6, i32 37)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void spacer(int n, int c) {
  int i;
  char str[259];
  for (i = 0; i < n; i++)
    printf("%c", (char)c);
}


x86 assembly (clang, -O0):
<spacer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1154 <spacer+0x44>
mov    -0x8(%rbp),%eax
lea    0xec2(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1128 <spacer+0x18>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spacer>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
jle    113f <spacer+0x2f>
mov    %edi,%ebx
movsbl %sil,%ebp
lea    0xedb(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
jne    1130 <spacer+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @spacer(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = trunc i32 %1 to i8
br label %6
6: ; preds = %4, %6
%7 = phi i32 [ 0, %4 ], [ %9, %6 ]
%8 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %5)
%9 = add nuw nsw i32 %7, 1
%10 = icmp eq i32 %9, %0
br i1 %10, label %11, label %6
11: ; preds = %6, %2
ret void
}
/* Variables and functions */
double GetScrCapsX62();
double getscrcapsx() { return GetScrCapsX62(); }


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

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

LLVM IR (-O0):
define double @getscrcapsx() {
%1 = call double (...) @GetScrCapsX62()
ret double %1
}

LLVM IR (-O2):
define double @getscrcapsx() {
%1 = tail call double (...) @GetScrCapsX62()
ret double %1
}
/* Variables and functions */
size_t internal_strlen(const char *s) {
  size_t n;
  for (n = 0; s && *s; ++n, ++s)
    ;
  return n;
}


x86 assembly (clang, -O0):
<internal_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
je     1130 <internal_strlen+0x30>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1140 <internal_strlen+0x40>
jmp    1162 <internal_strlen+0x62>
jmp    1145 <internal_strlen+0x45>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <internal_strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<internal_strlen>:
test   %rdi,%rdi
je     111f <internal_strlen+0x1f>
cmpb   $0x0,(%rdi)
je     111f <internal_strlen+0x1f>
xor    %ecx,%ecx
nopl   0x0(%rax)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
mov    %rax,%rcx
jne    1110 <internal_strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @internal_strlen(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %10, %6 ], [ %0, %3 ]
%8 = phi i64 [ %9, %6 ], [ 0, %3 ]
%9 = add i64 %8, 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %3, %1
%14 = phi i64 [ 0, %1 ], [ 0, %3 ], [ %9, %6 ]
ret i64 %14
}
char *movstr(register const char *a, register char *b) {
  while (*b++ = *a++)
    ;
  return (--b);
}


x86 assembly (clang, -O0):
<movstr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     113b <movstr+0x3b>
jmp    110c <movstr+0xc>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<movstr>:
mov    %rsi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %cl,0x1(%rax)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <movstr+0x10>
ret

LLVM IR (-O0):
define i8* @movstr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %12, %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 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %4
store i8 %8, i8* %9
%11 = icmp ne i8 %8, 0
br i1 %11, label %12, label %13
12: ; preds = %5
br label %5
13: ; preds = %5
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i32 -1
store i8* %15, i8** %4
ret i8* %15
}

LLVM IR (-O2):
define i8* @movstr(i8* nocapture %0, i8* writeonly %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %6, %3 ]
%5 = phi i8* [ %1, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ callrts(char *);
zor() { callrts("ccor"); }


x86 assembly (clang, -O0):
<zor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <callrts@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"ccor\00"
define i32 @zor() {
%1 = alloca i32
%2 = call i32 @callrts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [5 x i8] c"ccor\00"
define i32 @zor() {
%1 = tail call i32 @callrts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ t1();
int /*<<< orphan*/ t2();
int /*<<< orphan*/ t3();
void main() {
  t1();
  t2();
  t3();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <t1@plt>
mov    $0x0,%al
call   1050 <t2@plt>
mov    $0x0,%al
call   1040 <t3@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <t1@plt>
xor    %eax,%eax
call   1050 <t2@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <t3@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @t1()
%2 = call i32 (...) @t2()
%3 = call i32 (...) @t3()
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @t1()
%2 = tail call i32 (...) @t2()
%3 = tail call i32 (...) @t3()
ret void
}
int test_imm_9Auint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x9A << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_9Auint64_midword_reg>:
test   $0x9a0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_9Auint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 154
%6 = icmp ne i64 %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_9Auint64_midword_reg(i64 %0) {
%2 = and i64 %0, 10092544
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
unsigned xrop3_242_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~S;
  stk2 = D & stk3;
  stk1 = T | stk2;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_242_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_242_1_1>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
or     %ecx,%eax
or     %edi,%esi
xor    $0xff,%edi
not    %eax
and    %edi,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_242_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %6
%24 = xor i32 %23, -1
store i32 %24, i32* %10
%25 = load i32, i32* %5
%26 = load i32, i32* %10
%27 = and i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %7
%29 = load i32, i32* %9
%30 = or i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
%32 = load i32, i32* %6
%33 = xor i32 %32, -1
%34 = and i32 %31, %33
%35 = load i32, i32* %7
%36 = xor i32 %35, -1
%37 = and i32 %34, %36
%38 = load i32, i32* %5
%39 = load i32, i32* %6
%40 = and i32 %38, %39
%41 = or i32 %37, %40
%42 = load i32, i32* %5
%43 = load i32, i32* %7
%44 = and i32 %42, %43
%45 = or i32 %41, %44
ret i32 %45
}

LLVM IR (-O2):
define i32 @xrop3_242_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %3, 255
%8 = or i32 %6, %4
%9 = xor i32 %8, -1
%10 = and i32 %7, %9
%11 = or i8 %1, %0
%12 = zext i8 %11 to i32
%13 = or i32 %10, %12
ret i32 %13
}
int test_imm_6Cuint16_reg(unsigned short val) {
  return ((val) & (0x6C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_6Cuint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x6c,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_6Cuint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 108
%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_6Cuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 108
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int test_imm_15int8_reg(signed char val) {
  return ((val) & (0x15 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_15int8_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, 21
%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_15int8_reg(i8 signext %0) {
%2 = and i8 %0, 21
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void RTEnvFreeUtf16Block(void) {}


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

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

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

LLVM IR (-O2):
define void @RTEnvFreeUtf16Block() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sum_it(int);
int main(int argc, char *argv[]) {
  printf("sum_it(3)"
         " -> %d\n",
         sum_it(3));
  printf("sum_it(6)"
         " -> %d\n",
         sum_it(6));
  printf("sum_it(4)"
         " -> %d\n",
         sum_it(4));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x3,%edi
call   1040 <sum_it@plt>
mov    %eax,%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    $0x6,%edi
call   1040 <sum_it@plt>
mov    %eax,%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    $0x4,%edi
call   1040 <sum_it@plt>
mov    %eax,%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
call   1040 <sum_it@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x6,%edi
call   1040 <sum_it@plt>
lea    0xec7(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x4,%edi
call   1040 <sum_it@plt>
lea    0xec0(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"sum_it(3) -> %d\0A\00"
@.str.1 = [17 x i8] c"sum_it(6) -> %d\0A\00"
@.str.2 = [17 x i8] c"sum_it(4) -> %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @sum_it(i32 3)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @sum_it(i32 6)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = tail call i32 @sum_it(i32 4)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %7)
ret i32 0
}
void header_two_func(void) {}


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

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

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

LLVM IR (-O2):
define void @header_two_func() {
ret void
}
int populate_bar(int note) {
  int temp_notes[4];
  int shuffled_notes[4];
  temp_notes[0] = note;
  int major = note + 4;
  int minor = note + 5;
}


x86 assembly (clang, -O0):
<populate_bar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x34(%rbp)
mov    -0x8(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x38(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @populate_bar(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [4 x i32]
%5 = alloca [4 x i32]
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
%8 = load i32, i32* %3
%9 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
store i32 %8, i32* %9
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 4
store i32 %11, i32* %6
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 5
store i32 %13, i32* %7
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @populate_bar(i32 %0) {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int tm_mon;
  int tm_mday;
  int tm_year;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, int, int, int);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void ddate_1(void) {
  struct tm *t;
  time_t now;
  time(&now);
  t = localtime(&now);
  printf("%02d/%02d/%d\n\n\n", t->tm_mon + 1, t->tm_mday, t->tm_year - 101);
}


x86 assembly (clang, -O0):
<ddate_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0xc(%rbp),%rdi
call   1050 <time@plt>
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
add    $0x1,%esi
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%ecx
sub    $0x65,%ecx
lea    0xe91(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ddate_1>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <time@plt>
mov    %rbx,%rdi
call   1030 <localtime@plt>
mov    (%rax),%esi
mov    0x4(%rax),%edx
add    $0x1,%esi
mov    0x8(%rax),%ecx
add    $0xffffff9b,%ecx
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32, i32, i32 }
@.str = [16 x i8] c"%02d/%02d/%d\0A\0A\0A\00"
define void @ddate_1() {
%1 = alloca %struct.tm*
%2 = alloca i32
%3 = call i32 @time(i32* %2)
%4 = call %struct.tm* @localtime(i32* %2)
store %struct.tm* %4, %struct.tm** %1
%5 = load %struct.tm*, %struct.tm** %1
%6 = getelementptr inbounds %struct.tm, %struct.tm* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = add nsw i32 %7, 1
%9 = load %struct.tm*, %struct.tm** %1
%10 = getelementptr inbounds %struct.tm, %struct.tm* %9, i32 0, i32 1
%11 = load i32, i32* %10
%12 = load %struct.tm*, %struct.tm** %1
%13 = getelementptr inbounds %struct.tm, %struct.tm* %12, i32 0, i32 2
%14 = load i32, i32* %13
%15 = sub nsw i32 %14, 101
%16 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %11, i32 %15)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32, i32, i32 }
@.str = [16 x i8] c"%02d/%02d/%d\0A\0A\0A\00"
define void @ddate_1() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @time(i32* %1)
%4 = call %struct.tm* @localtime(i32* %1)
%5 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 0
%6 = load i32, i32* %5
%7 = add nsw i32 %6, 1
%8 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 1
%9 = load i32, i32* %8
%10 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 2
%11 = load i32, i32* %10
%12 = add nsw i32 %11, -101
%13 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %9, i32 %12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fun(char *, char *);
int /*<<< orphan*/ puts(char *);
int main() {
  char s1[100], s2[100] = "hello";
  fun(s1, s2);
  puts(s1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xe0(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1050 <memset@plt>
movb   $0x68,-0xe0(%rbp)
movb   $0x65,-0xdf(%rbp)
movb   $0x6c,-0xde(%rbp)
movb   $0x6c,-0xdd(%rbp)
movb   $0x6f,-0xdc(%rbp)
lea    -0x70(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
call   1040 <fun@plt>
lea    -0x70(%rbp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xe0,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movl   $0x0,0x60(%rsp)
movl   $0x6c6c6568,(%rsp)
movb   $0x6f,0x4(%rsp)
lea    0x70(%rsp),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1040 <fun@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca [100 x i8]
store i32 0, i32* %1
%4 = bitcast [100 x i8]* %3 to i8*
%5 = bitcast i8* %4 to [100 x i8]*
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i32 0, i32 0
store i8 104, i8* %6
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i32 0, i32 1
store i8 101, i8* %7
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i32 0, i32 2
store i8 108, i8* %8
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i32 0, i32 3
store i8 108, i8* %9
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i32 0, i32 4
store i8 111, i8* %10
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%13 = call i32 @fun(i8* %11, i8* %12)
%14 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%15 = call i32 @puts(i8* %14)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
store i8 104, i8* %4
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 1
store i8 101, i8* %5
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 2
store i8 108, i8* %6
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 3
store i8 108, i8* %7
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 4
store i8 111, i8* %8
%9 = call i32 @fun(i8* %3, i8* %4)
%10 = call i32 @puts(i8* %3)
ret i32 0
}
/* Type definitions */
struct DataMap {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
struct DataMap *DataMapReadBlock(int /*<<< orphan*/, int *);
int /*<<< orphan*/ fileno(int /*<<< orphan*/ *);
struct DataMap *DataMapFreadBlock(FILE *fp, int *s) {
  return DataMapReadBlock(fileno(fp), s);
}


x86 assembly (clang, -O0):
<DataMapFreadBlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fileno@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1030 <DataMapReadBlock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DataMapFreadBlock>:
push   %rbx
mov    %rsi,%rbx
call   1040 <fileno@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <DataMapReadBlock@plt>

LLVM IR (-O0):
%struct.DataMap = type { i32 }
define %struct.DataMap* @DataMapFreadBlock(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 = call i32 @fileno(i32* %5)
%7 = load i32*, i32** %4
%8 = call %struct.DataMap* @DataMapReadBlock(i32 %6, i32* %7)
ret %struct.DataMap* %8
}

LLVM IR (-O2):
%struct.DataMap = type { i32 }
define %struct.DataMap* @DataMapFreadBlock(i32* nocapture %0, i32* %1) {
%3 = tail call i32 @fileno(i32* %0)
%4 = tail call %struct.DataMap* @DataMapReadBlock(i32 %3, i32* %1)
ret %struct.DataMap* %4
}
int gfbyte(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @gfbyte() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void menu() {
  printf("\n 0. Menu 1. Insert Entry 2. Display Records 3. Search from B+ Tree "
         "4. Save to display with Dotty\n");
}


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

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

LLVM IR (-O0):
@.str = [99 x i8] c"\0A 0. Menu 1. Insert Entry 2. Display Records 3. Search from B+ Tree 4. Save to display with Dotty\0A\00"
define void @menu() {
%1 = call i32 @printf(i8* getelementptr inbounds ([99 x i8], [99 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [98 x i8] c"\0A 0. Menu 1. Insert Entry 2. Display Records 3. Search from B+ Tree 4. Save to display with Dotty\00"
define void @menu() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([98 x i8], [98 x i8]* @str, i64 0, i64 0))
ret void
}
void event_mrest(n, m) int n, m;
{ xevent_rest(1, 1, n); }


x86 assembly (clang, -O0):
<event_mrest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x1,%esi
mov    %esi,%edi
mov    $0x0,%al
call   1030 <xevent_rest@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<event_mrest>:
mov    %edi,%edx
mov    $0x1,%edi
mov    $0x1,%esi
xor    %eax,%eax
jmp    1030 <xevent_rest@plt>

LLVM IR (-O0):
define void @event_mrest(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 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @xevent_rest to i32 (i32, i32, i32, ...)*)(i32 1, i32 1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @event_mrest(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @xevent_rest to i32 (i32, i32, i32, ...)*)(i32 1, i32 1, i32 %0)
ret void
}
/* Type definitions */
struct rb3_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/
rb3_link_and_rebalance_and_maybe_augment(struct rb3_head *, struct rb3_head *,
                                         int, int /*<<< orphan*/ *);
void rb3_link_and_rebalance(struct rb3_head *head, struct rb3_head *parent,
                            int dir) {
  rb3_link_and_rebalance_and_maybe_augment(head, parent, dir, NULL);
}


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

x86 assembly (clang, -O2):
<rb3_link_and_rebalance>:
xor    %ecx,%ecx
jmp    1030 <rb3_link_and_rebalance_and_maybe_augment@plt>

LLVM IR (-O0):
%struct.rb3_head = type { i32 }
define void @rb3_link_and_rebalance(%struct.rb3_head* %0, %struct.rb3_head* %1, i32 %2) {
%4 = alloca %struct.rb3_head*
%5 = alloca %struct.rb3_head*
%6 = alloca i32
store %struct.rb3_head* %0, %struct.rb3_head** %4
store %struct.rb3_head* %1, %struct.rb3_head** %5
store i32 %2, i32* %6
%7 = load %struct.rb3_head*, %struct.rb3_head** %4
%8 = load %struct.rb3_head*, %struct.rb3_head** %5
%9 = load i32, i32* %6
%10 = call i32 @rb3_link_and_rebalance_and_maybe_augment(%struct.rb3_head* %7, %struct.rb3_head* %8, i32 %9, i32* null)
ret void
}

LLVM IR (-O2):
%struct.rb3_head = type { i32 }
define void @rb3_link_and_rebalance(%struct.rb3_head* %0, %struct.rb3_head* %1, i32 %2) {
%4 = tail call i32 @rb3_link_and_rebalance_and_maybe_augment(%struct.rb3_head* %0, %struct.rb3_head* %1, i32 %2, i32* null)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int count_invs(int *, int *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, int);
void main() {
  int a[] = {3, 2, 1};
  int len = sizeof(a) / sizeof(a[0]);
  int temp[len];
  printf("Number of inversions is %d", count_invs(a, temp, 0, len - 1));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xeda(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x3,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
lea    0xf(,%rax,4),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rsi
sub    %rcx,%rsi
mov    %rsi,%rsp
mov    %rax,-0x28(%rbp)
lea    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
xor    %edx,%edx
call   1040 <count_invs@plt>
mov    %eax,%esi
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
mov    %rsp,%rbx
mov    0xeda(%rip),%eax
mov    %eax,0x8(%rsp)
mov    0xec7(%rip),%rax
mov    %rax,(%rsp)
mov    %rsp,%rdi
lea    0x10(%rsp),%rsi
xor    %edx,%edx
mov    $0x2,%ecx
call   1040 <count_invs@plt>
lea    0xeb4(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %rbx,%rsp
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.a = [3 x i32] [i32 3, i32 2, i32 1]
@.str = [27 x i8] c"Number of inversions is %d\00"
define void @main() {
%1 = alloca [3 x i32]
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = bitcast [3 x i32]* %1 to i8*
store i32 3, i32* %2
%6 = load i32, i32* %2
%7 = zext i32 %6 to i64
%8 = call i8* @llvm.stacksave()
store i8* %8, i8** %3
%9 = alloca i32, i64 %7
store i64 %7, i64* %4
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%11 = load i32, i32* %2
%12 = sub nsw i32 %11, 1
%13 = call i32 @count_invs(i32* %10, i32* %9, i32 0, i32 %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = load i8*, i8** %3
ret void
}

LLVM IR (-O2):
@__const.main.a = [3 x i32] [i32 3, i32 2, i32 1]
@.str = [27 x i8] c"Number of inversions is %d\00"
define void @main() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = tail call i8* @llvm.stacksave()
%4 = alloca [3 x i32]
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%7 = call i32 @count_invs(i32* %6, i32* %5, i32 0, i32 2)
%8 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}
/* Variables and functions */
int is_alpha(char);
int is_number(char);
int f_location(char *str) {
  if (is_alpha(str[2]) == -1 || is_number(str[3]) == -1)
    return (-1);
  return (0);
}


x86 assembly (clang, -O0):
<f_location>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl 0x2(%rax),%edi
call   1040 <is_alpha@plt>
cmp    $0xffffffff,%eax
je     1158 <f_location+0x38>
mov    -0x10(%rbp),%rax
movsbl 0x3(%rax),%edi
call   1030 <is_number@plt>
cmp    $0xffffffff,%eax
jne    1164 <f_location+0x44>
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <f_location+0x4b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_location>:
push   %rbx
mov    %rdi,%rbx
movsbl 0x2(%rdi),%edi
call   1040 <is_alpha@plt>
cmp    $0xffffffff,%eax
je     1149 <f_location+0x29>
movsbl 0x3(%rbx),%edi
call   1030 <is_number@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
sete   %al
neg    %eax
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @f_location(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 2
%3 = load i8, i8* %2
%4 = tail call i32 @is_alpha(i8 signext %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %12, label %6
6: ; preds = %1
%7 = getelementptr inbounds i8, i8* %0, i64 3
%8 = load i8, i8* %7
%9 = tail call i32 @is_number(i8 signext %8)
%10 = icmp eq i32 %9, -1
%11 = sext i1 %10 to i32
br label %12
12: ; preds = %6, %1
%13 = phi i32 [ -1, %1 ], [ %11, %6 ]
ret i32 %13
}
int strwcnt(const char *str) {
  char prev = ' ';
  int result = 0;
  for (char *iter = (char *)str; *iter; prev = *iter, iter++)
    if (*iter != ' ' && prev == ' ')
      result++;
  return result;
}


x86 assembly (clang, -O0):
<strwcnt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movb   $0x20,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     116d <strwcnt+0x6d>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     114e <strwcnt+0x4e>
movsbl -0x9(%rbp),%eax
cmp    $0x20,%eax
jne    114e <strwcnt+0x4e>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1153 <strwcnt+0x53>
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111b <strwcnt+0x1b>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strwcnt>:
mov    (%rdi),%cl
test   %cl,%cl
je     1133 <strwcnt+0x33>
add    $0x1,%rdi
mov    $0x20,%dl
xor    %eax,%eax
xchg   %ax,%ax
cmp    $0x20,%cl
setne  %sil
cmp    $0x20,%dl
sete   %dl
and    %sil,%dl
movzbl %dl,%edx
add    %edx,%eax
mov    %ecx,%edx
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <strwcnt+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strwcnt(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %6, %1
%5 = phi i32 [ 0, %1 ], [ %15, %6 ]
ret i32 %5
6: ; preds = %1, %6
%7 = phi i8 [ %17, %6 ], [ %2, %1 ]
%8 = phi i8* [ %16, %6 ], [ %0, %1 ]
%9 = phi i32 [ %15, %6 ], [ 0, %1 ]
%10 = phi i8 [ %7, %6 ], [ 32, %1 ]
%11 = icmp ne i8 %7, 32
%12 = icmp eq i8 %10, 32
%13 = and i1 %12, %11
%14 = zext i1 %13 to i32
%15 = add nuw nsw i32 %9, %14
%16 = getelementptr inbounds i8, i8* %8, i64 1
%17 = load i8, i8* %16
%18 = icmp eq i8 %17, 0
br i1 %18, label %4, label %6
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  double tv_sec;
  double tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, struct timezone *);
double get_cur_time() {
  struct timeval tv;
  struct timezone tz;
  double cur_time;
  gettimeofday(&tv, &tz);
  cur_time = tv.tv_sec + tv.tv_usec / 1000000.0;
  return cur_time;
}


x86 assembly (clang, -O0):
<get_cur_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xec9(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_cur_time>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <gettimeofday@plt>
movsd  0x10(%rsp),%xmm0
divsd  0xed1(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
%struct.timezone = type { i32 }
define double @get_cur_time() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = alloca double
%4 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%6 = load double, double* %5
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%8 = load double, double* %7
%9 = fdiv double %8, 1.000000e+06
%10 = fadd double %6, %9
store double %10, double* %3
%11 = load double, double* %3
ret double %11
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
%struct.timezone = type { i32 }
define double @get_cur_time() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = bitcast %struct.timeval* %1 to i8*
%4 = bitcast %struct.timezone* %2 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%7 = load double, double* %6
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%9 = load double, double* %8
%10 = fdiv double %9, 1.000000e+06
%11 = fadd double %7, %10
ret double %11
}
int LOS_EvbUartReadByte2(char *c, unsigned short len, unsigned int timeout) {
  return 0;
}


x86 assembly (clang, -O0):
<LOS_EvbUartReadByte2>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %edx,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @LOS_EvbUartReadByte2(i8* %0, i16 zeroext %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i16
%6 = alloca i32
store i8* %0, i8** %4
store i16 %1, i16* %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @LOS_EvbUartReadByte2(i8* nocapture readnone %0, i16 zeroext %1, i32 %2) {
ret i32 0
}
long double ldmin(long double a, long double b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<ldmin>:
push   %rbp
mov    %rsp,%rbp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fucomip %st(1),%st
fstp   %st(0)
jbe    1130 <ldmin+0x30>
jmp    1125 <ldmin+0x25>
fldt   -0x10(%rbp)
fstpt  -0x2c(%rbp)
jmp    1136 <ldmin+0x36>
fldt   -0x20(%rbp)
fstpt  -0x2c(%rbp)
fldt   -0x2c(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldmin>:
fldt   0x8(%rsp)
fldt   0x18(%rsp)
fucomi %st(1),%st
fcmovnbe %st(1),%st
fstp   %st(1)
ret

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

LLVM IR (-O2):
define x86_fp80 @ldmin(x86_fp80 %0, x86_fp80 %1) {
%3 = fcmp olt x86_fp80 %0, %1
%4 = select i1 %3, x86_fp80 %0, x86_fp80 %1
ret x86_fp80 %4
}
/* Variables and functions */
int *test();
void func() {
  int *a1 = test();
  int *b1 = test();
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <test@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <test@plt>
mov    %rax,-0x10(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
push   %rax
xor    %eax,%eax
call   1030 <test@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <test@plt>

LLVM IR (-O0):
define void @func() {
%1 = alloca i32*
%2 = alloca i32*
%3 = call i32* (...) @test()
store i32* %3, i32** %1
%4 = call i32* (...) @test()
store i32* %4, i32** %2
ret void
}

LLVM IR (-O2):
define void @func() {
%1 = tail call i32* (...) @test()
%2 = tail call i32* (...) @test()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dma_init();
int /*<<< orphan*/ fdc_add();
int /*<<< orphan*/ lpt_init();
int /*<<< orphan*/ pic_init();
int /*<<< orphan*/ pit_init();
int /*<<< orphan*/ serial1_init(int, int);
int /*<<< orphan*/ serial2_init(int, int);
void common_init() {
  dma_init();
  fdc_add();
  lpt_init();
  pic_init();
  pit_init();
  serial1_init(0x3f8, 4);
  serial2_init(0x2f8, 3);
}


x86 assembly (clang, -O0):
<common_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <dma_init@plt>
mov    $0x0,%al
call   1080 <fdc_add@plt>
mov    $0x0,%al
call   1090 <lpt_init@plt>
mov    $0x0,%al
call   1030 <pic_init@plt>
mov    $0x0,%al
call   1050 <pit_init@plt>
mov    $0x3f8,%edi
mov    $0x4,%esi
call   1060 <serial1_init@plt>
mov    $0x2f8,%edi
mov    $0x3,%esi
call   1070 <serial2_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<common_init>:
push   %rax
xor    %eax,%eax
call   1040 <dma_init@plt>
xor    %eax,%eax
call   1080 <fdc_add@plt>
xor    %eax,%eax
call   1090 <lpt_init@plt>
xor    %eax,%eax
call   1030 <pic_init@plt>
xor    %eax,%eax
call   1050 <pit_init@plt>
mov    $0x3f8,%edi
mov    $0x4,%esi
call   1060 <serial1_init@plt>
mov    $0x2f8,%edi
mov    $0x3,%esi
pop    %rax
jmp    1070 <serial2_init@plt>

LLVM IR (-O0):
define void @common_init() {
%1 = call i32 (...) @dma_init()
%2 = call i32 (...) @fdc_add()
%3 = call i32 (...) @lpt_init()
%4 = call i32 (...) @pic_init()
%5 = call i32 (...) @pit_init()
%6 = call i32 @serial1_init(i32 1016, i32 4)
%7 = call i32 @serial2_init(i32 760, i32 3)
ret void
}

LLVM IR (-O2):
define void @common_init() {
%1 = tail call i32 (...) @dma_init()
%2 = tail call i32 (...) @fdc_add()
%3 = tail call i32 (...) @lpt_init()
%4 = tail call i32 (...) @pic_init()
%5 = tail call i32 (...) @pit_init()
%6 = tail call i32 @serial1_init(i32 1016, i32 4)
%7 = tail call i32 @serial2_init(i32 760, i32 3)
ret void
}