#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void robPrintMessage(int num) {
  int i = 0;
  printf("Mitchell ");
  printf("Sam DeWhitt ");
  for (i; i < num; i++) {
    printf("really ");
  }
  printf("loves robots!\n");
  return;
}


x86 assembly (clang, -O0):
<robPrintMessage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1160 <robPrintMessage+0x50>
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113a <robPrintMessage+0x2a>
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<robPrintMessage>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xed3(%rip),%rdi
call   1040 <printf@plt>
lea    0xed1(%rip),%rdi
call   1040 <printf@plt>
test   %ebx,%ebx
jle    115d <robPrintMessage+0x3d>
lea    0xece(%rip),%r14
nopl   0x0(%rax)
mov    %r14,%rdi
call   1040 <printf@plt>
add    $0xffffffff,%ebx
jne    1150 <robPrintMessage+0x30>
lea    0xebb(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"Mitchell \00"
@.str.1 = [13 x i8] c"Sam DeWhitt \00"
@.str.2 = [8 x i8] c"really \00"
@str = [14 x i8] c"loves robots!\00"
define void @robPrintMessage(i32 %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %10
5: ; preds = %1, %5
%6 = phi i32 [ %8, %5 ], [ 0, %1 ]
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%8 = add nuw nsw i32 %6, 1
%9 = icmp eq i32 %8, %0
br i1 %9, label %10, label %5
10: ; preds = %5, %1
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}