#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 *, int);
int rand();
void write_column() {
  int numbers[50] = {0};
  int k, no;
  for (k = 0; k < 6; ++k) {
    while (numbers[no = rand() % 49 + 1])
      ;
    numbers[no]++;
  }
  for (k = 1; k < 50; ++k)
    if (numbers[k])
      printf("%2d ", k);
}


x86 assembly (clang, -O0):
<write_column>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
lea    -0xd0(%rbp),%rdi
xor    %esi,%esi
mov    $0xc8,%edx
call   1040 <memset@plt>
movl   $0x0,-0xd4(%rbp)
cmpl   $0x6,-0xd4(%rbp)
jge    11c4 <write_column+0x94>
jmp    116a <write_column+0x3a>
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0x31,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0xd8(%rbp)
movslq %edx,%rax
cmpl   $0x0,-0xd0(%rbp,%rax,4)
je     1198 <write_column+0x68>
jmp    116a <write_column+0x3a>
movslq -0xd8(%rbp),%rax
mov    -0xd0(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0xd0(%rbp,%rax,4)
mov    -0xd4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd4(%rbp)
jmp    1158 <write_column+0x28>
movl   $0x1,-0xd4(%rbp)
cmpl   $0x32,-0xd4(%rbp)
jge    121b <write_column+0xeb>
movslq -0xd4(%rbp),%rax
cmpl   $0x0,-0xd0(%rbp,%rax,4)
je     1202 <write_column+0xd2>
mov    -0xd4(%rbp),%esi
lea    0xe03(%rip),%rdi
call   1030 <printf@plt>
jmp    1207 <write_column+0xd7>
mov    -0xd4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd4(%rbp)
jmp    11ce <write_column+0x9e>
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_column>:
push   %r14
push   %rbx
sub    $0xc8,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movq   $0x0,0xc0(%rsp)
xor    %eax,%eax
call   1040 <rand@plt>
cltq
imul   $0x5397829d,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x24,%rcx
add    %edx,%ecx
imul   $0x31,%ecx,%ecx
sub    %ecx,%eax
cltq
cmpl   $0x0,0x4(%rsp,%rax,4)
jne    1180 <write_column+0x60>
add    $0x1,%rax
movl   $0x1,(%rsp,%rax,4)
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <rand@plt>
cltq
imul   $0x5397829d,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x24,%rcx
add    %edx,%ecx
imul   $0x31,%ecx,%ecx
sub    %ecx,%eax
cltq
cmpl   $0x0,0x4(%rsp,%rax,4)
jne    11c0 <write_column+0xa0>
add    $0x1,%rax
movl   $0x1,(%rsp,%rax,4)
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <rand@plt>
cltq
imul   $0x5397829d,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x24,%rcx
add    %edx,%ecx
imul   $0x31,%ecx,%ecx
sub    %ecx,%eax
cltq
cmpl   $0x0,0x4(%rsp,%rax,4)
jne    1200 <write_column+0xe0>
add    $0x1,%rax
movl   $0x1,(%rsp,%rax,4)
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <rand@plt>
cltq
imul   $0x5397829d,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x24,%rcx
add    %edx,%ecx
imul   $0x31,%ecx,%ecx
sub    %ecx,%eax
cltq
cmpl   $0x0,0x4(%rsp,%rax,4)
jne    1240 <write_column+0x120>
add    $0x1,%rax
movl   $0x1,(%rsp,%rax,4)
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <rand@plt>
cltq
imul   $0x5397829d,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x24,%rcx
add    %edx,%ecx
imul   $0x31,%ecx,%ecx
sub    %ecx,%eax
cltq
cmpl   $0x0,0x4(%rsp,%rax,4)
jne    1280 <write_column+0x160>
add    $0x1,%rax
movl   $0x1,(%rsp,%rax,4)
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <rand@plt>
cltq
imul   $0x5397829d,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x24,%rcx
add    %edx,%ecx
imul   $0x31,%ecx,%ecx
sub    %ecx,%eax
cltq
cmpl   $0x0,0x4(%rsp,%rax,4)
jne    12c0 <write_column+0x1a0>
add    $0x1,%rax
movl   $0x1,(%rsp,%rax,4)
mov    $0x1,%ebx
lea    0xcfe(%rip),%r14
jmp    131a <write_column+0x1fa>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%rbx
cmp    $0x32,%rbx
je     132c <write_column+0x20c>
cmpl   $0x0,(%rsp,%rbx,4)
je     1310 <write_column+0x1f0>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
jmp    1310 <write_column+0x1f0>
add    $0xc8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%2d \00"
define void @write_column() {
%1 = alloca [50 x i32]
%2 = alloca i32
%3 = alloca i32
%4 = bitcast [50 x i32]* %1 to i8*
store i32 0, i32* %2
br label %5
5: ; preds = %24, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 6
br i1 %7, label %8, label %27
8: ; preds = %5
br label %9
9: ; preds = %17, %8
%10 = call i32 (...) @rand()
%11 = srem i32 %10, 49
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [50 x i32], [50 x i32]* %1, i64 0, i64 %13
%15 = load i32, i32* %14
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %9
br label %9
18: ; preds = %9
%19 = load i32, i32* %3
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [50 x i32], [50 x i32]* %1, i64 0, i64 %20
%22 = load i32, i32* %21
%23 = add nsw i32 %22, 1
store i32 %23, i32* %21
br label %24
24: ; preds = %18
%25 = load i32, i32* %2
%26 = add nsw i32 %25, 1
store i32 %26, i32* %2
br label %5
27: ; preds = %5
store i32 1, i32* %2
br label %28
28: ; preds = %41, %27
%29 = load i32, i32* %2
%30 = icmp slt i32 %29, 50
br i1 %30, label %31, label %44
31: ; preds = %28
%32 = load i32, i32* %2
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [50 x i32], [50 x i32]* %1, i64 0, i64 %33
%35 = load i32, i32* %34
%36 = icmp ne i32 %35, 0
br i1 %36, label %37, label %40
37: ; preds = %31
%38 = load i32, i32* %2
%39 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %38)
br label %40
40: ; preds = %37, %31
br label %41
41: ; preds = %40
%42 = load i32, i32* %2
%43 = add nsw i32 %42, 1
store i32 %43, i32* %2
br label %28
44: ; preds = %28
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%2d \00"
define void @write_column() {
%1 = alloca [50 x i32]
%2 = bitcast [50 x i32]* %1 to i8*
br label %3
3: ; preds = %0, %3
%4 = tail call i32 (...) @rand()
%5 = srem i32 %4, 49
%6 = add nsw i32 %5, 1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [50 x i32], [50 x i32]* %1, i64 0, i64 %7
%9 = load i32, i32* %8
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = getelementptr inbounds [50 x i32], [50 x i32]* %1, i64 0, i64 %7
store i32 1, i32* %12
br label %13
13: ; preds = %13, %11
%14 = tail call i32 (...) @rand()
%15 = srem i32 %14, 49
%16 = add nsw i32 %15, 1
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [50 x i32], [50 x i32]* %1, i64 0, i64 %17
%19 = load i32, i32* %18
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %13
21: ; preds = %13
%22 = getelementptr inbounds [50 x i32], [50 x i32]* %1, i64 0, i64 %17
store i32 1, i32* %22
br label %23
23: ; preds = %23, %21
%24 = tail call i32 (...) @rand()
%25 = srem i32 %24, 49
%26 = add nsw i32 %25, 1
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [50 x i32], [50 x i32]* %1, i64 0, i64 %27
%29 = load i32, i32* %28
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %23
31: ; preds = %23
%32 = getelementptr inbounds [50 x i32], [50 x i32]* %1, i64 0, i64 %27
store i32 1, i32* %32
br label %33
33: ; preds = %33, %31
%34 = tail call i32 (...) @rand()
%35 = srem i32 %34, 49
%36 = add nsw i32 %35, 1
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [50 x i32], [50 x i32]* %1, i64 0, i64 %37
%39 = load i32, i32* %38
%40 = icmp eq i32 %39, 0
br i1 %40, label %41, label %33
41: ; preds = %33
%42 = getelementptr inbounds [50 x i32], [50 x i32]* %1, i64 0, i64 %37
store i32 1, i32* %42
br label %43
43: ; preds = %43, %41
%44 = tail call i32 (...) @rand()
%45 = srem i32 %44, 49
%46 = add nsw i32 %45, 1
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [50 x i32], [50 x i32]* %1, i64 0, i64 %47
%49 = load i32, i32* %48
%50 = icmp eq i32 %49, 0
br i1 %50, label %51, label %43
51: ; preds = %43
%52 = getelementptr inbounds [50 x i32], [50 x i32]* %1, i64 0, i64 %47
store i32 1, i32* %52
br label %53
53: ; preds = %53, %51
%54 = tail call i32 (...) @rand()
%55 = srem i32 %54, 49
%56 = add nsw i32 %55, 1
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds [50 x i32], [50 x i32]* %1, i64 0, i64 %57
%59 = load i32, i32* %58
%60 = icmp eq i32 %59, 0
br i1 %60, label %61, label %53
61: ; preds = %53
%62 = getelementptr inbounds [50 x i32], [50 x i32]* %1, i64 0, i64 %57
store i32 1, i32* %62
br label %63
63: ; preds = %61, %71
%64 = phi i64 [ 1, %61 ], [ %72, %71 ]
%65 = getelementptr inbounds [50 x i32], [50 x i32]* %1, i64 0, i64 %64
%66 = load i32, i32* %65
%67 = icmp eq i32 %66, 0
br i1 %67, label %71, label %68
68: ; preds = %63
%69 = trunc i64 %64 to i32
%70 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %69)
br label %71
71: ; preds = %63, %68
%72 = add nuw nsw i64 %64, 1
%73 = icmp eq i64 %72, 50
br i1 %73, label %74, label %63
74: ; preds = %71
ret void
}