#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 */
scalar_t__ ceilf(float);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdout;
void print_mask(int hd_prnt, char *name, int multi_node, int rank, int thrd,
                int ncpus, int nranks, int nthrds, int *icpus) {
  int i, lsdigit, n10;
  char node_header[4096];
  if (multi_node && hd_prnt) {
    for (i = 0; i <= 20; i++)
      node_header[i] = ' ';
    node_header[20 - 4] = 'n';
    node_header[20 - 3] = 'o';
    node_header[20 - 2] = 'd';
    node_header[20 - 1] = 'e';
    node_header[20 + 1] = ' ';
    node_header[20 + 2] = '\0';
  }
  if (hd_prnt) {
    if (multi_node)
      printf(" %20s", node_header);
    if (nranks == 1 && nthrds == 1)
      printf(" ");
    if (nranks != 1 && nthrds == 1)
      printf("rank ");
    if (nranks == 1 && nthrds != 1)
      printf("thrd ");
    if (nranks != 1 && nthrds != 1)
      printf("rank thrd ");
    n10 = ((int)ceilf((float)ncpus / 10));
    printf("|         |");
    for (i = 1; i < n10; i++)
      printf("   %2d    |", i * 10);
    printf("\n");
  } else {
    if (multi_node)
      printf(" %20.20s  ", name);
    if (nranks == 1 && nthrds == 1)
      printf(" ");
    if (nranks != 1 && nthrds == 1)
      printf("%4.4d ", rank);
    if (nranks == 1 && nthrds != 1)
      printf("%4.4d ", thrd);
    if (nranks != 1 && nthrds != 1)
      printf("%4.4d %4.4d ", rank, thrd);
    for (i = 0; i < ncpus; i++) {
      lsdigit = i;
      if (i > 9) {
        lsdigit = i - (i / 10) * 10;
      }
      if (icpus[i] == 1)
        printf("%1.1d", lsdigit);
      else
        printf("-");
      if (i == ncpus - 1)
        printf("\n");
    }
  }
  fflush(stdout);
}


