#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*/ addch(int);
int /*<<< orphan*/ move(int, int);
void PaintWall() {
  int i;
  int up = 1;
  int down = up + 20;
  int left = 1;
  int right = left + 50;
  for (i = (left + 1); i <= (right - 1); i++) {
    move(up, i);
    addch(45);
    move(down, i);
    addch(45);
  }
  for (i = (up + 1); i <= (down - 1); i++) {
    move(i, left);
    addch(124);
    move(i, right);
    addch(124);
  }
  move(up, left);
  addch(47);
  move(up, right);
  addch(92);
  move(down, left);
  addch(92);
  move(down, right);
  addch(47);
}


x86 assembly (clang, -O0):
<PaintWall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x14,%eax
mov    %eax,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x32,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     119a <PaintWall+0x7a>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1040 <move@plt>
mov    $0x2d,%edi
call   1030 <addch@plt>
mov    -0xc(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1040 <move@plt>
mov    $0x2d,%edi
call   1030 <addch@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1151 <PaintWall+0x31>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     11ec <PaintWall+0xcc>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1040 <move@plt>
mov    $0x7c,%edi
call   1030 <addch@plt>
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1040 <move@plt>
mov    $0x7c,%edi
call   1030 <addch@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    11a3 <PaintWall+0x83>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1040 <move@plt>
mov    $0x2f,%edi
call   1030 <addch@plt>
mov    -0x8(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1040 <move@plt>
mov    $0x5c,%edi
call   1030 <addch@plt>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1040 <move@plt>
mov    $0x5c,%edi
call   1030 <addch@plt>
mov    -0xc(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1040 <move@plt>
mov    $0x2f,%edi
call   1030 <addch@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PaintWall>:
push   %rbx
mov    $0x2,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x1,%edi
mov    %ebx,%esi
call   1040 <move@plt>
mov    $0x2d,%edi
call   1030 <addch@plt>
mov    $0x15,%edi
mov    %ebx,%esi
call   1040 <move@plt>
mov    $0x2d,%edi
call   1030 <addch@plt>
add    $0x1,%ebx
cmp    $0x33,%ebx
jne    1130 <PaintWall+0x10>
mov    $0x2,%ebx
nopl   0x0(%rax)
mov    %ebx,%edi
mov    $0x1,%esi
call   1040 <move@plt>
mov    $0x7c,%edi
call   1030 <addch@plt>
mov    %ebx,%edi
mov    $0x33,%esi
call   1040 <move@plt>
mov    $0x7c,%edi
call   1030 <addch@plt>
add    $0x1,%ebx
cmp    $0x15,%ebx
jne    1170 <PaintWall+0x50>
mov    $0x1,%edi
mov    $0x1,%esi
call   1040 <move@plt>
mov    $0x2f,%edi
call   1030 <addch@plt>
mov    $0x1,%edi
mov    $0x33,%esi
call   1040 <move@plt>
mov    $0x5c,%edi
call   1030 <addch@plt>
mov    $0x15,%edi
mov    $0x1,%esi
call   1040 <move@plt>
mov    $0x5c,%edi
call   1030 <addch@plt>
mov    $0x15,%edi
mov    $0x33,%esi
call   1040 <move@plt>
mov    $0x2f,%edi
pop    %rbx
jmp    1030 <addch@plt>

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

LLVM IR (-O2):
define void @PaintWall() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 2, %0 ], [ %7, %1 ]
%3 = tail call i32 @move(i32 1, i32 %2)
%4 = tail call i32 @addch(i32 45)
%5 = tail call i32 @move(i32 21, i32 %2)
%6 = tail call i32 @addch(i32 45)
%7 = add nuw nsw i32 %2, 1
%8 = icmp eq i32 %7, 51
br i1 %8, label %9, label %1
9: ; preds = %1, %9
%10 = phi i32 [ %15, %9 ], [ 2, %1 ]
%11 = tail call i32 @move(i32 %10, i32 1)
%12 = tail call i32 @addch(i32 124)
%13 = tail call i32 @move(i32 %10, i32 51)
%14 = tail call i32 @addch(i32 124)
%15 = add nuw nsw i32 %10, 1
%16 = icmp eq i32 %15, 21
br i1 %16, label %17, label %9
17: ; preds = %9
%18 = tail call i32 @move(i32 1, i32 1)
%19 = tail call i32 @addch(i32 47)
%20 = tail call i32 @move(i32 1, i32 51)
%21 = tail call i32 @addch(i32 92)
%22 = tail call i32 @move(i32 21, i32 1)
%23 = tail call i32 @addch(i32 92)
%24 = tail call i32 @move(i32 21, i32 51)
%25 = tail call i32 @addch(i32 47)
ret void
}