#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 IloscMalychLiter(char *);
int IloscWielkichLiter(char *);
int PoliczSpacje(char *);
int RozmiarNajdluzszegoSlowa(char *);
int /*<<< orphan*/ ZamienNaPodkreslenie(char *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  char *Napis = "Jak dobrze jest wstac skoro swit. Jutrzenki blask ...";
  int IloscSpacji;
  int DlugoscSlowaXXX;
  int IloscMaLiter = 0;
  int IloscWiLiter = 0;
  printf("\n------------------------------\n");
  printf(" Statystyka dla tekstu: '%s'\n\n", Napis);
  IloscSpacji = PoliczSpacje(Napis);
  DlugoscSlowaXXX = RozmiarNajdluzszegoSlowa(Napis);
  ZamienNaPodkreslenie(Napis);
  IloscMaLiter = IloscMalychLiter(Napis);
  IloscWiLiter = IloscWielkichLiter(Napis);
  printf("               Ilosc spacji: %i\n", IloscSpacji);
  printf("         Ilosc malych liter: %i\n", IloscMaLiter);
  printf("       Ilosc wielkich liter: %i\n", IloscWiLiter);
  printf(" Rozmiar najdluzszego slowa: %i\n", DlugoscSlowaXXX);
  printf(" Tekst z podkresleniami: '%s'\n", Napis);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe8a(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1080 <PoliczSpacje@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <RozmiarNajdluzszegoSlowa@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <ZamienNaPodkreslenie@plt>
mov    -0x10(%rbp),%rdi
call   1070 <IloscMalychLiter@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <IloscWielkichLiter@plt>
mov    %eax,-0x20(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x20(%rbp),%esi
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe36(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
lea    0xf69(%rip),%rdi
call   1060 <puts@plt>
lea    0xe9b(%rip),%rdi
lea    0xe5e(%rip),%r12
mov    %r12,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r12,%rdi
call   10a0 <PoliczSpacje@plt>
mov    %eax,%r15d
mov    %r12,%rdi
call   1050 <RozmiarNajdluzszegoSlowa@plt>
mov    %eax,%r14d
mov    %r12,%rdi
call   1030 <ZamienNaPodkreslenie@plt>
mov    %r12,%rdi
call   1090 <IloscMalychLiter@plt>
mov    %eax,%ebp
mov    %r12,%rdi
call   1070 <IloscWielkichLiter@plt>
mov    %eax,%ebx
lea    0xe70(%rip),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xe80(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xe91(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xea2(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xeb2(%rip),%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [54 x i8] c"Jak dobrze jest wstac skoro swit. Jutrzenki blask ...\00"
@.str.1 = [33 x i8] c"\0A------------------------------\0A\00"
@.str.2 = [31 x i8] c" Statystyka dla tekstu: '%s'\0A\0A\00"
@.str.3 = [33 x i8] c" Ilosc spacji: %i\0A\00"
@.str.4 = [33 x i8] c" Ilosc malych liter: %i\0A\00"
@.str.5 = [33 x i8] c" Ilosc wielkich liter: %i\0A\00"
@.str.6 = [33 x i8] c" Rozmiar najdluzszego slowa: %i\0A\00"
@.str.7 = [31 x i8] c" Tekst z podkresleniami: '%s'\0A\00"
@.str.8 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8** %2
store i32 0, i32* %5
store i32 0, i32* %6
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%8 = load i8*, i8** %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i8* %8)
%10 = load i8*, i8** %2
%11 = call i32 @PoliczSpacje(i8* %10)
store i32 %11, i32* %3
%12 = load i8*, i8** %2
%13 = call i32 @RozmiarNajdluzszegoSlowa(i8* %12)
store i32 %13, i32* %4
%14 = load i8*, i8** %2
%15 = call i32 @ZamienNaPodkreslenie(i8* %14)
%16 = load i8*, i8** %2
%17 = call i32 @IloscMalychLiter(i8* %16)
store i32 %17, i32* %5
%18 = load i8*, i8** %2
%19 = call i32 @IloscWielkichLiter(i8* %18)
store i32 %19, i32* %6
%20 = load i32, i32* %3
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i32 %20)
%22 = load i32, i32* %5
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0), i32 %22)
%24 = load i32, i32* %6
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), i32 %24)
%26 = load i32, i32* %4
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.6, i64 0, i64 0), i32 %26)
%28 = load i8*, i8** %2
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.7, i64 0, i64 0), i8* %28)
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [54 x i8] c"Jak dobrze jest wstac skoro swit. Jutrzenki blask ...\00"
@.str.2 = [31 x i8] c" Statystyka dla tekstu: '%s'\0A\0A\00"
@.str.3 = [33 x i8] c" Ilosc spacji: %i\0A\00"
@.str.4 = [33 x i8] c" Ilosc malych liter: %i\0A\00"
@.str.5 = [33 x i8] c" Ilosc wielkich liter: %i\0A\00"
@.str.6 = [33 x i8] c" Rozmiar najdluzszego slowa: %i\0A\00"
@.str.7 = [31 x i8] c" Tekst z podkresleniami: '%s'\0A\00"
@str = [32 x i8] c"\0A------------------------------\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @PoliczSpacje(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @RozmiarNajdluzszegoSlowa(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @ZamienNaPodkreslenie(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @IloscMalychLiter(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @IloscWielkichLiter(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i32 %3)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0), i32 %6)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), i32 %7)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.6, i64 0, i64 0), i32 %4)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%13 = tail call i32 @putchar(i32 10)
ret i32 0
}