#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 const *);
int /*<<< orphan*/ stderr;
void print_usage_message(const char *program_name, const char **text) {
  unsigned i = 0;
  fprintf(stderr, "Usage:  %s  <options> <object file>\n", program_name);
  for (i = 0; *text[i]; ++i) {
    fprintf(stderr, "%s\n", text[i]);
  }
}


x86 assembly (clang, -O0):
<print_usage_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    (%rax,%rcx,8),%rax
cmpb   $0x0,(%rax)
je     1189 <print_usage_message+0x79>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    (%rax,%rcx,8),%rdx
lea    0xeaf(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1147 <print_usage_message+0x37>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage_message>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%rdx
mov    0x2ebc(%rip),%r15
mov    (%r15),%edi
lea    0xed2(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%rdx
cmpb   $0x0,(%rdx)
je     1169 <print_usage_message+0x59>
mov    $0x1,%ebp
lea    0xede(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    (%r15),%edi
mov    %r14,%rsi
call   1030 <fprintf@plt>
mov    %ebp,%eax
mov    (%rbx,%rax,8),%rdx
add    $0x1,%ebp
cmpb   $0x0,(%rdx)
jne    1150 <print_usage_message+0x40>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"Usage: %s <options> <object file>\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @print_usage_message(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
%5 = alloca i32
store i8* %0, i8** %3
store i8** %1, i8*** %4
store i32 0, i32* %5
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %3
%8 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %7)
store i32 0, i32* %5
br label %9
9: ; preds = %25, %2
%10 = load i8**, i8*** %4
%11 = load i32, i32* %5
%12 = zext i32 %11 to i64
%13 = getelementptr inbounds i8*, i8** %10, i64 %12
%14 = load i8*, i8** %13
%15 = load i8, i8* %14
%16 = icmp ne i8 %15, 0
br i1 %16, label %17, label %28
17: ; preds = %9
%18 = load i32, i32* @stderr
%19 = load i8**, i8*** %4
%20 = load i32, i32* %5
%21 = zext i32 %20 to i64
%22 = getelementptr inbounds i8*, i8** %19, i64 %21
%23 = load i8*, i8** %22
%24 = call i32 @fprintf(i32 %18, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %23)
br label %25
25: ; preds = %17
%26 = load i32, i32* %5
%27 = add i32 %26, 1
store i32 %27, i32* %5
br label %9
28: ; preds = %9
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"Usage: %s <options> <object file>\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @print_usage_message(i8* %0, i8** nocapture %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = load i8*, i8** %1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %19, label %8
8: ; preds = %2, %8
%9 = phi i8* [ %16, %8 ], [ %5, %2 ]
%10 = phi i32 [ %13, %8 ], [ 0, %2 ]
%11 = load i32, i32* @stderr
%12 = tail call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%13 = add i32 %10, 1
%14 = zext i32 %13 to i64
%15 = getelementptr inbounds i8*, i8** %1, i64 %14
%16 = load i8*, i8** %15
%17 = load i8, i8* %16
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %8
19: ; preds = %8, %2
ret void
}