#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 rush(int x, int y) {
  int width;
  int height;
  width = x;
  height = y;
  while (height > 0) {
    while (width > 0) {
      if (width == x && (height == 1 || height == y))
        ft_putchar('A');
      else if (width == 1 && (height == 1 || height == y))
        ft_putchar('C');
      else if (width == 1 || width == x || height == 1 || height == y)
        ft_putchar('B');
      else
        ft_putchar(' ');
      width--;
    }
    ft_putchar('\n');
    width = x;
    height--;
  }
}


x86 assembly (clang, -O0):
<rush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    121e <rush+0x10e>
jmp    1139 <rush+0x29>
cmpl   $0x0,-0xc(%rbp)
jle    1200 <rush+0xf0>
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jne    1174 <rush+0x64>
cmpl   $0x1,-0x10(%rbp)
je     1165 <rush+0x55>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1174 <rush+0x64>
mov    $0x41,%edi
call   1030 <ft_putchar@plt>
jmp    11f2 <rush+0xe2>
cmpl   $0x1,-0xc(%rbp)
jne    11a3 <rush+0x93>
cmpl   $0x1,-0x10(%rbp)
je     1194 <rush+0x84>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    11a3 <rush+0x93>
mov    $0x43,%edi
call   1030 <ft_putchar@plt>
jmp    11ed <rush+0xdd>
cmpl   $0x1,-0xc(%rbp)
je     11cf <rush+0xbf>
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
je     11cf <rush+0xbf>
cmpl   $0x1,-0x10(%rbp)
je     11cf <rush+0xbf>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    11de <rush+0xce>
mov    $0x42,%edi
call   1030 <ft_putchar@plt>
jmp    11e8 <rush+0xd8>
mov    $0x20,%edi
call   1030 <ft_putchar@plt>
jmp    11ed <rush+0xdd>
jmp    11f2 <rush+0xe2>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1139 <rush+0x29>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    112a <rush+0x1a>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rush>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdi,0x10(%rsp)
mov    %esi,0x8(%rsp)
test   %esi,%esi
jle    1200 <rush+0xf0>
mov    0x10(%rsp),%rax
add    $0x1,%eax
mov    %eax,0xc(%rsp)
mov    $0x42,%r13d
mov    0x8(%rsp),%eax
mov    %eax,%ebp
jmp    1168 <rush+0x58>
nopl   0x0(%rax)
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
lea    -0x1(%rbp),%eax
cmp    $0x1,%ebp
mov    %eax,%ebp
jle    1200 <rush+0xf0>
cmpl   $0x0,0x10(%rsp)
jle    1150 <rush+0x40>
cmp    $0x1,%ebp
setne  %al
sete   %cl
cmp    0x8(%rsp),%ebp
setne  %bl
sete   %r15b
or     %cl,%r15b
and    %al,%bl
xor    %r14d,%r14d
mov    0xc(%rsp),%r12d
jmp    11d5 <rush+0xc5>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmp    0x8(%rsp),%ebp
mov    $0x20,%eax
cmove  %r13d,%eax
cmp    $0x1,%ebp
cmove  %r13d,%eax
test   %r14d,%r14d
cmove  %r13d,%eax
movzbl %al,%edi
call   1030 <ft_putchar@plt>
add    $0xffffffff,%r12d
add    $0x1,%r14d
cmp    $0x1,%r12d
jle    1150 <rush+0x40>
test   %r14d,%r14d
setne  %cl
or     %bl,%cl
mov    $0x41,%al
cmp    $0x1,%cl
jne    11bb <rush+0xab>
cmp    $0x2,%r12d
jne    11a0 <rush+0x90>
mov    $0x42,%al
test   %r15b,%r15b
je     11bb <rush+0xab>
mov    $0x43,%edi
call   1030 <ft_putchar@plt>
jmp    1150 <rush+0x40>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @rush(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %38
4: ; preds = %2
%5 = icmp sgt i32 %0, 0
br label %6
6: ; preds = %4, %34
%7 = phi i32 [ %1, %4 ], [ %36, %34 ]
br i1 %5, label %8, label %34
8: ; preds = %6
%9 = icmp ne i32 %7, 1
%10 = icmp ne i32 %7, %1
%11 = icmp eq i32 %7, 1
%12 = icmp eq i32 %7, %1
%13 = or i1 %11, %12
%14 = and i1 %9, %10
br label %15
15: ; preds = %8, %29
%16 = phi i32 [ %0, %8 ], [ %32, %29 ]
%17 = icmp eq i32 %16, %0
%18 = xor i1 %17, true
%19 = select i1 %18, i1 true, i1 %14
br i1 %19, label %20, label %29
20: ; preds = %15
%21 = icmp eq i32 %16, 1
br i1 %21, label %22, label %25
22: ; preds = %20
br i1 %13, label %23, label %29
23: ; preds = %22
%24 = tail call i32 @ft_putchar(i8 signext 67)
br label %34
25: ; preds = %20
%26 = select i1 %17, i1 true, i1 %11
%27 = select i1 %26, i1 true, i1 %12
%28 = select i1 %27, i8 66, i8 32
br label %29
29: ; preds = %25, %22, %15
%30 = phi i8 [ 65, %15 ], [ 66, %22 ], [ %28, %25 ]
%31 = tail call i32 @ft_putchar(i8 signext %30)
%32 = add nsw i32 %16, -1
%33 = icmp sgt i32 %16, 1
br i1 %33, label %15, label %34
34: ; preds = %29, %23, %6
%35 = tail call i32 @ft_putchar(i8 signext 10)
%36 = add nsw i32 %7, -1
%37 = icmp sgt i32 %7, 1
br i1 %37, label %6, label %38
38: ; preds = %34, %2
ret void
}