#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_middle(int);
int /*<<< orphan*/ ft_print_top_bottom(int);
void rush(int x, int y) {
  if (x <= 0 || y <= 0) {
    return;
  }
  ft_print_top_bottom(x);
  while (y > 2) {
    ft_print_middle(x);
    y--;
  }
  if (y > 1) {
    ft_print_top_bottom(x);
  }
}


x86 assembly (clang, -O0):
<rush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1142 <rush+0x22>
cmpl   $0x0,-0x8(%rbp)
jg     1147 <rush+0x27>
jmp    1181 <rush+0x61>
mov    -0x4(%rbp),%edi
call   1040 <ft_print_top_bottom@plt>
cmpl   $0x2,-0x8(%rbp)
jle    116f <rush+0x4f>
mov    -0x4(%rbp),%edi
call   1030 <ft_print_middle@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    114f <rush+0x2f>
cmpl   $0x1,-0x8(%rbp)
jle    1181 <rush+0x61>
mov    -0x4(%rbp),%edi
call   1040 <ft_print_top_bottom@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rush>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
jle    1163 <rush+0x43>
mov    %esi,%ebp
test   %esi,%esi
jle    1163 <rush+0x43>
mov    %edi,%ebx
call   1040 <ft_print_top_bottom@plt>
cmp    $0x3,%ebp
jb     1151 <rush+0x31>
nopl   0x0(%rax)
mov    %ebx,%edi
call   1030 <ft_print_middle@plt>
add    $0xffffffff,%ebp
cmp    $0x2,%ebp
ja     1140 <rush+0x20>
jmp    1156 <rush+0x36>
cmp    $0x2,%ebp
jne    1163 <rush+0x43>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <ft_print_top_bottom@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @rush(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp sle i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp sle i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %7, %2
br label %28
11: ; preds = %7
%12 = load i32, i32* %3
%13 = call i32 @ft_print_top_bottom(i32 %12)
br label %14
14: ; preds = %17, %11
%15 = load i32, i32* %4
%16 = icmp sgt i32 %15, 2
br i1 %16, label %17, label %22
17: ; preds = %14
%18 = load i32, i32* %3
%19 = call i32 @ft_print_middle(i32 %18)
%20 = load i32, i32* %4
%21 = add nsw i32 %20, -1
store i32 %21, i32* %4
br label %14
22: ; preds = %14
%23 = load i32, i32* %4
%24 = icmp sgt i32 %23, 1
br i1 %24, label %25, label %28
25: ; preds = %22
%26 = load i32, i32* %3
%27 = call i32 @ft_print_top_bottom(i32 %26)
br label %28
28: ; preds = %10, %25, %22
ret void
}

LLVM IR (-O2):
define void @rush(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 1
%4 = icmp slt i32 %1, 1
%5 = or i1 %3, %4
br i1 %5, label %18, label %6
6: ; preds = %2
%7 = tail call i32 @ft_print_top_bottom(i32 %0)
%8 = icmp ugt i32 %1, 2
br i1 %8, label %9, label %14
9: ; preds = %6, %9
%10 = phi i32 [ %12, %9 ], [ %1, %6 ]
%11 = tail call i32 @ft_print_middle(i32 %0)
%12 = add nsw i32 %10, -1
%13 = icmp ugt i32 %12, 2
br i1 %13, label %9, label %16
14: ; preds = %6
%15 = icmp eq i32 %1, 2
br i1 %15, label %16, label %18
16: ; preds = %9, %14
%17 = tail call i32 @ft_print_top_bottom(i32 %0)
br label %18
18: ; preds = %2, %16, %14
ret void
}