#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 */
struct mtwist_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ avoid(struct mtwist_state *);
int /*<<< orphan*/ break_lines(char *, int);
char *bring_your(struct mtwist_state *);
char *climate(struct mtwist_state *);
char *culture(struct mtwist_state *);
char *exceptional(struct mtwist_state *);
char *known_for(struct mtwist_state *);
char *planet(struct mtwist_state *);
char *producing(struct mtwist_state *);
char *product(struct mtwist_state *);
char *qnationality(struct mtwist_state *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *, char *, char *, char *,
                            char *, char *, char *, char *, char *, char *,
                            char *, char *, char *, char *, char *, char *);
int /*<<< orphan*/ strcpy(char *, int /*<<< orphan*/);
char *terrible(struct mtwist_state *);
char toupper(char);
char *traveling_accessory(struct mtwist_state *);
void planet_description(struct mtwist_state *mt, char *buffer, int buflen,
                        int line_len) {
  char do_avoid[100];
  strcpy(do_avoid, avoid(mt));
  do_avoid[0] = toupper(do_avoid[0]);
  snprintf(buffer, buflen,
           "This %s %s %s %s %s %s %s and %s %s %s %s. %s the %s %s.  %s %s.\n",
           climate(mt), planet(mt), known_for(mt), producing(mt),
           exceptional(mt), qnationality(mt), product(mt), known_for(mt),
           exceptional(mt), qnationality(mt), culture(mt), do_avoid,
           terrible(mt), product(mt), bring_your(mt), traveling_accessory(mt));
  break_lines(buffer, line_len);
}


