#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*/ time_t;

/* Variables and functions */
int bridgedapi_get(char *, char *, char *, int /*<<< orphan*/ *,
                   int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int bridgedapi_ping(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ free(char *);
int getopt(int, char **, char *);
int /*<<< orphan*/ optarg;
char *rindex(char *, char);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
char *strdup(int /*<<< orphan*/);
int /*<<< orphan*/ xdebug_setmaxlevel(int);
int /*<<< orphan*/ xverbose_setmaxlevel(int);
int main(int argc, char **argv) {
  int fstatus = -1;
  char *progname;
  int option;
  char *optstring = "dvhf:pgb:r:";
  char *short_options_desc =
      "\nUsage : %s [-h] [-dv] [-f conffile] [-b batchid] [-r rmid] [-p|g]\n\n";
  char *addon_options_desc =
      "\t-h\t\tshow this message\n\t-d\t\tincrease debug "
      "level\n\t-v\t\tincrease verbose level\n\t-f conffile\tConfiguration "
      "file\n\t-b batchid\tBatch session identifier\n\t-r rmid\t\tResource "
      "manager job identifier\n\t-p\t\tping request (default)\n\t-g\t\tget "
      "request\n\n";
  char *conf_file_string = NULL;
  char *batchid = NULL;
  char *rmid = NULL;
  time_t used, usable, halt;
  int debug_level = 0;
  int verbose_level = 0;
  int action = 1;
  progname = rindex(argv[0], '/');
  if (progname == NULL)
    progname = argv[0];
  else
    progname++;
  while ((option = getopt(argc, argv, optstring)) != -1) {
    switch (option) {
    case 'v':
      verbose_level++;
      break;
    case 'd':
      debug_level++;
      break;
    case 'f':
      conf_file_string = strdup(optarg);
      break;
    case 'b':
      batchid = strdup(optarg);
      if (batchid == NULL) {
        fprintf(stderr, "memory allocation error!");
        return 1;
      }
      break;
    case 'r':
      rmid = strdup(optarg);
      if (rmid == NULL) {
        fprintf(stderr, "memory allocation error!");
        return 1;
      }
      break;
    case 'p':
      action = 1;
      break;
    case 'g':
      action = 2;
      break;
    case 'h':
    default:
      fprintf(stdout, short_options_desc, progname);
      fprintf(stdout, "%s\n", addon_options_desc);
      exit(0);
      break;
    }
  }
  xdebug_setmaxlevel(debug_level);
  xverbose_setmaxlevel(verbose_level);
  switch (action) {
  case 2:
    fstatus =
        bridgedapi_get(conf_file_string, batchid, rmid, &usable, &used, &halt);
    if (fstatus == 0) {
      fprintf(stdout, "used=%ld usable=%ld halt=%ld\n", used, usable, halt);
    } else {
      fprintf(stderr, "unable to process get request\n");
    }
    break;
  case 1:
  default:
    fstatus = bridgedapi_ping(conf_file_string);
    if (fstatus != 0) {
      fprintf(stderr, "unable to process ping request\n");
    }
    break;
  }
  if (batchid != NULL)
    free(batchid);
  if (rmid != NULL)
    free(rmid);
  return fstatus;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
lea    0xe8d(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xe8e(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    0xec8(%rip),%rax
mov    %rax,-0x40(%rbp)
movq   $0x0,-0x48(%rbp)
movq   $0x0,-0x50(%rbp)
movq   $0x0,-0x58(%rbp)
movl   $0x0,-0x68(%rbp)
movl   $0x0,-0x6c(%rbp)
movl   $0x1,-0x70(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    $0x2f,%esi
call   1080 <rindex@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    123e <main+0x9e>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    124a <main+0xaa>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    124f <main+0xaf>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x30(%rbp),%rdx
call   1090 <getopt@plt>
mov    %eax,-0x24(%rbp)
cmp    $0xffffffff,%eax
je     13ad <main+0x20d>
mov    -0x24(%rbp),%eax
add    $0xffffff9e,%eax
mov    %eax,%ecx
mov    %rcx,-0x78(%rbp)
sub    $0x14,%eax
ja     136e <main+0x1ce>
mov    -0x78(%rbp),%rax
lea    0xd75(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
jmp    13a8 <main+0x208>
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    13a8 <main+0x208>
mov    0x2d41(%rip),%rax
mov    (%rax),%edi
call   10c0 <strdup@plt>
mov    %rax,-0x48(%rbp)
jmp    13a8 <main+0x208>
mov    0x2d2a(%rip),%rax
mov    (%rax),%edi
call   10c0 <strdup@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
jne    1307 <main+0x167>
mov    0x2ced(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    14b3 <main+0x313>
jmp    13a8 <main+0x208>
mov    0x2ce5(%rip),%rax
mov    (%rax),%edi
call   10c0 <strdup@plt>
mov    %rax,-0x58(%rbp)
cmpq   $0x0,-0x58(%rbp)
jne    134c <main+0x1ac>
mov    0x2ca8(%rip),%rax
mov    (%rax),%edi
lea    0xe57(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    14b3 <main+0x313>
jmp    13a8 <main+0x208>
movl   $0x1,-0x70(%rbp)
jmp    13a8 <main+0x208>
movl   $0x2,-0x70(%rbp)
jmp    13a8 <main+0x208>
jmp    136e <main+0x1ce>
mov    0x2c5b(%rip),%rax
mov    (%rax),%edi
mov    -0x38(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2c43(%rip),%rax
mov    (%rax),%edi
mov    -0x40(%rbp),%rdx
lea    0xe0f(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
xor    %edi,%edi
call   10b0 <exit@plt>
jmp    124f <main+0xaf>
mov    -0x68(%rbp),%edi
call   1060 <xdebug_setmaxlevel@plt>
mov    -0x6c(%rbp),%edi
call   1070 <xverbose_setmaxlevel@plt>
mov    -0x70(%rbp),%eax
mov    %eax,-0x7c(%rbp)
sub    $0x1,%eax
je     144e <main+0x2ae>
jmp    13d1 <main+0x231>
mov    -0x7c(%rbp),%eax
sub    $0x2,%eax
jne    1453 <main+0x2b3>
jmp    13e2 <main+0x242>
mov    -0x48(%rbp),%rdi
mov    -0x50(%rbp),%rsi
mov    -0x58(%rbp),%rdx
lea    -0x60(%rbp),%rcx
lea    -0x5c(%rbp),%r8
lea    -0x64(%rbp),%r9
call   1040 <bridgedapi_get@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1432 <main+0x292>
mov    0x2bbd(%rip),%rax
mov    (%rax),%edi
mov    -0x5c(%rbp),%edx
mov    -0x60(%rbp),%ecx
mov    -0x64(%rbp),%r8d
lea    0xd87(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    1449 <main+0x2a9>
mov    0x2b9f(%rip),%rax
mov    (%rax),%edi
lea    0xd89(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    1485 <main+0x2e5>
jmp    1453 <main+0x2b3>
mov    -0x48(%rbp),%rdi
call   10a0 <bridgedapi_ping@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1480 <main+0x2e0>
mov    0x2b68(%rip),%rax
mov    (%rax),%edi
lea    0xd71(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    1485 <main+0x2e5>
cmpq   $0x0,-0x50(%rbp)
je     1499 <main+0x2f9>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x58(%rbp)
je     14ad <main+0x30d>
mov    -0x58(%rbp),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
mov    (%rsi),%rdi
mov    $0x2f,%esi
call   1080 <rindex@plt>
test   %rax,%rax
je     11cb <main+0x2b>
add    $0x1,%rax
jmp    11ce <main+0x2e>
mov    (%rbx),%rax
mov    %rax,0x30(%rsp)
mov    $0x1,%r15d
xor    %eax,%eax
mov    %rax,0x10(%rsp)
lea    0xe6d(%rip),%r13
lea    0xe12(%rip),%r14
xor    %r12d,%r12d
xor    %eax,%eax
mov    %rax,0x18(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0xc(%rsp)
nopl   0x0(%rax,%rax,1)
mov    %r15d,%eax
jmp    1225 <main+0x85>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x2,%eax
mov    %eax,%r15d
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r13,%rdx
call   1090 <getopt@plt>
lea    -0x62(%rax),%ecx
cmp    $0x14,%ecx
ja     12b0 <main+0x110>
mov    $0x1,%eax
movslq (%r14,%rcx,4),%rcx
add    %r14,%rcx
jmp    *%rcx
mov    0x2da6(%rip),%rax
mov    (%rax),%edi
call   10c0 <strdup@plt>
mov    %rax,%r12
test   %rax,%rax
jne    1210 <main+0x70>
jmp    139a <main+0x1fa>
addl   $0x1,0x8(%rsp)
jmp    1210 <main+0x70>
mov    0x2d84(%rip),%rax
mov    (%rax),%edi
call   10c0 <strdup@plt>
mov    %rax,0x10(%rsp)
jmp    1210 <main+0x70>
mov    0x2d6f(%rip),%rax
mov    (%rax),%edi
call   10c0 <strdup@plt>
mov    %rax,%rcx
mov    %rax,0x18(%rsp)
test   %rax,%rax
jne    1210 <main+0x70>
jmp    139a <main+0x1fa>
addl   $0x1,0xc(%rsp)
jmp    1210 <main+0x70>
cmp    $0xffffffff,%eax
jne    13b8 <main+0x218>
mov    0x8(%rsp),%edi
call   1060 <xdebug_setmaxlevel@plt>
mov    0xc(%rsp),%edi
call   1070 <xverbose_setmaxlevel@plt>
cmp    $0x2,%r15d
jne    130d <main+0x16d>
lea    0x28(%rsp),%rcx
lea    0x2c(%rsp),%r8
lea    0x24(%rsp),%r9
mov    0x10(%rsp),%rdi
mov    %r12,%rsi
mov    0x18(%rsp),%rbp
mov    %rbp,%rdx
call   1040 <bridgedapi_get@plt>
test   %eax,%eax
je     1340 <main+0x1a0>
mov    %eax,%ebx
mov    0x2cd6(%rip),%rax
mov    (%rax),%edi
lea    0xec0(%rip),%rsi
jmp    1332 <main+0x192>
mov    0x10(%rsp),%rdi
call   10a0 <bridgedapi_ping@plt>
test   %eax,%eax
mov    0x18(%rsp),%rbp
je     136d <main+0x1cd>
mov    %eax,%ebx
mov    0x2caf(%rip),%rax
mov    (%rax),%edi
lea    0xeb8(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
test   %r12,%r12
jne    1374 <main+0x1d4>
jmp    137c <main+0x1dc>
mov    0x2c89(%rip),%rax
mov    (%rax),%edi
mov    0x2c(%rsp),%edx
mov    0x28(%rsp),%ecx
mov    0x24(%rsp),%r8d
lea    0xe50(%rip),%rsi
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <fprintf@plt>
test   %r12,%r12
jne    1374 <main+0x1d4>
jmp    137c <main+0x1dc>
xor    %ebx,%ebx
test   %r12,%r12
je     137c <main+0x1dc>
mov    %r12,%rdi
call   1030 <free@plt>
test   %rbp,%rbp
je     1389 <main+0x1e9>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %ebx,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2c37(%rip),%rax
mov    (%rax),%edi
lea    0xde6(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0x1,%ebx
jmp    1389 <main+0x1e9>
mov    0x2c11(%rip),%rbx
mov    (%rbx),%edi
lea    0xc98(%rip),%rsi
mov    0x30(%rsp),%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    (%rbx),%edi
lea    0xdcc(%rip),%rsi
lea    0xcc1(%rip),%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
xor    %edi,%edi
call   10b0 <exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"dvhf:pgb:r:\00"
@.str.1 = [69 x i8] c"\0AUsage : %s [-h] [-dv] [-f conffile] [-b batchid] [-r rmid] [-p|g]\0A\0A\00"
@.str.2 = [235 x i8] c"\09-h\09\09show this message\0A\09-d\09\09increase debug level\0A\09-v\09\09increase verbose level\0A\09-f conffile\09Configuration file\0A\09-b batchid\09Batch session identifier\0A\09-r rmid\09\09Resource manager job identifier\0A\09-p\09\09ping request (default)\0A\09-g\09\09get request\0A\0A\00"
@optarg = global i32 0
@stderr = global i32 0
@.str.3 = [25 x i8] c"memory allocation error!\00"
@stdout = global i32 0
@.str.4 = [4 x i8] c"%s\0A\00"
@.str.5 = [30 x i8] c"used=%ld usable=%ld halt=%ld\0A\00"
@.str.6 = [31 x i8] c"unable to process get request\0A\00"
@.str.7 = [32 x i8] c"unable to process ping request\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 -1, i32* %6
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %9
store i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.1, i64 0, i64 0), i8** %10
store i8* getelementptr inbounds ([235 x i8], [235 x i8]* @.str.2, i64 0, i64 0), i8** %11
store i8* null, i8** %12
store i8* null, i8** %13
store i8* null, i8** %14
store i32 0, i32* %18
store i32 0, i32* %19
store i32 1, i32* %20
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 0
%23 = load i8*, i8** %22
%24 = call i8* @rindex(i8* %23, i8 signext 47)
store i8* %24, i8** %7
%25 = load i8*, i8** %7
%26 = icmp eq i8* %25, null
br i1 %26, label %27, label %31
27: ; preds = %2
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 0
%30 = load i8*, i8** %29
store i8* %30, i8** %7
br label %34
31: ; preds = %2
%32 = load i8*, i8** %7
%33 = getelementptr inbounds i8, i8* %32, i32 1
store i8* %33, i8** %7
br label %34
34: ; preds = %31, %27
br label %35
35: ; preds = %82, %34
%36 = load i32, i32* %4
%37 = load i8**, i8*** %5
%38 = load i8*, i8** %9
%39 = call i32 @getopt(i32 %36, i8** %37, i8* %38)
store i32 %39, i32* %8
%40 = icmp ne i32 %39, -1
br i1 %40, label %41, label %83
41: ; preds = %35
%42 = load i32, i32* %8
switch i32 %42, label %73 [
i32 118, label %43
i32 100, label %46
i32 102, label %49
i32 98, label %52
i32 114, label %61
i32 112, label %70
i32 103, label %71
i32 104, label %72
]
43: ; preds = %41
%44 = load i32, i32* %19
%45 = add nsw i32 %44, 1
store i32 %45, i32* %19
br label %82
46: ; preds = %41
%47 = load i32, i32* %18
%48 = add nsw i32 %47, 1
store i32 %48, i32* %18
br label %82
49: ; preds = %41
%50 = load i32, i32* @optarg
%51 = call i8* @strdup(i32 %50)
store i8* %51, i8** %12
br label %82
52: ; preds = %41
%53 = load i32, i32* @optarg
%54 = call i8* @strdup(i32 %53)
store i8* %54, i8** %13
%55 = load i8*, i8** %13
%56 = icmp eq i8* %55, null
br i1 %56, label %57, label %60
57: ; preds = %52
%58 = load i32, i32* @stderr
%59 = call i32 (i32, i8*, ...) @fprintf(i32 %58, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %3
br label %130
60: ; preds = %52
br label %82
61: ; preds = %41
%62 = load i32, i32* @optarg
%63 = call i8* @strdup(i32 %62)
store i8* %63, i8** %14
%64 = load i8*, i8** %14
%65 = icmp eq i8* %64, null
br i1 %65, label %66, label %69
66: ; preds = %61
%67 = load i32, i32* @stderr
%68 = call i32 (i32, i8*, ...) @fprintf(i32 %67, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %3
br label %130
69: ; preds = %61
br label %82
70: ; preds = %41
store i32 1, i32* %20
br label %82
71: ; preds = %41
store i32 2, i32* %20
br label %82
72: ; preds = %41
br label %73
73: ; preds = %41, %72
%74 = load i32, i32* @stdout
%75 = load i8*, i8** %10
%76 = load i8*, i8** %7
%77 = call i32 (i32, i8*, ...) @fprintf(i32 %74, i8* %75, i8* %76)
%78 = load i32, i32* @stdout
%79 = load i8*, i8** %11
%80 = call i32 (i32, i8*, ...) @fprintf(i32 %78, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %79)
%81 = call i32 @exit(i32 0)
unreachable
82: ; preds = %71, %70, %69, %60, %49, %46, %43
br label %35
83: ; preds = %35
%84 = load i32, i32* %18
%85 = call i32 @xdebug_setmaxlevel(i32 %84)
%86 = load i32, i32* %19
%87 = call i32 @xverbose_setmaxlevel(i32 %86)
%88 = load i32, i32* %20
switch i32 %88, label %107 [
i32 2, label %89
i32 1, label %106
]
89: ; preds = %83
%90 = load i8*, i8** %12
%91 = load i8*, i8** %13
%92 = load i8*, i8** %14
%93 = call i32 @bridgedapi_get(i8* %90, i8* %91, i8* %92, i32* %16, i32* %15, i32* %17)
store i32 %93, i32* %6
%94 = load i32, i32* %6
%95 = icmp eq i32 %94, 0
br i1 %95, label %96, label %102
96: ; preds = %89
%97 = load i32, i32* @stdout
%98 = load i32, i32* %15
%99 = load i32, i32* %16
%100 = load i32, i32* %17
%101 = call i32 (i32, i8*, ...) @fprintf(i32 %97, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i32 %98, i32 %99, i32 %100)
br label %105
102: ; preds = %89
%103 = load i32, i32* @stderr
%104 = call i32 (i32, i8*, ...) @fprintf(i32 %103, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0))
br label %105
105: ; preds = %102, %96
br label %116
106: ; preds = %83
br label %107
107: ; preds = %83, %106
%108 = load i8*, i8** %12
%109 = call i32 @bridgedapi_ping(i8* %108)
store i32 %109, i32* %6
%110 = load i32, i32* %6
%111 = icmp ne i32 %110, 0
br i1 %111, label %112, label %115
112: ; preds = %107
%113 = load i32, i32* @stderr
%114 = call i32 (i32, i8*, ...) @fprintf(i32 %113, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.7, i64 0, i64 0))
br label %115
115: ; preds = %112, %107
br label %116
116: ; preds = %115, %105
%117 = load i8*, i8** %13
%118 = icmp ne i8* %117, null
br i1 %118, label %119, label %122
119: ; preds = %116
%120 = load i8*, i8** %13
%121 = call i32 @free(i8* %120)
br label %122
122: ; preds = %119, %116
%123 = load i8*, i8** %14
%124 = icmp ne i8* %123, null
br i1 %124, label %125, label %128
125: ; preds = %122
%126 = load i8*, i8** %14
%127 = call i32 @free(i8* %126)
br label %128
128: ; preds = %125, %122
%129 = load i32, i32* %6
store i32 %129, i32* %3
br label %130
130: ; preds = %128, %66, %57
%131 = load i32, i32* %3
ret i32 %131
}

LLVM IR (-O2):
@.str = [12 x i8] c"dvhf:pgb:r:\00"
@.str.1 = [69 x i8] c"\0AUsage : %s [-h] [-dv] [-f conffile] [-b batchid] [-r rmid] [-p|g]\0A\0A\00"
@.str.2 = [235 x i8] c"\09-h\09\09show this message\0A\09-d\09\09increase debug level\0A\09-v\09\09increase verbose level\0A\09-f conffile\09Configuration file\0A\09-b batchid\09Batch session identifier\0A\09-r rmid\09\09Resource manager job identifier\0A\09-p\09\09ping request (default)\0A\09-g\09\09get request\0A\0A\00"
@optarg = global i32 0
@stderr = global i32 0
@.str.3 = [25 x i8] c"memory allocation error!\00"
@stdout = global i32 0
@.str.4 = [4 x i8] c"%s\0A\00"
@.str.5 = [30 x i8] c"used=%ld usable=%ld halt=%ld\0A\00"
@.str.6 = [31 x i8] c"unable to process get request\0A\00"
@.str.7 = [32 x i8] c"unable to process ping request\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = bitcast i32* %5 to i8*
%9 = load i8*, i8** %1
%10 = tail call i8* @rindex(i8* %9, i8 signext 47)
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = load i8*, i8** %1
br label %16
14: ; preds = %2
%15 = getelementptr inbounds i8, i8* %10, i64 1
br label %16
16: ; preds = %14, %12
%17 = phi i8* [ %13, %12 ], [ %15, %14 ]
br label %18
18: ; preds = %52, %16
%19 = phi i8* [ %54, %52 ], [ null, %16 ]
%20 = phi i8* [ %26, %52 ], [ null, %16 ]
%21 = phi i8* [ %32, %52 ], [ null, %16 ]
%22 = phi i32 [ %37, %52 ], [ 0, %16 ]
%23 = phi i32 [ %41, %52 ], [ 0, %16 ]
%24 = phi i32 [ %44, %52 ], [ 1, %16 ]
br label %25
25: ; preds = %18, %55
%26 = phi i8* [ %20, %18 ], [ %57, %55 ]
%27 = phi i8* [ %21, %18 ], [ %32, %55 ]
%28 = phi i32 [ %22, %18 ], [ %37, %55 ]
%29 = phi i32 [ %23, %18 ], [ %41, %55 ]
%30 = phi i32 [ %24, %18 ], [ %44, %55 ]
br label %31
31: ; preds = %25, %62
%32 = phi i8* [ %27, %25 ], [ %64, %62 ]
%33 = phi i32 [ %28, %25 ], [ %37, %62 ]
%34 = phi i32 [ %29, %25 ], [ %41, %62 ]
%35 = phi i32 [ %30, %25 ], [ %44, %62 ]
br label %36
36: ; preds = %31, %50
%37 = phi i32 [ %33, %31 ], [ %51, %50 ]
%38 = phi i32 [ %34, %31 ], [ %41, %50 ]
%39 = phi i32 [ %35, %31 ], [ %44, %50 ]
br label %40
40: ; preds = %36, %48
%41 = phi i32 [ %38, %36 ], [ %49, %48 ]
%42 = phi i32 [ %39, %36 ], [ %44, %48 ]
br label %43
43: ; preds = %46, %40
%44 = phi i32 [ %42, %40 ], [ %47, %46 ]
%45 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
switch i32 %45, label %70 [
i32 -1, label %76
i32 118, label %48
i32 100, label %50
i32 102, label %52
i32 98, label %55
i32 114, label %62
i32 112, label %46
i32 103, label %69
]
46: ; preds = %43, %69
%47 = phi i32 [ 2, %69 ], [ 1, %43 ]
br label %43
48: ; preds = %43
%49 = add nsw i32 %41, 1
br label %40
50: ; preds = %43
%51 = add nsw i32 %37, 1
br label %36
52: ; preds = %43
%53 = load i32, i32* @optarg
%54 = tail call i8* @strdup(i32 %53)
br label %18
55: ; preds = %43
%56 = load i32, i32* @optarg
%57 = tail call i8* @strdup(i32 %56)
%58 = icmp eq i8* %57, null
br i1 %58, label %59, label %25
59: ; preds = %55
%60 = load i32, i32* @stderr
%61 = tail call i32 (i32, i8*, ...) @fprintf(i32 %60, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
br label %107
62: ; preds = %43
%63 = load i32, i32* @optarg
%64 = tail call i8* @strdup(i32 %63)
%65 = icmp eq i8* %64, null
br i1 %65, label %66, label %31
66: ; preds = %62
%67 = load i32, i32* @stderr
%68 = tail call i32 (i32, i8*, ...) @fprintf(i32 %67, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
br label %107
69: ; preds = %43
br label %46
70: ; preds = %43
%71 = load i32, i32* @stdout
%72 = tail call i32 (i32, i8*, ...) @fprintf(i32 %71, i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.1, i64 0, i64 0), i8* %17)
%73 = load i32, i32* @stdout
%74 = tail call i32 (i32, i8*, ...) @fprintf(i32 %73, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([235 x i8], [235 x i8]* @.str.2, i64 0, i64 0))
%75 = tail call i32 @exit(i32 0)
unreachable
76: ; preds = %43
%77 = tail call i32 @xdebug_setmaxlevel(i32 %37)
%78 = tail call i32 @xverbose_setmaxlevel(i32 %41)
%79 = icmp eq i32 %44, 2
br i1 %79, label %80, label %92
80: ; preds = %76
%81 = call i32 @bridgedapi_get(i8* %19, i8* %26, i8* %32, i32* %4, i32* %3, i32* %5)
%82 = icmp eq i32 %81, 0
br i1 %82, label %83, label %89
83: ; preds = %80
%84 = load i32, i32* @stdout
%85 = load i32, i32* %3
%86 = load i32, i32* %4
%87 = load i32, i32* %5
%88 = call i32 (i32, i8*, ...) @fprintf(i32 %84, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i32 %85, i32 %86, i32 %87)
br label %98
89: ; preds = %80
%90 = load i32, i32* @stderr
%91 = call i32 (i32, i8*, ...) @fprintf(i32 %90, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0))
br label %98
92: ; preds = %76
%93 = tail call i32 @bridgedapi_ping(i8* %19)
%94 = icmp eq i32 %93, 0
br i1 %94, label %98, label %95
95: ; preds = %92
%96 = load i32, i32* @stderr
%97 = tail call i32 (i32, i8*, ...) @fprintf(i32 %96, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.7, i64 0, i64 0))
br label %98
98: ; preds = %92, %95, %83, %89
%99 = phi i32 [ 0, %83 ], [ %81, %89 ], [ %93, %95 ], [ 0, %92 ]
%100 = icmp eq i8* %26, null
br i1 %100, label %103, label %101
101: ; preds = %98
%102 = call i32 @free(i8* %26)
br label %103
103: ; preds = %101, %98
%104 = icmp eq i8* %32, null
br i1 %104, label %107, label %105
105: ; preds = %103
%106 = call i32 @free(i8* %32)
br label %107
107: ; preds = %103, %105, %66, %59
%108 = phi i32 [ 1, %66 ], [ 1, %59 ], [ %99, %105 ], [ %99, %103 ]
ret i32 %108
}