#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 */
unsigned int do_smi_read(unsigned int, unsigned int);
scalar_t__ do_smi_write(unsigned int, unsigned int, unsigned int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ smi_usage();
int /*<<< orphan*/ sscanf(char *, char *, unsigned int *);
scalar_t__ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  unsigned int phyaddr = 0;
  unsigned int regnum = 0;
  unsigned int regvalue = 0;
  if ((argc != 6) && (argc != 8)) {
    smi_usage();
    return 0;
  }
  if (strcmp(argv[1], "read") == 0) {
    if (argc != 6) {
      smi_usage();
      return 0;
    }
    if (strcmp(argv[2], "phy") != 0) {
      smi_usage();
      return 0;
    }
    if (strcmp(argv[4], "reg") != 0) {
      smi_usage();
      return 0;
    }
    sscanf(argv[3], "%x", &phyaddr);
    sscanf(argv[5], "%x", &regnum);
    printf("\n  smi read phy 0x%x reg 0x%x:\n", phyaddr, regnum);
    regvalue = do_smi_read(phyaddr, regnum);
    printf("  value: 0x%x\n\n", regvalue);
    return 0;
  } else if (strcmp(argv[1], "write") == 0) {
    if (argc != 8) {
      smi_usage();
      return 0;
    }
    if (strcmp(argv[2], "phy") != 0) {
      smi_usage();
      return 0;
    }
    if (strcmp(argv[4], "reg") != 0) {
      smi_usage();
      return 0;
    }
    if (strcmp(argv[6], "value") != 0) {
      smi_usage();
      return 0;
    }
    sscanf(argv[3], "%x", &phyaddr);
    sscanf(argv[5], "%x", &regnum);
    sscanf(argv[7], "%x", &regvalue);
    printf("\n  smi write phy 0x%x reg 0x%x value 0x%x\n", phyaddr, regnum,
           regvalue);
    if (0 == do_smi_write(phyaddr, regnum, regvalue)) {
      printf("  success\n\n");
    } else {
      printf("  failed\n\n");
    }
    return 0;
  } else {
    smi_usage();
    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   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x6,-0x8(%rbp)
je     11b2 <main+0x52>
cmpl   $0x8,-0x8(%rbp)
je     11b2 <main+0x52>
mov    $0x0,%al
call   1070 <smi_usage@plt>
movl   $0x0,-0x4(%rbp)
jmp    1442 <main+0x2e2>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe3f(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    12be <main+0x15e>
cmpl   $0x6,-0x8(%rbp)
je     11ed <main+0x8d>
mov    $0x0,%al
call   1070 <smi_usage@plt>
movl   $0x0,-0x4(%rbp)
jmp    1442 <main+0x2e2>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe09(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     121e <main+0xbe>
mov    $0x0,%al
call   1070 <smi_usage@plt>
movl   $0x0,-0x4(%rbp)
jmp    1442 <main+0x2e2>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
lea    0xddc(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     124f <main+0xef>
mov    $0x0,%al
call   1070 <smi_usage@plt>
movl   $0x0,-0x4(%rbp)
jmp    1442 <main+0x2e2>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xdaf(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1060 <sscanf@plt>
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rdi
lea    0xd97(%rip),%rsi
lea    -0x18(%rbp),%rdx
call   1060 <sscanf@plt>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xd84(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1030 <do_smi_read@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xd85(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1442 <main+0x2e2>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd73(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1434 <main+0x2d4>
cmpl   $0x8,-0x8(%rbp)
je     12f9 <main+0x199>
mov    $0x0,%al
call   1070 <smi_usage@plt>
movl   $0x0,-0x4(%rbp)
jmp    1442 <main+0x2e2>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xcfd(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     132a <main+0x1ca>
mov    $0x0,%al
call   1070 <smi_usage@plt>
movl   $0x0,-0x4(%rbp)
jmp    1442 <main+0x2e2>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
lea    0xcd0(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     135b <main+0x1fb>
mov    $0x0,%al
call   1070 <smi_usage@plt>
movl   $0x0,-0x4(%rbp)
jmp    1442 <main+0x2e2>
mov    -0x10(%rbp),%rax
mov    0x30(%rax),%rdi
lea    0xcdc(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     138c <main+0x22c>
mov    $0x0,%al
call   1070 <smi_usage@plt>
movl   $0x0,-0x4(%rbp)
jmp    1442 <main+0x2e2>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xc72(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1060 <sscanf@plt>
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rdi
lea    0xc5a(%rip),%rsi
lea    -0x18(%rbp),%rdx
call   1060 <sscanf@plt>
mov    -0x10(%rbp),%rax
mov    0x38(%rax),%rdi
lea    0xc42(%rip),%rsi
lea    -0x1c(%rbp),%rdx
call   1060 <sscanf@plt>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
lea    0xc68(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
call   1080 <do_smi_write@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    141a <main+0x2ba>
lea    0xc69(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1428 <main+0x2c8>
lea    0xc62(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1442 <main+0x2e2>
mov    $0x0,%al
call   1070 <smi_usage@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
movl   $0x0,0x10(%rsp)
movl   $0x0,0xc(%rsp)
movl   $0x0,0x14(%rsp)
cmp    $0x6,%edi
je     11a1 <main+0x31>
cmp    $0x8,%ebp
jne    12d2 <main+0x162>
mov    0x8(%rbx),%rdi
lea    0xe54(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     12a3 <main+0x133>
mov    0x8(%rbx),%rdi
lea    0xe7b(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
jne    12d2 <main+0x162>
cmp    $0x8,%ebp
jne    12d2 <main+0x162>
mov    0x10(%rbx),%rdi
lea    0xe1e(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
jne    12d2 <main+0x162>
mov    0x20(%rbx),%rdi
lea    0xe09(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
jne    12d2 <main+0x162>
mov    0x30(%rbx),%rdi
lea    0xe2d(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
jne    12d2 <main+0x162>
mov    0x18(%rbx),%rdi
lea    0xddb(%rip),%rbp
lea    0x10(%rsp),%rdx
mov    %rbp,%rsi
call   1070 <sscanf@plt>
mov    0x28(%rbx),%rdi
lea    0xc(%rsp),%rdx
mov    %rbp,%rsi
call   1070 <sscanf@plt>
mov    0x38(%rbx),%rdi
lea    0x14(%rsp),%rdx
mov    %rbp,%rsi
call   1070 <sscanf@plt>
mov    0x10(%rsp),%esi
mov    0xc(%rsp),%edx
mov    0x14(%rsp),%ecx
lea    0xdd8(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x10(%rsp),%edi
mov    0xc(%rsp),%esi
mov    0x14(%rsp),%edx
call   1090 <do_smi_write@plt>
test   %rax,%rax
je     1340 <main+0x1d0>
lea    0xddb(%rip),%rdi
call   1040 <puts@plt>
jmp    12d9 <main+0x169>
cmp    $0x6,%ebp
jne    12d2 <main+0x162>
mov    0x10(%rbx),%rdi
lea    0xd52(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
jne    12d2 <main+0x162>
mov    0x20(%rbx),%rdi
lea    0xd41(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     12e2 <main+0x172>
xor    %eax,%eax
call   1080 <smi_usage@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret
mov    0x18(%rbx),%rdi
lea    0xd20(%rip),%rbp
lea    0x10(%rsp),%rdx
mov    %rbp,%rsi
call   1070 <sscanf@plt>
mov    0x28(%rbx),%rdi
lea    0xc(%rsp),%rdx
mov    %rbp,%rsi
call   1070 <sscanf@plt>
mov    0x10(%rsp),%esi
mov    0xc(%rsp),%edx
lea    0xcf6(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x10(%rsp),%edi
mov    0xc(%rsp),%esi
call   1030 <do_smi_read@plt>
lea    0xcfb(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    12d9 <main+0x169>
lea    0xd3a(%rip),%rdi
call   1040 <puts@plt>
jmp    12d9 <main+0x169>

LLVM IR (-O0):
@.str = [5 x i8] c"read\00"
@.str.1 = [4 x i8] c"phy\00"
@.str.2 = [4 x i8] c"reg\00"
@.str.3 = [3 x i8] c"%x\00"
@.str.4 = [32 x i8] c"\0A smi read phy 0x%x reg 0x%x:\0A\00"
@.str.5 = [16 x i8] c" value: 0x%x\0A\0A\00"
@.str.6 = [6 x i8] c"write\00"
@.str.7 = [6 x i8] c"value\00"
@.str.8 = [43 x i8] c"\0A smi write phy 0x%x reg 0x%x value 0x%x\0A\00"
@.str.9 = [12 x i8] c" success\0A\0A\00"
@.str.10 = [11 x i8] c" failed\0A\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 6
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i32, i32* %4
%13 = icmp ne i32 %12, 8
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 (...) @smi_usage()
store i32 0, i32* %3
br label %124
16: ; preds = %11, %2
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = call i64 @strcmp(i8* %19, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %60
22: ; preds = %16
%23 = load i32, i32* %4
%24 = icmp ne i32 %23, 6
br i1 %24, label %25, label %27
25: ; preds = %22
%26 = call i32 (...) @smi_usage()
store i32 0, i32* %3
br label %124
27: ; preds = %22
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 2
%30 = load i8*, i8** %29
%31 = call i64 @strcmp(i8* %30, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%32 = icmp ne i64 %31, 0
br i1 %32, label %33, label %35
33: ; preds = %27
%34 = call i32 (...) @smi_usage()
store i32 0, i32* %3
br label %124
35: ; preds = %27
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 4
%38 = load i8*, i8** %37
%39 = call i64 @strcmp(i8* %38, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%40 = icmp ne i64 %39, 0
br i1 %40, label %41, label %43
41: ; preds = %35
%42 = call i32 (...) @smi_usage()
store i32 0, i32* %3
br label %124
43: ; preds = %35
%44 = load i8**, i8*** %5
%45 = getelementptr inbounds i8*, i8** %44, i64 3
%46 = load i8*, i8** %45
%47 = call i32 @sscanf(i8* %46, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %6)
%48 = load i8**, i8*** %5
%49 = getelementptr inbounds i8*, i8** %48, i64 5
%50 = load i8*, i8** %49
%51 = call i32 @sscanf(i8* %50, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %7)
%52 = load i32, i32* %6
%53 = load i32, i32* %7
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0), i32 %52, i32 %53)
%55 = load i32, i32* %6
%56 = load i32, i32* %7
%57 = call i32 @do_smi_read(i32 %55, i32 %56)
store i32 %57, i32* %8
%58 = load i32, i32* %8
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i32 %58)
store i32 0, i32* %3
br label %124
60: ; preds = %16
%61 = load i8**, i8*** %5
%62 = getelementptr inbounds i8*, i8** %61, i64 1
%63 = load i8*, i8** %62
%64 = call i64 @strcmp(i8* %63, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%65 = icmp eq i64 %64, 0
br i1 %65, label %66, label %122
66: ; preds = %60
%67 = load i32, i32* %4
%68 = icmp ne i32 %67, 8
br i1 %68, label %69, label %71
69: ; preds = %66
%70 = call i32 (...) @smi_usage()
store i32 0, i32* %3
br label %124
71: ; preds = %66
%72 = load i8**, i8*** %5
%73 = getelementptr inbounds i8*, i8** %72, i64 2
%74 = load i8*, i8** %73
%75 = call i64 @strcmp(i8* %74, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%76 = icmp ne i64 %75, 0
br i1 %76, label %77, label %79
77: ; preds = %71
%78 = call i32 (...) @smi_usage()
store i32 0, i32* %3
br label %124
79: ; preds = %71
%80 = load i8**, i8*** %5
%81 = getelementptr inbounds i8*, i8** %80, i64 4
%82 = load i8*, i8** %81
%83 = call i64 @strcmp(i8* %82, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%84 = icmp ne i64 %83, 0
br i1 %84, label %85, label %87
85: ; preds = %79
%86 = call i32 (...) @smi_usage()
store i32 0, i32* %3
br label %124
87: ; preds = %79
%88 = load i8**, i8*** %5
%89 = getelementptr inbounds i8*, i8** %88, i64 6
%90 = load i8*, i8** %89
%91 = call i64 @strcmp(i8* %90, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%92 = icmp ne i64 %91, 0
br i1 %92, label %93, label %95
93: ; preds = %87
%94 = call i32 (...) @smi_usage()
store i32 0, i32* %3
br label %124
95: ; preds = %87
%96 = load i8**, i8*** %5
%97 = getelementptr inbounds i8*, i8** %96, i64 3
%98 = load i8*, i8** %97
%99 = call i32 @sscanf(i8* %98, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %6)
%100 = load i8**, i8*** %5
%101 = getelementptr inbounds i8*, i8** %100, i64 5
%102 = load i8*, i8** %101
%103 = call i32 @sscanf(i8* %102, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %7)
%104 = load i8**, i8*** %5
%105 = getelementptr inbounds i8*, i8** %104, i64 7
%106 = load i8*, i8** %105
%107 = call i32 @sscanf(i8* %106, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %8)
%108 = load i32, i32* %6
%109 = load i32, i32* %7
%110 = load i32, i32* %8
%111 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.8, i64 0, i64 0), i32 %108, i32 %109, i32 %110)
%112 = load i32, i32* %6
%113 = load i32, i32* %7
%114 = load i32, i32* %8
%115 = call i64 @do_smi_write(i32 %112, i32 %113, i32 %114)
%116 = icmp eq i64 0, %115
br i1 %116, label %117, label %119
117: ; preds = %95
%118 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0))
br label %121
119: ; preds = %95
%120 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0))
br label %121
121: ; preds = %119, %117
store i32 0, i32* %3
br label %124
122: ; preds = %60
%123 = call i32 (...) @smi_usage()
store i32 0, i32* %3
br label %124
124: ; preds = %122, %121, %93, %85, %77, %69, %43, %41, %33, %25, %14
%125 = load i32, i32* %3
ret i32 %125
}

LLVM IR (-O2):
@.str = [5 x i8] c"read\00"
@.str.1 = [4 x i8] c"phy\00"
@.str.2 = [4 x i8] c"reg\00"
@.str.3 = [3 x i8] c"%x\00"
@.str.4 = [32 x i8] c"\0A smi read phy 0x%x reg 0x%x:\0A\00"
@.str.5 = [16 x i8] c" value: 0x%x\0A\0A\00"
@.str.6 = [6 x i8] c"write\00"
@.str.7 = [6 x i8] c"value\00"
@.str.8 = [43 x i8] c"\0A smi write phy 0x%x reg 0x%x value 0x%x\0A\00"
@str = [10 x i8] c" failed\0A\00"
@str.11 = [11 x i8] c" success\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%7 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%8 = bitcast i32* %5 to i8*
store i32 0, i32* %5
%9 = icmp eq i32 %0, 6
%10 = icmp eq i32 %0, 8
switch i32 %0, label %11 [
i32 8, label %13
i32 6, label %13
]
11: ; preds = %2
%12 = tail call i32 (...) @smi_usage()
br label %102
13: ; preds = %2, %2
%14 = getelementptr inbounds i8*, i8** %1, i64 1
%15 = load i8*, i8** %14
%16 = tail call i64 @strcmp(i8* %15, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %49
18: ; preds = %13
br i1 %9, label %21, label %19
19: ; preds = %18
%20 = tail call i32 (...) @smi_usage()
br label %102
21: ; preds = %18
%22 = getelementptr inbounds i8*, i8** %1, i64 2
%23 = load i8*, i8** %22
%24 = tail call i64 @strcmp(i8* %23, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%25 = icmp eq i64 %24, 0
br i1 %25, label %28, label %26
26: ; preds = %21
%27 = tail call i32 (...) @smi_usage()
br label %102
28: ; preds = %21
%29 = getelementptr inbounds i8*, i8** %1, i64 4
%30 = load i8*, i8** %29
%31 = tail call i64 @strcmp(i8* %30, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%32 = icmp eq i64 %31, 0
br i1 %32, label %35, label %33
33: ; preds = %28
%34 = tail call i32 (...) @smi_usage()
br label %102
35: ; preds = %28
%36 = getelementptr inbounds i8*, i8** %1, i64 3
%37 = load i8*, i8** %36
%38 = call i32 @sscanf(i8* %37, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %3)
%39 = getelementptr inbounds i8*, i8** %1, i64 5
%40 = load i8*, i8** %39
%41 = call i32 @sscanf(i8* %40, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %4)
%42 = load i32, i32* %3
%43 = load i32, i32* %4
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0), i32 %42, i32 %43)
%45 = load i32, i32* %3
%46 = load i32, i32* %4
%47 = call i32 @do_smi_read(i32 %45, i32 %46)
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i32 %47)
br label %102
49: ; preds = %13
%50 = load i8*, i8** %14
%51 = tail call i64 @strcmp(i8* %50, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%52 = icmp eq i64 %51, 0
br i1 %52, label %53, label %100
53: ; preds = %49
br i1 %10, label %56, label %54
54: ; preds = %53
%55 = tail call i32 (...) @smi_usage()
br label %102
56: ; preds = %53
%57 = getelementptr inbounds i8*, i8** %1, i64 2
%58 = load i8*, i8** %57
%59 = tail call i64 @strcmp(i8* %58, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%60 = icmp eq i64 %59, 0
br i1 %60, label %63, label %61
61: ; preds = %56
%62 = tail call i32 (...) @smi_usage()
br label %102
63: ; preds = %56
%64 = getelementptr inbounds i8*, i8** %1, i64 4
%65 = load i8*, i8** %64
%66 = tail call i64 @strcmp(i8* %65, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%67 = icmp eq i64 %66, 0
br i1 %67, label %70, label %68
68: ; preds = %63
%69 = tail call i32 (...) @smi_usage()
br label %102
70: ; preds = %63
%71 = getelementptr inbounds i8*, i8** %1, i64 6
%72 = load i8*, i8** %71
%73 = tail call i64 @strcmp(i8* %72, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%74 = icmp eq i64 %73, 0
br i1 %74, label %77, label %75
75: ; preds = %70
%76 = tail call i32 (...) @smi_usage()
br label %102
77: ; preds = %70
%78 = getelementptr inbounds i8*, i8** %1, i64 3
%79 = load i8*, i8** %78
%80 = call i32 @sscanf(i8* %79, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %3)
%81 = getelementptr inbounds i8*, i8** %1, i64 5
%82 = load i8*, i8** %81
%83 = call i32 @sscanf(i8* %82, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %4)
%84 = getelementptr inbounds i8*, i8** %1, i64 7
%85 = load i8*, i8** %84
%86 = call i32 @sscanf(i8* %85, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %5)
%87 = load i32, i32* %3
%88 = load i32, i32* %4
%89 = load i32, i32* %5
%90 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.8, i64 0, i64 0), i32 %87, i32 %88, i32 %89)
%91 = load i32, i32* %3
%92 = load i32, i32* %4
%93 = load i32, i32* %5
%94 = call i64 @do_smi_write(i32 %91, i32 %92, i32 %93)
%95 = icmp eq i64 %94, 0
br i1 %95, label %96, label %98
96: ; preds = %77
%97 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.11, i64 0, i64 0))
br label %102
98: ; preds = %77
%99 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
br label %102
100: ; preds = %49
%101 = tail call i32 (...) @smi_usage()
br label %102
102: ; preds = %96, %98, %100, %75, %68, %61, %54, %35, %33, %26, %19, %11
ret i32 0
}