#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*/ Usage(char *);
int strtol(char *, int /*<<< orphan*/ *, int);
void Get_args(int argc, char *argv[], int *thread_count_p, int *m_p, int *n_p) {
  if (argc != 4)
    Usage(argv[0]);
  *thread_count_p = strtol(argv[1], NULL, 10);
  *m_p = strtol(argv[2], NULL, 10);
  *n_p = strtol(argv[3], NULL, 10);
  if (*thread_count_p <= 0 || *m_p <= 0 || *n_p <= 0)
    Usage(argv[0]);
}


x86 assembly (clang, -O0):
<Get_args>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
cmpl   $0x4,-0x4(%rbp)
je     1151 <Get_args+0x31>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <Usage@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
cmpl   $0x0,(%rax)
jle    11d2 <Get_args+0xb2>
mov    -0x20(%rbp),%rax
cmpl   $0x0,(%rax)
jle    11d2 <Get_args+0xb2>
mov    -0x28(%rbp),%rax
cmpl   $0x0,(%rax)
jg     11de <Get_args+0xbe>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <Usage@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Get_args>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %r8,%r15
mov    %rcx,%r14
mov    %rdx,%r12
mov    %rsi,%rbx
cmp    $0x4,%edi
je     1141 <Get_args+0x21>
mov    (%rbx),%rdi
call   1030 <Usage@plt>
mov    0x8(%rbx),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %eax,(%r12)
mov    0x10(%rbx),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %eax,(%r14)
mov    0x18(%rbx),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %eax,(%r15)
cmpl   $0x0,(%r12)
jle    1198 <Get_args+0x78>
cmpl   $0x0,(%r14)
jle    1198 <Get_args+0x78>
test   %eax,%eax
jle    1198 <Get_args+0x78>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
mov    (%rbx),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <Usage@plt>

LLVM IR (-O0):
define void @Get_args(i32 %0, i8** %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
store i32 %0, i32* %6
store i8** %1, i8*** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%11 = load i32, i32* %6
%12 = icmp ne i32 %11, 4
br i1 %12, label %13, label %18
13: ; preds = %5
%14 = load i8**, i8*** %7
%15 = getelementptr inbounds i8*, i8** %14, i64 0
%16 = load i8*, i8** %15
%17 = call i32 @Usage(i8* %16)
br label %18
18: ; preds = %13, %5
%19 = load i8**, i8*** %7
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
%22 = call i32 @strtol(i8* %21, i32* null, i32 10)
%23 = load i32*, i32** %8
store i32 %22, i32* %23
%24 = load i8**, i8*** %7
%25 = getelementptr inbounds i8*, i8** %24, i64 2
%26 = load i8*, i8** %25
%27 = call i32 @strtol(i8* %26, i32* null, i32 10)
%28 = load i32*, i32** %9
store i32 %27, i32* %28
%29 = load i8**, i8*** %7
%30 = getelementptr inbounds i8*, i8** %29, i64 3
%31 = load i8*, i8** %30
%32 = call i32 @strtol(i8* %31, i32* null, i32 10)
%33 = load i32*, i32** %10
store i32 %32, i32* %33
%34 = load i32*, i32** %8
%35 = load i32, i32* %34
%36 = icmp sle i32 %35, 0
br i1 %36, label %45, label %37
37: ; preds = %18
%38 = load i32*, i32** %9
%39 = load i32, i32* %38
%40 = icmp sle i32 %39, 0
br i1 %40, label %45, label %41
41: ; preds = %37
%42 = load i32*, i32** %10
%43 = load i32, i32* %42
%44 = icmp sle i32 %43, 0
br i1 %44, label %45, label %50
45: ; preds = %41, %37, %18
%46 = load i8**, i8*** %7
%47 = getelementptr inbounds i8*, i8** %46, i64 0
%48 = load i8*, i8** %47
%49 = call i32 @Usage(i8* %48)
br label %50
50: ; preds = %45, %41
ret void
}

LLVM IR (-O2):
define void @Get_args(i32 %0, i8** nocapture %1, i32* nocapture %2, i32* nocapture %3, i32* nocapture writeonly %4) {
%6 = icmp eq i32 %0, 4
br i1 %6, label %10, label %7
7: ; preds = %5
%8 = load i8*, i8** %1
%9 = tail call i32 @Usage(i8* %8)
br label %10
10: ; preds = %7, %5
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = tail call i32 @strtol(i8* nocapture %12, i32* null, i32 10)
store i32 %13, i32* %2
%14 = getelementptr inbounds i8*, i8** %1, i64 2
%15 = load i8*, i8** %14
%16 = tail call i32 @strtol(i8* nocapture %15, i32* null, i32 10)
store i32 %16, i32* %3
%17 = getelementptr inbounds i8*, i8** %1, i64 3
%18 = load i8*, i8** %17
%19 = tail call i32 @strtol(i8* nocapture %18, i32* null, i32 10)
store i32 %19, i32* %4
%20 = load i32, i32* %2
%21 = icmp slt i32 %20, 1
br i1 %21, label %27, label %22
22: ; preds = %10
%23 = load i32, i32* %3
%24 = icmp slt i32 %23, 1
%25 = icmp slt i32 %19, 1
%26 = select i1 %24, i1 true, i1 %25
br i1 %26, label %27, label %30
27: ; preds = %22, %10
%28 = load i8*, i8** %1
%29 = tail call i32 @Usage(i8* %28)
br label %30
30: ; preds = %22, %27
ret void
}