#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*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
scalar_t__ strncmp(char *, char *, int);
int check_status(char *status) {
  if (strncmp(status, "new", 3) == 0)
    return 1;
  else if (strncmp(status, "stop", 4) == 0) {
    printf("   Processing interrupted by user!\n\n");
    exit(0);
  } else
    return 0;
}


x86 assembly (clang, -O0):
<check_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb9(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1167 <check_status+0x37>
movl   $0x1,-0x4(%rbp)
jmp    11a0 <check_status+0x70>
mov    -0x10(%rbp),%rdi
lea    0xe92(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1199 <check_status+0x69>
lea    0xe7c(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_status>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     116a <check_status+0x3a>
lea    0xeb3(%rip),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1171 <check_status+0x41>
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret
lea    0xe91(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"new\00"
@.str.1 = [5 x i8] c"stop\00"
@.str.2 = [37 x i8] c" Processing interrupted by user!\0A\0A\00"
define i32 @check_status(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @strncmp(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %16
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i64 @strncmp(i8* %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 4)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %8
%13 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
%14 = call i32 @exit(i32 0)
unreachable
15: ; preds = %8
store i32 0, i32* %2
br label %16
16: ; preds = %15, %7
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
@.str = [4 x i8] c"new\00"
@.str.1 = [5 x i8] c"stop\00"
@str = [36 x i8] c" Processing interrupted by user!\0A\00"
define i32 @check_status(i8* %0) {
%2 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%3 = icmp eq i64 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%9 = tail call i32 @exit(i32 0)
unreachable
10: ; preds = %4, %1
%11 = phi i32 [ 1, %1 ], [ 0, %4 ]
ret i32 %11
}