#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*/ change_block(int);
int /*<<< orphan*/ console_style(int);
scalar_t__ prompt(int, int, char *, char *, int);
int sscanf(char *, char *, int *);
void goto_block(void) {
  char line[20];
  int blk;
  console_style(1);
  if (prompt(5, 2 + (1024 / 64) + 5, "Goto Block: ", line, 20) &&
      sscanf(line, "%d", &blk) == 1) {
    change_block(blk);
  }
}


x86 assembly (clang, -O0):
<goto_block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    $0x1,%edi
call   1050 <console_style@plt>
lea    -0x20(%rbp),%rcx
mov    $0x5,%edi
mov    $0x17,%esi
lea    0xe99(%rip),%rdx
mov    $0x14,%r8d
call   1040 <prompt@plt>
cmp    $0x0,%rax
je     11a1 <goto_block+0x61>
lea    -0x20(%rbp),%rdi
lea    0xe86(%rip),%rsi
lea    -0x24(%rbp),%rdx
call   1060 <sscanf@plt>
cmp    $0x1,%eax
jne    11a1 <goto_block+0x61>
mov    -0x24(%rbp),%edi
call   1030 <change_block@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<goto_block>:
sub    $0x28,%rsp
mov    $0x1,%edi
call   1050 <console_style@plt>
lea    0xeab(%rip),%rdx
lea    0x10(%rsp),%rcx
mov    $0x5,%edi
mov    $0x17,%esi
mov    $0x14,%r8d
call   1040 <prompt@plt>
test   %rax,%rax
je     1198 <goto_block+0x58>
lea    0xe92(%rip),%rsi
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rdx
call   1060 <sscanf@plt>
cmp    $0x1,%eax
jne    1198 <goto_block+0x58>
mov    0xc(%rsp),%edi
call   1030 <change_block@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Goto Block: \00"
@.str.1 = [3 x i8] c"%d\00"
define void @goto_block() {
%1 = alloca [20 x i8]
%2 = alloca i32
%3 = call i32 @console_style(i32 1)
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%5 = call i64 @prompt(i32 5, i32 23, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %4, i32 20)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %0
%8 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%9 = call i32 @sscanf(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i32, i32* %2
%13 = call i32 @change_block(i32 %12)
br label %14
14: ; preds = %11, %7, %0
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"Goto Block: \00"
@.str.1 = [3 x i8] c"%d\00"
define void @goto_block() {
%1 = alloca [20 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @console_style(i32 1)
%6 = call i64 @prompt(i32 5, i32 23, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %3, i32 20)
%7 = icmp eq i64 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %0
%9 = call i32 @sscanf(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = call i32 @change_block(i32 %12)
br label %14
14: ; preds = %11, %8, %0
ret void
}