#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 *, unsigned int, char);
void print_row(unsigned *b, int i) {
  unsigned n;
  for (n = 4; n--;)
    printf("%5d%c", b[n * i], n ? ' ' : '\n');
}


x86 assembly (clang, -O0):
<print_row>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x4,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x10(%rbp)
cmp    $0x0,%eax
je     1171 <print_row+0x61>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
imul   -0xc(%rbp),%ecx
mov    %ecx,%ecx
mov    (%rax,%rcx,4),%esi
mov    -0x10(%rbp),%edx
mov    $0xa,%eax
mov    $0x20,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
lea    0xe9c(%rip),%rdi
movsbl %al,%edx
call   1030 <printf@plt>
jmp    1126 <print_row+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_row>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
lea    (%r14,%r14,2),%eax
mov    (%rdi,%rax,4),%esi
lea    0xed7(%rip),%r15
mov    %r15,%rdi
mov    $0x20,%edx
call   1030 <printf@plt>
lea    (%r14,%r14,1),%eax
mov    (%rbx,%rax,4),%esi
mov    %r15,%rdi
mov    $0x20,%edx
call   1030 <printf@plt>
mov    %r14d,%eax
mov    (%rbx,%rax,4),%esi
mov    %r15,%rdi
mov    $0x20,%edx
call   1030 <printf@plt>
mov    (%rbx),%esi
mov    %r15,%rdi
mov    $0xa,%edx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%5d%c\00"
define void @print_row(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 4, i32* %5
br label %6
6: ; preds = %10, %2
%7 = load i32, i32* %5
%8 = add i32 %7, -1
store i32 %8, i32* %5
%9 = icmp ne i32 %7, 0
br i1 %9, label %10, label %24
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = load i32, i32* %4
%14 = mul i32 %12, %13
%15 = zext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %11, i64 %15
%17 = load i32, i32* %16
%18 = load i32, i32* %5
%19 = icmp ne i32 %18, 0
%20 = zext i1 %19 to i64
%21 = select i1 %19, i32 32, i32 10
%22 = trunc i32 %21 to i8
%23 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %17, i8 signext %22)
br label %6
24: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%5d%c\00"
define void @print_row(i32* nocapture %0, i32 %1) {
%3 = mul i32 %1, 3
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %6, i8 signext 32)
%8 = shl i32 %1, 1
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %11, i8 signext 32)
%13 = zext i32 %1 to i64
%14 = getelementptr inbounds i32, i32* %0, i64 %13
%15 = load i32, i32* %14
%16 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %15, i8 signext 32)
%17 = load i32, i32* %0
%18 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %17, i8 signext 10)
ret void
}