#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 groo(int, int);
int /*<<< orphan*/ printf(char *, ...);
void grem() {
  int x = 0;
  printf("   ");
  for (; x < 16; x++)
    printf("%c", groo(x, 8));
  printf("\n\n");
}


x86 assembly (clang, -O0):
<grem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x10,-0x4(%rbp)
jge    1172 <grem+0x52>
mov    -0x4(%rbp),%edi
mov    $0x8,%esi
call   1030 <groo@plt>
mov    %eax,%esi
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    113d <grem+0x1d>
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<grem>:
push   %rax
lea    0xeb8(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %edi,%edi
mov    $0x8,%esi
call   1040 <groo@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x1,%edi
mov    $0x8,%esi
call   1040 <groo@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x2,%edi
mov    $0x8,%esi
call   1040 <groo@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x3,%edi
mov    $0x8,%esi
call   1040 <groo@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x4,%edi
mov    $0x8,%esi
call   1040 <groo@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x5,%edi
mov    $0x8,%esi
call   1040 <groo@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x6,%edi
mov    $0x8,%esi
call   1040 <groo@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x7,%edi
mov    $0x8,%esi
call   1040 <groo@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x8,%edi
mov    $0x8,%esi
call   1040 <groo@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0x9,%edi
mov    $0x8,%esi
call   1040 <groo@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
mov    $0x8,%esi
call   1040 <groo@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0xb,%edi
mov    $0x8,%esi
call   1040 <groo@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0xc,%edi
mov    $0x8,%esi
call   1040 <groo@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0xd,%edi
mov    $0x8,%esi
call   1040 <groo@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0xe,%edi
mov    $0x8,%esi
call   1040 <groo@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    $0xf,%edi
mov    $0x8,%esi
call   1040 <groo@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
lea    0xd51(%rip),%rdi
pop    %rax
jmp    1050 <puts@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c" \00"
@str = [2 x i8] c"\0A\00"
define void @grem() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @groo(i32 0, i32 8)
%3 = tail call i32 @putchar(i32 %2)
%4 = tail call i32 @groo(i32 1, i32 8)
%5 = tail call i32 @putchar(i32 %4)
%6 = tail call i32 @groo(i32 2, i32 8)
%7 = tail call i32 @putchar(i32 %6)
%8 = tail call i32 @groo(i32 3, i32 8)
%9 = tail call i32 @putchar(i32 %8)
%10 = tail call i32 @groo(i32 4, i32 8)
%11 = tail call i32 @putchar(i32 %10)
%12 = tail call i32 @groo(i32 5, i32 8)
%13 = tail call i32 @putchar(i32 %12)
%14 = tail call i32 @groo(i32 6, i32 8)
%15 = tail call i32 @putchar(i32 %14)
%16 = tail call i32 @groo(i32 7, i32 8)
%17 = tail call i32 @putchar(i32 %16)
%18 = tail call i32 @groo(i32 8, i32 8)
%19 = tail call i32 @putchar(i32 %18)
%20 = tail call i32 @groo(i32 9, i32 8)
%21 = tail call i32 @putchar(i32 %20)
%22 = tail call i32 @groo(i32 10, i32 8)
%23 = tail call i32 @putchar(i32 %22)
%24 = tail call i32 @groo(i32 11, i32 8)
%25 = tail call i32 @putchar(i32 %24)
%26 = tail call i32 @groo(i32 12, i32 8)
%27 = tail call i32 @putchar(i32 %26)
%28 = tail call i32 @groo(i32 13, i32 8)
%29 = tail call i32 @putchar(i32 %28)
%30 = tail call i32 @groo(i32 14, i32 8)
%31 = tail call i32 @putchar(i32 %30)
%32 = tail call i32 @groo(i32 15, i32 8)
%33 = tail call i32 @putchar(i32 %32)
%34 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret void
}