#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*/ cards_init();
int /*<<< orphan*/ data_init(int);
int /*<<< orphan*/ data_setai(int);
int /*<<< orphan*/ halt();
int /*<<< orphan*/ io_init();
int /*<<< orphan*/ main_routine();
int *pregame();
int main() {
  io_init();
  cards_init();
  int *setupdat = pregame();
  data_init(setupdat[7]);
  int i;
  for (i = 0; i < 7; i++) {
    if (setupdat[i])
      data_setai(i);
  }
  main_routine();
  halt();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <io_init@plt>
mov    $0x0,%al
call   1050 <cards_init@plt>
mov    $0x0,%al
call   1060 <pregame@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x1c(%rax),%edi
call   1080 <data_init@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x7,-0x14(%rbp)
jge    11e2 <main+0x72>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     11cf <main+0x5f>
mov    -0x14(%rbp),%edi
call   1030 <data_setai@plt>
jmp    11d4 <main+0x64>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11ab <main+0x3b>
mov    $0x0,%al
call   1090 <main_routine@plt>
mov    $0x0,%al
call   1070 <halt@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <io_init@plt>
xor    %eax,%eax
call   1050 <cards_init@plt>
xor    %eax,%eax
call   1060 <pregame@plt>
mov    %rax,%rbx
mov    0x1c(%rax),%edi
call   1080 <data_init@plt>
cmpl   $0x0,(%rbx)
je     119d <main+0x2d>
xor    %edi,%edi
call   1030 <data_setai@plt>
cmpl   $0x0,0x4(%rbx)
je     11ad <main+0x3d>
mov    $0x1,%edi
call   1030 <data_setai@plt>
cmpl   $0x0,0x8(%rbx)
je     11bd <main+0x4d>
mov    $0x2,%edi
call   1030 <data_setai@plt>
cmpl   $0x0,0xc(%rbx)
je     11cd <main+0x5d>
mov    $0x3,%edi
call   1030 <data_setai@plt>
cmpl   $0x0,0x10(%rbx)
je     11dd <main+0x6d>
mov    $0x4,%edi
call   1030 <data_setai@plt>
cmpl   $0x0,0x14(%rbx)
je     11ed <main+0x7d>
mov    $0x5,%edi
call   1030 <data_setai@plt>
cmpl   $0x0,0x18(%rbx)
je     11fd <main+0x8d>
mov    $0x6,%edi
call   1030 <data_setai@plt>
xor    %eax,%eax
call   1090 <main_routine@plt>
xor    %eax,%eax
call   1070 <halt@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @io_init()
%5 = call i32 (...) @cards_init()
%6 = call i32* (...) @pregame()
store i32* %6, i32** %2
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 7
%9 = load i32, i32* %8
%10 = call i32 @data_init(i32 %9)
store i32 0, i32* %3
br label %11
11: ; preds = %25, %0
%12 = load i32, i32* %3
%13 = icmp slt i32 %12, 7
br i1 %13, label %14, label %28
14: ; preds = %11
%15 = load i32*, i32** %2
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
%19 = load i32, i32* %18
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %14
%22 = load i32, i32* %3
%23 = call i32 @data_setai(i32 %22)
br label %24
24: ; preds = %21, %14
br label %25
25: ; preds = %24
%26 = load i32, i32* %3
%27 = add nsw i32 %26, 1
store i32 %27, i32* %3
br label %11
28: ; preds = %11
%29 = call i32 (...) @main_routine()
%30 = call i32 (...) @halt()
%31 = load i32, i32* %1
ret i32 %31
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @io_init()
%2 = tail call i32 (...) @cards_init()
%3 = tail call i32* (...) @pregame()
%4 = getelementptr inbounds i32, i32* %3, i64 7
%5 = load i32, i32* %4
%6 = tail call i32 @data_init(i32 %5)
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %0
%10 = tail call i32 @data_setai(i32 0)
br label %11
11: ; preds = %0, %9
%12 = getelementptr inbounds i32, i32* %3, i64 1
%13 = load i32, i32* %12
%14 = icmp eq i32 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %11
%16 = tail call i32 @data_setai(i32 1)
br label %17
17: ; preds = %15, %11
%18 = getelementptr inbounds i32, i32* %3, i64 2
%19 = load i32, i32* %18
%20 = icmp eq i32 %19, 0
br i1 %20, label %23, label %21
21: ; preds = %17
%22 = tail call i32 @data_setai(i32 2)
br label %23
23: ; preds = %21, %17
%24 = getelementptr inbounds i32, i32* %3, i64 3
%25 = load i32, i32* %24
%26 = icmp eq i32 %25, 0
br i1 %26, label %29, label %27
27: ; preds = %23
%28 = tail call i32 @data_setai(i32 3)
br label %29
29: ; preds = %27, %23
%30 = getelementptr inbounds i32, i32* %3, i64 4
%31 = load i32, i32* %30
%32 = icmp eq i32 %31, 0
br i1 %32, label %35, label %33
33: ; preds = %29
%34 = tail call i32 @data_setai(i32 4)
br label %35
35: ; preds = %33, %29
%36 = getelementptr inbounds i32, i32* %3, i64 5
%37 = load i32, i32* %36
%38 = icmp eq i32 %37, 0
br i1 %38, label %41, label %39
39: ; preds = %35
%40 = tail call i32 @data_setai(i32 5)
br label %41
41: ; preds = %39, %35
%42 = getelementptr inbounds i32, i32* %3, i64 6
%43 = load i32, i32* %42
%44 = icmp eq i32 %43, 0
br i1 %44, label %47, label %45
45: ; preds = %41
%46 = tail call i32 @data_setai(i32 6)
br label %47
47: ; preds = %45, %41
%48 = tail call i32 (...) @main_routine()
%49 = tail call i32 (...) @halt()
ret i32 0
}