#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*/ print_motor_detail_status();
int /*<<< orphan*/ print_motor_speed();
int /*<<< orphan*/ print_user_inputs(char *);
int /*<<< orphan*/ scanf(char *, ...);
int /*<<< orphan*/ set_moter_voltage(int);
int /*<<< orphan*/ set_motor_speed(int);
int main(int argc, char **argv) {
  int usr_priority;
  int motor_params[2];
  char input_text[64];
  scanf("%d", &motor_params[0]);
  scanf("%d", &motor_params[1]);
  scanf("%d", &usr_priority);
  scanf("%s", input_text);
  print_user_inputs(input_text);
  set_motor_speed(motor_params[0]);
  set_moter_voltage(motor_params[1]);
  if (usr_priority == 0) {
    print_motor_detail_status();
  } else {
    print_motor_speed();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x1c(%rbp),%rsi
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    -0x1c(%rbp),%rsi
add    $0x4,%rsi
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    0xe5b(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    -0x60(%rbp),%rsi
lea    0xe48(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    -0x60(%rbp),%rdi
call   1080 <print_user_inputs@plt>
mov    -0x1c(%rbp),%edi
call   1030 <set_motor_speed@plt>
mov    -0x18(%rbp),%edi
call   1070 <set_moter_voltage@plt>
cmpl   $0x0,-0x14(%rbp)
jne    11f1 <main+0x91>
mov    $0x0,%al
call   1040 <print_motor_detail_status@plt>
jmp    11f8 <main+0x98>
mov    $0x0,%al
call   1050 <print_motor_speed@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
lea    0xe94(%rip),%rbx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xe63(%rip),%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    %rbx,%rdi
call   1080 <print_user_inputs@plt>
mov    0x4(%rsp),%edi
call   1030 <set_motor_speed@plt>
mov    0x8(%rsp),%edi
call   1070 <set_moter_voltage@plt>
cmpl   $0x0,0xc(%rsp)
je     11d9 <main+0x79>
xor    %eax,%eax
call   1050 <print_motor_speed@plt>
jmp    11e0 <main+0x80>
xor    %eax,%eax
call   1040 <print_motor_detail_status@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [2 x i32]
%8 = alloca [64 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %9)
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %11)
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%14 = getelementptr inbounds [64 x i8], [64 x i8]* %8, i64 0, i64 0
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %14)
%16 = getelementptr inbounds [64 x i8], [64 x i8]* %8, i64 0, i64 0
%17 = call i32 @print_user_inputs(i8* %16)
%18 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%19 = load i32, i32* %18
%20 = call i32 @set_motor_speed(i32 %19)
%21 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
%22 = load i32, i32* %21
%23 = call i32 @set_moter_voltage(i32 %22)
%24 = load i32, i32* %6
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %2
%27 = call i32 (...) @print_motor_detail_status()
br label %30
28: ; preds = %2
%29 = call i32 (...) @print_motor_speed()
br label %30
30: ; preds = %28, %26
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca [2 x i32]
%5 = alloca [64 x i8]
%6 = bitcast i32* %3 to i8*
%7 = bitcast [2 x i32]* %4 to i8*
%8 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %9)
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %11)
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%15 = call i32 @print_user_inputs(i8* %8)
%16 = load i32, i32* %9
%17 = call i32 @set_motor_speed(i32 %16)
%18 = load i32, i32* %11
%19 = call i32 @set_moter_voltage(i32 %18)
%20 = load i32, i32* %3
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %2
%23 = call i32 (...) @print_motor_detail_status()
br label %26
24: ; preds = %2
%25 = call i32 (...) @print_motor_speed()
br label %26
26: ; preds = %24, %22
ret i32 0
}