#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 *);
int /*<<< orphan*/ scanf(char *, char **);
scalar_t__ strcmp(char const *, char *);
int main(void) {
  const char SECRET[100] = "blah";
  char guess[100];
  do {
    printf("Please guess the secret word:\n");
    scanf("%99s", &guess);
    if (strcmp(SECRET, guess) == 0) {
      printf("Correct guess - well done!!!!!! You are very clever!!!!!!\n");
    } else {
      printf("Sorry %s is not the secret word\n");
    }
  } while (strcmp(SECRET, guess) != 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1040 <memset@plt>
movb   $0x62,-0x70(%rbp)
movb   $0x6c,-0x6f(%rbp)
movb   $0x61,-0x6e(%rbp)
movb   $0x68,-0x6d(%rbp)
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
lea    -0xe0(%rbp),%rsi
lea    0xe93(%rip),%rdi
call   1060 <scanf@plt>
lea    -0x70(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    11bc <main+0x7c>
lea    0xe72(%rip),%rdi
call   1030 <printf@plt>
jmp    11c8 <main+0x88>
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
jmp    11cd <main+0x8d>
lea    -0x70(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1172 <main+0x32>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xd8,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movl   $0x0,0x60(%rsp)
movl   $0x68616c62,(%rsp)
lea    0xe9f(%rip),%r14
lea    0xe72(%rip),%r15
lea    0x70(%rsp),%rbx
mov    %rsp,%r12
lea    0xea7(%rip),%r13
lea    0xe61(%rip),%rbp
jmp    11c8 <main+0x88>
cs nopw 0x0(%rax,%rax,1)
mov    %rbp,%rdi
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     11f5 <main+0xb5>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    11b0 <main+0x70>
mov    %r13,%rdi
call   1030 <puts@plt>
jmp    11b8 <main+0x78>
xor    %eax,%eax
add    $0xd8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Please guess the secret word:\0A\00"
@.str.1 = [5 x i8] c"%99s\00"
@.str.2 = [59 x i8] c"Correct guess - well done!!!!!! You are very clever!!!!!!\0A\00"
@.str.3 = [33 x i8] c"Sorry %s is not the secret word\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 i8* %4 to [100 x i8]*
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i32 0, i32 0
store i8 98, i8* %6
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i32 0, i32 1
store i8 108, i8* %7
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i32 0, i32 2
store i8 97, i8* %8
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i32 0, i32 3
store i8 104, i8* %9
br label %10
10: ; preds = %23, %0
%11 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%12 = bitcast [100 x i8]* %3 to i8**
%13 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %12)
%14 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%16 = call i64 @strcmp(i8* %14, i8* %15)
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %10
%19 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.2, i64 0, i64 0))
br label %22
20: ; preds = %10
%21 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
br label %22
22: ; preds = %20, %18
br label %23
23: ; preds = %22
%24 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%25 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%26 = call i64 @strcmp(i8* %24, i8* %25)
%27 = icmp ne i64 %26, 0
br i1 %27, label %10, label %28
28: ; preds = %23
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [5 x i8] c"%99s\00"
@.str.3 = [33 x i8] c"Sorry %s is not the secret word\0A\00"
@str = [30 x i8] c"Please guess the secret word:\00"
@str.4 = [58 x i8] c"Correct guess - well done!!!!!! You are very clever!!!!!!\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
store i8 98, i8* %3
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 1
store i8 108, i8* %4
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 2
store i8 97, i8* %5
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 3
store i8 104, i8* %6
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%8 = bitcast [100 x i8]* %2 to i8**
br label %9
9: ; preds = %18, %0
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %8)
%12 = call i64 @strcmp(i8* %3, i8* %7)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %9
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str.4, i64 0, i64 0))
br label %18
16: ; preds = %9
%17 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
br label %18
18: ; preds = %14, %16
%19 = call i64 @strcmp(i8* %3, i8* %7)
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %9
21: ; preds = %18
ret i32 0
}