#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*/ gets(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
scalar_t__ strcasecmp(char *, char *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int main() {
  char command[64];
  char response[] = "You think I know how to ";
  char new[128];
  while (strcasecmp(command, "quit")) {
    printf("C:\\>");
    gets(command);
    strcpy(new, response);
    strcat(new, command);
    strcat(new, "?");
    printf("%s\n", new);
    printf("\nToata propozitia de mai sus are #%d caractere\n\n", strlen(new));
  }
  puts("Well, maybe I do...");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xe77(%rip),%rax
mov    %rax,-0x70(%rbp)
mov    0xe74(%rip),%rax
mov    %rax,-0x68(%rbp)
mov    0xe71(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xe6f(%rip),%al
mov    %al,-0x58(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xe62(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
je     1246 <main+0xd6>
lea    0xe51(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x50(%rbp),%rdi
call   1080 <gets@plt>
lea    -0xf0(%rbp),%rdi
lea    -0x70(%rbp),%rsi
call   1040 <strcpy@plt>
lea    -0xf0(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1090 <strcat@plt>
lea    -0xf0(%rbp),%rdi
lea    0xe18(%rip),%rsi
call   1090 <strcat@plt>
lea    -0xf0(%rbp),%rsi
lea    0xe07(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0xf0(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,%esi
lea    0xdef(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    11ac <main+0x3c>
lea    0xe0d(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xe8,%rsp
movups 0xe81(%rip),%xmm0
movups %xmm0,0x9(%rsp)
movaps 0xe6c(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xe7a(%rip),%rsi
lea    0x20(%rsp),%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     1243 <main+0xd3>
lea    0x20(%rsp),%r15
lea    0x60(%rsp),%rbx
mov    %rsp,%r12
lea    0xe5d(%rip),%r13
lea    0xe58(%rip),%rbp
lea    0xe45(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    0xe37(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r15,%rdi
call   1080 <gets@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1090 <strcat@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1090 <strcat@plt>
mov    %rbx,%rdi
call   1050 <puts@plt>
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    %rbp,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <strcasecmp@plt>
test   %rax,%rax
jne    11e0 <main+0x70>
lea    0xe0c(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
add    $0xe8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.response = [25 x i8] c"You think I know how to \00"
@.str = [5 x i8] c"quit\00"
@.str.1 = [5 x i8] c"C:\\>\00"
@.str.2 = [2 x i8] c"?\00"
@.str.3 = [4 x i8] c"%s\0A\00"
@.str.4 = [49 x i8] c"\0AToata propozitia de mai sus are #%d caractere\0A\0A\00"
@.str.5 = [20 x i8] c"Well, maybe I do...\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [64 x i8]
%3 = alloca [25 x i8]
%4 = alloca [128 x i8]
store i32 0, i32* %1
%5 = bitcast [25 x i8]* %3 to i8*
br label %6
6: ; preds = %10, %0
%7 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%8 = call i64 @strcasecmp(i8* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %27
10: ; preds = %6
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%12 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%13 = call i32 @gets(i8* %12)
%14 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%15 = getelementptr inbounds [25 x i8], [25 x i8]* %3, i64 0, i64 0
%16 = call i32 @strcpy(i8* %14, i8* %15)
%17 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%18 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%19 = call i32 @strcat(i8* %17, i8* %18)
%20 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%21 = call i32 @strcat(i8* %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%22 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %22)
%24 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%25 = call i32 @strlen(i8* %24)
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.4, i64 0, i64 0), i32 %25)
br label %6
27: ; preds = %6
%28 = call i32 @puts(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.response = [25 x i8] c"You think I know how to \00"
@.str = [5 x i8] c"quit\00"
@.str.1 = [5 x i8] c"C:\\>\00"
@.str.2 = [2 x i8] c"?\00"
@.str.4 = [49 x i8] c"\0AToata propozitia de mai sus are #%d caractere\0A\0A\00"
@.str.5 = [20 x i8] c"Well, maybe I do...\00"
define i32 @main() {
%1 = alloca [64 x i8]
%2 = alloca [25 x i8]
%3 = alloca [128 x i8]
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [25 x i8], [25 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%7 = call i64 @strcasecmp(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %20, label %9
9: ; preds = %0, %9
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @gets(i8* %4)
%12 = call i32 @strcpy(i8* %6, i8* %5)
%13 = call i32 @strcat(i8* %6, i8* %4)
%14 = call i32 @strcat(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%15 = call i32 @puts(i8* %6)
%16 = call i32 @strlen(i8* %6)
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.4, i64 0, i64 0), i32 %16)
%18 = call i64 @strcasecmp(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %9
20: ; preds = %9, %0
%21 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}