#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 */
struct emmc_block_dev {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ sd_card_init(struct emmc_block_dev *, float,
                                int /*<<< orphan*/);
void force_erase(struct emmc_block_dev *emmc_dev) {
  printf("WARNING: This will permanently erase the (e)MMC aka. "
         "NAND!\n\nContinue only if you do have a NAND dump of your 3DS!\n\n "
         "Enter H (big h) to continue.\n");
  char in;
  scanf(" %c", &in);
  if ('H' == in)
    sd_card_init(emmc_dev, 'F', 0);
  return;
}


x86 assembly (clang, -O0):
<force_erase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xec1(%rip),%rdi
call   1040 <printf@plt>
lea    0xf47(%rip),%rdi
lea    -0x9(%rbp),%rsi
call   1050 <scanf@plt>
movsbl -0x9(%rbp),%ecx
mov    $0x48,%eax
cmp    %ecx,%eax
jne    117c <force_erase+0x4c>
mov    -0x8(%rbp),%rdi
movss  0xe8b(%rip),%xmm0
xor    %esi,%esi
call   1030 <sd_card_init@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<force_erase>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb9(%rip),%rdi
lea    0xf(%rsp),%rsi
call   1050 <scanf@plt>
cmpb   $0x48,0xf(%rsp)
jne    116e <force_erase+0x3e>
movss  0xe9c(%rip),%xmm0
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <sd_card_init@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.emmc_block_dev = type { i32 }
@.str = [146 x i8] c"WARNING: This will permanently erase the (e)MMC aka. NAND!\0A\0AContinue only if you do have a NAND dump of your 3DS!\0A\0A Enter H (big h) to continue.\0A\00"
@.str.1 = [4 x i8] c" %c\00"
define void @force_erase(%struct.emmc_block_dev* %0) {
%2 = alloca %struct.emmc_block_dev*
%3 = alloca i8
store %struct.emmc_block_dev* %0, %struct.emmc_block_dev** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
%8 = icmp eq i32 72, %7
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load %struct.emmc_block_dev*, %struct.emmc_block_dev** %2
%11 = call i32 @sd_card_init(%struct.emmc_block_dev* %10, float 7.000000e+01, i32 0)
br label %12
12: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
%struct.emmc_block_dev = type { i32 }
@.str.1 = [4 x i8] c" %c\00"
@str = [145 x i8] c"WARNING: This will permanently erase the (e)MMC aka. NAND!\0A\0AContinue only if you do have a NAND dump of your 3DS!\0A\0A Enter H (big h) to continue.\00"
define void @force_erase(%struct.emmc_block_dev* %0) {
%2 = alloca i8
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([145 x i8], [145 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = load i8, i8* %2
%6 = icmp eq i8 %5, 72
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @sd_card_init(%struct.emmc_block_dev* %0, float 7.000000e+01, i32 0)
br label %9
9: ; preds = %7, %1
ret void
}