#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*/ sprintf(char *, char *, int, int, int, int, int, int, int,
                           int, int, int);
int strlen(char *);
int board_to_string(char *output, int match_index, int (*board)[3]) {
  sprintf(output, "m%i b%d-%d-%d-%d-%d-%d-%d-%d-%d ", match_index, board[0][0],
          board[0][1], board[0][2], board[1][0], board[1][1], board[1][2],
          board[2][0], board[2][1], board[2][2]);
  return strlen(output);
}


x86 assembly (clang, -O0):
<board_to_string>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %rdi,-0x20(%rbp)
mov    %esi,-0x24(%rbp)
mov    %rdx,-0x30(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%edx
mov    -0x30(%rbp),%rax
mov    (%rax),%ecx
mov    -0x30(%rbp),%rax
mov    0x4(%rax),%r8d
mov    -0x30(%rbp),%rax
mov    0x8(%rax),%r9d
mov    -0x30(%rbp),%rax
mov    0xc(%rax),%r15d
mov    -0x30(%rbp),%rax
mov    0x10(%rax),%r14d
mov    -0x30(%rbp),%rax
mov    0x14(%rax),%ebx
mov    -0x30(%rbp),%rax
mov    0x18(%rax),%r11d
mov    -0x30(%rbp),%rax
mov    0x1c(%rax),%r10d
mov    -0x30(%rbp),%rax
mov    0x20(%rax),%eax
lea    0xe76(%rip),%rsi
mov    %r15d,(%rsp)
mov    %r14d,0x8(%rsp)
mov    %ebx,0x10(%rsp)
mov    %r11d,0x18(%rsp)
mov    %r10d,0x20(%rsp)
mov    %eax,0x28(%rsp)
call   1040 <sprintf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<board_to_string>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r12
mov    (%rdx),%ecx
mov    0x4(%rdx),%r8d
mov    0x8(%rdx),%r9d
mov    0xc(%rdx),%r10d
mov    0x10(%rdx),%r11d
mov    0x14(%rdx),%r14d
mov    0x18(%rdx),%r15d
mov    0x1c(%rdx),%ebx
mov    0x20(%rdx),%eax
lea    0xeac(%rip),%rsi
mov    %ebp,%edx
push   %rax
push   %rbx
push   %r15
push   %r14
push   %r11
push   %r10
call   1040 <sprintf@plt>
add    $0x30,%rsp
mov    %r12,%rdi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <strlen@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"m%i b%d-%d-%d-%d-%d-%d-%d-%d-%d \00"
define i32 @board_to_string(i8* %0, i32 %1, [3 x i32]* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca [3 x i32]*
store i8* %0, i8** %4
store i32 %1, i32* %5
store [3 x i32]* %2, [3 x i32]** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load [3 x i32]*, [3 x i32]** %6
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0
%11 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 0
%12 = load i32, i32* %11
%13 = load [3 x i32]*, [3 x i32]** %6
%14 = getelementptr inbounds [3 x i32], [3 x i32]* %13, i64 0
%15 = getelementptr inbounds [3 x i32], [3 x i32]* %14, i64 0, i64 1
%16 = load i32, i32* %15
%17 = load [3 x i32]*, [3 x i32]** %6
%18 = getelementptr inbounds [3 x i32], [3 x i32]* %17, i64 0
%19 = getelementptr inbounds [3 x i32], [3 x i32]* %18, i64 0, i64 2
%20 = load i32, i32* %19
%21 = load [3 x i32]*, [3 x i32]** %6
%22 = getelementptr inbounds [3 x i32], [3 x i32]* %21, i64 1
%23 = getelementptr inbounds [3 x i32], [3 x i32]* %22, i64 0, i64 0
%24 = load i32, i32* %23
%25 = load [3 x i32]*, [3 x i32]** %6
%26 = getelementptr inbounds [3 x i32], [3 x i32]* %25, i64 1
%27 = getelementptr inbounds [3 x i32], [3 x i32]* %26, i64 0, i64 1
%28 = load i32, i32* %27
%29 = load [3 x i32]*, [3 x i32]** %6
%30 = getelementptr inbounds [3 x i32], [3 x i32]* %29, i64 1
%31 = getelementptr inbounds [3 x i32], [3 x i32]* %30, i64 0, i64 2
%32 = load i32, i32* %31
%33 = load [3 x i32]*, [3 x i32]** %6
%34 = getelementptr inbounds [3 x i32], [3 x i32]* %33, i64 2
%35 = getelementptr inbounds [3 x i32], [3 x i32]* %34, i64 0, i64 0
%36 = load i32, i32* %35
%37 = load [3 x i32]*, [3 x i32]** %6
%38 = getelementptr inbounds [3 x i32], [3 x i32]* %37, i64 2
%39 = getelementptr inbounds [3 x i32], [3 x i32]* %38, i64 0, i64 1
%40 = load i32, i32* %39
%41 = load [3 x i32]*, [3 x i32]** %6
%42 = getelementptr inbounds [3 x i32], [3 x i32]* %41, i64 2
%43 = getelementptr inbounds [3 x i32], [3 x i32]* %42, i64 0, i64 2
%44 = load i32, i32* %43
%45 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %12, i32 %16, i32 %20, i32 %24, i32 %28, i32 %32, i32 %36, i32 %40, i32 %44)
%46 = load i8*, i8** %4
%47 = call i32 @strlen(i8* %46)
ret i32 %47
}

LLVM IR (-O2):
@.str = [33 x i8] c"m%i b%d-%d-%d-%d-%d-%d-%d-%d-%d \00"
define i32 @board_to_string(i8* %0, i32 %1, [3 x i32]* nocapture %2) {
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%5 = load i32, i32* %4
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 1
%7 = load i32, i32* %6
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 2
%9 = load i32, i32* %8
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 1, i64 0
%11 = load i32, i32* %10
%12 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 1, i64 1
%13 = load i32, i32* %12
%14 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 1, i64 2
%15 = load i32, i32* %14
%16 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 2, i64 0
%17 = load i32, i32* %16
%18 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 2, i64 1
%19 = load i32, i32* %18
%20 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 2, i64 2
%21 = load i32, i32* %20
%22 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %5, i32 %7, i32 %9, i32 %11, i32 %13, i32 %15, i32 %17, i32 %19, i32 %21)
%23 = tail call i32 @strlen(i8* %0)
ret i32 %23
}