#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 */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int x_org;
  int width;
  int height;
  scalar_t__ y_org;
};
typedef TYPE_1__ xXineramaScreenInfo;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int DefaultScreen(int /*<<< orphan*/ *);
int /*<<< orphan*/ EXIT_FAILURE;
int EXIT_SUCCESS;
scalar_t__ VMwareCtrl_QueryVersion(int /*<<< orphan*/ *, int *, int *);
scalar_t__ VMwareCtrl_SetRes(int /*<<< orphan*/ *, int, int, int);
scalar_t__ VMwareCtrl_SetTopology(int /*<<< orphan*/ *, int, TYPE_1__ *, int);
int /*<<< orphan*/ *XOpenDisplay(char *);
int atoi(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ strcmp(char *, char *);
int main(int argc, char **argv) {
  Display *dpy;
  char *displayName = NULL;
  int screen;
  int major, minor;
  dpy = XOpenDisplay(displayName);
  if (!dpy) {
    printf("Could not open default X Display\n");
    exit(EXIT_FAILURE);
  }
  screen = DefaultScreen(dpy);
  if (VMwareCtrl_QueryVersion(dpy, &major, &minor)) {
    printf("Got Extension version %d.%d\n", major, minor);
  } else {
    printf("VMWARE_CTRL Extension not found.\n");
    exit(EXIT_FAILURE);
  }
  if (argc >= 2) {
    if (strcmp(argv[1], "setres") == 0) {
      int x, y;
      if (argc < 4) {
        printf("Setres needs x and y too\n");
        exit(EXIT_FAILURE);
      }
      x = atoi(argv[2]);
      y = atoi(argv[3]);
      if (VMwareCtrl_SetRes(dpy, screen, x, y)) {
        printf("Set Res was successful\n");
      } else {
        printf("Set Res failed\n");
      }
    } else if (strcmp(argv[1], "settopology") == 0) {
      xXineramaScreenInfo extents[2];
      if (major == 0 && minor < 2) {
        printf("VMWARE_CTRL version >= 0.2 is required\n");
        exit(EXIT_FAILURE);
      }
      printf("Requesting hard-coded topology\n");
      extents[0].x_org = 0;
      extents[0].y_org = 0;
      extents[0].width = 800;
      extents[0].height = 600;
      extents[1].x_org = 800;
      extents[1].y_org = 0;
      extents[1].width = 800;
      extents[1].height = 600;
      if (VMwareCtrl_SetTopology(dpy, screen, extents, 2)) {
        printf("SetTopology was successful\n");
      } else {
        printf("SetTopology failed\n");
      }
    }
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1050 <XOpenDisplay@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    11e2 <main+0x52>
lea    0xe33(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e05(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>
mov    -0x18(%rbp),%rdi
call   10b0 <DefaultScreen@plt>
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x28(%rbp),%rsi
lea    -0x2c(%rbp),%rdx
call   1070 <VMwareCtrl_QueryVersion@plt>
cmp    $0x0,%rax
je     1222 <main+0x92>
mov    -0x28(%rbp),%esi
mov    -0x2c(%rbp),%edx
lea    0xe0c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    123e <main+0xae>
lea    0xe16(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2da9(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>
cmpl   $0x2,-0x8(%rbp)
jl     13d3 <main+0x243>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe0a(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    12ee <main+0x15e>
cmpl   $0x4,-0x8(%rbp)
jge    128c <main+0xfc>
lea    0xdf1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2d5b(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1090 <atoi@plt>
mov    %eax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1090 <atoi@plt>
mov    %eax,-0x34(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x30(%rbp),%edx
mov    -0x34(%rbp),%ecx
call   1060 <VMwareCtrl_SetRes@plt>
cmp    $0x0,%rax
je     12db <main+0x14b>
lea    0xdb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12e9 <main+0x159>
lea    0xdb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13ce <main+0x23e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdad(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    13c9 <main+0x239>
cmpl   $0x0,-0x28(%rbp)
jne    133c <main+0x1ac>
cmpl   $0x2,-0x2c(%rbp)
jge    133c <main+0x1ac>
lea    0xd8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2cab(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>
lea    0xd9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x70(%rbp)
movq   $0x0,-0x60(%rbp)
movl   $0x320,-0x6c(%rbp)
movl   $0x258,-0x68(%rbp)
movl   $0x320,-0x58(%rbp)
movq   $0x0,-0x48(%rbp)
movl   $0x320,-0x54(%rbp)
movl   $0x258,-0x50(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x24(%rbp),%esi
lea    -0x70(%rbp),%rdx
mov    $0x2,%ecx
call   1080 <VMwareCtrl_SetTopology@plt>
cmp    $0x0,%rax
je     13b6 <main+0x226>
lea    0xd54(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13c4 <main+0x234>
lea    0xd5d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13c9 <main+0x239>
jmp    13ce <main+0x23e>
jmp    13d3 <main+0x243>
mov    0x2bfe(%rip),%rax
mov    (%rax),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %rsi,%r15
mov    %edi,%ebp
xor    %edi,%edi
call   1060 <XOpenDisplay@plt>
test   %rax,%rax
je     130f <main+0x16f>
mov    %rax,%rbx
mov    %rax,%rdi
call   10c0 <DefaultScreen@plt>
mov    %eax,%r14d
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    %rbx,%rdi
call   1080 <VMwareCtrl_QueryVersion@plt>
test   %rax,%rax
je     1318 <main+0x178>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
lea    0xe09(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x1,%ebp
jle    12fb <main+0x15b>
mov    0x8(%r15),%rdi
lea    0xe0b(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     12b9 <main+0x119>
mov    0x8(%r15),%rdi
lea    0xdf9(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    12fb <main+0x15b>
cmpl   $0x0,0xc(%rsp)
jne    124b <main+0xab>
cmpl   $0x1,0x8(%rsp)
jle    133b <main+0x19b>
lea    0xe20(%rip),%rdi
call   1030 <puts@plt>
movl   $0x0,0x10(%rsp)
movq   $0x0,0x20(%rsp)
movabs $0x25800000320,%rax
mov    %rax,0x14(%rsp)
movl   $0x320,0x28(%rsp)
movq   $0x0,0x38(%rsp)
mov    %rax,0x2c(%rsp)
lea    0x10(%rsp),%rdx
mov    %rbx,%rdi
mov    %r14d,%esi
mov    $0x2,%ecx
call   1090 <VMwareCtrl_SetTopology@plt>
test   %rax,%rax
lea    0xde5(%rip),%rax
lea    0xdf1(%rip),%rdi
cmove  %rax,%rdi
jmp    12f6 <main+0x156>
cmp    $0x3,%ebp
jbe    1332 <main+0x192>
mov    0x10(%r15),%rdi
call   10a0 <atoi@plt>
mov    %eax,%ebp
mov    0x18(%r15),%rdi
call   10a0 <atoi@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
mov    %ebp,%edx
mov    %eax,%ecx
call   1070 <VMwareCtrl_SetRes@plt>
test   %rax,%rax
je     12ef <main+0x14f>
lea    0xe08(%rip),%rdi
jmp    12f6 <main+0x156>
lea    0xdf0(%rip),%rdi
call   1030 <puts@plt>
mov    0x2cd6(%rip),%rax
mov    (%rax),%eax
add    $0x48,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xd1a(%rip),%rdi
jmp    131f <main+0x17f>
lea    0xd32(%rip),%rdi
call   1030 <puts@plt>
mov    0x2cb5(%rip),%rax
mov    (%rax),%edi
call   10b0 <exit@plt>
lea    0xdd3(%rip),%rdi
jmp    131f <main+0x17f>
lea    0xd7d(%rip),%rdi
jmp    131f <main+0x17f>

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32, i32, i32, i64 }
@.str = [34 x i8] c"Could not open default X Display\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [29 x i8] c"Got Extension version %d.%d\0A\00"
@.str.2 = [34 x i8] c"VMWARE_CTRL Extension not found.\0A\00"
@.str.3 = [7 x i8] c"setres\00"
@.str.4 = [26 x i8] c"Setres needs x and y too\0A\00"
@.str.5 = [24 x i8] c"Set Res was successful\0A\00"
@.str.6 = [16 x i8] c"Set Res failed\0A\00"
@.str.7 = [12 x i8] c"settopology\00"
@.str.8 = [40 x i8] c"VMWARE_CTRL version >= 0.2 is required\0A\00"
@.str.9 = [32 x i8] c"Requesting hard-coded topology\0A\00"
@.str.10 = [28 x i8] c"SetTopology was successful\0A\00"
@.str.11 = [20 x i8] c"SetTopology failed\0A\00"
@EXIT_SUCCESS = global i32 0
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 i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca [2 x %struct.TYPE_3__]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %7
%14 = load i8*, i8** %7
%15 = call i32* @XOpenDisplay(i8* %14)
store i32* %15, i32** %6
%16 = load i32*, i32** %6
%17 = icmp ne i32* %16, null
br i1 %17, label %22, label %18
18: ; preds = %2
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%20 = load i32, i32* @EXIT_FAILURE
%21 = call i32 @exit(i32 %20)
unreachable
22: ; preds = %2
%23 = load i32*, i32** %6
%24 = call i32 @DefaultScreen(i32* %23)
store i32 %24, i32* %8
%25 = load i32*, i32** %6
%26 = call i64 @VMwareCtrl_QueryVersion(i32* %25, i32* %9, i32* %10)
%27 = icmp ne i64 %26, 0
br i1 %27, label %28, label %32
28: ; preds = %22
%29 = load i32, i32* %9
%30 = load i32, i32* %10
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %29, i32 %30)
br label %36
32: ; preds = %22
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
%34 = load i32, i32* @EXIT_FAILURE
%35 = call i32 @exit(i32 %34)
unreachable
36: ; preds = %28
%37 = load i32, i32* %4
%38 = icmp sge i32 %37, 2
br i1 %38, label %39, label %118
39: ; preds = %36
%40 = load i8**, i8*** %5
%41 = getelementptr inbounds i8*, i8** %40, i64 1
%42 = load i8*, i8** %41
%43 = call i64 @strcmp(i8* %42, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%44 = icmp eq i64 %43, 0
br i1 %44, label %45, label %72
45: ; preds = %39
%46 = load i32, i32* %4
%47 = icmp slt i32 %46, 4
br i1 %47, label %48, label %52
48: ; preds = %45
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0))
%50 = load i32, i32* @EXIT_FAILURE
%51 = call i32 @exit(i32 %50)
unreachable
52: ; preds = %45
%53 = load i8**, i8*** %5
%54 = getelementptr inbounds i8*, i8** %53, i64 2
%55 = load i8*, i8** %54
%56 = call i32 @atoi(i8* %55)
store i32 %56, i32* %11
%57 = load i8**, i8*** %5
%58 = getelementptr inbounds i8*, i8** %57, i64 3
%59 = load i8*, i8** %58
%60 = call i32 @atoi(i8* %59)
store i32 %60, i32* %12
%61 = load i32*, i32** %6
%62 = load i32, i32* %8
%63 = load i32, i32* %11
%64 = load i32, i32* %12
%65 = call i64 @VMwareCtrl_SetRes(i32* %61, i32 %62, i32 %63, i32 %64)
%66 = icmp ne i64 %65, 0
br i1 %66, label %67, label %69
67: ; preds = %52
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0))
br label %71
69: ; preds = %52
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0))
br label %71
71: ; preds = %69, %67
br label %117
72: ; preds = %39
%73 = load i8**, i8*** %5
%74 = getelementptr inbounds i8*, i8** %73, i64 1
%75 = load i8*, i8** %74
%76 = call i64 @strcmp(i8* %75, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0))
%77 = icmp eq i64 %76, 0
br i1 %77, label %78, label %116
78: ; preds = %72
%79 = load i32, i32* %9
%80 = icmp eq i32 %79, 0
br i1 %80, label %81, label %88
81: ; preds = %78
%82 = load i32, i32* %10
%83 = icmp slt i32 %82, 2
br i1 %83, label %84, label %88
84: ; preds = %81
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.8, i64 0, i64 0))
%86 = load i32, i32* @EXIT_FAILURE
%87 = call i32 @exit(i32 %86)
unreachable
88: ; preds = %81, %78
%89 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.9, i64 0, i64 0))
%90 = getelementptr inbounds [2 x %struct.TYPE_3__], [2 x %struct.TYPE_3__]* %13, i64 0, i64 0
%91 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %90, i32 0, i32 0
store i32 0, i32* %91
%92 = getelementptr inbounds [2 x %struct.TYPE_3__], [2 x %struct.TYPE_3__]* %13, i64 0, i64 0
%93 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %92, i32 0, i32 3
store i64 0, i64* %93
%94 = getelementptr inbounds [2 x %struct.TYPE_3__], [2 x %struct.TYPE_3__]* %13, i64 0, i64 0
%95 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %94, i32 0, i32 1
store i32 800, i32* %95
%96 = getelementptr inbounds [2 x %struct.TYPE_3__], [2 x %struct.TYPE_3__]* %13, i64 0, i64 0
%97 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %96, i32 0, i32 2
store i32 600, i32* %97
%98 = getelementptr inbounds [2 x %struct.TYPE_3__], [2 x %struct.TYPE_3__]* %13, i64 0, i64 1
%99 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %98, i32 0, i32 0
store i32 800, i32* %99
%100 = getelementptr inbounds [2 x %struct.TYPE_3__], [2 x %struct.TYPE_3__]* %13, i64 0, i64 1
%101 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %100, i32 0, i32 3
store i64 0, i64* %101
%102 = getelementptr inbounds [2 x %struct.TYPE_3__], [2 x %struct.TYPE_3__]* %13, i64 0, i64 1
%103 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %102, i32 0, i32 1
store i32 800, i32* %103
%104 = getelementptr inbounds [2 x %struct.TYPE_3__], [2 x %struct.TYPE_3__]* %13, i64 0, i64 1
%105 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %104, i32 0, i32 2
store i32 600, i32* %105
%106 = load i32*, i32** %6
%107 = load i32, i32* %8
%108 = getelementptr inbounds [2 x %struct.TYPE_3__], [2 x %struct.TYPE_3__]* %13, i64 0, i64 0
%109 = call i64 @VMwareCtrl_SetTopology(i32* %106, i32 %107, %struct.TYPE_3__* %108, i32 2)
%110 = icmp ne i64 %109, 0
br i1 %110, label %111, label %113
111: ; preds = %88
%112 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.10, i64 0, i64 0))
br label %115
113: ; preds = %88
%114 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.11, i64 0, i64 0))
br label %115
115: ; preds = %113, %111
br label %116
116: ; preds = %115, %72
br label %117
117: ; preds = %116, %71
br label %118
118: ; preds = %117, %36
%119 = load i32, i32* @EXIT_SUCCESS
ret i32 %119
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32, i32, i32, i64 }
@EXIT_FAILURE = global i32 0
@.str.1 = [29 x i8] c"Got Extension version %d.%d\0A\00"
@.str.3 = [7 x i8] c"setres\00"
@.str.7 = [12 x i8] c"settopology\00"
@EXIT_SUCCESS = global i32 0
@str = [33 x i8] c"Could not open default X Display\00"
@str.12 = [33 x i8] c"VMWARE_CTRL Extension not found.\00"
@str.13 = [31 x i8] c"Requesting hard-coded topology\00"
@str.14 = [19 x i8] c"SetTopology failed\00"
@str.15 = [27 x i8] c"SetTopology was successful\00"
@str.16 = [39 x i8] c"VMWARE_CTRL version >= 0.2 is required\00"
@str.17 = [15 x i8] c"Set Res failed\00"
@str.18 = [23 x i8] c"Set Res was successful\00"
@str.19 = [25 x i8] c"Setres needs x and y too\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [2 x %struct.TYPE_3__]
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = tail call i32* @XOpenDisplay(i8* null)
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%12 = load i32, i32* @EXIT_FAILURE
%13 = tail call i32 @exit(i32 %12)
unreachable
14: ; preds = %2
%15 = tail call i32 @DefaultScreen(i32* %8)
%16 = call i64 @VMwareCtrl_QueryVersion(i32* %8, i32* %3, i32* %4)
%17 = icmp eq i64 %16, 0
br i1 %17, label %23, label %18
18: ; preds = %14
%19 = load i32, i32* %3
%20 = load i32, i32* %4
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %19, i32 %20)
%22 = icmp sgt i32 %0, 1
br i1 %22, label %27, label %81
23: ; preds = %14
%24 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.12, i64 0, i64 0))
%25 = load i32, i32* @EXIT_FAILURE
%26 = call i32 @exit(i32 %25)
unreachable
27: ; preds = %18
%28 = getelementptr inbounds i8*, i8** %1, i64 1
%29 = load i8*, i8** %28
%30 = call i64 @strcmp(i8* %29, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%31 = icmp eq i64 %30, 0
br i1 %31, label %32, label %51
32: ; preds = %27
%33 = icmp ult i32 %0, 4
br i1 %33, label %34, label %38
34: ; preds = %32
%35 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.19, i64 0, i64 0))
%36 = load i32, i32* @EXIT_FAILURE
%37 = call i32 @exit(i32 %36)
unreachable
38: ; preds = %32
%39 = getelementptr inbounds i8*, i8** %1, i64 2
%40 = load i8*, i8** %39
%41 = call i32 @atoi(i8* %40)
%42 = getelementptr inbounds i8*, i8** %1, i64 3
%43 = load i8*, i8** %42
%44 = call i32 @atoi(i8* %43)
%45 = call i64 @VMwareCtrl_SetRes(i32* %8, i32 %15, i32 %41, i32 %44)
%46 = icmp eq i64 %45, 0
br i1 %46, label %49, label %47
47: ; preds = %38
%48 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.18, i64 0, i64 0))
br label %81
49: ; preds = %38
%50 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.17, i64 0, i64 0))
br label %81
51: ; preds = %27
%52 = load i8*, i8** %28
%53 = call i64 @strcmp(i8* %52, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0))
%54 = icmp eq i64 %53, 0
br i1 %54, label %55, label %81
55: ; preds = %51
%56 = bitcast [2 x %struct.TYPE_3__]* %5 to i8*
%57 = load i32, i32* %3
%58 = icmp eq i32 %57, 0
%59 = load i32, i32* %4
%60 = icmp slt i32 %59, 2
%61 = select i1 %58, i1 %60, i1 false
br i1 %61, label %62, label %66
62: ; preds = %55
%63 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.16, i64 0, i64 0))
%64 = load i32, i32* @EXIT_FAILURE
%65 = call i32 @exit(i32 %64)
unreachable
66: ; preds = %55
%67 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.13, i64 0, i64 0))
%68 = getelementptr inbounds [2 x %struct.TYPE_3__], [2 x %struct.TYPE_3__]* %5, i64 0, i64 0
%69 = getelementptr inbounds [2 x %struct.TYPE_3__], [2 x %struct.TYPE_3__]* %5, i64 0, i64 0, i32 0
store i32 0, i32* %69
%70 = getelementptr inbounds [2 x %struct.TYPE_3__], [2 x %struct.TYPE_3__]* %5, i64 0, i64 0, i32 3
store i64 0, i64* %70
%71 = getelementptr inbounds [2 x %struct.TYPE_3__], [2 x %struct.TYPE_3__]* %5, i64 0, i64 0, i32 1
store i32 800, i32* %71
%72 = getelementptr inbounds [2 x %struct.TYPE_3__], [2 x %struct.TYPE_3__]* %5, i64 0, i64 0, i32 2
store i32 600, i32* %72
%73 = getelementptr inbounds [2 x %struct.TYPE_3__], [2 x %struct.TYPE_3__]* %5, i64 0, i64 1, i32 0
store i32 800, i32* %73
%74 = getelementptr inbounds [2 x %struct.TYPE_3__], [2 x %struct.TYPE_3__]* %5, i64 0, i64 1, i32 3
store i64 0, i64* %74
%75 = getelementptr inbounds [2 x %struct.TYPE_3__], [2 x %struct.TYPE_3__]* %5, i64 0, i64 1, i32 1
store i32 800, i32* %75
%76 = getelementptr inbounds [2 x %struct.TYPE_3__], [2 x %struct.TYPE_3__]* %5, i64 0, i64 1, i32 2
store i32 600, i32* %76
%77 = call i64 @VMwareCtrl_SetTopology(i32* %8, i32 %15, %struct.TYPE_3__* %68, i32 2)
%78 = icmp eq i64 %77, 0
%79 = select i1 %78, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @str.14, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @str.15, i64 0, i64 0)
%80 = call i32 @puts(i8* dereferenceable(1) %79)
br label %81
81: ; preds = %47, %49, %66, %51, %18
%82 = load i32, i32* @EXIT_SUCCESS
ret i32 %82
}