#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 *, char *, char *);
int /*<<< orphan*/ stderr;
int usage(char *progname, char *err) {
  fprintf(stderr, "Usage: %s progname [arg0name [args]]\n%s%s", progname,
          err ? err : "", err ? "\n" : "");
  return 1;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114c <usage+0x3c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    115c <usage+0x4c>
lea    0xed8(%rip),%rax
mov    %rax,-0x28(%rbp)
jmp    115c <usage+0x4c>
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%edi
mov    -0x28(%rbp),%rcx
mov    -0x10(%rbp),%rsi
lea    0xeb9(%rip),%r8
lea    0xeb1(%rip),%rax
cmp    $0x0,%rsi
cmovne %rax,%r8
lea    0xe78(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2ec2(%rip),%rax
test   %rsi,%rsi
lea    0xf03(%rip),%rsi
cmove  %rsi,%rcx
mov    (%rax),%edi
lea    0xef5(%rip),%r8
cmove  %rsi,%r8
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [42 x i8] c"Usage: %s progname [arg0name [args]]\0A%s%s\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [2 x i8] c"\0A\00"
define i32 @usage(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i8*, i8** %4
br label %12
11: ; preds = %2
br label %12
12: ; preds = %11, %9
%13 = phi i8* [ %10, %9 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %11 ]
%14 = load i8*, i8** %4
%15 = icmp ne i8* %14, null
%16 = zext i1 %15 to i64
%17 = select i1 %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0)
%18 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %13, i8* %17)
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [42 x i8] c"Usage: %s progname [arg0name [args]]\0A%s%s\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [2 x i8] c"\0A\00"
define i32 @usage(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = icmp eq i8* %1, null
%5 = select i1 %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* %1
%6 = select i1 %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0)
%7 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %5, i8* %6)
ret i32 1
}