#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 */
char *lowercase(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *uppercase(char *);
int main(int argc, char const *argv[]) {
  char name[] = "Seed or Die";
  printf("> '%s'\n", name);
  printf("> '%s'\n", uppercase(name));
  printf("> '%s'\n", lowercase(name));
  char *new = uppercase(name);
  char *new2 = lowercase(name);
  printf("> '%s'\n", new);
  printf("> '%s'\n", new2);
  strcpy(name, uppercase(name));
  printf("> '%s'\n", name);
  strcpy(name, lowercase(name));
  printf("> '%s'\n", name);
  printf("> '%s'\n", lowercase(uppercase(lowercase(name))));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xea3(%rip),%rax
mov    %rax,-0x1c(%rbp)
mov    0xea1(%rip),%eax
mov    %eax,-0x14(%rbp)
lea    -0x1c(%rbp),%rsi
lea    0xe97(%rip),%rdi
call   1040 <printf@plt>
lea    -0x1c(%rbp),%rdi
call   1060 <uppercase@plt>
mov    %rax,%rsi
lea    0xe7f(%rip),%rdi
call   1040 <printf@plt>
lea    -0x1c(%rbp),%rdi
call   1050 <lowercase@plt>
mov    %rax,%rsi
lea    0xe67(%rip),%rdi
call   1040 <printf@plt>
lea    -0x1c(%rbp),%rdi
call   1060 <uppercase@plt>
mov    %rax,-0x28(%rbp)
lea    -0x1c(%rbp),%rdi
call   1050 <lowercase@plt>
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rsi
lea    0xe3d(%rip),%rdi
call   1040 <printf@plt>
mov    -0x30(%rbp),%rsi
lea    0xe2d(%rip),%rdi
call   1040 <printf@plt>
lea    -0x1c(%rbp),%rax
mov    %rax,-0x40(%rbp)
lea    -0x1c(%rbp),%rdi
call   1060 <uppercase@plt>
mov    -0x40(%rbp),%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
lea    -0x1c(%rbp),%rsi
lea    0xe00(%rip),%rdi
call   1040 <printf@plt>
lea    -0x1c(%rbp),%rax
mov    %rax,-0x38(%rbp)
lea    -0x1c(%rbp),%rdi
call   1050 <lowercase@plt>
mov    -0x38(%rbp),%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
lea    -0x1c(%rbp),%rsi
lea    0xdd3(%rip),%rdi
call   1040 <printf@plt>
lea    -0x1c(%rbp),%rdi
call   1050 <lowercase@plt>
mov    %rax,%rdi
call   1060 <uppercase@plt>
mov    %rax,%rdi
call   1050 <lowercase@plt>
mov    %rax,%rsi
lea    0xdab(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
movabs $0x20726f2064656553,%rax
6f 72 20
mov    %rax,0x8(%rsp)
movl   $0x656944,0x10(%rsp)
lea    0xea3(%rip),%r14
lea    0x8(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1060 <uppercase@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1050 <lowercase@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1060 <uppercase@plt>
mov    %rax,%r15
mov    %rbx,%rdi
call   1050 <lowercase@plt>
mov    %rax,%r12
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <printf@plt>
mov    %r14,%rdi
mov    %r12,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1060 <uppercase@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1050 <lowercase@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1050 <lowercase@plt>
mov    %rax,%rdi
call   1060 <uppercase@plt>
mov    %rax,%rdi
call   1050 <lowercase@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.name = [12 x i8] c"Seed or Die\00"
@.str = [8 x i8] c"> '%s'\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [12 x i8]
%7 = alloca i8*
%8 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = bitcast [12 x i8]* %6 to i8*
%10 = getelementptr inbounds [12 x i8], [12 x i8]* %6, i64 0, i64 0
%11 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = getelementptr inbounds [12 x i8], [12 x i8]* %6, i64 0, i64 0
%13 = call i8* @uppercase(i8* %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = getelementptr inbounds [12 x i8], [12 x i8]* %6, i64 0, i64 0
%16 = call i8* @lowercase(i8* %15)
%17 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %16)
%18 = getelementptr inbounds [12 x i8], [12 x i8]* %6, i64 0, i64 0
%19 = call i8* @uppercase(i8* %18)
store i8* %19, i8** %7
%20 = getelementptr inbounds [12 x i8], [12 x i8]* %6, i64 0, i64 0
%21 = call i8* @lowercase(i8* %20)
store i8* %21, i8** %8
%22 = load i8*, i8** %7
%23 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %22)
%24 = load i8*, i8** %8
%25 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %24)
%26 = getelementptr inbounds [12 x i8], [12 x i8]* %6, i64 0, i64 0
%27 = getelementptr inbounds [12 x i8], [12 x i8]* %6, i64 0, i64 0
%28 = call i8* @uppercase(i8* %27)
%29 = call i32 @strcpy(i8* %26, i8* %28)
%30 = getelementptr inbounds [12 x i8], [12 x i8]* %6, i64 0, i64 0
%31 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %30)
%32 = getelementptr inbounds [12 x i8], [12 x i8]* %6, i64 0, i64 0
%33 = getelementptr inbounds [12 x i8], [12 x i8]* %6, i64 0, i64 0
%34 = call i8* @lowercase(i8* %33)
%35 = call i32 @strcpy(i8* %32, i8* %34)
%36 = getelementptr inbounds [12 x i8], [12 x i8]* %6, i64 0, i64 0
%37 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %36)
%38 = getelementptr inbounds [12 x i8], [12 x i8]* %6, i64 0, i64 0
%39 = call i8* @lowercase(i8* %38)
%40 = call i8* @uppercase(i8* %39)
%41 = call i8* @lowercase(i8* %40)
%42 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %41)
ret i32 0
}

LLVM IR (-O2):
@__const.main.name = [12 x i8] c"Seed or Die\00"
@.str = [8 x i8] c"> '%s'\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [12 x i8]
%4 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i8* @uppercase(i8* %4)
%7 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = call i8* @lowercase(i8* %4)
%9 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = call i8* @uppercase(i8* %4)
%11 = call i8* @lowercase(i8* %4)
%12 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %10)
%13 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %11)
%14 = call i8* @uppercase(i8* %4)
%15 = call i32 @strcpy(i8* %4, i8* %14)
%16 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %4)
%17 = call i8* @lowercase(i8* %4)
%18 = call i32 @strcpy(i8* %4, i8* %17)
%19 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %4)
%20 = call i8* @lowercase(i8* %4)
%21 = call i8* @uppercase(i8* %20)
%22 = call i8* @lowercase(i8* %21)
%23 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %22)
ret i32 0
}