#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 trailing_zero_factorial(int);
int winner_tic_tac(char **);
int main(int argc, char const *argv[]) {
  printf("CTCI Moderate Problems\n\n");
  char board[3][3] = {{'1', '0', '0'}, {'1', '1', '0'}, {'0', '1', '1'}};
  printf("winner_tic_tac:[%d]\n", winner_tic_tac(board));
  printf("trailing_zero_factorial(25):[%d]\n", trailing_zero_factorial(25));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0xef5(%rip),%rax
mov    %rax,-0x19(%rbp)
mov    0xef3(%rip),%al
mov    %al,-0x11(%rbp)
lea    -0x19(%rbp),%rdi
call   1040 <winner_tic_tac@plt>
mov    %eax,%esi
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x19,%edi
call   1050 <trailing_zero_factorial@plt>
mov    %eax,%esi
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xef5(%rip),%rdi
call   1030 <puts@plt>
mov    0xeb2(%rip),%al
mov    %al,0x10(%rsp)
mov    0xe9f(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1050 <winner_tic_tac@plt>
lea    0xe92(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x19,%edi
call   1060 <trailing_zero_factorial@plt>
lea    0xe8d(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [25 x i8] c"CTCI Moderate Problems\0A\0A\00"
@__const.main.board = [3 x [3 x i8]] [[3 x i8] c"100", [3 x i8] c"110", [3 x i8] c"011"]
@.str.1 = [21 x i8] c"winner_tic_tac:[%d]\0A\00"
@.str.2 = [34 x i8] c"trailing_zero_factorial(25):[%d]\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [3 x [3 x i8]]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%8 = bitcast [3 x [3 x i8]]* %6 to i8*
%9 = getelementptr inbounds [3 x [3 x i8]], [3 x [3 x i8]]* %6, i64 0, i64 0
%10 = bitcast [3 x i8]* %9 to i8**
%11 = call i32 @winner_tic_tac(i8** %10)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = call i32 @trailing_zero_factorial(i32 25)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i32 %13)
ret i32 0
}

LLVM IR (-O2):
@__const.main.board = [3 x [3 x i8]] [[3 x i8] c"100", [3 x i8] c"110", [3 x i8] c"011"]
@.str.1 = [21 x i8] c"winner_tic_tac:[%d]\0A\00"
@.str.2 = [34 x i8] c"trailing_zero_factorial(25):[%d]\0A\00"
@str = [24 x i8] c"CTCI Moderate Problems\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [3 x [3 x i8]]
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%5 = getelementptr inbounds [3 x [3 x i8]], [3 x [3 x i8]]* %3, i64 0, i64 0, i64 0
%6 = bitcast [3 x [3 x i8]]* %3 to i8**
%7 = call i32 @winner_tic_tac(i8** %6)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = call i32 @trailing_zero_factorial(i32 25)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}