#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*/ printf(char *, ...);
int out_ps(unsigned int d, unsigned int m, unsigned n) {
  if (m == (0))
    return 0;
  if (n == (0)) {
    if (d < ((unsigned)144))
      printf("postscript /ft%d/ft%d load bind def\n", d - 1, m - 1);
    else
      printf("postscript /sh%d/sh%d load bind def\n", d - 1, m - 1);
    return 0;
  }
  printf("postscript /");
  if (d < ((unsigned)144))
    printf("ft");
  else
    printf("sh");
  printf("%d{(\\%o\\%o)sags}!\n", d - 1, m, n);
  return 0;
}


x86 assembly (clang, -O0):
<out_ps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1137 <out_ps+0x27>
movl   $0x0,-0x4(%rbp)
jmp    11f0 <out_ps+0xe0>
cmpl   $0x0,-0x10(%rbp)
jne    1193 <out_ps+0x83>
cmpl   $0x90,-0x8(%rbp)
jae    116d <out_ps+0x5d>
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1187 <out_ps+0x77>
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    11f0 <out_ps+0xe0>
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x90,-0x8(%rbp)
jae    11c1 <out_ps+0xb1>
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11cf <out_ps+0xbf>
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe7b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<out_ps>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
je     1191 <out_ps+0x81>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
test   %edx,%edx
je     116a <out_ps+0x5a>
lea    0xf20(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
cmp    $0x90,%ebx
lea    0xf19(%rip),%rax
lea    0xf15(%rip),%rdi
cmovb  %rax,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0xffffffff,%ebx
lea    0xf03(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %r14d,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
jmp    1191 <out_ps+0x81>
lea    -0x1(%rbx),%esi
add    $0xffffffff,%ebp
cmp    $0x8f,%ebx
ja     1181 <out_ps+0x71>
lea    0xe81(%rip),%rdi
jmp    1188 <out_ps+0x78>
lea    0xe9d(%rip),%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [37 x i8] c"postscript /ft%d/ft%d load bind def\0A\00"
@.str.1 = [37 x i8] c"postscript /sh%d/sh%d load bind def\0A\00"
@.str.2 = [13 x i8] c"postscript /\00"
@.str.3 = [3 x i8] c"ft\00"
@.str.4 = [3 x i8] c"sh\00"
@.str.5 = [19 x i8] c"%d{(\\%o\\%o)sags}!\0A\00"
define i32 @out_ps(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %6
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %3
store i32 0, i32* %4
br label %44
11: ; preds = %3
%12 = load i32, i32* %7
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %30
14: ; preds = %11
%15 = load i32, i32* %5
%16 = icmp ult i32 %15, 144
br i1 %16, label %17, label %23
17: ; preds = %14
%18 = load i32, i32* %5
%19 = sub i32 %18, 1
%20 = load i32, i32* %6
%21 = sub i32 %20, 1
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %19, i32 %21)
br label %29
23: ; preds = %14
%24 = load i32, i32* %5
%25 = sub i32 %24, 1
%26 = load i32, i32* %6
%27 = sub i32 %26, 1
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32 %25, i32 %27)
br label %29
29: ; preds = %23, %17
store i32 0, i32* %4
br label %44
30: ; preds = %11
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%32 = load i32, i32* %5
%33 = icmp ult i32 %32, 144
br i1 %33, label %34, label %36
34: ; preds = %30
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %38
36: ; preds = %30
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %38
38: ; preds = %36, %34
%39 = load i32, i32* %5
%40 = sub i32 %39, 1
%41 = load i32, i32* %6
%42 = load i32, i32* %7
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i32 %40, i32 %41, i32 %42)
store i32 0, i32* %4
br label %44
44: ; preds = %38, %29, %10
%45 = load i32, i32* %4
ret i32 %45
}

LLVM IR (-O2):
@.str = [37 x i8] c"postscript /ft%d/ft%d load bind def\0A\00"
@.str.1 = [37 x i8] c"postscript /sh%d/sh%d load bind def\0A\00"
@.str.2 = [13 x i8] c"postscript /\00"
@.str.3 = [3 x i8] c"ft\00"
@.str.4 = [3 x i8] c"sh\00"
@.str.5 = [19 x i8] c"%d{(\\%o\\%o)sags}!\0A\00"
define i32 @out_ps(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, 0
br i1 %4, label %22, label %5
5: ; preds = %3
%6 = icmp eq i32 %2, 0
br i1 %6, label %7, label %15
7: ; preds = %5
%8 = icmp ult i32 %0, 144
%9 = add i32 %0, -1
%10 = add i32 %1, -1
br i1 %8, label %11, label %13
11: ; preds = %7
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
br label %22
13: ; preds = %7
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 %10)
br label %22
15: ; preds = %5
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%17 = icmp ult i32 %0, 144
%18 = select i1 %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0)
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %18)
%20 = add i32 %0, -1
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i32 %20, i32 %1, i32 %2)
br label %22
22: ; preds = %11, %13, %3, %15
ret i32 0
}