#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 *);
int /*<<< orphan*/ scanf(char *, char *, char *);
char *strlen(char *);
char toupper(char);
int main(void) {
  char imie[100], nazwisko[100];
  scanf("%s%s", imie, nazwisko);
  printf("Dlugosc imienia: %zu, dlugosc nazwiska: %zu\n", strlen(imie),
         strlen(nazwisko));
  for (char *i = imie; *i; ++i)
    *i = toupper(*i);
  for (char *i = nazwisko; *i; ++i)
    *i = toupper(*i);
  printf("%s %s\n", imie, nazwisko);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rsi
lea    -0xe0(%rbp),%rdx
lea    0xe9c(%rip),%rdi
call   1060 <scanf@plt>
lea    -0x70(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0xf8(%rbp)
lea    -0xe0(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0xf8(%rbp),%rsi
mov    %rax,%rdx
lea    0xe6f(%rip),%rdi
call   1050 <printf@plt>
lea    -0x70(%rbp),%rax
mov    %rax,-0xe8(%rbp)
mov    -0xe8(%rbp),%rax
cmpb   $0x0,(%rax)
je     11e7 <main+0xa7>
mov    -0xe8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0xe8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xe8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xe8(%rbp)
jmp    11a6 <main+0x66>
lea    -0xe0(%rbp),%rax
mov    %rax,-0xf0(%rbp)
mov    -0xf0(%rbp),%rax
cmpb   $0x0,(%rax)
je     1236 <main+0xf6>
mov    -0xf0(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0xf0(%rbp),%rax
mov    %cl,(%rax)
mov    -0xf0(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xf0(%rbp)
jmp    11f5 <main+0xb5>
lea    -0x70(%rbp),%rsi
lea    -0xe0(%rbp),%rdx
lea    0xdea(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0xd8,%rsp
lea    0xeaf(%rip),%rdi
lea    0x70(%rsp),%rbx
mov    %rsp,%r14
mov    %rbx,%rsi
mov    %r14,%rdx
call   1060 <scanf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <strlen@plt>
lea    0xe87(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1050 <printf@plt>
mov    0x70(%rsp),%al
test   %al,%al
je     11b6 <main+0x76>
lea    0x71(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    11a0 <main+0x60>
mov    (%rsp),%al
test   %al,%al
je     11e6 <main+0xa6>
lea    0x1(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    11d0 <main+0x90>
lea    0xe45(%rip),%rdi
lea    0x70(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <printf@plt>
xor    %eax,%eax
add    $0xd8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%s%s\00"
@.str.1 = [45 x i8] c"Dlugosc imienia: %zu, dlugosc nazwiska: %zu\0A\00"
@.str.2 = [7 x i8] c"%s %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca [100 x i8]
%4 = alloca i8*
%5 = alloca i8*
store i32 0, i32* %1
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%8 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%10 = call i8* @strlen(i8* %9)
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%12 = call i8* @strlen(i8* %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0), i8* %10, i8* %12)
%14 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
store i8* %14, i8** %4
br label %15
15: ; preds = %24, %0
%16 = load i8*, i8** %4
%17 = load i8, i8* %16
%18 = icmp ne i8 %17, 0
br i1 %18, label %19, label %27
19: ; preds = %15
%20 = load i8*, i8** %4
%21 = load i8, i8* %20
%22 = call signext i8 @toupper(i8 signext %21)
%23 = load i8*, i8** %4
store i8 %22, i8* %23
br label %24
24: ; preds = %19
%25 = load i8*, i8** %4
%26 = getelementptr inbounds i8, i8* %25, i32 1
store i8* %26, i8** %4
br label %15
27: ; preds = %15
%28 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
store i8* %28, i8** %5
br label %29
29: ; preds = %38, %27
%30 = load i8*, i8** %5
%31 = load i8, i8* %30
%32 = icmp ne i8 %31, 0
br i1 %32, label %33, label %41
33: ; preds = %29
%34 = load i8*, i8** %5
%35 = load i8, i8* %34
%36 = call signext i8 @toupper(i8 signext %35)
%37 = load i8*, i8** %5
store i8 %36, i8* %37
br label %38
38: ; preds = %33
%39 = load i8*, i8** %5
%40 = getelementptr inbounds i8, i8* %39, i32 1
store i8* %40, i8** %5
br label %29
41: ; preds = %29
%42 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%43 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%44 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %42, i8* %43)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s%s\00"
@.str.1 = [45 x i8] c"Dlugosc imienia: %zu, dlugosc nazwiska: %zu\0A\00"
@.str.2 = [7 x i8] c"%s %s\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
%6 = call i8* @strlen(i8* %3)
%7 = call i8* @strlen(i8* %4)
%8 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0), i8* %6, i8* %7)
%9 = load i8, i8* %3
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %14, %0
%12 = load i8, i8* %4
%13 = icmp eq i8 %12, 0
br i1 %13, label %21, label %23
14: ; preds = %0, %14
%15 = phi i8 [ %19, %14 ], [ %9, %0 ]
%16 = phi i8* [ %18, %14 ], [ %3, %0 ]
%17 = call signext i8 @toupper(i8 signext %15)
store i8 %17, i8* %16
%18 = getelementptr inbounds i8, i8* %16, i64 1
%19 = load i8, i8* %18
%20 = icmp eq i8 %19, 0
br i1 %20, label %11, label %14
21: ; preds = %23, %11
%22 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %3, i8* %4)
ret i32 0
23: ; preds = %11, %23
%24 = phi i8 [ %28, %23 ], [ %12, %11 ]
%25 = phi i8* [ %27, %23 ], [ %4, %11 ]
%26 = call signext i8 @toupper(i8 signext %24)
store i8 %26, i8* %25
%27 = getelementptr inbounds i8, i8* %25, i64 1
%28 = load i8, i8* %27
%29 = icmp eq i8 %28, 0
br i1 %29, label %21, label %23
}