#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*/ atoi(char *);
int /*<<< orphan*/ bs_cmd_flag_hif_mode_cmd();
int /*<<< orphan*/ bs_cmd_upd_full(int /*<<< orphan*/, int, int /*<<< orphan*/);
int /*<<< orphan*/ bs_cmd_wait_dspe_frend();
int /*<<< orphan*/ bs_cmd_wait_dspe_trg();
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  int lut = 15;
  if (argc != 2) {
    printf("Usage: bs_disp_full <mode>\n\r");
    return (-1);
  }
  bs_cmd_flag_hif_mode_cmd();
  bs_cmd_wait_dspe_trg();
  bs_cmd_wait_dspe_frend();
  bs_cmd_upd_full(atoi(*++argv), lut, 0);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xf,-0x14(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     119f <main+0x3f>
lea    0xe72(%rip),%rdi
call   1050 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    11df <main+0x7f>
mov    $0x0,%al
call   1040 <bs_cmd_flag_hif_mode_cmd@plt>
mov    $0x0,%al
call   1060 <bs_cmd_wait_dspe_trg@plt>
mov    $0x0,%al
call   1030 <bs_cmd_wait_dspe_frend@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rdi
call   1080 <atoi@plt>
mov    %eax,%edi
mov    -0x14(%rbp),%esi
xor    %edx,%edx
call   1070 <bs_cmd_upd_full@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
cmp    $0x2,%edi
jne    119c <main+0x3c>
mov    %rsi,%r14
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <bs_cmd_flag_hif_mode_cmd@plt>
xor    %eax,%eax
call   1060 <bs_cmd_wait_dspe_trg@plt>
xor    %eax,%eax
call   1030 <bs_cmd_wait_dspe_frend@plt>
mov    0x8(%r14),%rdi
call   1080 <atoi@plt>
mov    %eax,%edi
mov    $0xf,%esi
xor    %edx,%edx
call   1070 <bs_cmd_upd_full@plt>
jmp    11ad <main+0x4d>
lea    0xe5d(%rip),%rdi
call   1050 <printf@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Usage: bs_disp_full <mode>\0A\0D\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 15, i32* %6
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 2
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %21
11: ; preds = %2
%12 = call i32 (...) @bs_cmd_flag_hif_mode_cmd()
%13 = call i32 (...) @bs_cmd_wait_dspe_trg()
%14 = call i32 (...) @bs_cmd_wait_dspe_frend()
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i32 1
store i8** %16, i8*** %5
%17 = load i8*, i8** %16
%18 = call i32 @atoi(i8* %17)
%19 = load i32, i32* %6
%20 = call i32 @bs_cmd_upd_full(i32 %18, i32 %19, i32 0)
store i32 0, i32* %3
br label %21
21: ; preds = %11, %9
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
@.str = [29 x i8] c"Usage: bs_disp_full <mode>\0A\0D\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %14
6: ; preds = %2
%7 = tail call i32 (...) @bs_cmd_flag_hif_mode_cmd()
%8 = tail call i32 (...) @bs_cmd_wait_dspe_trg()
%9 = tail call i32 (...) @bs_cmd_wait_dspe_frend()
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = tail call i32 @atoi(i8* %11)
%13 = tail call i32 @bs_cmd_upd_full(i32 %12, i32 15, i32 0)
br label %14
14: ; preds = %6, %4
%15 = phi i32 [ -1, %4 ], [ 0, %6 ]
ret i32 %15
}