x86 assembly (clang, -O0):
<planet_description>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x168,%rsp
mov    %rdi,-0x30(%rbp)
mov    %rsi,-0x38(%rbp)
mov    %edx,-0x3c(%rbp)
mov    %ecx,-0x40(%rbp)
lea    -0xb0(%rbp),%rax
mov    %rax,-0x120(%rbp)
mov    -0x30(%rbp),%rdi
call   10d0 <avoid@plt>
mov    -0x120(%rbp),%rdi
mov    %eax,%esi
call   1030 <strcpy@plt>
movsbl -0xb0(%rbp),%edi
call   1050 <toupper@plt>
mov    %al,-0xb0(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x118(%rbp)
mov    -0x3c(%rbp),%eax
mov    %eax,-0x10c(%rbp)
mov    -0x30(%rbp),%rdi
call   10f0 <climate@plt>
mov    %rax,-0x108(%rbp)
mov    -0x30(%rbp),%rdi
call   1100 <planet@plt>
mov    %rax,-0x100(%rbp)
mov    -0x30(%rbp),%rdi
call   1060 <known_for@plt>
mov    %rax,-0xf8(%rbp)
mov    -0x30(%rbp),%rdi
call   10c0 <producing@plt>
mov    %rax,-0xe0(%rbp)
mov    -0x30(%rbp),%rdi
call   1090 <exceptional@plt>
mov    %rax,-0xd8(%rbp)
mov    -0x30(%rbp),%rdi
call   1070 <qnationality@plt>
mov    %rax,-0xd0(%rbp)
mov    -0x30(%rbp),%rdi
call   10e0 <product@plt>
mov    %rax,-0xc8(%rbp)
mov    -0x30(%rbp),%rdi
call   1060 <known_for@plt>
mov    %rax,-0xc0(%rbp)
mov    -0x30(%rbp),%rdi
call   1090 <exceptional@plt>
mov    %rax,%r13
mov    -0x30(%rbp),%rdi
call   1070 <qnationality@plt>
mov    %rax,%r12
mov    -0x30(%rbp),%rdi
call   1110 <culture@plt>
mov    %rax,%r15
lea    -0xb0(%rbp),%r14
mov    -0x30(%rbp),%rdi
call   1080 <terrible@plt>
mov    %rax,%rbx
mov    -0x30(%rbp),%rdi
call   10e0 <product@plt>
mov    %rax,-0xf0(%rbp)
mov    -0x30(%rbp),%rdi
call   10b0 <bring_your@plt>
mov    %rax,-0xe8(%rbp)
mov    -0x30(%rbp),%rdi
call   1040 <traveling_accessory@plt>
mov    -0x118(%rbp),%rdi
mov    -0x10c(%rbp),%esi
mov    -0x108(%rbp),%rcx
mov    -0x100(%rbp),%r8
mov    -0xf8(%rbp),%r9
mov    -0xf0(%rbp),%r11
mov    -0xe8(%rbp),%r10
mov    %rax,%rdx
mov    -0xe0(%rbp),%rax
mov    %rdx,-0xb8(%rbp)
lea    0xc6b(%rip),%rdx
mov    %rax,(%rsp)
mov    -0xd8(%rbp),%rax
mov    %rax,0x8(%rsp)
mov    -0xd0(%rbp),%rax
mov    %rax,0x10(%rsp)
mov    -0xc8(%rbp),%rax
mov    %rax,0x18(%rsp)
mov    -0xc0(%rbp),%rax
mov    %rax,0x20(%rsp)
mov    -0xb8(%rbp),%rax
mov    %r13,0x28(%rsp)
mov    %r12,0x30(%rsp)
mov    %r15,0x38(%rsp)
mov    %r14,0x40(%rsp)
mov    %rbx,0x48(%rsp)
mov    %r11,0x50(%rsp)
mov    %r10,0x58(%rsp)
mov    %rax,0x60(%rsp)
call   10a0 <snprintf@plt>
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%esi
call   1120 <break_lines@plt>
add    $0x168,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<planet_description>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xc8,%rsp
mov    %ecx,0xc(%rsp)
mov    %edx,0x8(%rsp)
mov    %rsi,0x58(%rsp)
mov    %rdi,%rbp
call   10d0 <avoid@plt>
lea    0x60(%rsp),%rdi
mov    %eax,%esi
call   1030 <strcpy@plt>
movsbl 0x60(%rsp),%edi
call   1050 <toupper@plt>
mov    %al,0x60(%rsp)
mov    %rbp,%rdi
call   10f0 <climate@plt>
mov    %rax,0x40(%rsp)
mov    %rbp,%rdi
call   1100 <planet@plt>
mov    %rax,0x30(%rsp)
mov    %rbp,%rdi
call   1060 <known_for@plt>
mov    %rax,0x28(%rsp)
mov    %rbp,%rdi
call   10c0 <producing@plt>
mov    %rax,0x50(%rsp)
mov    %rbp,%rdi
call   1090 <exceptional@plt>
mov    %rax,0x48(%rsp)
mov    %rbp,%rdi
call   1070 <qnationality@plt>
mov    %rax,0x38(%rsp)
mov    %rbp,%rdi
call   10e0 <product@plt>
mov    %rax,0x20(%rsp)
mov    %rbp,%rdi
call   1060 <known_for@plt>
mov    %rax,0x18(%rsp)
mov    %rbp,%rdi
call   1090 <exceptional@plt>
mov    %rax,0x10(%rsp)
mov    %rbp,%rdi
call   1070 <qnationality@plt>
mov    %rax,%r13
mov    %rbp,%rdi
call   1110 <culture@plt>
mov    %rax,%r14
mov    %rbp,%rdi
call   1080 <terrible@plt>
mov    %rax,%rbx
mov    %rbp,%rdi
call   10e0 <product@plt>
mov    %rax,%r15
mov    %rbp,%rdi
call   10b0 <bring_your@plt>
mov    %rax,%r12
mov    %rbp,%rdi
call   1040 <traveling_accessory@plt>
sub    $0x8,%rsp
lea    0xd01(%rip),%rdx
mov    0x60(%rsp),%rbp
mov    %rbp,%rdi
mov    0x10(%rsp),%esi
mov    0x48(%rsp),%rcx
mov    0x38(%rsp),%r8
mov    0x30(%rsp),%r9
push   %rax
push   %r12
push   %r15
push   %rbx
lea    0x88(%rsp),%rax
push   %rax
push   %r14
push   %r13
push   0x50(%rsp)
push   0x60(%rsp)
push   0x70(%rsp)
push   0x90(%rsp)
push   0xa8(%rsp)
push   0xb8(%rsp)
call   10a0 <snprintf@plt>
add    $0x70,%rsp
mov    %rbp,%rdi
mov    0xc(%rsp),%esi
call   1120 <break_lines@plt>
add    $0xc8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.mtwist_state = type { i32 }
@.str = [66 x i8] c"This %s %s %s %s %s %s %s and %s %s %s %s. %s the %s %s. %s %s.\0A\00"
define void @planet_description(%struct.mtwist_state* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca %struct.mtwist_state*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca [100 x i8]
store %struct.mtwist_state* %0, %struct.mtwist_state** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%11 = load %struct.mtwist_state*, %struct.mtwist_state** %5
%12 = call i32 @avoid(%struct.mtwist_state* %11)
%13 = call i32 @strcpy(i8* %10, i32 %12)
%14 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%15 = load i8, i8* %14
%16 = call signext i8 @toupper(i8 signext %15)
%17 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
store i8 %16, i8* %17
%18 = load i8*, i8** %6
%19 = load i32, i32* %7
%20 = load %struct.mtwist_state*, %struct.mtwist_state** %5
%21 = call i8* @climate(%struct.mtwist_state* %20)
%22 = load %struct.mtwist_state*, %struct.mtwist_state** %5
%23 = call i8* @planet(%struct.mtwist_state* %22)
%24 = load %struct.mtwist_state*, %struct.mtwist_state** %5
%25 = call i8* @known_for(%struct.mtwist_state* %24)
%26 = load %struct.mtwist_state*, %struct.mtwist_state** %5
%27 = call i8* @producing(%struct.mtwist_state* %26)
%28 = load %struct.mtwist_state*, %struct.mtwist_state** %5
%29 = call i8* @exceptional(%struct.mtwist_state* %28)
%30 = load %struct.mtwist_state*, %struct.mtwist_state** %5
%31 = call i8* @qnationality(%struct.mtwist_state* %30)
%32 = load %struct.mtwist_state*, %struct.mtwist_state** %5
%33 = call i8* @product(%struct.mtwist_state* %32)
%34 = load %struct.mtwist_state*, %struct.mtwist_state** %5
%35 = call i8* @known_for(%struct.mtwist_state* %34)
%36 = load %struct.mtwist_state*, %struct.mtwist_state** %5
%37 = call i8* @exceptional(%struct.mtwist_state* %36)
%38 = load %struct.mtwist_state*, %struct.mtwist_state** %5
%39 = call i8* @qnationality(%struct.mtwist_state* %38)
%40 = load %struct.mtwist_state*, %struct.mtwist_state** %5
%41 = call i8* @culture(%struct.mtwist_state* %40)
%42 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%43 = load %struct.mtwist_state*, %struct.mtwist_state** %5
%44 = call i8* @terrible(%struct.mtwist_state* %43)
%45 = load %struct.mtwist_state*, %struct.mtwist_state** %5
%46 = call i8* @product(%struct.mtwist_state* %45)
%47 = load %struct.mtwist_state*, %struct.mtwist_state** %5
%48 = call i8* @bring_your(%struct.mtwist_state* %47)
%49 = load %struct.mtwist_state*, %struct.mtwist_state** %5
%50 = call i8* @traveling_accessory(%struct.mtwist_state* %49)
%51 = call i32 @snprintf(i8* %18, i32 %19, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0), i8* %21, i8* %23, i8* %25, i8* %27, i8* %29, i8* %31, i8* %33, i8* %35, i8* %37, i8* %39, i8* %41, i8* %42, i8* %44, i8* %46, i8* %48, i8* %50)
%52 = load i8*, i8** %6
%53 = load i32, i32* %8
%54 = call i32 @break_lines(i8* %52, i32 %53)
ret void
}

