#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 */
typedef int /*<<< orphan*/ first_str;

/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ print_eng_letters();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ stdin;
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int /*<<< orphan*/ strncat(char *, char *, int);
int main() {
  print_eng_letters();
  char letter = 'W';
  printf("The symbol and the code: %c : %d\n", letter, letter);
  char first_str[] = "A very very important sentence";
  unsigned int char_array_size = sizeof(first_str) / sizeof(first_str[0]);
  printf("The string: %s\nString size: %u\nArray size: %u\n\n", first_str,
         strlen(first_str), char_array_size);
  char secret_str[] = "just cat";
  char buffer[80];
  unsigned short buf_size;
  do {
    printf("Guess secret string? ");
    fgets(buffer, 80, stdin);
    buf_size = strlen(buffer);
    if (buffer[buf_size - 1] == '\n') {
      buffer[buf_size - 1] = '\0';
    }
  } while (strcmp(secret_str, buffer) != 0);
  puts("Correct answer!\n");
  char str1[20], str2[20], str3[] = "or not to be";
  strcpy(str1, "To be ");
  strcpy(str2, str3);
  strncat(str1, str2, 6);
  puts(str1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   10a0 <print_eng_letters@plt>
movb   $0x57,-0x5(%rbp)
movsbl -0x5(%rbp),%esi
movsbl -0x5(%rbp),%edx
lea    0xe54(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0xee6(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xee3(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xee0(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%eax
mov    %eax,-0x18(%rbp)
mov    0xed8(%rip),%ax
mov    %ax,-0x14(%rbp)
mov    0xed0(%rip),%al
mov    %al,-0x12(%rbp)
movl   $0x1f,-0x34(%rbp)
lea    -0x30(%rbp),%rax
mov    %rax,-0xe8(%rbp)
lea    -0x30(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0xe8(%rbp),%rsi
mov    %eax,%edx
mov    -0x34(%rbp),%ecx
lea    0xe03(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0xe25(%rip),%rax
mov    %rax,-0x3d(%rbp)
mov    0xe23(%rip),%al
mov    %al,-0x35(%rbp)
lea    0xe1a(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x90(%rbp),%rdi
mov    0x2d92(%rip),%rax
mov    (%rax),%edx
mov    $0x50,%esi
call   1080 <fgets@plt>
lea    -0x90(%rbp),%rdi
call   1050 <strlen@plt>
mov    %ax,-0x92(%rbp)
movzwl -0x92(%rbp),%eax
sub    $0x1,%eax
cltq
movsbl -0x90(%rbp,%rax,1),%eax
ff
cmp    $0xa,%eax
jne    12a6 <main+0x126>
movzwl -0x92(%rbp),%eax
sub    $0x1,%eax
cltq
movb   $0x0,-0x90(%rbp,%rax,1)
jmp    12ab <main+0x12b>
lea    -0x3d(%rbp),%rdi
lea    -0x90(%rbp),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    123a <main+0xba>
lea    0xda5(%rip),%rdi
call   1040 <puts@plt>
mov    0xdaa(%rip),%rax
mov    %rax,-0xdd(%rbp)
mov    0xda5(%rip),%eax
mov    %eax,-0xd5(%rbp)
mov    0xd9d(%rip),%al
mov    %al,-0xd1(%rbp)
lea    -0xb0(%rbp),%rdi
lea    0xd8a(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0xd0(%rbp),%rdi
lea    -0xdd(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0xb0(%rbp),%rdi
lea    -0xd0(%rbp),%rsi
mov    $0x6,%edx
call   1070 <strncat@plt>
lea    -0xb0(%rbp),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0xd8,%rsp
xor    %eax,%eax
call   10a0 <print_eng_letters@plt>
lea    0xe64(%rip),%rdi
mov    $0x57,%esi
mov    $0x57,%edx
xor    %eax,%eax
call   1060 <printf@plt>
movups 0xefb(%rip),%xmm0
movups %xmm0,0x2f(%rsp)
movaps 0xee0(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <strlen@plt>
lea    0xe49(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
mov    $0x1f,%ecx
xor    %eax,%eax
call   1060 <printf@plt>
movabs $0x746163207473756a,%rax
63 61 74
mov    %rax,(%rsp)
movb   $0x0,0x8(%rsp)
lea    0xe57(%rip),%r14
mov    0x2ddd(%rip),%r12
lea    0x80(%rsp),%rbx
mov    %rsp,%r15
jmp    1230 <main+0xb0>
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %rbx,%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
je     1264 <main+0xe4>
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    (%r12),%edx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1080 <fgets@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
movzwl %ax,%eax
cmpb   $0xa,-0x1(%rax,%rbx,1)
jne    1220 <main+0xa0>
movb   $0x0,0x7f(%rsp,%rax,1)
jmp    1220 <main+0xa0>
lea    0xe06(%rip),%rdi
call   1040 <puts@plt>
movabs $0x6562206f742074,%rax
mov    %rax,0x15(%rsp)
movabs $0x7420746f6e20726f,%rax
74 20 74
mov    %rax,0x10(%rsp)
lea    0xdfa(%rip),%rsi
lea    0x60(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0x40(%rsp),%r14
lea    0x10(%rsp),%rsi
mov    %r14,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x6,%edx
call   1070 <strncat@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0xd8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [34 x i8] c"The symbol and the code: %c : %d\0A\00"
@__const.main.first_str = [31 x i8] c"A very very important sentence\00"
@.str.1 = [48 x i8] c"The string: %s\0AString size: %u\0AArray size: %u\0A\0A\00"
@__const.main.secret_str = [9 x i8] c"just cat\00"
@.str.2 = [22 x i8] c"Guess secret string? \00"
@stdin = global i32 0
@.str.3 = [17 x i8] c"Correct answer!\0A\00"
@__const.main.str3 = [13 x i8] c"or not to be\00"
@.str.4 = [7 x i8] c"To be \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca [31 x i8]
%4 = alloca i32
%5 = alloca [9 x i8]
%6 = alloca [80 x i8]
%7 = alloca i16
%8 = alloca [20 x i8]
%9 = alloca [20 x i8]
%10 = alloca [13 x i8]
store i32 0, i32* %1
%11 = call i32 (...) @print_eng_letters()
store i8 87, i8* %2
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = load i8, i8* %2
%15 = sext i8 %14 to i32
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %15)
%17 = bitcast [31 x i8]* %3 to i8*
store i32 31, i32* %4
%18 = getelementptr inbounds [31 x i8], [31 x i8]* %3, i64 0, i64 0
%19 = getelementptr inbounds [31 x i8], [31 x i8]* %3, i64 0, i64 0
%20 = call i32 @strlen(i8* %19)
%21 = load i32, i32* %4
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0), i8* %18, i32 %20, i32 %21)
%23 = bitcast [9 x i8]* %5 to i8*
br label %24
24: ; preds = %47, %0
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%26 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%27 = load i32, i32* @stdin
%28 = call i32 @fgets(i8* %26, i32 80, i32 %27)
%29 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%30 = call i32 @strlen(i8* %29)
%31 = trunc i32 %30 to i16
store i16 %31, i16* %7
%32 = load i16, i16* %7
%33 = zext i16 %32 to i32
%34 = sub nsw i32 %33, 1
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 %35
%37 = load i8, i8* %36
%38 = sext i8 %37 to i32
%39 = icmp eq i32 %38, 10
br i1 %39, label %40, label %46
40: ; preds = %24
%41 = load i16, i16* %7
%42 = zext i16 %41 to i32
%43 = sub nsw i32 %42, 1
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 %44
store i8 0, i8* %45
br label %46
46: ; preds = %40, %24
br label %47
47: ; preds = %46
%48 = getelementptr inbounds [9 x i8], [9 x i8]* %5, i64 0, i64 0
%49 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%50 = call i64 @strcmp(i8* %48, i8* %49)
%51 = icmp ne i64 %50, 0
br i1 %51, label %24, label %52
52: ; preds = %47
%53 = call i32 @puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
%54 = bitcast [13 x i8]* %10 to i8*
%55 = getelementptr inbounds [20 x i8], [20 x i8]* %8, i64 0, i64 0
%56 = call i32 @strcpy(i8* %55, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%57 = getelementptr inbounds [20 x i8], [20 x i8]* %9, i64 0, i64 0
%58 = getelementptr inbounds [13 x i8], [13 x i8]* %10, i64 0, i64 0
%59 = call i32 @strcpy(i8* %57, i8* %58)
%60 = getelementptr inbounds [20 x i8], [20 x i8]* %8, i64 0, i64 0
%61 = getelementptr inbounds [20 x i8], [20 x i8]* %9, i64 0, i64 0
%62 = call i32 @strncat(i8* %60, i8* %61, i32 6)
%63 = getelementptr inbounds [20 x i8], [20 x i8]* %8, i64 0, i64 0
%64 = call i32 @puts(i8* %63)
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"The symbol and the code: %c : %d\0A\00"
@__const.main.first_str = [31 x i8] c"A very very important sentence\00"
@.str.1 = [48 x i8] c"The string: %s\0AString size: %u\0AArray size: %u\0A\0A\00"
@__const.main.secret_str = [9 x i8] c"just cat\00"
@.str.2 = [22 x i8] c"Guess secret string? \00"
@stdin = global i32 0
@.str.3 = [17 x i8] c"Correct answer!\0A\00"
@__const.main.str3 = [13 x i8] c"or not to be\00"
@.str.4 = [7 x i8] c"To be \00"
define i32 @main() {
%1 = alloca [31 x i8]
%2 = alloca [9 x i8]
%3 = alloca [80 x i8]
%4 = alloca [20 x i8]
%5 = alloca [20 x i8]
%6 = alloca [13 x i8]
%7 = tail call i32 (...) @print_eng_letters()
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 87, i32 87)
%9 = getelementptr inbounds [31 x i8], [31 x i8]* %1, i64 0, i64 0
%10 = call i32 @strlen(i8* %9)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0), i8* %9, i32 %10, i32 31)
%12 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 0
%13 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
br label %14
14: ; preds = %26, %0
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%16 = load i32, i32* @stdin
%17 = call i32 @fgets(i8* %13, i32 80, i32 %16)
%18 = call i32 @strlen(i8* %13)
%19 = and i32 %18, 65535
%20 = add nsw i32 %19, -1
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 %21
%23 = load i8, i8* %22
%24 = icmp eq i8 %23, 10
br i1 %24, label %25, label %26
25: ; preds = %14
store i8 0, i8* %22
br label %26
26: ; preds = %14, %25
%27 = call i64 @strcmp(i8* %12, i8* %13)
%28 = icmp eq i64 %27, 0
br i1 %28, label %29, label %14
29: ; preds = %26
%30 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
%31 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%32 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%33 = getelementptr inbounds [13 x i8], [13 x i8]* %6, i64 0, i64 0
%34 = call i32 @strcpy(i8* %31, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%35 = call i32 @strcpy(i8* %32, i8* %33)
%36 = call i32 @strncat(i8* %31, i8* %32, i32 6)
%37 = call i32 @puts(i8* %31)
ret i32 0
}