#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);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
scalar_t__ strcmp(char *, char *);
void damage_warning() {
  printf(
      "WARNING: this expiremental tool is very DANGEROUS. You are going to "
      "edit the partition table with it. Use it your own risk! The copyright "
      "holder is not responsible for any damage this software can do.\n");
  char input[3];
  while (strcmp(input, "y\n")) {
    printf("Are you sure you want to conitunue? [y/n]");
    fgets(input, 3, stdin);
    if (!strcmp(input, "n\n"))
      exit(1);
  }
}


x86 assembly (clang, -O0):
<damage_warning>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
lea    -0x3(%rbp),%rdi
lea    0xf6b(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     11ba <damage_warning+0x7a>
lea    0xf58(%rip),%rdi
call   1030 <printf@plt>
lea    -0x3(%rbp),%rdi
mov    0x2e63(%rip),%rax
mov    (%rax),%edx
mov    $0x3,%esi
call   1040 <fgets@plt>
lea    -0x3(%rbp),%rdi
lea    0xf5b(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    11b5 <damage_warning+0x75>
mov    $0x1,%edi
call   1060 <exit@plt>
jmp    1154 <damage_warning+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<damage_warning>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
lea    0xe90(%rip),%r14
lea    0xd(%rsp),%rbx
lea    0xe87(%rip),%r15
mov    0x2e65(%rip),%r13
lea    0xea3(%rip),%r12
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     11d3 <damage_warning+0x83>
mov    %r15,%rdi
call   1040 <printf@plt>
mov    0x0(%r13),%edx
mov    %rbx,%rdi
mov    $0x3,%esi
call   1050 <fgets@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
jne    1190 <damage_warning+0x40>
mov    $0x1,%edi
call   1070 <exit@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [202 x i8] c"WARNING: this expiremental tool is very DANGEROUS. You are going to edit the partition table with it. Use it your own risk! The copyright holder is not responsible for any damage this software can do.\0A\00"
@.str.1 = [3 x i8] c"y\0A\00"
@.str.2 = [42 x i8] c"Are you sure you want to conitunue? [y/n]\00"
@stdin = global i32 0
@.str.3 = [3 x i8] c"n\0A\00"
define void @damage_warning() {
%1 = alloca [3 x i8]
%2 = call i32 @printf(i8* getelementptr inbounds ([202 x i8], [202 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %17, %0
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%5 = call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %18
7: ; preds = %3
%8 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
%9 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%10 = load i32, i32* @stdin
%11 = call i32 @fgets(i8* %9, i32 3, i32 %10)
%12 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%13 = call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%14 = icmp ne i64 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %7
%16 = call i32 @exit(i32 1)
unreachable
17: ; preds = %7
br label %3
18: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"y\0A\00"
@.str.2 = [42 x i8] c"Are you sure you want to conitunue? [y/n]\00"
@stdin = global i32 0
@.str.3 = [3 x i8] c"n\0A\00"
@str = [201 x i8] c"WARNING: this expiremental tool is very DANGEROUS. You are going to edit the partition table with it. Use it your own risk! The copyright holder is not responsible for any damage this software can do.\00"
define void @damage_warning() {
%1 = alloca [3 x i8]
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([201 x i8], [201 x i8]* @str, i64 0, i64 0))
%3 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
br label %4
4: ; preds = %7, %0
%5 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %15, label %7
7: ; preds = %4
%8 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
%9 = load i32, i32* @stdin
%10 = call i32 @fgets(i8* %3, i32 3, i32 %9)
%11 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %7
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %4
ret void
}