#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*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ parse_bytes(char *, unsigned long *);
int /*<<< orphan*/ print_usage(char **);
int /*<<< orphan*/ rw_loop(unsigned long);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  unsigned long rate;
  if (argc != 2) {
    print_usage(argv);
    return 1;
  }
  if (!parse_bytes(argv[1], &rate)) {
    fprintf(stderr, "%s: error parsing rate\n", argv[0]);
    print_usage(argv);
    return 1;
  }
  rw_loop(rate);
  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)
cmpl   $0x2,-0x8(%rbp)
je     1175 <main+0x35>
mov    -0x10(%rbp),%rdi
call   1060 <print_usage@plt>
movl   $0x1,-0x4(%rbp)
jmp    11d0 <main+0x90>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <parse_bytes@plt>
cmp    $0x0,%eax
jne    11c0 <main+0x80>
mov    0x2e4a(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe5a(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1060 <print_usage@plt>
movl   $0x1,-0x4(%rbp)
jmp    11d0 <main+0x90>
mov    -0x18(%rbp),%rdi
call   1040 <rw_loop@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
cmp    $0x2,%edi
jne    1185 <main+0x45>
mov    0x8(%rbx),%rdi
lea    0x8(%rsp),%rsi
call   1030 <parse_bytes@plt>
test   %eax,%eax
je     116d <main+0x2d>
mov    0x8(%rsp),%rdi
call   1040 <rw_loop@plt>
xor    %eax,%eax
jmp    1192 <main+0x52>
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xe80(%rip),%rsi
call   1050 <fprintf@plt>
mov    %rbx,%rdi
call   1060 <print_usage@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"%s: error parsing rate\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 2
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = call i32 @print_usage(i8** %10)
store i32 1, i32* %3
br label %29
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i32 @parse_bytes(i8* %15, i64* %6)
%17 = icmp ne i32 %16, 0
br i1 %17, label %26, label %18
18: ; preds = %12
%19 = load i32, i32* @stderr
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 0
%22 = load i8*, i8** %21
%23 = call i32 @fprintf(i32 %19, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %22)
%24 = load i8**, i8*** %5
%25 = call i32 @print_usage(i8** %24)
store i32 1, i32* %3
br label %29
26: ; preds = %12
%27 = load i64, i64* %6
%28 = call i32 @rw_loop(i64 %27)
store i32 0, i32* %3
br label %29
29: ; preds = %26, %18, %9
%30 = load i32, i32* %3
ret i32 %30
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"%s: error parsing rate\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = icmp eq i32 %0, 2
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @print_usage(i8** %1)
br label %21
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = call i32 @parse_bytes(i8* %10, i64* %3)
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %8
%14 = load i32, i32* @stderr
%15 = load i8*, i8** %1
%16 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = call i32 @print_usage(i8** %1)
br label %21
18: ; preds = %8
%19 = load i64, i64* %3
%20 = call i32 @rw_loop(i64 %19)
br label %21
21: ; preds = %18, %13, %6
%22 = phi i32 [ 1, %6 ], [ 0, %18 ], [ 1, %13 ]
ret i32 %22
}