#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*/ my_mvaddstr(int, int, char *);
int add_man(int y, int x) {
  static char *man[2][2] = {{"", "(O)"}, {"Help!", "\\O/"}};
  int i;
  if (x < 0) {
    return 0;
  }
  for (i = 0; i < 2; ++i) {
    my_mvaddstr(y + i, x, man[(84 + x) / 12 % 2][i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<add_man>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1134 <add_man+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1197 <add_man+0x87>
movl   $0x0,-0x10(%rbp)
cmpl   $0x2,-0x10(%rbp)
jge    1190 <add_man+0x80>
mov    -0x8(%rbp),%edi
add    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%eax
add    $0x54,%eax
mov    $0xc,%ecx
cltd
idiv   %ecx
mov    $0x2,%ecx
cltd
idiv   %ecx
movslq %edx,%rcx
lea    0x2ec2(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
call   1030 <my_mvaddstr@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113b <add_man+0x2b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_man>:
test   %esi,%esi
js     115b <add_man+0x4b>
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
lea    0x54(%rbx),%eax
mov    $0xaaaaaaab,%ecx
imul   %rax,%rcx
shr    $0x23,%rcx
and    $0x1,%ecx
shl    $0x4,%rcx
lea    0x2cc6(%rip),%rax
mov    (%rcx,%rax,1),%rdx
mov    0x8(%rcx,%rax,1),%r14
call   1030 <my_mvaddstr@plt>
add    $0x1,%ebp
mov    %ebp,%edi
mov    %ebx,%esi
mov    %r14,%rdx
call   1030 <my_mvaddstr@plt>
pop    %rbx
pop    %r14
pop    %rbp
xor    %eax,%eax
ret

LLVM IR (-O0):
@add_man.man = internal global [2 x [2 x i8*]] [[2 x i8*] [i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0)], [2 x i8*] [i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i32 0, i32 0)]]
@.str = [1 x i8] zeroinitializer
@.str.1 = [4 x i8] c"(O)\00"
@.str.2 = [6 x i8] c"Help!\00"
@.str.3 = [4 x i8] c"\\O/\00"
define i32 @add_man(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 0, i32* %3
br label %34
10: ; preds = %2
store i32 0, i32* %6
br label %11
11: ; preds = %30, %10
%12 = load i32, i32* %6
%13 = icmp slt i32 %12, 2
br i1 %13, label %14, label %33
14: ; preds = %11
%15 = load i32, i32* %4
%16 = load i32, i32* %6
%17 = add nsw i32 %15, %16
%18 = load i32, i32* %5
%19 = load i32, i32* %5
%20 = add nsw i32 84, %19
%21 = sdiv i32 %20, 12
%22 = srem i32 %21, 2
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [2 x [2 x i8*]], [2 x [2 x i8*]]* @add_man.man, i64 0, i64 %23
%25 = load i32, i32* %6
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [2 x i8*], [2 x i8*]* %24, i64 0, i64 %26
%28 = load i8*, i8** %27
%29 = call i32 @my_mvaddstr(i32 %17, i32 %18, i8* %28)
br label %30
30: ; preds = %14
%31 = load i32, i32* %6
%32 = add nsw i32 %31, 1
store i32 %32, i32* %6
br label %11
33: ; preds = %11
store i32 0, i32* %3
br label %34
34: ; preds = %33, %9
%35 = load i32, i32* %3
ret i32 %35
}

LLVM IR (-O2):
@add_man.man = internal unnamed_addr constant [2 x [2 x i8*]] [[2 x i8*] [i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0)], [2 x i8*] [i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i32 0, i32 0)]]
@.str = [1 x i8] zeroinitializer
@.str.1 = [4 x i8] c"(O)\00"
@.str.2 = [6 x i8] c"Help!\00"
@.str.3 = [4 x i8] c"\\O/\00"
define i32 @add_man(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 0
br i1 %3, label %16, label %4
4: ; preds = %2
%5 = add nuw nsw i32 %1, 84
%6 = udiv i32 %5, 12
%7 = and i32 %6, 1
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds [2 x [2 x i8*]], [2 x [2 x i8*]]* @add_man.man, i64 0, i64 %8, i64 0
%10 = load i8*, i8** %9
%11 = tail call i32 @my_mvaddstr(i32 %0, i32 %1, i8* %10)
%12 = add i32 %0, 1
%13 = getelementptr inbounds [2 x [2 x i8*]], [2 x [2 x i8*]]* @add_man.man, i64 0, i64 %8, i64 1
%14 = load i8*, i8** %13
%15 = tail call i32 @my_mvaddstr(i32 %12, i32 %1, i8* %14)
br label %16
16: ; preds = %4, %2
ret i32 0
}