xunge/DecIR huggingface dataset:
void test_lru() {}


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

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

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

LLVM IR (-O2):
define void @test_lru() {
ret void
}
unsigned int isEarlier(unsigned int s1, unsigned int u1, unsigned int s2,
                       unsigned int u2) {
  if (s1 < s2) {
    return (1 == 1);
  } else if (s1 > s2) {
    return (1 == 0);
  } else {
    return u1 < u2;
  }
  __builtin_unreachable();
}


x86 assembly (clang, -O0):
<isEarlier>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jae    1128 <isEarlier+0x28>
movl   $0x1,-0x4(%rbp)
jmp    1151 <isEarlier+0x51>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jbe    1140 <isEarlier+0x40>
movl   $0x0,-0x4(%rbp)
jmp    1151 <isEarlier+0x51>
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
setb   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isEarlier>:
mov    $0x1,%eax
cmp    %edx,%edi
jb     1116 <isEarlier+0x16>
xor    %eax,%eax
cmp    %edx,%edi
ja     1116 <isEarlier+0x16>
xor    %eax,%eax
cmp    %ecx,%esi
setb   %al
ret

LLVM IR (-O0):
define i32 @isEarlier(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
%10 = load i32, i32* %6
%11 = load i32, i32* %8
%12 = icmp ult i32 %10, %11
br i1 %12, label %13, label %14
13: ; preds = %4
store i32 1, i32* %5
br label %24
14: ; preds = %4
%15 = load i32, i32* %6
%16 = load i32, i32* %8
%17 = icmp ugt i32 %15, %16
br i1 %17, label %18, label %19
18: ; preds = %14
store i32 0, i32* %5
br label %24
19: ; preds = %14
%20 = load i32, i32* %7
%21 = load i32, i32* %9
%22 = icmp ult i32 %20, %21
%23 = zext i1 %22 to i32
store i32 %23, i32* %5
br label %24
24: ; preds = %19, %18, %13
%25 = load i32, i32* %5
ret i32 %25
}

