#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 d(int);
int /*<<< orphan*/ niceprint(char *);
int /*<<< orphan*/ orc(int);
int /*<<< orphan*/ patrol(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ putchar(char);
void merchants() {
  niceprint("The characters encounter a group of orc merchants who have come "
            "to Gracklstugh as caravan guards, and see "
            "the characters as a chance to bully some surface dwellers.  The "
            "orcs try to goad the characters into striking "
            "first, then quickly stand down, knowing that a patrol will arrive "
            "in a few rounds after the combat starts.");
  printf("\nThe patrol arrives %d rounds after a fight breaks out.\n\n", d(6));
  orc(d(4) + 1);
  (void)putchar('\n');
  patrol(1);
}


x86 assembly (clang, -O0):
<merchants>:
push   %rbp
mov    %rsp,%rbp
lea    0xe95(%rip),%rdi
call   1080 <niceprint@plt>
mov    $0x6,%edi
call   1050 <d@plt>
mov    %eax,%esi
lea    0xfc0(%rip),%rdi
call   1070 <printf@plt>
mov    $0x4,%edi
call   1050 <d@plt>
mov    %eax,%edi
add    $0x1,%edi
call   1060 <orc@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x1,%edi
call   1040 <patrol@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<merchants>:
push   %rax
lea    0xe98(%rip),%rdi
call   1080 <niceprint@plt>
mov    $0x6,%edi
call   1050 <d@plt>
lea    0xfc5(%rip),%rdi
mov    %eax,%esi
call   1070 <printf@plt>
mov    $0x4,%edi
call   1050 <d@plt>
lea    0x1(%rax),%edi
call   1060 <orc@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <patrol@plt>

LLVM IR (-O0):
@.str = [323 x i8] c"The characters encounter a group of orc merchants who have come to Gracklstugh as caravan guards, and see the characters as a chance to bully some surface dwellers. The orcs try to goad the characters into striking first, then quickly stand down, knowing that a patrol will arrive in a few rounds after the combat starts.\00"
@.str.1 = [58 x i8] c"\0AThe patrol arrives %d rounds after a fight breaks out.\0A\0A\00"
define void @merchants() {
%1 = call i32 @niceprint(i8* getelementptr inbounds ([323 x i8], [323 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @d(i32 6)
%3 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = call i32 @d(i32 4)
%5 = add nsw i32 %4, 1
%6 = call i32 @orc(i32 %5)
%7 = call i32 @putchar(i8 signext 10)
%8 = call i32 @patrol(i32 1)
ret void
}

LLVM IR (-O2):
@.str = [323 x i8] c"The characters encounter a group of orc merchants who have come to Gracklstugh as caravan guards, and see the characters as a chance to bully some surface dwellers. The orcs try to goad the characters into striking first, then quickly stand down, knowing that a patrol will arrive in a few rounds after the combat starts.\00"
@.str.1 = [58 x i8] c"\0AThe patrol arrives %d rounds after a fight breaks out.\0A\0A\00"
define void @merchants() {
%1 = tail call i32 @niceprint(i8* getelementptr inbounds ([323 x i8], [323 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @d(i32 6)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = tail call i32 @d(i32 4)
%5 = add nsw i32 %4, 1
%6 = tail call i32 @orc(i32 %5)
%7 = tail call i32 @putchar(i8 signext 10)
%8 = tail call i32 @patrol(i32 1)
ret void
}