int main(int argc, char *argv[]) {
  if (argc != 1)
    usage();
  if (usbrelay_init() != 0) {
    printf("%s\n", usbrelay_strerror());
    return 1;
  }
  printf("%i\n", usbrelay_count());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     1177 <main+0x27>
mov    $0x0,%al
call   1050 <usage@plt>
mov    $0x0,%al
call   1070 <usbrelay_init@plt>
cmp    $0x0,%eax
je     11aa <main+0x5a>
mov    $0x0,%al
call   1040 <usbrelay_strerror@plt>
mov    %eax,%esi
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11c8 <main+0x78>
mov    $0x0,%al
call   1060 <usbrelay_count@plt>
mov    %eax,%esi
lea    0xe4a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x1,%edi
je     115d <main+0xd>
xor    %eax,%eax
call   1050 <usage@plt>
xor    %ebx,%ebx
xor    %eax,%eax
call   1070 <usbrelay_init@plt>
test   %eax,%eax
je     1188 <main+0x38>
xor    %eax,%eax
call   1040 <usbrelay_strerror@plt>
lea    0xe88(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%ebx
jmp    119f <main+0x4f>
xor    %eax,%eax
call   1060 <usbrelay_count@plt>
lea    0xe6e(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [4 x i8] c"%i\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @usage()
br label %10
10: ; preds = %8, %2
%11 = call i32 (...) @usbrelay_init()
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = call i32 (...) @usbrelay_strerror()
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
store i32 1, i32* %3
br label %19
16: ; preds = %10
%17 = call i32 (...) @usbrelay_count()
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %17)
store i32 0, i32* %3
br label %19
19: ; preds = %16, %13
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [4 x i8] c"%i\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (...) @usage()
br label %6
6: ; preds = %4, %2
%7 = tail call i32 (...) @usbrelay_init()
%8 = icmp eq i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %6
%10 = tail call i32 (...) @usbrelay_strerror()
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %15
12: ; preds = %6
%13 = tail call i32 (...) @usbrelay_count()
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %12, %9
%16 = phi i32 [ 1, %9 ], [ 0, %12 ]
ret i32 %16
}