#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 */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ m5_fail(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ parse_int_args(int, char **, int /*<<< orphan*/ *, int);
int /*<<< orphan*/ usage();
void do_fail(int argc, char *argv[]) {
  if (argc < 1 || argc > 2)
    usage();
  uint64_t ints[2] = {0, 0};
  parse_int_args(argc, argv, ints, argc);
  m5_fail(ints[1], ints[0]);
}


x86 assembly (clang, -O0):
<do_fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
jl     1163 <do_fail+0x23>
cmpl   $0x2,-0x4(%rbp)
jle    116a <do_fail+0x2a>
mov    $0x0,%al
call   1050 <usage@plt>
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
mov    -0x4(%rbp),%ecx
call   1060 <parse_int_args@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1030 <m5_fail@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_fail>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebx
lea    -0x3(%rbx),%eax
cmp    $0xfffffffd,%eax
ja     1148 <do_fail+0x18>
xor    %eax,%eax
call   1040 <usage@plt>
movq   $0x0,(%rsp)
mov    %rsp,%rdx
mov    %ebx,%edi
mov    %r14,%rsi
mov    %ebx,%ecx
call   1050 <parse_int_args@plt>
mov    (%rsp),%esi
mov    0x4(%rsp),%edi
call   1030 <m5_fail@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @do_fail(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [2 x i32]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 1
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i32, i32* %3
%10 = icmp sgt i32 %9, 2
br i1 %10, label %11, label %13
11: ; preds = %8, %2
%12 = call i32 (...) @usage()
br label %13
13: ; preds = %11, %8
%14 = bitcast [2 x i32]* %5 to i8*
%15 = load i32, i32* %3
%16 = load i8**, i8*** %4
%17 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%18 = load i32, i32* %3
%19 = call i32 @parse_int_args(i32 %15, i8** %16, i32* %17, i32 %18)
%20 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
%21 = load i32, i32* %20
%22 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%23 = load i32, i32* %22
%24 = call i32 @m5_fail(i32 %21, i32 %23)
ret void
}

LLVM IR (-O2):
define void @do_fail(i32 %0, i8** %1) {
%3 = alloca i64
%4 = add i32 %0, -3
%5 = icmp ult i32 %4, -2
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 (...) @usage()
br label %8
8: ; preds = %2, %6
%9 = bitcast i64* %3 to [2 x i32]*
%10 = bitcast i64* %3 to i8*
store i64 0, i64* %3
%11 = bitcast i64* %3 to i32*
%12 = call i32 @parse_int_args(i32 %0, i8** %1, i32* %11, i32 %0)
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 1
%14 = load i32, i32* %13
%15 = load i32, i32* %11
%16 = call i32 @m5_fail(i32 %14, i32 %15)
ret void
}