#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*/ ft_initial(char **, int **);
int ft_missing(int **, int, int, int);
int ft_double(char **argv) {
  int i;
  int j;
  int test;
  int swap[9][9];
  i = 0;
  ft_initial(argv, swap);
  while (i++ < 10) {
    j = 0;
    while (j++ < 10) {
      test = swap[i][j];
      swap[i][j] = 0;
      if (ft_missing(swap, i, j, test) != 3 && test != 0)
        return (0);
      swap[i][j] = test;
    }
  }
  return (1);
}


x86 assembly (clang, -O0):
<ft_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x160(%rbp),%rsi
call   1040 <ft_initial@plt>
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0xa,%eax
jge    1208 <ft_double+0xe8>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x18(%rbp)
cmp    $0xa,%eax
jge    1203 <ft_double+0xe3>
movslq -0x14(%rbp),%rcx
lea    -0x160(%rbp),%rax
imul   $0x24,%rcx,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x1c(%rbp)
movslq -0x14(%rbp),%rcx
lea    -0x160(%rbp),%rax
imul   $0x24,%rcx,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
lea    -0x160(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
call   1030 <ft_missing@plt>
cmp    $0x3,%eax
je     11e2 <ft_double+0xc2>
cmpl   $0x0,-0x1c(%rbp)
je     11e2 <ft_double+0xc2>
movl   $0x0,-0x4(%rbp)
jmp    120f <ft_double+0xef>
mov    -0x1c(%rbp),%edx
movslq -0x14(%rbp),%rcx
lea    -0x160(%rbp),%rax
imul   $0x24,%rcx,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
jmp    1161 <ft_double+0x41>
jmp    1146 <ft_double+0x26>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x160,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_double>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x150,%rsp
mov    %rsp,%r14
mov    %r14,%rsi
call   1040 <ft_initial@plt>
lea    0x28(%rsp),%r12
mov    $0x1,%r15d
xor    %ebx,%ebx
jmp    115e <ft_double+0x3e>
nopl   0x0(%rax)
mov    %ebp,(%r12,%rbx,4)
add    $0x1,%rbx
cmp    $0xa,%rbx
je     1190 <ft_double+0x70>
mov    (%r12,%rbx,4),%ebp
movl   $0x0,(%r12,%rbx,4)
lea    0x1(%rbx),%edx
mov    %r14,%rdi
mov    %r15d,%esi
mov    %ebp,%ecx
call   1030 <ft_missing@plt>
test   %ebp,%ebp
je     1150 <ft_double+0x30>
cmp    $0x3,%eax
je     1150 <ft_double+0x30>
jmp    11a5 <ft_double+0x85>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%r15
add    $0x24,%r12
cmp    $0xb,%r15
jne    1145 <ft_double+0x25>
mov    $0x1,%eax
jmp    11a7 <ft_double+0x87>
xor    %eax,%eax
add    $0x150,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ft_double(i8** %0) {
%2 = alloca i32
%3 = alloca i8**
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [9 x [9 x i32]]
store i8** %0, i8*** %3
store i32 0, i32* %4
%8 = load i8**, i8*** %3
%9 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %7, i64 0, i64 0
%10 = bitcast [9 x i32]* %9 to i32**
%11 = call i32 @ft_initial(i8** %8, i32** %10)
br label %12
12: ; preds = %54, %1
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 1
store i32 %14, i32* %4
%15 = icmp slt i32 %13, 10
br i1 %15, label %16, label %55
16: ; preds = %12
store i32 0, i32* %5
br label %17
17: ; preds = %46, %16
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
%20 = icmp slt i32 %18, 10
br i1 %20, label %21, label %54
21: ; preds = %17
%22 = load i32, i32* %4
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %7, i64 0, i64 %23
%25 = load i32, i32* %5
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [9 x i32], [9 x i32]* %24, i64 0, i64 %26
%28 = load i32, i32* %27
store i32 %28, i32* %6
%29 = load i32, i32* %4
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %7, i64 0, i64 %30
%32 = load i32, i32* %5
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [9 x i32], [9 x i32]* %31, i64 0, i64 %33
store i32 0, i32* %34
%35 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %7, i64 0, i64 0
%36 = bitcast [9 x i32]* %35 to i32**
%37 = load i32, i32* %4
%38 = load i32, i32* %5
%39 = load i32, i32* %6
%40 = call i32 @ft_missing(i32** %36, i32 %37, i32 %38, i32 %39)
%41 = icmp ne i32 %40, 3
br i1 %41, label %42, label %46
42: ; preds = %21
%43 = load i32, i32* %6
%44 = icmp ne i32 %43, 0
br i1 %44, label %45, label %46
45: ; preds = %42
store i32 0, i32* %2
br label %56
46: ; preds = %42, %21
%47 = load i32, i32* %6
%48 = load i32, i32* %4
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %7, i64 0, i64 %49
%51 = load i32, i32* %5
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds [9 x i32], [9 x i32]* %50, i64 0, i64 %52
store i32 %47, i32* %53
br label %17
54: ; preds = %17
br label %12
55: ; preds = %12
store i32 1, i32* %2
br label %56
56: ; preds = %55, %45
%57 = load i32, i32* %2
ret i32 %57
}

LLVM IR (-O2):
define i32 @ft_double(i8** %0) {
%2 = alloca [9 x [9 x i32]]
%3 = bitcast [9 x [9 x i32]]* %2 to i8*
%4 = bitcast [9 x [9 x i32]]* %2 to i32**
%5 = call i32 @ft_initial(i8** %0, i32** %4)
br label %9
6: ; preds = %21
%7 = add nuw nsw i64 %10, 1
%8 = icmp eq i64 %7, 11
br i1 %8, label %24, label %9
9: ; preds = %1, %6
%10 = phi i64 [ 1, %1 ], [ %7, %6 ]
%11 = trunc i64 %10 to i32
br label %12
12: ; preds = %9, %21
%13 = phi i64 [ 1, %9 ], [ %22, %21 ]
%14 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %2, i64 0, i64 %10, i64 %13
%15 = load i32, i32* %14
store i32 0, i32* %14
%16 = trunc i64 %13 to i32
%17 = call i32 @ft_missing(i32** %4, i32 %11, i32 %16, i32 %15)
%18 = icmp ne i32 %17, 3
%19 = icmp ne i32 %15, 0
%20 = and i1 %19, %18
br i1 %20, label %24, label %21
21: ; preds = %12
store i32 %15, i32* %14
%22 = add nuw nsw i64 %13, 1
%23 = icmp eq i64 %22, 11
br i1 %23, label %6, label %12
24: ; preds = %6, %12
%25 = phi i32 [ 0, %12 ], [ 1, %6 ]
ret i32 %25
}