#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 XpandWindow(int, int);
int atoi(char *);
int getopt(int, char **, char *);
char *optarg;
int /*<<< orphan*/ printf(char *, int, int);
int main(int argc, char *argv[]) {
  int opt;
  char *window_value;
  char *scale_value;
  while ((opt = getopt(argc, argv, "w:s:")) != -1) {
    switch (opt) {
    case 'w':
      window_value = optarg;
      break;
    case 's':
      scale_value = optarg;
      break;
    case '?':
      break;
    }
  }
  int wid = atoi(window_value);
  int scale = atoi(scale_value);
  printf("xpandwindow: xpanding window %d with scale %d\n", wid, scale);
  return XpandWindow(wid, scale);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe9c(%rip),%rdx
call   1050 <getopt@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
je     11db <main+0x9b>
mov    -0x14(%rbp),%eax
mov    %eax,-0x34(%rbp)
sub    $0x3f,%eax
je     11d1 <main+0x91>
jmp    1189 <main+0x49>
mov    -0x34(%rbp),%eax
sub    $0x73,%eax
je     11be <main+0x7e>
jmp    119a <main+0x5a>
mov    -0x34(%rbp),%eax
sub    $0x77,%eax
jne    11d6 <main+0x96>
jmp    11ab <main+0x6b>
mov    0x2e46(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    11d6 <main+0x96>
mov    0x2e33(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
jmp    11d6 <main+0x96>
jmp    11d6 <main+0x96>
jmp    1156 <main+0x16>
mov    -0x20(%rbp),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x28(%rbp),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x30(%rbp)
mov    -0x2c(%rbp),%esi
mov    -0x30(%rbp),%edx
lea    0xe05(%rip),%rdi
call   1030 <printf@plt>
mov    -0x2c(%rbp),%edi
mov    -0x30(%rbp),%esi
call   1040 <XpandWindow@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xea9(%rip),%r15
mov    0x2e9a(%rip),%r13
xchg   %ax,%ax
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r15,%rdx
call   1050 <getopt@plt>
cmp    $0xffffffff,%eax
je     1188 <main+0x48>
cmp    $0x73,%eax
je     1182 <main+0x42>
cmp    $0x77,%eax
jne    1160 <main+0x20>
mov    0x0(%r13),%r12
jmp    1160 <main+0x20>
mov    0x0(%r13),%r14
jmp    1160 <main+0x20>
mov    %r12,%rdi
call   1060 <atoi@plt>
mov    %eax,%ebx
mov    %r14,%rdi
call   1060 <atoi@plt>
mov    %eax,%ebp
lea    0xe62(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    %ebx,%edi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <XpandWindow@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"w:s:\00"
@optarg = global i8* null
@.str.1 = [47 x i8] c"xpandwindow: xpanding window %d with scale %d\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 i8*
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %11
11: ; preds = %23, %2
%12 = load i32, i32* %4
%13 = load i8**, i8*** %5
%14 = call i32 @getopt(i32 %12, i8** %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32 %14, i32* %6
%15 = icmp ne i32 %14, -1
br i1 %15, label %16, label %24
16: ; preds = %11
%17 = load i32, i32* %6
switch i32 %17, label %23 [
i32 119, label %18
i32 115, label %20
i32 63, label %22
]
18: ; preds = %16
%19 = load i8*, i8** @optarg
store i8* %19, i8** %7
br label %23
20: ; preds = %16
%21 = load i8*, i8** @optarg
store i8* %21, i8** %8
br label %23
22: ; preds = %16
br label %23
23: ; preds = %16, %22, %20, %18
br label %11
24: ; preds = %11
%25 = load i8*, i8** %7
%26 = call i32 @atoi(i8* %25)
store i32 %26, i32* %9
%27 = load i8*, i8** %8
%28 = call i32 @atoi(i8* %27)
store i32 %28, i32* %10
%29 = load i32, i32* %9
%30 = load i32, i32* %10
%31 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i32 %29, i32 %30)
%32 = load i32, i32* %9
%33 = load i32, i32* %10
%34 = call i32 @XpandWindow(i32 %32, i32 %33)
ret i32 %34
}

LLVM IR (-O2):
@.str = [5 x i8] c"w:s:\00"
@optarg = global i8* null
@.str.1 = [47 x i8] c"xpandwindow: xpanding window %d with scale %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
br label %3
3: ; preds = %12, %2
%4 = phi i8* [ %13, %12 ], [ undef, %2 ]
%5 = phi i8* [ %7, %12 ], [ undef, %2 ]
br label %6
6: ; preds = %3, %10
%7 = phi i8* [ %5, %3 ], [ %11, %10 ]
br label %8
8: ; preds = %6, %8
%9 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
switch i32 %9, label %8 [
i32 -1, label %14
i32 119, label %10
i32 115, label %12
]
10: ; preds = %8
%11 = load i8*, i8** @optarg
br label %6
12: ; preds = %8
%13 = load i8*, i8** @optarg
br label %3
14: ; preds = %8
%15 = tail call i32 @atoi(i8* %7)
%16 = tail call i32 @atoi(i8* %4)
%17 = tail call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i32 %15, i32 %16)
%18 = tail call i32 @XpandWindow(i32 %15, i32 %16)
ret i32 %18
}