#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 *, char *);
char *str_trim(char *);
int main() {
  char str_0[] = "       ";
  char str_1[] = "  I am working at Singapore.    ";
  char str_2[] = " I am working at     Singapore.";
  char str_3[] = "I am working at Singapore.";
  printf("%s\n", str_trim(str_0));
  printf("%s\n", str_trim(str_1));
  printf("%s\n", str_trim(str_2));
  printf("%s\n", str_trim(str_3));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0xc(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xebb(%rip),%rsi
mov    $0x21,%edx
call   1040 <memcpy@plt>
mov    0xeda(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xed1(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x70(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x68(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xec5(%rip),%ax
mov    %ax,-0x58(%rbp)
mov    0xebd(%rip),%al
mov    %al,-0x56(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <str_trim@plt>
mov    %rax,%rsi
lea    0xe35(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rdi
call   1050 <str_trim@plt>
mov    %rax,%rsi
lea    0xe1d(%rip),%rdi
call   1030 <printf@plt>
lea    -0x50(%rbp),%rdi
call   1050 <str_trim@plt>
mov    %rax,%rsi
lea    0xe05(%rip),%rdi
call   1030 <printf@plt>
lea    -0x70(%rbp),%rdi
call   1050 <str_trim@plt>
mov    %rax,%rsi
lea    0xded(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x80,%rsp
movabs $0x20202020202020,%rax
mov    %rax,0x8(%rsp)
movaps 0xed2(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xeb6(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movb   $0x0,0x30(%rsp)
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movups 0xee8(%rip),%xmm0
movups %xmm0,0x4b(%rsp)
movaps 0xed1(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
lea    0x8(%rsp),%rdi
call   1040 <str_trim@plt>
lea    0xed6(%rip),%rbx
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
lea    0x10(%rsp),%rdi
call   1040 <str_trim@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
lea    0x60(%rsp),%rdi
call   1040 <str_trim@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
lea    0x40(%rsp),%rdi
call   1040 <str_trim@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.str_0 = [8 x i8] c" \00"
@__const.main.str_1 = [33 x i8] c" I am working at Singapore. \00"
@__const.main.str_2 = [32 x i8] c" I am working at Singapore.\00"
@__const.main.str_3 = [27 x i8] c"I am working at Singapore.\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i8]
%3 = alloca [33 x i8]
%4 = alloca [32 x i8]
%5 = alloca [27 x i8]
store i32 0, i32* %1
%6 = bitcast [8 x i8]* %2 to i8*
%7 = bitcast [33 x i8]* %3 to i8*
%8 = bitcast [32 x i8]* %4 to i8*
%9 = bitcast [27 x i8]* %5 to i8*
%10 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%11 = call i8* @str_trim(i8* %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 0
%14 = call i8* @str_trim(i8* %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%17 = call i8* @str_trim(i8* %16)
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %17)
%19 = getelementptr inbounds [27 x i8], [27 x i8]* %5, i64 0, i64 0
%20 = call i8* @str_trim(i8* %19)
%21 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %20)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str_1 = [33 x i8] c" I am working at Singapore. \00"
@__const.main.str_2 = [32 x i8] c" I am working at Singapore.\00"
@__const.main.str_3 = [27 x i8] c"I am working at Singapore.\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca [33 x i8]
%3 = alloca [32 x i8]
%4 = alloca [27 x i8]
%5 = bitcast i64* %1 to i8*
store i64 9042521604759584, i64* %1
%6 = getelementptr inbounds [33 x i8], [33 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [27 x i8], [27 x i8]* %4, i64 0, i64 0
%9 = call i8* @str_trim(i8* %5)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = call i8* @str_trim(i8* %6)
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = call i8* @str_trim(i8* %7)
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = call i8* @str_trim(i8* %8)
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %15)
ret i32 0
}