#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 */
scalar_t__ ft_check_void_int(char *);
scalar_t__ ft_is_alone(char *);
int get_height(char *);
int get_width(char *);
int ft_check_shape(char *s) {
  int i;
  int height;
  int width;
  i = 0;
  height = get_height(s);
  width = get_width(s);
  if (ft_is_alone(s) == 0)
    return (0);
  if (ft_check_void_int(s) == 0 || width == 0 || height == 0)
    return (0);
  if (height == 2 && width == 2)
    return (1);
  else if (height == 2 && width == 3)
    return (1);
  else if (height == 3 && width == 2)
    return (1);
  else if (height == 1 && width == 4)
    return (1);
  else if (height == 4 && width == 1)
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<ft_check_shape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <get_height@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <get_width@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <ft_is_alone@plt>
cmp    $0x0,%rax
jne    118a <ft_check_shape+0x4a>
movl   $0x0,-0x4(%rbp)
jmp    1264 <ft_check_shape+0x124>
mov    -0x10(%rbp),%rdi
call   1060 <ft_check_void_int@plt>
cmp    $0x0,%rax
je     11b1 <ft_check_shape+0x71>
cmpl   $0x0,-0x1c(%rbp)
je     11b1 <ft_check_shape+0x71>
cmpl   $0x0,-0x18(%rbp)
jne    11bd <ft_check_shape+0x7d>
movl   $0x0,-0x4(%rbp)
jmp    1264 <ft_check_shape+0x124>
cmpl   $0x2,-0x18(%rbp)
jne    11dd <ft_check_shape+0x9d>
cmpl   $0x2,-0x1c(%rbp)
jne    11dd <ft_check_shape+0x9d>
movl   $0x1,-0x4(%rbp)
jmp    1264 <ft_check_shape+0x124>
cmpl   $0x2,-0x18(%rbp)
jne    11fd <ft_check_shape+0xbd>
cmpl   $0x3,-0x1c(%rbp)
jne    11fd <ft_check_shape+0xbd>
movl   $0x1,-0x4(%rbp)
jmp    1264 <ft_check_shape+0x124>
cmpl   $0x3,-0x18(%rbp)
jne    121d <ft_check_shape+0xdd>
cmpl   $0x2,-0x1c(%rbp)
jne    121d <ft_check_shape+0xdd>
movl   $0x1,-0x4(%rbp)
jmp    1264 <ft_check_shape+0x124>
cmpl   $0x1,-0x18(%rbp)
jne    123d <ft_check_shape+0xfd>
cmpl   $0x4,-0x1c(%rbp)
jne    123d <ft_check_shape+0xfd>
movl   $0x1,-0x4(%rbp)
jmp    1264 <ft_check_shape+0x124>
cmpl   $0x4,-0x18(%rbp)
jne    125d <ft_check_shape+0x11d>
cmpl   $0x1,-0x1c(%rbp)
jne    125d <ft_check_shape+0x11d>
movl   $0x1,-0x4(%rbp)
jmp    1264 <ft_check_shape+0x124>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_check_shape>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbp
call   1030 <get_height@plt>
mov    %eax,%r14d
mov    %rbp,%rdi
call   1040 <get_width@plt>
mov    %eax,%r15d
mov    %rbp,%rdi
call   1050 <ft_is_alone@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     11c8 <ft_check_shape+0x88>
mov    %rbp,%rdi
call   1060 <ft_check_void_int@plt>
test   %rax,%rax
je     11c8 <ft_check_shape+0x88>
test   %r15d,%r15d
je     11c8 <ft_check_shape+0x88>
test   %r14d,%r14d
je     11c8 <ft_check_shape+0x88>
mov    $0x1,%ebx
cmp    $0x2,%r14d
jne    1194 <ft_check_shape+0x54>
cmp    $0x2,%r15d
je     11c8 <ft_check_shape+0x88>
cmp    $0x2,%r14d
jne    11a0 <ft_check_shape+0x60>
cmp    $0x3,%r15d
je     11c8 <ft_check_shape+0x88>
cmp    $0x3,%r14d
jne    11ac <ft_check_shape+0x6c>
cmp    $0x2,%r15d
je     11c8 <ft_check_shape+0x88>
cmp    $0x1,%r14d
jne    11b8 <ft_check_shape+0x78>
cmp    $0x4,%r15d
je     11c8 <ft_check_shape+0x88>
xor    $0x4,%r14d
xor    $0x1,%r15d
xor    %ebx,%ebx
or     %r14d,%r15d
sete   %bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ft_check_shape(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %4
%7 = load i8*, i8** %3
%8 = call i32 @get_height(i8* %7)
store i32 %8, i32* %5
%9 = load i8*, i8** %3
%10 = call i32 @get_width(i8* %9)
store i32 %10, i32* %6
%11 = load i8*, i8** %3
%12 = call i64 @ft_is_alone(i8* %11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %1
store i32 0, i32* %2
br label %62
15: ; preds = %1
%16 = load i8*, i8** %3
%17 = call i64 @ft_check_void_int(i8* %16)
%18 = icmp eq i64 %17, 0
br i1 %18, label %25, label %19
19: ; preds = %15
%20 = load i32, i32* %6
%21 = icmp eq i32 %20, 0
br i1 %21, label %25, label %22
22: ; preds = %19
%23 = load i32, i32* %5
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %26
25: ; preds = %22, %19, %15
store i32 0, i32* %2
br label %62
26: ; preds = %22
%27 = load i32, i32* %5
%28 = icmp eq i32 %27, 2
br i1 %28, label %29, label %33
29: ; preds = %26
%30 = load i32, i32* %6
%31 = icmp eq i32 %30, 2
br i1 %31, label %32, label %33
32: ; preds = %29
store i32 1, i32* %2
br label %62
33: ; preds = %29, %26
%34 = load i32, i32* %5
%35 = icmp eq i32 %34, 2
br i1 %35, label %36, label %40
36: ; preds = %33
%37 = load i32, i32* %6
%38 = icmp eq i32 %37, 3
br i1 %38, label %39, label %40
39: ; preds = %36
store i32 1, i32* %2
br label %62
40: ; preds = %36, %33
%41 = load i32, i32* %5
%42 = icmp eq i32 %41, 3
br i1 %42, label %43, label %47
43: ; preds = %40
%44 = load i32, i32* %6
%45 = icmp eq i32 %44, 2
br i1 %45, label %46, label %47
46: ; preds = %43
store i32 1, i32* %2
br label %62
47: ; preds = %43, %40
%48 = load i32, i32* %5
%49 = icmp eq i32 %48, 1
br i1 %49, label %50, label %54
50: ; preds = %47
%51 = load i32, i32* %6
%52 = icmp eq i32 %51, 4
br i1 %52, label %53, label %54
53: ; preds = %50
store i32 1, i32* %2
br label %62
54: ; preds = %50, %47
%55 = load i32, i32* %5
%56 = icmp eq i32 %55, 4
br i1 %56, label %57, label %61
57: ; preds = %54
%58 = load i32, i32* %6
%59 = icmp eq i32 %58, 1
br i1 %59, label %60, label %61
60: ; preds = %57
store i32 1, i32* %2
br label %62
61: ; preds = %57, %54
store i32 0, i32* %2
br label %62
62: ; preds = %61, %60, %53, %46, %39, %32, %25, %14
%63 = load i32, i32* %2
ret i32 %63
}

LLVM IR (-O2):
define i32 @ft_check_shape(i8* %0) {
%2 = tail call i32 @get_height(i8* %0)
%3 = tail call i32 @get_width(i8* %0)
%4 = tail call i64 @ft_is_alone(i8* %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %32, label %6
6: ; preds = %1
%7 = tail call i64 @ft_check_void_int(i8* %0)
%8 = icmp eq i64 %7, 0
%9 = icmp eq i32 %3, 0
%10 = select i1 %8, i1 true, i1 %9
%11 = icmp eq i32 %2, 0
%12 = select i1 %10, i1 true, i1 %11
br i1 %12, label %32, label %13
13: ; preds = %6
%14 = icmp eq i32 %2, 2
%15 = icmp eq i32 %3, 2
%16 = select i1 %14, i1 %15, i1 false
br i1 %16, label %32, label %17
17: ; preds = %13
%18 = icmp eq i32 %3, 3
%19 = select i1 %14, i1 %18, i1 false
br i1 %19, label %32, label %20
20: ; preds = %17
%21 = icmp eq i32 %2, 3
%22 = select i1 %21, i1 %15, i1 false
br i1 %22, label %32, label %23
23: ; preds = %20
%24 = icmp eq i32 %2, 1
%25 = icmp eq i32 %3, 4
%26 = select i1 %24, i1 %25, i1 false
br i1 %26, label %32, label %27
27: ; preds = %23
%28 = icmp eq i32 %2, 4
%29 = icmp eq i32 %3, 1
%30 = select i1 %28, i1 %29, i1 false
%31 = zext i1 %30 to i32
br label %32
32: ; preds = %27, %23, %20, %17, %13, %6, %1
%33 = phi i32 [ 0, %1 ], [ 0, %6 ], [ 1, %13 ], [ 1, %17 ], [ 1, %20 ], [ 1, %23 ], [ %31, %27 ]
ret i32 %33
}