#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 *, ...);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ system(char *);
void status(char a[], char b[]) {
  int count = 1;
  char yes_no[4];
  char yes1[] = "Yes";
  char yes2[] = "yes";
  if ((strcmp(a, b)) == 0) {
    printf("Correct!!\n");
    system(a);
  } else {
    while (strcmp(a, b) != 0) {
      printf("Wrong! try again: ");
      gets(b);
      count++;
      if ((count % 5) == 0) {
        printf("Do you want to get the answer? (yes or no) If no, you will "
               "continue: ");
        gets(yes_no);
        if ((strcmp(yes1, yes_no) == 0) || (strcmp(yes_no, yes2) == 0)) {
          printf("%s\n", a);
          printf("Lets try it now: ");
          gets(b);
          count++;
        }
      }
    }
    printf("Correct!!\n");
    system(a);
  }
}


x86 assembly (clang, -O0):
<status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    0xea3(%rip),%eax
mov    %eax,-0x1c(%rbp)
mov    0xe9e(%rip),%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    119c <status+0x5c>
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <system@plt>
jmp    1284 <status+0x144>
jmp    11a1 <status+0x61>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     126d <status+0x12d>
lea    0xe54(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1060 <gets@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1268 <status+0x128>
lea    0xe33(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x18(%rbp),%rdi
call   1060 <gets@plt>
lea    -0x1c(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     1231 <status+0xf1>
lea    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1263 <status+0x123>
mov    -0x8(%rbp),%rsi
lea    0xe30(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe26(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1060 <gets@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1268 <status+0x128>
jmp    11a1 <status+0x61>
lea    0xd94(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <system@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<status>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
mov    %rdi,%r14
movl   $0x736559,0x10(%rsp)
movl   $0x736579,0xc(%rsp)
call   1060 <strcmp@plt>
test   %rax,%rax
je     1277 <status+0x127>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1254 <status+0x104>
mov    $0x1,%r12d
lea    0xe5d(%rip),%r15
lea    0x14(%rsp),%r13
jmp    11e8 <status+0x98>
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0xe9a(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1070 <gets@plt>
add    $0x2,%r12d
mov    %r12d,%ebp
mov    %r14,%rdi
mov    %rbx,%rsi
call   1060 <strcmp@plt>
mov    %ebp,%r12d
test   %rax,%rax
je     1254 <status+0x104>
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1070 <gets@plt>
lea    0x1(%r12),%ebp
imul   $0xcccccccd,%ebp,%eax
add    $0x19999999,%eax
cmp    $0x33333332,%eax
ja     11d5 <status+0x85>
lea    0xdfb(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r13,%rdi
call   1070 <gets@plt>
lea    0x10(%rsp),%rdi
mov    %r13,%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     11b0 <status+0x60>
mov    %r13,%rdi
lea    0xc(%rsp),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
jne    11d5 <status+0x85>
jmp    11b0 <status+0x60>
lea    0xe10(%rip),%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
call   1040 <system@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xded(%rip),%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <system@plt>

LLVM IR (-O0):
@__const.status.yes1 = [4 x i8] c"Yes\00"
@__const.status.yes2 = [4 x i8] c"yes\00"
@.str = [11 x i8] c"Correct!!\0A\00"
@.str.1 = [19 x i8] c"Wrong! try again: \00"
@.str.2 = [70 x i8] c"Do you want to get the answer? (yes or no) If no, you will continue: \00"
@.str.3 = [4 x i8] c"%s\0A\00"
@.str.4 = [18 x i8] c"Lets try it now: \00"
define void @status(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca [4 x i8]
%7 = alloca [4 x i8]
%8 = alloca [4 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 1, i32* %5
%9 = bitcast [4 x i8]* %7 to i8*
%10 = bitcast [4 x i8]* %8 to i8*
%11 = load i8*, i8** %3
%12 = load i8*, i8** %4
%13 = call i64 @strcmp(i8* %11, i8* %12)
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %2
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%17 = load i8*, i8** %3
%18 = call i32 @system(i8* %17)
br label %61
19: ; preds = %2
br label %20
20: ; preds = %56, %19
%21 = load i8*, i8** %3
%22 = load i8*, i8** %4
%23 = call i64 @strcmp(i8* %21, i8* %22)
%24 = icmp ne i64 %23, 0
br i1 %24, label %25, label %57
25: ; preds = %20
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%27 = load i8*, i8** %4
%28 = call i32 @gets(i8* %27)
%29 = load i32, i32* %5
%30 = add nsw i32 %29, 1
store i32 %30, i32* %5
%31 = load i32, i32* %5
%32 = srem i32 %31, 5
%33 = icmp eq i32 %32, 0
br i1 %33, label %34, label %56
34: ; preds = %25
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.2, i64 0, i64 0))
%36 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 0
%37 = call i32 @gets(i8* %36)
%38 = getelementptr inbounds [4 x i8], [4 x i8]* %7, i64 0, i64 0
%39 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 0
%40 = call i64 @strcmp(i8* %38, i8* %39)
%41 = icmp eq i64 %40, 0
br i1 %41, label %47, label %42
42: ; preds = %34
%43 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 0
%44 = getelementptr inbounds [4 x i8], [4 x i8]* %8, i64 0, i64 0
%45 = call i64 @strcmp(i8* %43, i8* %44)
%46 = icmp eq i64 %45, 0
br i1 %46, label %47, label %55
47: ; preds = %42, %34
%48 = load i8*, i8** %3
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %48)
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%51 = load i8*, i8** %4
%52 = call i32 @gets(i8* %51)
%53 = load i32, i32* %5
%54 = add nsw i32 %53, 1
store i32 %54, i32* %5
br label %55
55: ; preds = %47, %42
br label %56
56: ; preds = %55, %25
br label %20
57: ; preds = %20
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%59 = load i8*, i8** %3
%60 = call i32 @system(i8* %59)
br label %61
61: ; preds = %57, %15
ret void
}

LLVM IR (-O2):
@.str.1 = [19 x i8] c"Wrong! try again: \00"
@.str.2 = [70 x i8] c"Do you want to get the answer? (yes or no) If no, you will continue: \00"
@.str.4 = [18 x i8] c"Lets try it now: \00"
@str.5 = [10 x i8] c"Correct!!\00"
define void @status(i8* %0, i8* %1) {
%3 = alloca [4 x i8]
%4 = alloca i32
%5 = alloca i32
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%7 = bitcast i32* %4 to i8*
store i32 7562585, i32* %4
%8 = bitcast i32* %5 to i8*
store i32 7562617, i32* %5
%9 = tail call i64 @strcmp(i8* %0, i8* %1)
%10 = icmp eq i64 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %2
%12 = call i64 @strcmp(i8* %0, i8* %1)
%13 = icmp eq i64 %12, 0
br i1 %13, label %41, label %17
14: ; preds = %2
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.5, i64 0, i64 0))
%16 = tail call i32 @system(i8* %0)
br label %44
17: ; preds = %11, %37
%18 = phi i32 [ %38, %37 ], [ 1, %11 ]
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%20 = call i32 @gets(i8* %1)
%21 = add nsw i32 %18, 1
%22 = srem i32 %21, 5
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %37
24: ; preds = %17
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @.str.2, i64 0, i64 0))
%26 = call i32 @gets(i8* %6)
%27 = call i64 @strcmp(i8* %7, i8* %6)
%28 = icmp eq i64 %27, 0
br i1 %28, label %32, label %29
29: ; preds = %24
%30 = call i64 @strcmp(i8* %6, i8* %8)
%31 = icmp eq i64 %30, 0
br i1 %31, label %32, label %37
32: ; preds = %29, %24
%33 = call i32 @puts(i8* dereferenceable(1) %0)
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%35 = call i32 @gets(i8* %1)
%36 = add nsw i32 %18, 2
br label %37
37: ; preds = %29, %32, %17
%38 = phi i32 [ %36, %32 ], [ %21, %29 ], [ %21, %17 ]
%39 = call i64 @strcmp(i8* %0, i8* %1)
%40 = icmp eq i64 %39, 0
br i1 %40, label %41, label %17
41: ; preds = %37, %11
%42 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.5, i64 0, i64 0))
%43 = call i32 @system(i8* %0)
br label %44
44: ; preds = %41, %14
ret void
}