#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*/ printf(char *);
int /*<<< orphan*/ scanf(char *, ...);
void readInputUser(char name[], int askPriority, int *priority) {
  printf("Hvilken person er der tale om?\nIndtast input => ");
  scanf("%s", name);
  if (askPriority == 1) {
    printf("Hvilken prioritet?\nIndtast input => ");
    scanf("%d", priority);
  }
}


x86 assembly (clang, -O0):
<readInputUser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xee7(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
cmpl   $0x1,-0xc(%rbp)
jne    1179 <readInputUser+0x59>
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xee7(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readInputUser>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
lea    0xef2(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmp    $0x1,%ebp
jne    116f <readInputUser+0x4f>
lea    0xedf(%rip),%rdi
call   1030 <printf@plt>
lea    0xef8(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <scanf@plt>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [49 x i8] c"Hvilken person er der tale om?\0AIndtast input => \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [37 x i8] c"Hvilken prioritet?\0AIndtast input => \00"
@.str.3 = [3 x i8] c"%d\00"
define void @readInputUser(i8* %0, i32 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%8 = load i8*, i8** %4
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%10 = load i32, i32* %5
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %16
12: ; preds = %3
%13 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
%14 = load i32*, i32** %6
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %14)
br label %16
16: ; preds = %12, %3
ret void
}

LLVM IR (-O2):
@.str = [49 x i8] c"Hvilken person er der tale om?\0AIndtast input => \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [37 x i8] c"Hvilken prioritet?\0AIndtast input => \00"
@.str.3 = [3 x i8] c"%d\00"
define void @readInputUser(i8* %0, i32 %1, i32* %2) {
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%6 = icmp eq i32 %1, 1
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
%9 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %2)
br label %10
10: ; preds = %7, %3
ret void
}