#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_print_door(int, int);
int /*<<< orphan*/ ft_putchar(char);
void ft_putline_door(int line_size, int door_height, int dollar_line) {
  int door_width;
  int door_location_x;
  int i;
  i = 0;
  door_width = door_height;
  door_location_x = (line_size / 2) - (door_width);
  while (i < line_size) {
    ft_putchar(' ');
    i++;
  }
  ft_putchar('/');
  while (i < door_location_x) {
    ft_putchar('*');
    i++;
  }
  if (dollar_line == 1)
    ft_print_door(door_width, dollar_line);
  i = 0;
  while (i < line_size - 2) {
    ft_putchar('*');
    i++;
  }
  ft_putchar('\\');
  ft_putchar('\n');
}


x86 assembly (clang, -O0):
<ft_putline_door>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
sub    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1173 <ft_putline_door+0x53>
mov    $0x20,%edi
call   1030 <ft_putchar@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    114f <ft_putline_door+0x2f>
mov    $0x2f,%edi
call   1030 <ft_putchar@plt>
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11a1 <ft_putline_door+0x81>
mov    $0x2a,%edi
call   1030 <ft_putchar@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    117d <ft_putline_door+0x5d>
cmpl   $0x1,-0xc(%rbp)
jne    11b6 <ft_putline_door+0x96>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <ft_print_door@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x2,%ecx
cmp    %ecx,%eax
jge    11e6 <ft_putline_door+0xc6>
mov    $0x2a,%edi
call   1030 <ft_putchar@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11bd <ft_putline_door+0x9d>
mov    $0x5c,%edi
call   1030 <ft_putchar@plt>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putline_door>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%r14d
mov    %esi,%r15d
mov    %edi,%ebp
mov    %edi,%r12d
shr    $0x1f,%r12d
add    %edi,%r12d
sar    %r12d
sub    %esi,%r12d
test   %edi,%edi
jle    1163 <ft_putline_door+0x43>
mov    %ebp,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <ft_putchar@plt>
add    $0xffffffff,%ebx
jne    1150 <ft_putline_door+0x30>
mov    %ebp,%ebx
jmp    1165 <ft_putline_door+0x45>
xor    %ebx,%ebx
mov    $0x2f,%edi
call   1030 <ft_putchar@plt>
cmp    %r12d,%ebx
jge    1192 <ft_putline_door+0x72>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x2a,%edi
call   1030 <ft_putchar@plt>
add    $0x1,%ebx
cmp    %r12d,%ebx
jl     1180 <ft_putline_door+0x60>
cmp    $0x1,%r14d
jne    11a5 <ft_putline_door+0x85>
mov    %r15d,%edi
mov    $0x1,%esi
call   1040 <ft_print_door@plt>
cmp    $0x3,%ebp
jl     11bf <ft_putline_door+0x9f>
add    $0xfffffffe,%ebp
nopl   (%rax)
mov    $0x2a,%edi
call   1030 <ft_putchar@plt>
add    $0xffffffff,%ebp
jne    11b0 <ft_putline_door+0x90>
mov    $0x5c,%edi
call   1030 <ft_putchar@plt>
mov    $0xa,%edi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <ft_putchar@plt>

LLVM IR (-O0):
define void @ft_putline_door(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %9
%10 = load i32, i32* %5
store i32 %10, i32* %7
%11 = load i32, i32* %4
%12 = sdiv i32 %11, 2
%13 = load i32, i32* %7
%14 = sub nsw i32 %12, %13
store i32 %14, i32* %8
br label %15
15: ; preds = %19, %3
%16 = load i32, i32* %9
%17 = load i32, i32* %4
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %23
19: ; preds = %15
%20 = call i32 @ft_putchar(i8 signext 32)
%21 = load i32, i32* %9
%22 = add nsw i32 %21, 1
store i32 %22, i32* %9
br label %15
23: ; preds = %15
%24 = call i32 @ft_putchar(i8 signext 47)
br label %25
25: ; preds = %29, %23
%26 = load i32, i32* %9
%27 = load i32, i32* %8
%28 = icmp slt i32 %26, %27
br i1 %28, label %29, label %33
29: ; preds = %25
%30 = call i32 @ft_putchar(i8 signext 42)
%31 = load i32, i32* %9
%32 = add nsw i32 %31, 1
store i32 %32, i32* %9
br label %25
33: ; preds = %25
%34 = load i32, i32* %6
%35 = icmp eq i32 %34, 1
br i1 %35, label %36, label %40
36: ; preds = %33
%37 = load i32, i32* %7
%38 = load i32, i32* %6
%39 = call i32 @ft_print_door(i32 %37, i32 %38)
br label %40
40: ; preds = %36, %33
store i32 0, i32* %9
br label %41
41: ; preds = %46, %40
%42 = load i32, i32* %9
%43 = load i32, i32* %4
%44 = sub nsw i32 %43, 2
%45 = icmp slt i32 %42, %44
br i1 %45, label %46, label %50
46: ; preds = %41
%47 = call i32 @ft_putchar(i8 signext 42)
%48 = load i32, i32* %9
%49 = add nsw i32 %48, 1
store i32 %49, i32* %9
br label %41
50: ; preds = %41
%51 = call i32 @ft_putchar(i8 signext 92)
%52 = call i32 @ft_putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @ft_putline_door(i32 %0, i32 %1, i32 %2) {
%4 = sdiv i32 %0, 2
%5 = sub nsw i32 %4, %1
%6 = icmp sgt i32 %0, 0
br i1 %6, label %7, label %12
7: ; preds = %3, %7
%8 = phi i32 [ %10, %7 ], [ 0, %3 ]
%9 = tail call i32 @ft_putchar(i8 signext 32)
%10 = add nuw nsw i32 %8, 1
%11 = icmp eq i32 %10, %0
br i1 %11, label %12, label %7
12: ; preds = %7, %3
%13 = phi i32 [ 0, %3 ], [ %0, %7 ]
%14 = tail call i32 @ft_putchar(i8 signext 47)
%15 = icmp slt i32 %13, %5
br i1 %15, label %16, label %21
16: ; preds = %12, %16
%17 = phi i32 [ %19, %16 ], [ %13, %12 ]
%18 = tail call i32 @ft_putchar(i8 signext 42)
%19 = add nuw nsw i32 %17, 1
%20 = icmp slt i32 %19, %5
br i1 %20, label %16, label %21
21: ; preds = %16, %12
%22 = icmp eq i32 %2, 1
br i1 %22, label %23, label %25
23: ; preds = %21
%24 = tail call i32 @ft_print_door(i32 %1, i32 1)
br label %25
25: ; preds = %23, %21
%26 = add i32 %0, -2
%27 = icmp sgt i32 %0, 2
br i1 %27, label %28, label %33
28: ; preds = %25, %28
%29 = phi i32 [ %31, %28 ], [ 0, %25 ]
%30 = tail call i32 @ft_putchar(i8 signext 42)
%31 = add nuw nsw i32 %29, 1
%32 = icmp eq i32 %31, %26
br i1 %32, label %33, label %28
33: ; preds = %28, %25
%34 = tail call i32 @ft_putchar(i8 signext 92)
%35 = tail call i32 @ft_putchar(i8 signext 10)
ret void
}