#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*/ analysis(char *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ stdin;
int main(void) {
  char string[100];
  puts("\nSay something nice!");
  fgets(string, 100, stdin);
  puts("\nNow get ready for an interesting analysis..");
  puts("\tSo, in the above string you had:");
  printf("***String 1***:\n\t%s", string);
  analysis(string);
  printf("***String 2***:\n\t%s", string);
  puts("DONE");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1030 <puts@plt>
lea    -0x70(%rbp),%rdi
mov    0x2e82(%rip),%rax
mov    (%rax),%edx
mov    $0x64,%esi
call   1050 <fgets@plt>
lea    0xe9c(%rip),%rdi
call   1030 <puts@plt>
lea    0xebd(%rip),%rdi
call   1030 <puts@plt>
lea    -0x70(%rbp),%rsi
lea    0xecf(%rip),%rdi
call   1040 <printf@plt>
lea    -0x70(%rbp),%rdi
call   1060 <analysis@plt>
lea    -0x70(%rbp),%rsi
lea    0xeca(%rip),%rdi
call   1040 <printf@plt>
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
lea    0xeb4(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x64,%esi
call   1050 <fgets@plt>
lea    0xea4(%rip),%rdi
call   1030 <puts@plt>
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
lea    0xedb(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1060 <analysis@plt>
lea    0xed8(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
lea    0xedd(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"\0ASay something nice!\00"
@stdin = global i32 0
@.str.1 = [45 x i8] c"\0ANow get ready for an interesting analysis..\00"
@.str.2 = [34 x i8] c"\09So, in the above string you had:\00"
@.str.3 = [20 x i8] c"***String 1***:\0A\09%s\00"
@.str.4 = [20 x i8] c"***String 2***:\0A\09%s\00"
@.str.5 = [5 x i8] c"DONE\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
store i32 0, i32* %1
%3 = call i32 @puts(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = load i32, i32* @stdin
%6 = call i32 @fgets(i8* %4, i32 100, i32 %5)
%7 = call i32 @puts(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @puts(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8* %9)
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%12 = call i32 @analysis(i8* %11)
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%14 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i8* %13)
%15 = call i32 @puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"\0ASay something nice!\00"
@stdin = global i32 0
@.str.1 = [45 x i8] c"\0ANow get ready for an interesting analysis..\00"
@.str.2 = [34 x i8] c"\09So, in the above string you had:\00"
@.str.3 = [20 x i8] c"***String 1***:\0A\09%s\00"
@.str.4 = [20 x i8] c"***String 2***:\0A\09%s\00"
@.str.5 = [5 x i8] c"DONE\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %2, i32 100, i32 %4)
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8* %2)
%9 = call i32 @analysis(i8* %2)
%10 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i8* %2)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}