#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*/ mvEthRxCoalSet(unsigned int);
int /*<<< orphan*/ mvEthTxCoalSet(unsigned int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sscanf(char *, char *, unsigned int *);
int main(int argc, char **argv) {
  unsigned int direct, usec;
  if (argc == 3) {
    sscanf(argv[1], "%x", &direct);
    sscanf(argv[2], "%x", &usec);
  } else {
    printf("Usage: mv_set_coal <direction 0-Rx 1-Tx> <coal in micro sec>\n");
    return 0;
  }
  if (direct == 0)
    mvEthRxCoalSet(usec);
  else
    mvEthTxCoalSet(usec);
  return 1;
}


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)
cmpl   $0x3,-0x8(%rbp)
jne    1195 <main+0x55>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe91(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1060 <sscanf@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe79(%rip),%rsi
lea    -0x18(%rbp),%rdx
call   1060 <sscanf@plt>
jmp    11ad <main+0x6d>
lea    0xe67(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    11d3 <main+0x93>
cmpl   $0x0,-0x14(%rbp)
jne    11c4 <main+0x84>
mov    -0x18(%rbp),%edi
call   1050 <mvEthRxCoalSet@plt>
jmp    11cc <main+0x8c>
mov    -0x18(%rbp),%edi
call   1030 <mvEthTxCoalSet@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
cmp    $0x3,%edi
jne    1184 <main+0x44>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
lea    0xea9(%rip),%r14
lea    0x4(%rsp),%rdx
mov    %r14,%rsi
call   1060 <sscanf@plt>
mov    0x10(%rbx),%rdi
mov    %rsp,%rdx
mov    %r14,%rsi
call   1060 <sscanf@plt>
cmpl   $0x0,0x4(%rsp)
mov    (%rsp),%edi
je     1194 <main+0x54>
call   1040 <mvEthTxCoalSet@plt>
jmp    1199 <main+0x59>
lea    0xe78(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
jmp    119e <main+0x5e>
call   1050 <mvEthRxCoalSet@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%x\00"
@.str.1 = [62 x i8] c"Usage: mv_set_coal <direction 0-Rx 1-Tx> <coal in micro sec>\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 3
br i1 %9, label %10, label %19
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @sscanf(i8* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 2
%17 = load i8*, i8** %16
%18 = call i32 @sscanf(i8* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %7)
br label %21
19: ; preds = %2
%20 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %3
br label %31
21: ; preds = %10
%22 = load i32, i32* %6
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %27
24: ; preds = %21
%25 = load i32, i32* %7
%26 = call i32 @mvEthRxCoalSet(i32 %25)
br label %30
27: ; preds = %21
%28 = load i32, i32* %7
%29 = call i32 @mvEthTxCoalSet(i32 %28)
br label %30
30: ; preds = %27, %24
store i32 1, i32* %3
br label %31
31: ; preds = %30, %19
%32 = load i32, i32* %3
ret i32 %32
}

LLVM IR (-O2):
@.str = [3 x i8] c"%x\00"
@str = [61 x i8] c"Usage: mv_set_coal <direction 0-Rx 1-Tx> <coal in micro sec>\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = icmp eq i32 %0, 3
br i1 %7, label %8, label %18
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = call i32 @sscanf(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%12 = getelementptr inbounds i8*, i8** %1, i64 2
%13 = load i8*, i8** %12
%14 = call i32 @sscanf(i8* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%15 = load i32, i32* %3
%16 = icmp eq i32 %15, 0
%17 = load i32, i32* %4
br i1 %16, label %20, label %22
18: ; preds = %2
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str, i64 0, i64 0))
br label %24
20: ; preds = %8
%21 = call i32 @mvEthRxCoalSet(i32 %17)
br label %24
22: ; preds = %8
%23 = call i32 @mvEthTxCoalSet(i32 %17)
br label %24
24: ; preds = %20, %22, %18
%25 = phi i32 [ 0, %18 ], [ 1, %22 ], [ 1, %20 ]
ret i32 %25
}