#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 dlugosc(char *);
int /*<<< orphan*/ printf(char *, char *, int);
int main(void) {
  char s[100] = "Ala ma kota";
  char d[100] = "Wlazl kotek na plotek";
  printf("Dlugosc ciagu s(%s) = %d\n", s, dlugosc(s));
  printf("Dlugosc ciagu d(%s) = %d\n", d, dlugosc(d));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
lea    0xeb3(%rip),%rsi
mov    $0x64,%edx
call   1050 <memcpy@plt>
lea    -0xe0(%rbp),%rdi
lea    0xf0b(%rip),%rsi
mov    $0x64,%edx
call   1050 <memcpy@plt>
lea    -0x70(%rbp),%rax
mov    %rax,-0xf0(%rbp)
lea    -0x70(%rbp),%rdi
call   1040 <dlugosc@plt>
mov    -0xf0(%rbp),%rsi
mov    %eax,%edx
lea    0xf41(%rip),%rdi
call   1030 <printf@plt>
lea    -0xe0(%rbp),%rax
mov    %rax,-0xe8(%rbp)
lea    -0xe0(%rbp),%rdi
call   1040 <dlugosc@plt>
mov    -0xe8(%rbp),%rsi
mov    %eax,%edx
lea    0xf2c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xe0,%rsp
movaps 0xf21(%rip),%xmm0
movaps %xmm0,0xc0(%rsp)
movaps 0xf02(%rip),%xmm0
movaps %xmm0,0xb0(%rsp)
movaps 0xee3(%rip),%xmm0
movaps %xmm0,0xa0(%rsp)
movaps 0xec4(%rip),%xmm0
movaps %xmm0,0x90(%rsp)
movaps 0xea5(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0xe86(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movl   $0x0,0xd0(%rsp)
movaps 0xf2f(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xf13(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xef7(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xebf(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xea3(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x0,0x60(%rsp)
lea    0x70(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <dlugosc@plt>
lea    0xee7(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <dlugosc@plt>
lea    0xee5(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s = [100 x i8] c"Ala ma kota\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.d = [100 x i8] c"Wlazl kotek na plotek\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [26 x i8] c"Dlugosc ciagu s(%s) = %d\0A\00"
@.str.1 = [26 x i8] c"Dlugosc ciagu d(%s) = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca [100 x i8]
store i32 0, i32* %1
%4 = bitcast [100 x i8]* %2 to i8*
%5 = bitcast [100 x i8]* %3 to i8*
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%8 = call i32 @dlugosc(i8* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %8)
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%12 = call i32 @dlugosc(i8* %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %10, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [100 x i8] c"Ala ma kota\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.d = [100 x i8] c"Wlazl kotek na plotek\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [26 x i8] c"Dlugosc ciagu s(%s) = %d\0A\00"
@.str.1 = [26 x i8] c"Dlugosc ciagu d(%s) = %d\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 @dlugosc(i8* %3)
%6 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %3, i32 %5)
%7 = call i32 @dlugosc(i8* %4)
%8 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %4, i32 %7)
ret i32 0
}