#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*/ draw_coordinates(int, int, int, int);
int /*<<< orphan*/ move(int, int);
int /*<<< orphan*/ mvaddch(int, int, char);
int draw_target(int x, int y, int posx, int posy, char vert, char horz,
                char cen) {
  int i;
  for (i = 1; i < (x - 1); i++)
    mvaddch(posy, i, horz);
  for (i = 1; i < (y - 1); i++)
    mvaddch(i, posx, vert);
  mvaddch(posy, posx, cen);
  draw_coordinates(x, y, posx, posy);
  move(y - 1, x - 1);
  return (0);
}


x86 assembly (clang, -O0):
<draw_target>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %r8d,-0x28(%rbp)
mov    %ecx,%eax
mov    -0x28(%rbp),%ecx
mov    %eax,-0x24(%rbp)
mov    %edx,%eax
mov    -0x24(%rbp),%edx
mov    %eax,-0x20(%rbp)
mov    %esi,%eax
mov    -0x20(%rbp),%esi
mov    %eax,-0x1c(%rbp)
mov    %edi,%r8d
mov    -0x1c(%rbp),%edi
mov    %r9b,%al
mov    0x10(%rbp),%r9b
mov    %r8d,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %cl,-0x11(%rbp)
mov    %al,-0x12(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    11a9 <draw_target+0x79>
mov    -0x10(%rbp),%edi
mov    -0x18(%rbp),%esi
movsbl -0x12(%rbp),%edx
call   1040 <mvaddch@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    117b <draw_target+0x4b>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    11de <draw_target+0xae>
mov    -0x18(%rbp),%edi
mov    -0xc(%rbp),%esi
movsbl -0x11(%rbp),%edx
call   1040 <mvaddch@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11b0 <draw_target+0x80>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
movsbl 0x10(%rbp),%edx
call   1040 <mvaddch@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1030 <draw_coordinates@plt>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0x4(%rbp),%esi
sub    $0x1,%esi
call   1050 <move@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_target>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r8d,0xc(%rsp)
mov    %ecx,%r12d
mov    %edx,%r13d
mov    %rsi,(%rsp)
mov    %edi,%r15d
cmp    $0x3,%edi
jl     118f <draw_target+0x5f>
mov    $0x2,%r14d
sub    %r15d,%r14d
mov    $0x1,%ebp
movsbl %r9b,%ebx
nopw   0x0(%rax,%rax,1)
mov    %r12d,%edi
mov    %ebp,%esi
mov    %ebx,%edx
call   1040 <mvaddch@plt>
lea    (%r14,%rbp,1),%eax
add    $0x1,%eax
mov    %ebp,%ecx
add    $0x1,%ecx
mov    %ecx,%ebp
cmp    $0x1,%eax
jne    1170 <draw_target+0x40>
lea    -0x1(%r15),%eax
mov    %eax,0x14(%rsp)
mov    (%rsp),%rax
lea    -0x1(%rax),%ecx
mov    %ecx,0x10(%rsp)
cmp    $0x3,%eax
jl     11df <draw_target+0xaf>
mov    $0x2,%r14d
sub    (%rsp),%r14d
mov    $0x1,%ebp
movsbl 0xc(%rsp),%ebx
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %r13d,%esi
mov    %ebx,%edx
call   1040 <mvaddch@plt>
lea    (%r14,%rbp,1),%eax
add    $0x1,%eax
mov    %ebp,%ecx
add    $0x1,%ecx
mov    %ecx,%ebp
cmp    $0x1,%eax
jne    11c0 <draw_target+0x90>
movsbl 0x50(%rsp),%edx
mov    %r12d,%edi
mov    %r13d,%esi
call   1040 <mvaddch@plt>
mov    %r15d,%edi
mov    (%rsp),%rsi
mov    %r13d,%edx
mov    %r12d,%ecx
call   1030 <draw_coordinates@plt>
mov    0x10(%rsp),%edi
mov    0x14(%rsp),%esi
call   1050 <move@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @draw_target(i32 %0, i32 %1, i32 %2, i32 %3, i8 signext %4, i8 signext %5, i8 signext %6) {
%8 = add i32 %0, -1
%9 = icmp sgt i32 %0, 2
br i1 %9, label %13, label %10
10: ; preds = %13, %7
%11 = add i32 %1, -1
%12 = icmp sgt i32 %1, 2
br i1 %12, label %18, label %23
13: ; preds = %7, %13
%14 = phi i32 [ %16, %13 ], [ 1, %7 ]
%15 = tail call i32 @mvaddch(i32 %3, i32 %14, i8 signext %5)
%16 = add nuw nsw i32 %14, 1
%17 = icmp eq i32 %16, %8
br i1 %17, label %10, label %13
18: ; preds = %10, %18
%19 = phi i32 [ %21, %18 ], [ 1, %10 ]
%20 = tail call i32 @mvaddch(i32 %19, i32 %2, i8 signext %4)
%21 = add nuw nsw i32 %19, 1
%22 = icmp eq i32 %21, %11
br i1 %22, label %23, label %18
23: ; preds = %18, %10
%24 = tail call i32 @mvaddch(i32 %3, i32 %2, i8 signext %6)
%25 = tail call i32 @draw_coordinates(i32 %0, i32 %1, i32 %2, i32 %3)
%26 = tail call i32 @move(i32 %11, i32 %8)
ret i32 0
}