LLVM IR (-O2):
define i32 @isEarlier(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp ult i32 %0, %2
br i1 %5, label %11, label %6
6: ; preds = %4
%7 = icmp ugt i32 %0, %2
br i1 %7, label %11, label %8
8: ; preds = %6
%9 = icmp ult i32 %1, %3
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %6, %4, %8
%12 = phi i32 [ %10, %8 ], [ 1, %4 ], [ 0, %6 ]
ret i32 %12
}
/* Variables and functions */
int mprStrcmpAnyCase(char *, char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  char src[] = "/Streaming/channels/102/preview";
  char dst[] = "/streaming/channels/102/preview";
  printf("%d\n", mprStrcmpAnyCase(src, dst));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec1(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xebe(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xebb(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xeb8(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xeb5(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    -0x30(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1040 <mprStrcmpAnyCase@plt>
mov    %eax,%esi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xeed(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xed1(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x20(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <mprStrcmpAnyCase@plt>
lea    0xed9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.main.src = [32 x i8] c"/Streaming/channels/102/preview\00"
@__const.main.dst = [32 x i8] c"/streaming/channels/102/preview\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [32 x i8]
%3 = alloca [32 x i8]
store i32 0, i32* %1
%4 = bitcast [32 x i8]* %2 to i8*
%5 = bitcast [32 x i8]* %3 to i8*
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%8 = call i32 @mprStrcmpAnyCase(i8* %6, i8* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.src = [32 x i8] c"/Streaming/channels/102/preview\00"
@__const.main.dst = [32 x i8] c"/streaming/channels/102/preview\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [32 x i8]
%2 = alloca [32 x i8]
%3 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%5 = call i32 @mprStrcmpAnyCase(i8* %3, i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
unsigned long long mpy(long a, long b) {
  return (unsigned long long)a * (unsigned long long)b;
}


x86 assembly (clang, -O0):
<mpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @mpy(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 = mul i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @mpy(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
ret i64 %3
}
int char2int(char c) {
  int ret = 0;
  if (c >= 'A' && c <= 'Z') {
    ret = c - 'A' + 1;
  }
  return ret;
}


x86 assembly (clang, -O0):
<char2int>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1138 <char2int+0x38>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
jg     1138 <char2int+0x38>
movsbl -0x1(%rbp),%eax
sub    $0x41,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char2int>:
lea    -0x41(%rdi),%ecx
lea    -0x40(%rdi),%edx
xor    %eax,%eax
cmp    $0x1a,%cl
cmovb  %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @char2int(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = sext i8 %0 to i32
%5 = add nsw i32 %4, -64
%6 = select i1 %3, i32 %5, i32 0
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int rand();
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
long int custom_random(long int range) {
  long int number;
  time_t t;
  srand((unsigned)time(&t));
  number = (rand() & 0xFFFF) | ((rand() & 0xFFFF) << 16);
  return number % range;
}


x86 assembly (clang, -O0):
<custom_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x14(%rbp),%rdi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1050 <rand@plt>
and    $0xffff,%eax
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1050 <rand@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
and    $0xffff,%ecx
shl    $0x10,%ecx
or     %ecx,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cqto
idivq  -0x8(%rbp)
mov    %rdx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<custom_random>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0x4(%rsp),%rdi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
movzwl %ax,%ebp
xor    %eax,%eax
call   1050 <rand@plt>
shl    $0x10,%eax
or     %ebp,%eax
movslq %eax,%rcx
mov    %rcx,%rdx
or     %rbx,%rdx
shr    $0x20,%rdx
je     1179 <custom_random+0x49>
mov    %rcx,%rax
cqto
idiv   %rbx
mov    %rdx,%rax
jmp    117f <custom_random+0x4f>
xor    %edx,%edx
div    %ebx
mov    %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i64 @custom_random(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %2
%5 = call i64 @time(i32* %4)
%6 = trunc i64 %5 to i32
%7 = call i32 @srand(i32 %6)
%8 = call i32 (...) @rand()
%9 = and i32 %8, 65535
%10 = call i32 (...) @rand()
%11 = and i32 %10, 65535
%12 = shl i32 %11, 16
%13 = or i32 %9, %12
%14 = sext i32 %13 to i64
store i64 %14, i64* %3
%15 = load i64, i64* %3
%16 = load i64, i64* %2
%17 = srem i64 %15, %16
ret i64 %17
}

LLVM IR (-O2):
define i64 @custom_random(i64 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i64 @time(i32* %2)
%5 = trunc i64 %4 to i32
%6 = call i32 @srand(i32 %5)
%7 = call i32 (...) @rand()
%8 = and i32 %7, 65535
%9 = call i32 (...) @rand()
%10 = shl i32 %9, 16
%11 = or i32 %10, %8
%12 = sext i32 %11 to i64
%13 = srem i64 %12, %0
ret i64 %13
}
int getCommSize(void) {
  int totp;
  totp = 1;
  return totp;
}


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

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

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

LLVM IR (-O2):
define i32 @getCommSize() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() { printf("usage: gaia_dec <filename> <num>\n"); }


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

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

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

LLVM IR (-O2):
@str = [33 x i8] c"usage: gaia_dec <filename> <num>\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct IMAGE {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ draw_string(struct IMAGE *, int, int, char const *, int);
void draw_string_shadow(struct IMAGE *image, int x, int y, const char *s) {
  draw_string(image, x + 1, y + 1, s, 0);
  draw_string(image, x, y, s, 0xFFFF);
}


x86 assembly (clang, -O0):
<draw_string_shadow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
add    $0x1,%edx
mov    -0x18(%rbp),%rcx
xor    %r8d,%r8d
call   1030 <draw_string@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    $0xffff,%r8d
call   1030 <draw_string@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_string_shadow>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %edx,%r15d
mov    %esi,%r12d
mov    %rdi,%rbx
lea    0x1(%r12),%esi
lea    0x1(%r15),%edx
xor    %r8d,%r8d
call   1030 <draw_string@plt>
mov    %rbx,%rdi
mov    %r12d,%esi
mov    %r15d,%edx
mov    %r14,%rcx
mov    $0xffff,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <draw_string@plt>

LLVM IR (-O0):
%struct.IMAGE = type { i32 }
define void @draw_string_shadow(%struct.IMAGE* %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca %struct.IMAGE*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store %struct.IMAGE* %0, %struct.IMAGE** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load %struct.IMAGE*, %struct.IMAGE** %5
%10 = load i32, i32* %6
%11 = add nsw i32 %10, 1
%12 = load i32, i32* %7
%13 = add nsw i32 %12, 1
%14 = load i8*, i8** %8
%15 = call i32 @draw_string(%struct.IMAGE* %9, i32 %11, i32 %13, i8* %14, i32 0)
%16 = load %struct.IMAGE*, %struct.IMAGE** %5
%17 = load i32, i32* %6
%18 = load i32, i32* %7
%19 = load i8*, i8** %8
%20 = call i32 @draw_string(%struct.IMAGE* %16, i32 %17, i32 %18, i8* %19, i32 65535)
ret void
}

LLVM IR (-O2):
%struct.IMAGE = type { i32 }
define void @draw_string_shadow(%struct.IMAGE* %0, i32 %1, i32 %2, i8* %3) {
%5 = add nsw i32 %1, 1
%6 = add nsw i32 %2, 1
%7 = tail call i32 @draw_string(%struct.IMAGE* %0, i32 %5, i32 %6, i8* %3, i32 0)
%8 = tail call i32 @draw_string(%struct.IMAGE* %0, i32 %1, i32 %2, i8* %3, i32 65535)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ msg_error(char *);
void msg_oom(void) { msg_error("Out of memory!\n"); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"Out of memory!\0A\00"
define void @msg_oom() {
%1 = call i32 @msg_error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Out of memory!\0A\00"
define void @msg_oom() {
%1 = tail call i32 @msg_error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ draw_string(int /*<<< orphan*/, int, char *);
void draw_menu(int width, int height) {
  draw_string(0, height - 1,
              "Menu: 8 = N; 2 = S; 6 = E; 4 = W; 9 = NE; 3 = SE; 7 = NW; 1 = "
              "SW; q = Quit.");
}


x86 assembly (clang, -O0):
<draw_menu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
xor    %edi,%edi
lea    0xed3(%rip),%rdx
call   1030 <draw_string@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_menu>:
add    $0xffffffff,%esi
lea    0xee6(%rip),%rdx
xor    %edi,%edi
jmp    1030 <draw_string@plt>

LLVM IR (-O0):
@.str = [76 x i8] c"Menu: 8 = N; 2 = S; 6 = E; 4 = W; 9 = NE; 3 = SE; 7 = NW; 1 = SW; q = Quit.\00"
define void @draw_menu(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = sub nsw i32 %5, 1
%7 = call i32 @draw_string(i32 0, i32 %6, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [76 x i8] c"Menu: 8 = N; 2 = S; 6 = E; 4 = W; 9 = NE; 3 = SE; 7 = NW; 1 = SW; q = Quit.\00"
define void @draw_menu(i32 %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @draw_string(i32 0, i32 %3, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_letters(char *);
void print_arguments(int argc, char *argv[]) {
  for (int i = 0; i < argc; ++i) {
    print_letters(argv[i]);
  }
}


x86 assembly (clang, -O0):
<print_arguments>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1151 <print_arguments+0x41>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <print_letters@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <print_arguments+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_arguments>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
jle    1142 <print_arguments+0x32>
mov    %rsi,%r14
mov    %edi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <print_letters@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <print_arguments+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @print_arguments(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds i8*, i8** %1, i64 %8
%10 = load i8*, i8** %9
%11 = tail call i32 @print_letters(i8* %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
int Operand_mx_decode(unsigned int *valp __attribute__((__unused__))) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @Operand_mx_decode(i32* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ die(char *, int /*<<< orphan*/);
int /*<<< orphan*/ optarg;
long strtol(int /*<<< orphan*/, char **, int);
int getnum() {
  char *end;
  long result = strtol(optarg, &end, 10);
  if (end && *end)
    die("%s is not a valid number\n", optarg);
  return result;
}


x86 assembly (clang, -O0):
<getnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1173 <getnum+0x53>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1173 <getnum+0x53>
mov    0x2e93(%rip),%rax
mov    (%rax),%esi
lea    0xe92(%rip),%rdi
call   1040 <die@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getnum>:
push   %r14
push   %rbx
push   %rax
mov    0x2ecd(%rip),%r14
mov    (%r14),%edi
mov    %rsp,%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %rax,%rbx
mov    (%rsp),%rax
test   %rax,%rax
je     115b <getnum+0x3b>
cmpb   $0x0,(%rax)
je     115b <getnum+0x3b>
mov    (%r14),%esi
lea    0xeaa(%rip),%rdi
call   1040 <die@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@optarg = global i32 0
@.str = [26 x i8] c"%s is not a valid number\0A\00"
define i32 @getnum() {
%1 = alloca i8*
%2 = alloca i64
%3 = load i32, i32* @optarg
%4 = call i64 @strtol(i32 %3, i8** %1, i32 10)
store i64 %4, i64* %2
%5 = load i8*, i8** %1
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %15
7: ; preds = %0
%8 = load i8*, i8** %1
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %7
%13 = load i32, i32* @optarg
%14 = call i32 @die(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %12, %7, %0
%16 = load i64, i64* %2
%17 = trunc i64 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
@optarg = global i32 0
@.str = [26 x i8] c"%s is not a valid number\0A\00"
define i32 @getnum() {
%1 = alloca i8*
%2 = bitcast i8** %1 to i8*
%3 = load i32, i32* @optarg
%4 = call i64 @strtol(i32 %3, i8** %1, i32 10)
%5 = load i8*, i8** %1
%6 = icmp eq i8* %5, null
br i1 %6, label %13, label %7
7: ; preds = %0
%8 = load i8, i8* %5
%9 = icmp eq i8 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %7
%11 = load i32, i32* @optarg
%12 = call i32 @die(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %10, %7, %0
%14 = trunc i64 %4 to i32
ret i32 %14
}
/* Variables and functions */
int combination(int, int);
int uniquePaths(int m, int n) {
  if (m > n)
    return combination(m, n);
  else
    return combination(n, m);
}


x86 assembly (clang, -O0):
<uniquePaths>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    113d <uniquePaths+0x2d>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <combination@plt>
mov    %eax,-0x4(%rbp)
jmp    114b <uniquePaths+0x3b>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <combination@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uniquePaths>:
mov    %edi,%eax
cmp    %esi,%edi
jle    111d <uniquePaths+0xd>
mov    %eax,%edi
jmp    1030 <combination@plt>
mov    %esi,%edi
mov    %eax,%esi
jmp    1030 <combination@plt>

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

LLVM IR (-O2):
define i32 @uniquePaths(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @combination(i32 %0, i32 %1)
br label %8
6: ; preds = %2
%7 = tail call i32 @combination(i32 %1, i32 %0)
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ %5, %4 ], [ %7, %6 ]
ret i32 %9
}
/* Variables and functions */
int strtol(char *, char **, int);
int atoiv(char *arg, int def) {
  if (!arg)
    return def;
  char *endptr;
  int val = strtol(arg, &endptr, 10);
  if (arg == endptr)
    return def;
  return val;
}


x86 assembly (clang, -O0):
<atoiv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1135 <atoiv+0x25>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1169 <atoiv+0x59>
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jne    1163 <atoiv+0x53>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1169 <atoiv+0x59>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atoiv>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
test   %rdi,%rdi
je     1131 <atoiv+0x21>
mov    %rdi,%rbx
mov    %rsp,%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
cmp    %rbx,(%rsp)
cmovne %eax,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @atoiv(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = icmp eq i8* %0, null
br i1 %4, label %11, label %5
5: ; preds = %2
%6 = bitcast i8** %3 to i8*
%7 = call i32 @strtol(i8* %0, i8** %3, i32 10)
%8 = load i8*, i8** %3
%9 = icmp eq i8* %8, %0
%10 = select i1 %9, i32 %1, i32 %7
br label %11
11: ; preds = %2, %5
%12 = phi i32 [ %10, %5 ], [ %1, %2 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ create_deck();
int /*<<< orphan*/ menu();
int main(int argc, char *argv[]) {
  create_deck();
  menu();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @create_deck()
%4 = tail call i32 (...) @menu()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ asSumOfSquares(int);
void testAsSumOfSquares() {
  int count = 10;
  for (int i = 1; i <= count; i++)
    asSumOfSquares(i);
}


x86 assembly (clang, -O0):
<testAsSumOfSquares>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1148 <testAsSumOfSquares+0x38>
mov    -0x8(%rbp),%edi
call   1030 <asSumOfSquares@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <testAsSumOfSquares+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testAsSumOfSquares>:
push   %rax
mov    $0x1,%edi
call   1030 <asSumOfSquares@plt>
mov    $0x2,%edi
call   1030 <asSumOfSquares@plt>
mov    $0x3,%edi
call   1030 <asSumOfSquares@plt>
mov    $0x4,%edi
call   1030 <asSumOfSquares@plt>
mov    $0x5,%edi
call   1030 <asSumOfSquares@plt>
mov    $0x6,%edi
call   1030 <asSumOfSquares@plt>
mov    $0x7,%edi
call   1030 <asSumOfSquares@plt>
mov    $0x8,%edi
call   1030 <asSumOfSquares@plt>
mov    $0x9,%edi
call   1030 <asSumOfSquares@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <asSumOfSquares@plt>

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

LLVM IR (-O2):
define void @testAsSumOfSquares() {
%1 = tail call i32 @asSumOfSquares(i32 1)
%2 = tail call i32 @asSumOfSquares(i32 2)
%3 = tail call i32 @asSumOfSquares(i32 3)
%4 = tail call i32 @asSumOfSquares(i32 4)
%5 = tail call i32 @asSumOfSquares(i32 5)
%6 = tail call i32 @asSumOfSquares(i32 6)
%7 = tail call i32 @asSumOfSquares(i32 7)
%8 = tail call i32 @asSumOfSquares(i32 8)
%9 = tail call i32 @asSumOfSquares(i32 9)
%10 = tail call i32 @asSumOfSquares(i32 10)
ret void
}
void dummy2() {}


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

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

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

LLVM IR (-O2):
define void @dummy2() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ memset(struct tm *, int /*<<< orphan*/, int);
int /*<<< orphan*/ mktime(struct tm *);
int a2time(time_t *t, const char *fmt, const char *p) {
  struct tm tm;
  char *pp;
  memset(&tm, 0, sizeof(struct tm));
  pp = NULL;
  if (NULL != pp && '\0' == *pp) {
    *t = mktime(&tm);
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<a2time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
lea    -0x28(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
movq   $0x0,-0x30(%rbp)
xor    %eax,%eax
cmp    -0x30(%rbp),%rax
je     1186 <a2time+0x66>
mov    -0x30(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jne    1186 <a2time+0x66>
lea    -0x28(%rbp),%rdi
call   1040 <mktime@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    118d <a2time+0x6d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a2time>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define i32 @a2time(i32* %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca %struct.tm
%9 = alloca i8*
store i32* %0, i32** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%10 = call i32 @memset(%struct.tm* %8, i32 0, i32 4)
store i8* null, i8** %9
%11 = load i8*, i8** %9
%12 = icmp ne i8* null, %11
br i1 %12, label %13, label %21
13: ; preds = %3
%14 = load i8*, i8** %9
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 0, %16
br i1 %17, label %18, label %21
18: ; preds = %13
%19 = call i32 @mktime(%struct.tm* %8)
%20 = load i32*, i32** %5
store i32 %19, i32* %20
store i32 1, i32* %4
br label %22
21: ; preds = %13, %3
store i32 0, i32* %4
br label %22
22: ; preds = %21, %18
%23 = load i32, i32* %4
ret i32 %23
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @a2time(i32* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = alloca %struct.tm
%5 = bitcast %struct.tm* %4 to i8*
%6 = call i32 @memset(%struct.tm* %4, i32 0, i32 4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_cond_signal(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_mutex_lock(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_mutex_unlock(int /*<<< orphan*/ *);
void pwake_up(pthread_cond_t *cond, pthread_mutex_t *mtx) {
  pthread_mutex_lock(mtx);
  pthread_cond_signal(cond);
  pthread_mutex_unlock(mtx);
}


x86 assembly (clang, -O0):
<pwake_up>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <pthread_mutex_lock@plt>
mov    -0x8(%rbp),%rdi
call   1030 <pthread_cond_signal@plt>
mov    -0x10(%rbp),%rdi
call   1040 <pthread_mutex_unlock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pwake_up>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1050 <pthread_mutex_lock@plt>
mov    %r14,%rdi
call   1030 <pthread_cond_signal@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <pthread_mutex_unlock@plt>

LLVM IR (-O0):
define void @pwake_up(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = call i32 @pthread_mutex_lock(i32* %5)
%7 = load i32*, i32** %3
%8 = call i32 @pthread_cond_signal(i32* %7)
%9 = load i32*, i32** %4
%10 = call i32 @pthread_mutex_unlock(i32* %9)
ret void
}

LLVM IR (-O2):
define void @pwake_up(i32* %0, i32* %1) {
%3 = tail call i32 @pthread_mutex_lock(i32* %1)
%4 = tail call i32 @pthread_cond_signal(i32* %0)
%5 = tail call i32 @pthread_mutex_unlock(i32* %1)
ret void
}
char *strcpy(char *dst, const char *src) {
  char *save = dst;
  while ((*dst++ = *src++) != 0)
    ;
  return save;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     1147 <strcpy+0x47>
jmp    1114 <strcpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %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* %0
}
float areaOfCircle(float radius) {
  float area;
  area = 3.14 * radius * radius;
  return area;
}


x86 assembly (clang, -O0):
<areaOfCircle>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xee6(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<areaOfCircle>:
cvtss2sd %xmm0,%xmm0
movsd  0xef4(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @areaOfCircle(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fpext float %4 to double
%6 = fmul double 3.140000e+00, %5
%7 = load float, float* %2
%8 = fpext float %7 to double
%9 = fmul double %6, %8
%10 = fptrunc double %9 to float
store float %10, float* %3
%11 = load float, float* %3
ret float %11
}

LLVM IR (-O2):
define float @areaOfCircle(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 3.140000e+00
%4 = fmul double %3, %2
%5 = fptrunc double %4 to float
ret float %5
}
void set_direction(const int direction, int *i, int *j) {
  switch (direction) {
  case 0:
    *i = -1;
    *j = 0;
    break;
  case 1:
    *i = 0;
    *j = 1;
    break;
  case 2:
    *i = 1;
    *j = 0;
    break;
  case 3:
    *i = 0;
    *j = -1;
    break;
  }
}


x86 assembly (clang, -O0):
<set_direction>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x20(%rbp)
sub    $0x3,%rax
ja     1193 <set_direction+0x93>
mov    -0x20(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x10(%rbp),%rax
movl   $0xffffffff,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
jmp    1193 <set_direction+0x93>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
jmp    1193 <set_direction+0x93>
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
jmp    1193 <set_direction+0x93>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0xffffffff,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_direction>:
cmp    $0x3,%edi
ja     1120 <set_direction+0x20>
movslq %edi,%rax
lea    0xef1(%rip),%rcx
mov    (%rcx,%rax,4),%ecx
lea    0xef7(%rip),%rdi
mov    (%rdi,%rax,4),%eax
mov    %ecx,(%rsi)
mov    %eax,(%rdx)
ret

LLVM IR (-O0):
define void @set_direction(i32 %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32, i32* %4
switch i32 %7, label %20 [
i32 0, label %8
i32 1, label %11
i32 2, label %14
i32 3, label %17
]
8: ; preds = %3
%9 = load i32*, i32** %5
store i32 -1, i32* %9
%10 = load i32*, i32** %6
store i32 0, i32* %10
br label %20
11: ; preds = %3
%12 = load i32*, i32** %5
store i32 0, i32* %12
%13 = load i32*, i32** %6
store i32 1, i32* %13
br label %20
14: ; preds = %3
%15 = load i32*, i32** %5
store i32 1, i32* %15
%16 = load i32*, i32** %6
store i32 0, i32* %16
br label %20
17: ; preds = %3
%18 = load i32*, i32** %5
store i32 0, i32* %18
%19 = load i32*, i32** %6
store i32 -1, i32* %19
br label %20
20: ; preds = %3, %17, %14, %11, %8
ret void
}

LLVM IR (-O2):
@switch.table.set_direction = [4 x i32] [i32 -1, i32 0, i32 1, i32 0]
@switch.table.set_direction.1 = [4 x i32] [i32 0, i32 1, i32 0, i32 -1]
define void @set_direction(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = icmp ult i32 %0, 4
br i1 %4, label %5, label %12
5: ; preds = %3
%6 = sext i32 %0 to i64
%7 = getelementptr inbounds [4 x i32], [4 x i32]* @switch.table.set_direction, i64 0, i64 %6
%8 = load i32, i32* %7
%9 = sext i32 %0 to i64
%10 = getelementptr inbounds [4 x i32], [4 x i32]* @switch.table.set_direction.1, i64 0, i64 %9
%11 = load i32, i32* %10
store i32 %8, i32* %1
store i32 %11, i32* %2
br label %12
12: ; preds = %3, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void f12(long j) {
  if ((j & ((1UL << (12)) - 1)) >= ((1UL << ((12) - 1)) + 2))
    abort();
}


x86 assembly (clang, -O0):
<f12>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0xfff,%rax
cmp    $0x802,%rax
jb     1139 <f12+0x29>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f12>:
and    $0xffe,%edi
cmp    $0x802,%edi
jae    111f <f12+0xf>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @f12(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 4095
%5 = icmp uge i64 %4, 2050
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @f12(i64 %0) {
%2 = and i64 %0, 4094
%3 = icmp ugt i64 %2, 2049
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
ret void
}
void foo264() {}


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

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

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

LLVM IR (-O2):
define void @foo264() {
ret void
}
/* Variables and functions */
char *strrchr(char *, char);
char *cli_get_name(char *path) {
  char *base = strrchr(path, '/');
  return base ? base + 1 : path;
}


x86 assembly (clang, -O0):
<cli_get_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114a <cli_get_name+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1152 <cli_get_name+0x42>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cli_get_name>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @cli_get_name(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
br label %13
11: ; preds = %1
%12 = load i8*, i8** %2
br label %13
13: ; preds = %11, %8
%14 = phi i8* [ %10, %8 ], [ %12, %11 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @cli_get_name(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Type definitions */
struct sembuf {
  int member_1;
  int /*<<< orphan*/ member_2;
  int /*<<< orphan*/ member_0;
};

/* Variables and functions */
int /*<<< orphan*/ semop(int, struct sembuf *, int);
void wait_v(int semid) {
  struct sembuf sops = {0, -1, 0};
  semop(semid, &sops, 1);
}


x86 assembly (clang, -O0):
<wait_v>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xedc(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_v>:
sub    $0x18,%rsp
mov    0xeee(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xedb(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sembuf = type { i32, i32, i32 }
@__const.wait_v.sops = %struct.sembuf { i32 0, i32 -1, i32 0 }
define void @wait_v(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.sembuf
store i32 %0, i32* %2
%4 = bitcast %struct.sembuf* %3 to i8*
%5 = load i32, i32* %2
%6 = call i32 @semop(i32 %5, %struct.sembuf* %3, i32 1)
ret void
}

LLVM IR (-O2):
%struct.sembuf = type { i32, i32, i32 }
@__const.wait_v.sops = %struct.sembuf { i32 0, i32 -1, i32 0 }
define void @wait_v(i32 %0) {
%2 = alloca %struct.sembuf
%3 = bitcast %struct.sembuf* %2 to i8*
%4 = call i32 @semop(i32 %0, %struct.sembuf* %2, i32 1)
ret void
}
/* Variables and functions */
int multiset_size();
int marking_size() { return multiset_size(); }


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

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

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

LLVM IR (-O2):
define i32 @marking_size() {
%1 = tail call i32 (...) @multiset_size()
ret i32 %1
}
/* Variables and functions */
scalar_t__ getpid();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
void pp_debug(void) {
  int i = 0;
  printf("process ready for debugging (%d)\n", (int)(getpid()));
  while (i == 0) {
    sleep(5);
  }
}


x86 assembly (clang, -O0):
<pp_debug>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
cmpl   $0x0,-0x4(%rbp)
jne    116d <pp_debug+0x3d>
mov    $0x5,%edi
call   1050 <sleep@plt>
jmp    1154 <pp_debug+0x24>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pp_debug>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
cs nopw 0x0(%rax,%rax,1)
mov    $0x5,%edi
call   1050 <sleep@plt>
jmp    1150 <pp_debug+0x20>

LLVM IR (-O0):
@.str = [34 x i8] c"process ready for debugging (%d)\0A\00"
define void @pp_debug() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @getpid()
%3 = trunc i64 %2 to i32
%4 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %3)
br label %5
5: ; preds = %8, %0
%6 = load i32, i32* %1
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 @sleep(i32 5)
br label %5
10: ; preds = %5
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"process ready for debugging (%d)\0A\00"
define void @pp_debug() {
%1 = tail call i64 (...) @getpid()
%2 = trunc i64 %1 to i32
%3 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %4
4: ; preds = %4, %0
%5 = tail call i32 @sleep(i32 5)
br label %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void dump1d(size_t n, double X[n]) {
  size_t i;
  for (i = 0; i < n; i++)
    printf("% 12.6f ", X[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<dump1d>:
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    -0x8(%rbp),%rax
jae    1162 <dump1d+0x52>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xeb6(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <dump1d+0x18>
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump1d>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rdi,%rdi
je     1159 <dump1d+0x39>
mov    %rsi,%r14
mov    %rdi,%r12
xor    %ebx,%ebx
lea    0xec4(%rip),%r15
nopl   0x0(%rax)
movsd  (%r14,%rbx,8),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <dump1d+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

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