#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*/ f(int);
int /*<<< orphan*/ print(char *);
int round(int /*<<< orphan*/);
void main() {
  int i, j;
  char A[50][50], B[50];
  for (i = 0; i < 50; i++) {
    for (j = 0; j < 50; j++) {
      A[i][j] = ' ';
      B[j] = A[i][j];
    }
    j = round(f(i));
    A[i][j] = 'x';
    B[j] = A[i][j];
    print(B);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x32,-0x4(%rbp)
jge    1213 <main+0xe3>
movl   $0x0,-0x8(%rbp)
cmpl   $0x32,-0x8(%rbp)
jge    11a9 <main+0x79>
movslq -0x4(%rbp),%rcx
lea    -0x9d0(%rbp),%rax
imul   $0x32,%rcx,%rcx
add    %rcx,%rax
movslq -0x8(%rbp),%rcx
movb   $0x20,(%rax,%rcx,1)
movslq -0x4(%rbp),%rcx
lea    -0x9d0(%rbp),%rax
imul   $0x32,%rcx,%rcx
add    %rcx,%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,1),%cl
movslq -0x8(%rbp),%rax
mov    %cl,-0xa10(%rbp,%rax,1)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1153 <main+0x23>
mov    -0x4(%rbp),%edi
call   1030 <f@plt>
mov    %eax,%edi
call   1050 <round@plt>
mov    %eax,-0x8(%rbp)
movslq -0x4(%rbp),%rcx
lea    -0x9d0(%rbp),%rax
imul   $0x32,%rcx,%rcx
add    %rcx,%rax
movslq -0x8(%rbp),%rcx
movb   $0x78,(%rax,%rcx,1)
movslq -0x4(%rbp),%rcx
lea    -0x9d0(%rbp),%rax
imul   $0x32,%rcx,%rcx
add    %rcx,%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,1),%cl
movslq -0x8(%rbp),%rax
mov    %cl,-0xa10(%rbp,%rax,1)
lea    -0xa10(%rbp),%rdi
call   1040 <print@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1142 <main+0x12>
add    $0xa10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x38,%rsp
xor    %ebx,%ebx
mov    %rsp,%r14
nopl   0x0(%rax)
movaps 0xeb9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movw   $0x2020,0x30(%rsp)
mov    %ebx,%edi
call   1030 <f@plt>
mov    %eax,%edi
call   1050 <round@plt>
cltq
movb   $0x78,(%rsp,%rax,1)
mov    %r14,%rdi
call   1040 <print@plt>
add    $0x1,%ebx
cmp    $0x32,%ebx
jne    1140 <main+0x10>
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [50 x [50 x i8]]
%4 = alloca [50 x i8]
store i32 0, i32* %1
br label %5
5: ; preds = %54, %0
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 50
br i1 %7, label %8, label %57
8: ; preds = %5
store i32 0, i32* %2
br label %9
9: ; preds = %29, %8
%10 = load i32, i32* %2
%11 = icmp slt i32 %10, 50
br i1 %11, label %12, label %32
12: ; preds = %9
%13 = load i32, i32* %1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [50 x [50 x i8]], [50 x [50 x i8]]* %3, i64 0, i64 %14
%16 = load i32, i32* %2
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [50 x i8], [50 x i8]* %15, i64 0, i64 %17
store i8 32, i8* %18
%19 = load i32, i32* %1
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [50 x [50 x i8]], [50 x [50 x i8]]* %3, i64 0, i64 %20
%22 = load i32, i32* %2
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [50 x i8], [50 x i8]* %21, i64 0, i64 %23
%25 = load i8, i8* %24
%26 = load i32, i32* %2
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [50 x i8], [50 x i8]* %4, i64 0, i64 %27
store i8 %25, i8* %28
br label %29
29: ; preds = %12
%30 = load i32, i32* %2
%31 = add nsw i32 %30, 1
store i32 %31, i32* %2
br label %9
32: ; preds = %9
%33 = load i32, i32* %1
%34 = call i32 @f(i32 %33)
%35 = call i32 @round(i32 %34)
store i32 %35, i32* %2
%36 = load i32, i32* %1
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [50 x [50 x i8]], [50 x [50 x i8]]* %3, i64 0, i64 %37
%39 = load i32, i32* %2
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [50 x i8], [50 x i8]* %38, i64 0, i64 %40
store i8 120, i8* %41
%42 = load i32, i32* %1
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [50 x [50 x i8]], [50 x [50 x i8]]* %3, i64 0, i64 %43
%45 = load i32, i32* %2
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds [50 x i8], [50 x i8]* %44, i64 0, i64 %46
%48 = load i8, i8* %47
%49 = load i32, i32* %2
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [50 x i8], [50 x i8]* %4, i64 0, i64 %50
store i8 %48, i8* %51
%52 = getelementptr inbounds [50 x i8], [50 x i8]* %4, i64 0, i64 0
%53 = call i32 @print(i8* %52)
br label %54
54: ; preds = %32
%55 = load i32, i32* %1
%56 = add nsw i32 %55, 1
store i32 %56, i32* %1
br label %5
57: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = alloca [50 x i8]
%2 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%3 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
br label %4
4: ; preds = %0, %4
%5 = phi i32 [ 0, %0 ], [ %11, %4 ]
%6 = call i32 @f(i32 %5)
%7 = call i32 @round(i32 %6)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 %8
store i8 120, i8* %9
%10 = call i32 @print(i8* %3)
%11 = add nuw nsw i32 %5, 1
%12 = icmp eq i32 %11, 50
br i1 %12, label %13, label %4
13: ; preds = %4
ret void
}