#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*/ pst(int, int);
int /*<<< orphan*/ putchar(char);
int sscanf(char *, char *, int *);
int main(int argc, char **argv) {
  int width;
  if (argc < 2)
    return -1;
  int ret = sscanf(argv[1], "%d", &width);
  if (ret != 1)
    return -2;
  int lines = 0;
  int line_max = (width % 2) ? width : width - 1;
  for (lines = 0; lines < line_max; lines++) {
    pst(lines, width);
    putchar('\n');
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    115c <main+0x2c>
movl   $0xffffffff,-0x4(%rbp)
jmp    11ff <main+0xcf>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe95(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1040 <sscanf@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x1,-0x18(%rbp)
je     118d <main+0x5d>
movl   $0xfffffffe,-0x4(%rbp)
jmp    11ff <main+0xcf>
movl   $0x0,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     11b3 <main+0x83>
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    11bc <main+0x8c>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x20(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    11f8 <main+0xc8>
mov    -0x1c(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1050 <pst@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11c9 <main+0x99>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0xffffffff,%r15d
cmp    $0x2,%edi
jl     11d7 <main+0xa7>
mov    0x8(%rsi),%rdi
lea    0xeaf(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1040 <sscanf@plt>
mov    $0xfffffffe,%r15d
cmp    $0x1,%eax
jne    11d7 <main+0xa7>
mov    0x4(%rsp),%r14d
mov    %r14d,%ebx
and    $0x1,%ebx
lea    (%r14,%rbx,1),%ebp
add    $0xffffffff,%ebp
xor    %r15d,%r15d
test   %ebp,%ebp
jle    11d7 <main+0xa7>
xor    %edi,%edi
mov    %r14d,%esi
call   1050 <pst@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmp    $0x1,%ebp
je     11d7 <main+0xa7>
add    %ebx,%r14d
mov    $0x2,%ebp
sub    %r14d,%ebp
mov    $0x1,%ebx
nopl   0x0(%rax,%rax,1)
mov    0x4(%rsp),%esi
mov    %ebx,%edi
call   1050 <pst@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    (%rbx,%rbp,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x1,%eax
jne    11b0 <main+0x80>
mov    %r15d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 2
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 -1, i32* %3
br label %45
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32 @sscanf(i8* %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
store i32 %17, i32* %7
%18 = load i32, i32* %7
%19 = icmp ne i32 %18, 1
br i1 %19, label %20, label %21
20: ; preds = %13
store i32 -2, i32* %3
br label %45
21: ; preds = %13
store i32 0, i32* %8
%22 = load i32, i32* %6
%23 = srem i32 %22, 2
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %21
%26 = load i32, i32* %6
br label %30
27: ; preds = %21
%28 = load i32, i32* %6
%29 = sub nsw i32 %28, 1
br label %30
30: ; preds = %27, %25
%31 = phi i32 [ %26, %25 ], [ %29, %27 ]
store i32 %31, i32* %9
store i32 0, i32* %8
br label %32
32: ; preds = %41, %30
%33 = load i32, i32* %8
%34 = load i32, i32* %9
%35 = icmp slt i32 %33, %34
br i1 %35, label %36, label %44
36: ; preds = %32
%37 = load i32, i32* %8
%38 = load i32, i32* %6
%39 = call i32 @pst(i32 %37, i32 %38)
%40 = call i32 @putchar(i8 signext 10)
br label %41
41: ; preds = %36
%42 = load i32, i32* %8
%43 = add nsw i32 %42, 1
store i32 %43, i32* %8
br label %32
44: ; preds = %32
store i32 0, i32* %3
br label %45
45: ; preds = %44, %20, %12
%46 = load i32, i32* %3
ret i32 %46
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = icmp slt i32 %0, 2
br i1 %5, label %28, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @sscanf(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %28
11: ; preds = %6
%12 = load i32, i32* %3
%13 = and i32 %12, 1
%14 = add i32 %12, -1
%15 = add i32 %14, %13
%16 = icmp sgt i32 %15, 0
br i1 %16, label %17, label %28
17: ; preds = %11
%18 = call i32 @pst(i32 0, i32 %12)
%19 = call i32 @putchar(i8 signext 10)
%20 = icmp eq i32 %15, 1
br i1 %20, label %28, label %21
21: ; preds = %17, %21
%22 = phi i32 [ %26, %21 ], [ 1, %17 ]
%23 = load i32, i32* %3
%24 = call i32 @pst(i32 %22, i32 %23)
%25 = call i32 @putchar(i8 signext 10)
%26 = add nuw nsw i32 %22, 1
%27 = icmp eq i32 %26, %15
br i1 %27, label %28, label %21
28: ; preds = %21, %17, %11, %6, %2
%29 = phi i32 [ -1, %2 ], [ -2, %6 ], [ 0, %11 ], [ 0, %17 ], [ 0, %21 ]
ret i32 %29
}