LLVM IR (-O2):
%struct.mtwist_state = type { i32 }
@.str = [66 x i8] c"This %s %s %s %s %s %s %s and %s %s %s %s. %s the %s %s. %s %s.\0A\00"
define void @planet_description(%struct.mtwist_state* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca [100 x i8]
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%7 = tail call i32 @avoid(%struct.mtwist_state* %0)
%8 = call i32 @strcpy(i8* %6, i32 %7)
%9 = load i8, i8* %6
%10 = call signext i8 @toupper(i8 signext %9)
store i8 %10, i8* %6
%11 = call i8* @climate(%struct.mtwist_state* %0)
%12 = call i8* @planet(%struct.mtwist_state* %0)
%13 = call i8* @known_for(%struct.mtwist_state* %0)
%14 = call i8* @producing(%struct.mtwist_state* %0)
%15 = call i8* @exceptional(%struct.mtwist_state* %0)
%16 = call i8* @qnationality(%struct.mtwist_state* %0)
%17 = call i8* @product(%struct.mtwist_state* %0)
%18 = call i8* @known_for(%struct.mtwist_state* %0)
%19 = call i8* @exceptional(%struct.mtwist_state* %0)
%20 = call i8* @qnationality(%struct.mtwist_state* %0)
%21 = call i8* @culture(%struct.mtwist_state* %0)
%22 = call i8* @terrible(%struct.mtwist_state* %0)
%23 = call i8* @product(%struct.mtwist_state* %0)
%24 = call i8* @bring_your(%struct.mtwist_state* %0)
%25 = call i8* @traveling_accessory(%struct.mtwist_state* %0)
%26 = call i32 @snprintf(i8* %1, i32 %2, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0), i8* %11, i8* %12, i8* %13, i8* %14, i8* %15, i8* %16, i8* %17, i8* %18, i8* %19, i8* %20, i8* %21, i8* %6, i8* %22, i8* %23, i8* %24, i8* %25)
%27 = call i32 @break_lines(i8* %1, i32 %3)
ret void
}