#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_putchar(char);
void ft_print_char(int w, int h, int i, int j) {
  if (i == 1 || i == h) {
    if (j == 1)
      ft_putchar('A');
    else if (j == w)
      ft_putchar('C');
    else
      ft_putchar('B');
  } else {
    if (j == w || j == 1)
      ft_putchar('B');
    else
      ft_putchar(' ');
  }
}


x86 assembly (clang, -O0):
<ft_print_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
cmpl   $0x1,-0xc(%rbp)
je     113a <ft_print_char+0x2a>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1182 <ft_print_char+0x72>
cmpl   $0x1,-0x10(%rbp)
jne    1153 <ft_print_char+0x43>
mov    $0x41,%edi
call   1030 <ft_putchar@plt>
jmp    117d <ft_print_char+0x6d>
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jne    116e <ft_print_char+0x5e>
mov    $0x43,%edi
call   1030 <ft_putchar@plt>
jmp    1178 <ft_print_char+0x68>
mov    $0x42,%edi
call   1030 <ft_putchar@plt>
jmp    117d <ft_print_char+0x6d>
jmp    11b6 <ft_print_char+0xa6>
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
je     1198 <ft_print_char+0x88>
cmpl   $0x1,-0x10(%rbp)
jne    11a7 <ft_print_char+0x97>
mov    $0x42,%edi
call   1030 <ft_putchar@plt>
jmp    11b1 <ft_print_char+0xa1>
mov    $0x20,%edi
call   1030 <ft_putchar@plt>
jmp    11b6 <ft_print_char+0xa6>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_print_char>:
cmp    $0x1,%edx
je     1130 <ft_print_char+0x20>
cmp    %esi,%edx
je     1130 <ft_print_char+0x20>
cmp    $0x1,%ecx
mov    $0x42,%edx
mov    $0x20,%eax
cmove  %edx,%eax
cmp    %edi,%ecx
cmove  %edx,%eax
jmp    1137 <ft_print_char+0x27>
mov    $0x41,%al
cmp    $0x1,%ecx
jne    113f <ft_print_char+0x2f>
movzbl %al,%edi
jmp    1030 <ft_putchar@plt>
cmp    %edi,%ecx
sete   %al
or     $0x42,%al
movzbl %al,%edi
jmp    1030 <ft_putchar@plt>

LLVM IR (-O0):
define void @ft_print_char(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %7
%10 = icmp eq i32 %9, 1
br i1 %10, label %15, label %11
11: ; preds = %4
%12 = load i32, i32* %7
%13 = load i32, i32* %6
%14 = icmp eq i32 %12, %13
br i1 %14, label %15, label %30
15: ; preds = %11, %4
%16 = load i32, i32* %8
%17 = icmp eq i32 %16, 1
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = call i32 @ft_putchar(i8 signext 65)
br label %29
20: ; preds = %15
%21 = load i32, i32* %8
%22 = load i32, i32* %5
%23 = icmp eq i32 %21, %22
br i1 %23, label %24, label %26
24: ; preds = %20
%25 = call i32 @ft_putchar(i8 signext 67)
br label %28
26: ; preds = %20
%27 = call i32 @ft_putchar(i8 signext 66)
br label %28
28: ; preds = %26, %24
br label %29
29: ; preds = %28, %18
br label %42
30: ; preds = %11
%31 = load i32, i32* %8
%32 = load i32, i32* %5
%33 = icmp eq i32 %31, %32
br i1 %33, label %37, label %34
34: ; preds = %30
%35 = load i32, i32* %8
%36 = icmp eq i32 %35, 1
br i1 %36, label %37, label %39
37: ; preds = %34, %30
%38 = call i32 @ft_putchar(i8 signext 66)
br label %41
39: ; preds = %34
%40 = call i32 @ft_putchar(i8 signext 32)
br label %41
41: ; preds = %39, %37
br label %42
42: ; preds = %41, %29
ret void
}

LLVM IR (-O2):
define void @ft_print_char(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %2, 1
%6 = icmp eq i32 %2, %1
%7 = or i1 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = icmp eq i32 %3, 1
br i1 %9, label %18, label %10
10: ; preds = %8
%11 = icmp eq i32 %3, %0
%12 = select i1 %11, i8 67, i8 66
br label %18
13: ; preds = %4
%14 = icmp eq i32 %3, %0
%15 = icmp eq i32 %3, 1
%16 = or i1 %14, %15
%17 = select i1 %16, i8 66, i8 32
br label %18
18: ; preds = %13, %10, %8
%19 = phi i8 [ 65, %8 ], [ %12, %10 ], [ %17, %13 ]
%20 = tail call i32 @ft_putchar(i8 signext %19)
ret void
}