x86 assembly (clang, -O0):
<print_mask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1040,%rsp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     11c3 <print_mask+0x93>
cmpl   $0x0,-0x4(%rbp)
je     11c3 <print_mask+0x93>
movl   $0x0,-0x24(%rbp)
cmpl   $0x14,-0x24(%rbp)
jg     1199 <print_mask+0x69>
movslq -0x24(%rbp),%rax
movb   $0x20,-0x1030(%rbp,%rax,1)
20
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1175 <print_mask+0x45>
movb   $0x6e,-0x1020(%rbp)
movb   $0x6f,-0x101f(%rbp)
movb   $0x64,-0x101e(%rbp)
movb   $0x65,-0x101d(%rbp)
movb   $0x20,-0x101b(%rbp)
movb   $0x0,-0x101a(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     12e1 <print_mask+0x1b1>
cmpl   $0x0,-0x14(%rbp)
je     11ec <print_mask+0xbc>
lea    -0x1030(%rbp),%rsi
lea    0xe1f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x1,0x10(%rbp)
jne    120e <print_mask+0xde>
cmpl   $0x1,0x18(%rbp)
jne    120e <print_mask+0xde>
lea    0xe37(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x1,0x10(%rbp)
je     1230 <print_mask+0x100>
cmpl   $0x1,0x18(%rbp)
jne    1230 <print_mask+0x100>
lea    0xde1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x1,0x10(%rbp)
jne    1252 <print_mask+0x122>
cmpl   $0x1,0x18(%rbp)
je     1252 <print_mask+0x122>
lea    0xdca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x1,0x10(%rbp)
je     1274 <print_mask+0x144>
cmpl   $0x1,0x18(%rbp)
je     1274 <print_mask+0x144>
lea    0xda3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cvtsi2ssl -0x20(%rbp),%xmm0
movss  0xd7f(%rip),%xmm1
divss  %xmm1,%xmm0
call   1050 <ceilf@plt>
mov    %eax,-0x2c(%rbp)
lea    0xd87(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    12ce <print_mask+0x19e>
imul   $0xa,-0x24(%rbp),%esi
lea    0xd6e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    12a2 <print_mask+0x172>
lea    0xd5e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1445 <print_mask+0x315>
cmpl   $0x0,-0x14(%rbp)
je     12fd <print_mask+0x1cd>
mov    -0x10(%rbp),%rsi
lea    0xd3f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x1,0x10(%rbp)
jne    131f <print_mask+0x1ef>
cmpl   $0x1,0x18(%rbp)
jne    131f <print_mask+0x1ef>
lea    0xd26(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x1,0x10(%rbp)
je     1344 <print_mask+0x214>
cmpl   $0x1,0x18(%rbp)
jne    1344 <print_mask+0x214>
mov    -0x18(%rbp),%esi
lea    0xd09(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x1,0x10(%rbp)
jne    1369 <print_mask+0x239>
cmpl   $0x1,0x18(%rbp)
je     1369 <print_mask+0x239>
mov    -0x1c(%rbp),%esi
lea    0xce4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x1,0x10(%rbp)
je     1391 <print_mask+0x261>
cmpl   $0x1,0x18(%rbp)
je     1391 <print_mask+0x261>
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
lea    0xcb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1440 <print_mask+0x310>
mov    -0x24(%rbp),%eax
mov    %eax,-0x28(%rbp)
cmpl   $0x9,-0x24(%rbp)
jle    13d8 <print_mask+0x2a8>
mov    -0x24(%rbp),%eax
mov    %eax,-0x1034(%rbp)
mov    -0x24(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x1034(%rbp),%eax
imul   $0xa,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,-0x28(%rbp)
mov    0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
cmpl   $0x1,(%rax,%rcx,4)
jne    1400 <print_mask+0x2d0>
mov    -0x28(%rbp),%esi
lea    0xc59(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    140e <print_mask+0x2de>
lea    0xc4c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
mov    -0x20(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    142d <print_mask+0x2fd>
lea    0xc0d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1432 <print_mask+0x302>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1398 <print_mask+0x268>
jmp    1445 <print_mask+0x315>
mov    0x2b94(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x1040,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_mask>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1008,%rsp
mov    %r9d,%r12d
mov    %r8d,%r14d
mov    %ecx,%r15d
test   %edi,%edi
je     118b <print_mask+0x4b>
test   %edx,%edx
je     118b <print_mask+0x4b>
movabs $0x2020202020202020,%rax
20 20 20
mov    %rax,0xd(%rsp)
movaps 0xe88(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x65646f6e,0x10(%rsp)
65
movw   $0x20,0x15(%rsp)
mov    0x1048(%rsp),%ebx
mov    0x1040(%rsp),%ebp
test   %edi,%edi
je     11cb <print_mask+0x8b>
test   %edx,%edx
je     11b2 <print_mask+0x72>
lea    0xe6c(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x1,%ebp
jne    11f3 <print_mask+0xb3>
cmp    $0x1,%ebx
jne    11f3 <print_mask+0xb3>
mov    $0x20,%edi
call   1030 <putchar@plt>
jmp    1303 <print_mask+0x1c3>
test   %edx,%edx
je     11dd <print_mask+0x9d>
lea    0xe6d(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x1,%ebp
jne    1209 <print_mask+0xc9>
cmp    $0x1,%ebx
jne    1209 <print_mask+0xc9>
mov    $0x20,%edi
call   1030 <putchar@plt>
jmp    1260 <print_mask+0x120>
cmp    $0x1,%ebp
je     121f <print_mask+0xdf>
cmp    $0x1,%ebx
jne    121f <print_mask+0xdf>
lea    0xe16(%rip),%rdi
jmp    12fc <print_mask+0x1bc>
cmp    $0x1,%ebp
je     123d <print_mask+0xfd>
cmp    $0x1,%ebx
jne    123d <print_mask+0xfd>
lea    0xe3a(%rip),%rdi
mov    %r15d,%esi
jmp    1259 <print_mask+0x119>
cmp    $0x1,%ebp
jne    12eb <print_mask+0x1ab>
cmp    $0x1,%ebx
je     12eb <print_mask+0x1ab>
lea    0xded(%rip),%rdi
jmp    12fc <print_mask+0x1bc>
cmp    $0x1,%ebp
jne    137e <print_mask+0x23e>
cmp    $0x1,%ebx
je     137e <print_mask+0x23e>
lea    0xdfe(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
test   %r12d,%r12d
jle    135e <print_mask+0x21e>
mov    0x1050(%rsp),%r15
lea    -0x1(%r12),%r13d
mov    %r12d,%ebp
mov    $0xcccccccd,%r12d
lea    0xdd5(%rip),%r14
xor    %ebx,%ebx
jmp    129d <print_mask+0x15d>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbx
cmp    %rbx,%rbp
je     135e <print_mask+0x21e>
cmpl   $0x1,(%r15,%rbx,4)
jne    12d0 <print_mask+0x190>
mov    %ebx,%eax
imul   %r12,%rax
shr    $0x23,%rax
add    %eax,%eax
lea    (%rax,%rax,4),%esi
neg    %esi
add    %ebx,%esi
cmp    $0xa,%rbx
cmovb  %ebx,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    %rbx,%r13
jne    1290 <print_mask+0x150>
jmp    12df <print_mask+0x19f>
nop
mov    $0x2d,%edi
call   1030 <putchar@plt>
cmp    %rbx,%r13
jne    1290 <print_mask+0x150>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1290 <print_mask+0x150>
cmp    $0x1,%ebx
je     1303 <print_mask+0x1c3>
cmp    $0x1,%ebp
je     1303 <print_mask+0x1c3>
lea    0xd24(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %r12d,%xmm0
divss  0xcfd(%rip),%xmm0
call   1060 <ceilf@plt>
mov    %rax,%rbx
lea    0xd09(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x2,%ebx
jl     1354 <print_mask+0x214>
add    $0xffffffff,%ebx
mov    $0xa,%ebp
lea    0xcfa(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xa,%ebp
add    $0xffffffff,%ebx
jne    1340 <print_mask+0x200>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2c7b(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
add    $0x1008,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
cmp    $0x1,%ebx
je     1260 <print_mask+0x120>
cmp    $0x1,%ebp
je     1260 <print_mask+0x120>
lea    0xcb7(%rip),%rdi
mov    %r15d,%esi
mov    %r14d,%edx
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1260 <print_mask+0x120>

LLVM IR (-O0):
@.str = [6 x i8] c" %20s\00"
@.str.1 = [2 x i8] c" \00"
@.str.2 = [6 x i8] c"rank \00"
@.str.3 = [6 x i8] c"thrd \00"
@.str.4 = [11 x i8] c"rank thrd \00"
@.str.5 = [12 x i8] c"| |\00"
@.str.6 = [12 x i8] c" %2d |\00"
@.str.7 = [2 x i8] c"\0A\00"
@.str.8 = [11 x i8] c" %20.20s \00"
@.str.9 = [7 x i8] c"%4.4d \00"
@.str.10 = [13 x i8] c"%4.4d %4.4d \00"
@.str.11 = [6 x i8] c"%1.1d\00"
@.str.12 = [2 x i8] c"-\00"
@stdout = global i32 0
define void @print_mask(i32 %0, i8* %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32* %8) {
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32*
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca [4096 x i8]
store i32 %0, i32* %10
store i8* %1, i8** %11
store i32 %2, i32* %12
store i32 %3, i32* %13
store i32 %4, i32* %14
store i32 %5, i32* %15
store i32 %6, i32* %16
store i32 %7, i32* %17
store i32* %8, i32** %18
%23 = load i32, i32* %12
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %46
25: ; preds = %9
%26 = load i32, i32* %10
%27 = icmp ne i32 %26, 0
br i1 %27, label %28, label %46
28: ; preds = %25
store i32 0, i32* %19
br label %29
29: ; preds = %36, %28
%30 = load i32, i32* %19
%31 = icmp sle i32 %30, 20
br i1 %31, label %32, label %39
32: ; preds = %29
%33 = load i32, i32* %19
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [4096 x i8], [4096 x i8]* %22, i64 0, i64 %34
store i8 32, i8* %35
br label %36
36: ; preds = %32
%37 = load i32, i32* %19
%38 = add nsw i32 %37, 1
store i32 %38, i32* %19
br label %29
39: ; preds = %29
%40 = getelementptr inbounds [4096 x i8], [4096 x i8]* %22, i64 0, i64 16
store i8 110, i8* %40
%41 = getelementptr inbounds [4096 x i8], [4096 x i8]* %22, i64 0, i64 17
store i8 111, i8* %41
%42 = getelementptr inbounds [4096 x i8], [4096 x i8]* %22, i64 0, i64 18
store i8 100, i8* %42
%43 = getelementptr inbounds [4096 x i8], [4096 x i8]* %22, i64 0, i64 19
store i8 101, i8* %43
%44 = getelementptr inbounds [4096 x i8], [4096 x i8]* %22, i64 0, i64 21
store i8 32, i8* %44
%45 = getelementptr inbounds [4096 x i8], [4096 x i8]* %22, i64 0, i64 22
store i8 0, i8* %45
br label %46
46: ; preds = %39, %25, %9
%47 = load i32, i32* %10
%48 = icmp ne i32 %47, 0
br i1 %48, label %49, label %107
49: ; preds = %46
%50 = load i32, i32* %12
%51 = icmp ne i32 %50, 0
br i1 %51, label %52, label %55
52: ; preds = %49
%53 = getelementptr inbounds [4096 x i8], [4096 x i8]* %22, i64 0, i64 0
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %53)
br label %55
55: ; preds = %52, %49
%56 = load i32, i32* %16
%57 = icmp eq i32 %56, 1
br i1 %57, label %58, label %63
58: ; preds = %55
%59 = load i32, i32* %17
%60 = icmp eq i32 %59, 1
br i1 %60, label %61, label %63
61: ; preds = %58
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %63
63: ; preds = %61, %58, %55
%64 = load i32, i32* %16
%65 = icmp ne i32 %64, 1
br i1 %65, label %66, label %71
66: ; preds = %63
%67 = load i32, i32* %17
%68 = icmp eq i32 %67, 1
br i1 %68, label %69, label %71
69: ; preds = %66
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %71
71: ; preds = %69, %66, %63
%72 = load i32, i32* %16
%73 = icmp eq i32 %72, 1
br i1 %73, label %74, label %79
74: ; preds = %71
%75 = load i32, i32* %17
%76 = icmp ne i32 %75, 1
br i1 %76, label %77, label %79
77: ; preds = %74
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %79
79: ; preds = %77, %74, %71
%80 = load i32, i32* %16
%81 = icmp ne i32 %80, 1
br i1 %81, label %82, label %87
82: ; preds = %79
%83 = load i32, i32* %17
%84 = icmp ne i32 %83, 1
br i1 %84, label %85, label %87
85: ; preds = %82
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
br label %87
87: ; preds = %85, %82, %79
%88 = load i32, i32* %15
%89 = sitofp i32 %88 to float
%90 = fdiv float %89, 1.000000e+01
%91 = call i64 @ceilf(float %90)
%92 = trunc i64 %91 to i32
store i32 %92, i32* %21
%93 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
store i32 1, i32* %19
br label %94
94: ; preds = %102, %87
%95 = load i32, i32* %19
%96 = load i32, i32* %21
%97 = icmp slt i32 %95, %96
br i1 %97, label %98, label %105
98: ; preds = %94
%99 = load i32, i32* %19
%100 = mul nsw i32 %99, 10
%101 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i32 %100)
br label %102
102: ; preds = %98
%103 = load i32, i32* %19
%104 = add nsw i32 %103, 1
store i32 %104, i32* %19
br label %94
105: ; preds = %94
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
br label %188
107: ; preds = %46
%108 = load i32, i32* %12
%109 = icmp ne i32 %108, 0
br i1 %109, label %110, label %113
110: ; preds = %107
%111 = load i8*, i8** %11
%112 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i8* %111)
br label %113
113: ; preds = %110, %107
%114 = load i32, i32* %16
%115 = icmp eq i32 %114, 1
br i1 %115, label %116, label %121
116: ; preds = %113
%117 = load i32, i32* %17
%118 = icmp eq i32 %117, 1
br i1 %118, label %119, label %121
119: ; preds = %116
%120 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %121
121: ; preds = %119, %116, %113
%122 = load i32, i32* %16
%123 = icmp ne i32 %122, 1
br i1 %123, label %124, label %130
124: ; preds = %121
%125 = load i32, i32* %17
%126 = icmp eq i32 %125, 1
br i1 %126, label %127, label %130
127: ; preds = %124
%128 = load i32, i32* %13
%129 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i32 %128)
br label %130
130: ; preds = %127, %124, %121
%131 = load i32, i32* %16
%132 = icmp eq i32 %131, 1
br i1 %132, label %133, label %139
133: ; preds = %130
%134 = load i32, i32* %17
%135 = icmp ne i32 %134, 1
br i1 %135, label %136, label %139
136: ; preds = %133
%137 = load i32, i32* %14
%138 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i32 %137)
br label %139
139: ; preds = %136, %133, %130
%140 = load i32, i32* %16
%141 = icmp ne i32 %140, 1
br i1 %141, label %142, label %149
142: ; preds = %139
%143 = load i32, i32* %17
%144 = icmp ne i32 %143, 1
br i1 %144, label %145, label %149
145: ; preds = %142
%146 = load i32, i32* %13
%147 = load i32, i32* %14
%148 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i32 %146, i32 %147)
br label %149
149: ; preds = %145, %142, %139
store i32 0, i32* %19
br label %150
150: ; preds = %184, %149
%151 = load i32, i32* %19
%152 = load i32, i32* %15
%153 = icmp slt i32 %151, %152
br i1 %153, label %154, label %187
154: ; preds = %150
%155 = load i32, i32* %19
store i32 %155, i32* %20
%156 = load i32, i32* %19
%157 = icmp sgt i32 %156, 9
br i1 %157, label %158, label %164
158: ; preds = %154
%159 = load i32, i32* %19
%160 = load i32, i32* %19
%161 = sdiv i32 %160, 10
%162 = mul nsw i32 %161, 10
%163 = sub nsw i32 %159, %162
store i32 %163, i32* %20
br label %164
164: ; preds = %158, %154
%165 = load i32*, i32** %18
%166 = load i32, i32* %19
%167 = sext i32 %166 to i64
%168 = getelementptr inbounds i32, i32* %165, i64 %167
%169 = load i32, i32* %168
%170 = icmp eq i32 %169, 1
br i1 %170, label %171, label %174
171: ; preds = %164
%172 = load i32, i32* %20
%173 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0), i32 %172)
br label %176
174: ; preds = %164
%175 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
br label %176
176: ; preds = %174, %171
%177 = load i32, i32* %19
%178 = load i32, i32* %15
%179 = sub nsw i32 %178, 1
%180 = icmp eq i32 %177, %179
br i1 %180, label %181, label %183
181: ; preds = %176
%182 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
br label %183
183: ; preds = %181, %176
br label %184
184: ; preds = %183
%185 = load i32, i32* %19
%186 = add nsw i32 %185, 1
store i32 %186, i32* %19
br label %150
187: ; preds = %150
br label %188
188: ; preds = %187, %105
%189 = load i32, i32* @stdout
%190 = call i32 @fflush(i32 %189)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c" %20s\00"
@.str.2 = [6 x i8] c"rank \00"
@.str.3 = [6 x i8] c"thrd \00"
@.str.4 = [11 x i8] c"rank thrd \00"
@.str.5 = [12 x i8] c"| |\00"
@.str.6 = [12 x i8] c" %2d |\00"
@.str.8 = [11 x i8] c" %20.20s \00"
@.str.9 = [7 x i8] c"%4.4d \00"
@.str.10 = [13 x i8] c"%4.4d %4.4d \00"
@.str.11 = [6 x i8] c"%1.1d\00"
@stdout = global i32 0
define void @print_mask(i32 %0, i8* %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32* nocapture %8) {
%10 = alloca [4096 x i8]
%11 = getelementptr inbounds [4096 x i8], [4096 x i8]* %10, i64 0, i64 0
%12 = icmp ne i32 %2, 0
%13 = icmp ne i32 %0, 0
%14 = and i1 %13, %12
br i1 %14, label %15, label %23
15: ; preds = %9
%16 = getelementptr inbounds [4096 x i8], [4096 x i8]* %10, i64 0, i64 0
%17 = getelementptr inbounds [4096 x i8], [4096 x i8]* %10, i64 0, i64 16
store i8 110, i8* %17
%18 = getelementptr inbounds [4096 x i8], [4096 x i8]* %10, i64 0, i64 17
store i8 111, i8* %18
%19 = getelementptr inbounds [4096 x i8], [4096 x i8]* %10, i64 0, i64 18
store i8 100, i8* %19
%20 = getelementptr inbounds [4096 x i8], [4096 x i8]* %10, i64 0, i64 19
store i8 101, i8* %20
%21 = getelementptr inbounds [4096 x i8], [4096 x i8]* %10, i64 0, i64 21
store i8 32, i8* %21
%22 = getelementptr inbounds [4096 x i8], [4096 x i8]* %10, i64 0, i64 22
store i8 0, i8* %22
br label %23
23: ; preds = %15, %9
br i1 %13, label %24, label %62
24: ; preds = %23
br i1 %12, label %25, label %27
25: ; preds = %24
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %27
27: ; preds = %25, %24
%28 = icmp eq i32 %6, 1
%29 = icmp eq i32 %7, 1
%30 = and i1 %28, %29
br i1 %30, label %31, label %33
31: ; preds = %27
%32 = call i32 @putchar(i32 32)
br label %47
33: ; preds = %27
%34 = icmp ne i32 %6, 1
%35 = and i1 %34, %29
br i1 %35, label %36, label %38
36: ; preds = %33
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %47
38: ; preds = %33
%39 = icmp ne i32 %7, 1
%40 = and i1 %28, %39
br i1 %40, label %41, label %43
41: ; preds = %38
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %47
43: ; preds = %38
%44 = and i1 %39, %34
br i1 %44, label %45, label %47
45: ; preds = %43
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
br label %47
47: ; preds = %41, %36, %31, %45, %43
%48 = sitofp i32 %5 to float
%49 = fdiv float %48, 1.000000e+01
%50 = call i64 @ceilf(float %49)
%51 = trunc i64 %50 to i32
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
%53 = icmp sgt i32 %51, 1
br i1 %53, label %54, label %60
54: ; preds = %47, %54
%55 = phi i32 [ %58, %54 ], [ 1, %47 ]
%56 = mul nuw nsw i32 %55, 10
%57 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i32 %56)
%58 = add nuw nsw i32 %55, 1
%59 = icmp eq i32 %58, %51
br i1 %59, label %60, label %54
60: ; preds = %54, %47
%61 = call i32 @putchar(i32 10)
br label %111
62: ; preds = %23
br i1 %12, label %63, label %65
63: ; preds = %62
%64 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i8* %1)
br label %65
65: ; preds = %63, %62
%66 = icmp eq i32 %6, 1
%67 = icmp eq i32 %7, 1
%68 = and i1 %66, %67
br i1 %68, label %69, label %71
69: ; preds = %65
%70 = tail call i32 @putchar(i32 32)
br label %85
71: ; preds = %65
%72 = icmp ne i32 %6, 1
%73 = and i1 %72, %67
br i1 %73, label %74, label %76
74: ; preds = %71
%75 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i32 %3)
br label %85
76: ; preds = %71
%77 = icmp ne i32 %7, 1
%78 = and i1 %66, %77
br i1 %78, label %79, label %81
79: ; preds = %76
%80 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i32 %4)
br label %85
81: ; preds = %76
%82 = and i1 %77, %72
br i1 %82, label %83, label %85
83: ; preds = %81
%84 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i32 %3, i32 %4)
br label %85
85: ; preds = %79, %74, %69, %83, %81
%86 = icmp sgt i32 %5, 0
br i1 %86, label %87, label %111
87: ; preds = %85
%88 = add nsw i32 %5, -1
%89 = zext i32 %88 to i64
%90 = zext i32 %5 to i64
br label %91
91: ; preds = %87, %108
%92 = phi i64 [ 0, %87 ], [ %109, %108 ]
%93 = getelementptr inbounds i32, i32* %8, i64 %92
%94 = load i32, i32* %93
%95 = icmp eq i32 %94, 1
br i1 %95, label %96, label %102
96: ; preds = %91
%97 = icmp ugt i64 %92, 9
%98 = trunc i64 %92 to i32
%99 = urem i32 %98, 10
%100 = select i1 %97, i32 %99, i32 %98
%101 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0), i32 %100)
br label %104
102: ; preds = %91
%103 = tail call i32 @putchar(i32 45)
br label %104
104: ; preds = %102, %96
%105 = icmp eq i64 %92, %89
br i1 %105, label %106, label %108
106: ; preds = %104
%107 = tail call i32 @putchar(i32 10)
br label %108
108: ; preds = %104, %106
%109 = add nuw nsw i64 %92, 1
%110 = icmp eq i64 %109, %90
br i1 %110, label %111, label %91
111: ; preds = %108, %85, %60
%112 = load i32, i32* @stdout
%113 = call i32 @fflush(i32 %112)
ret void
}