#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 atoi(int /*<<< orphan*/);
int /*<<< orphan*/ combine(int *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ free(int *);
int getopt(int, char **, char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ memset(int *, int /*<<< orphan*/, int);
int /*<<< orphan*/ optarg;
int /*<<< orphan*/ printf(char *, int, int);
int main(int argc, char **argv) {
  int ch, m = 6, n = 2;
  int *flag, i;
  while (-1 != (ch = getopt(argc, argv, "m:n:"))) {
    switch (ch) {
    case 'm': {
      m = atoi(optarg);
      break;
    }
    case 'n': {
      n = atoi(optarg);
      break;
    }
    default: {
      break;
    }
    }
  }
  if (m < n) {
    m = n;
  }
  printf("m = %d, n = %d\n", m, n);
  flag = (int *)malloc(sizeof(int) * m);
  memset(flag, 0, sizeof(int) * m);
  combine(flag, m, n, 0);
  free(flag);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x6,-0x18(%rbp)
movl   $0x2,-0x1c(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe5e(%rip),%rdx
call   1080 <getopt@plt>
mov    %eax,%ecx
mov    %ecx,-0x14(%rbp)
mov    $0xffffffff,%eax
cmp    %ecx,%eax
je     1214 <main+0xa4>
mov    -0x14(%rbp),%eax
mov    %eax,-0x30(%rbp)
sub    $0x6d,%eax
je     11de <main+0x6e>
jmp    11cd <main+0x5d>
mov    -0x30(%rbp),%eax
sub    $0x6e,%eax
je     11f4 <main+0x84>
jmp    120a <main+0x9a>
mov    0x2e13(%rip),%rax
mov    (%rax),%edi
call   1090 <atoi@plt>
mov    %eax,-0x18(%rbp)
jmp    120f <main+0x9f>
mov    0x2dfd(%rip),%rax
mov    (%rax),%edi
call   1090 <atoi@plt>
mov    %eax,-0x1c(%rbp)
jmp    120f <main+0x9f>
jmp    120f <main+0x9f>
jmp    1194 <main+0x24>
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1226 <main+0xb6>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
lea    0xdd2(%rip),%rdi
call   1040 <printf@plt>
movslq -0x18(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
movslq -0x18(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edx
xor    %esi,%esi
call   1060 <memset@plt>
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
xor    %ecx,%ecx
call   1050 <combine@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x30,%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,%rbp
mov    %edi,%ebx
mov    $0x6,%r15d
mov    $0x2,%r14d
lea    0xe6d(%rip),%r12
mov    0x2e5e(%rip),%r13
nopw   0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    %rbp,%rsi
mov    %r12,%rdx
call   1080 <getopt@plt>
cmp    $0xffffffff,%eax
je     11d8 <main+0x68>
cmp    $0x6e,%eax
je     11ca <main+0x5a>
cmp    $0x6d,%eax
jne    11a0 <main+0x30>
mov    0x0(%r13),%edi
call   1090 <atoi@plt>
mov    %eax,%r15d
jmp    11a0 <main+0x30>
mov    0x0(%r13),%edi
call   1090 <atoi@plt>
mov    %eax,%r14d
jmp    11a0 <main+0x30>
cmp    %r14d,%r15d
cmovl  %r14d,%r15d
lea    0xe1f(%rip),%rdi
mov    %r15d,%esi
mov    %r14d,%edx
call   1040 <printf@plt>
lea    0x0(,%r15,4),%ebx
mov    %ebx,%edi
call   1070 <malloc@plt>
mov    %rax,%rbp
mov    %rax,%rdi
xor    %esi,%esi
mov    %ebx,%edx
call   1060 <memset@plt>
mov    %rbp,%rdi
mov    %r15d,%esi
mov    %r14d,%edx
xor    %ecx,%ecx
call   1050 <combine@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"m:n:\00"
@optarg = global i32 0
@.str.1 = [16 x i8] c"m = %d, n = %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 6, i32* %7
store i32 2, i32* %8
br label %11
11: ; preds = %25, %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 -1, %14
br i1 %15, label %16, label %26
16: ; preds = %11
%17 = load i32, i32* %6
switch i32 %17, label %24 [
i32 109, label %18
i32 110, label %21
]
18: ; preds = %16
%19 = load i32, i32* @optarg
%20 = call i32 @atoi(i32 %19)
store i32 %20, i32* %7
br label %25
21: ; preds = %16
%22 = load i32, i32* @optarg
%23 = call i32 @atoi(i32 %22)
store i32 %23, i32* %8
br label %25
24: ; preds = %16
br label %25
25: ; preds = %24, %21, %18
br label %11
26: ; preds = %11
%27 = load i32, i32* %7
%28 = load i32, i32* %8
%29 = icmp slt i32 %27, %28
br i1 %29, label %30, label %32
30: ; preds = %26
%31 = load i32, i32* %8
store i32 %31, i32* %7
br label %32
32: ; preds = %30, %26
%33 = load i32, i32* %7
%34 = load i32, i32* %8
%35 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %33, i32 %34)
%36 = load i32, i32* %7
%37 = sext i32 %36 to i64
%38 = mul i64 4, %37
%39 = trunc i64 %38 to i32
%40 = call i64 @malloc(i32 %39)
%41 = inttoptr i64 %40 to i32*
store i32* %41, i32** %9
%42 = load i32*, i32** %9
%43 = load i32, i32* %7
%44 = sext i32 %43 to i64
%45 = mul i64 4, %44
%46 = trunc i64 %45 to i32
%47 = call i32 @memset(i32* %42, i32 0, i32 %46)
%48 = load i32*, i32** %9
%49 = load i32, i32* %7
%50 = load i32, i32* %8
%51 = call i32 @combine(i32* %48, i32 %49, i32 %50, i32 0)
%52 = load i32*, i32** %9
%53 = call i32 @free(i32* %52)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"m:n:\00"
@optarg = global i32 0
@.str.1 = [16 x i8] c"m = %d, n = %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
br label %3
3: ; preds = %13, %2
%4 = phi i32 [ %15, %13 ], [ 2, %2 ]
%5 = phi i32 [ %7, %13 ], [ 6, %2 ]
br label %6
6: ; preds = %3, %10
%7 = phi i32 [ %5, %3 ], [ %12, %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 %16
i32 109, label %10
i32 110, label %13
]
10: ; preds = %8
%11 = load i32, i32* @optarg
%12 = tail call i32 @atoi(i32 %11)
br label %6
13: ; preds = %8
%14 = load i32, i32* @optarg
%15 = tail call i32 @atoi(i32 %14)
br label %3
16: ; preds = %8
%17 = icmp slt i32 %7, %4
%18 = select i1 %17, i32 %4, i32 %7
%19 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %18, i32 %4)
%20 = shl i32 %18, 2
%21 = tail call i64 @malloc(i32 %20)
%22 = inttoptr i64 %21 to i32*
%23 = tail call i32 @memset(i32* %22, i32 0, i32 %20)
%24 = tail call i32 @combine(i32* %22, i32 %18, i32 %4, i32 0)
%25 = tail call i32 @free(i32* %22)
ret i32 0
}