#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*/ aa();
int /*<<< orphan*/ aob();
int /*<<< orphan*/ aos();
void blah(int code1, int code2) {
  int i;
  int n_sets;
  n_sets = (int)(code1 == 32);
  if (code2 == 64)
    goto L2;
  else
    goto L3;
L2:
  aa();
L3:
  if (n_sets > 1)
    goto L4;
  else
    goto L10;
L4:
  aos();
  i = 0;
  goto L24;
L10:
  if (n_sets > 0)
    goto L25;
  else
    goto L8;
L25:
  i = 0;
L24:
  aob();
  i = i + 1;
  if (i < n_sets)
    goto L24;
  else
    goto L8;
L8:
  return;
}


x86 assembly (clang, -O0):
<blah>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x20,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x40,-0x8(%rbp)
jne    115c <blah+0x2c>
jmp    1161 <blah+0x31>
jmp    1168 <blah+0x38>
mov    $0x0,%al
call   1040 <aa@plt>
cmpl   $0x1,-0x10(%rbp)
jle    1177 <blah+0x47>
jmp    117c <blah+0x4c>
jmp    118f <blah+0x5f>
mov    $0x0,%al
call   1050 <aos@plt>
movl   $0x0,-0xc(%rbp)
jmp    11aa <blah+0x7a>
cmpl   $0x0,-0x10(%rbp)
jle    119e <blah+0x6e>
jmp    11a3 <blah+0x73>
jmp    11d0 <blah+0xa0>
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1030 <aob@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11cb <blah+0x9b>
jmp    11aa <blah+0x7a>
jmp    11d0 <blah+0xa0>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blah>:
push   %rbx
mov    %edi,%ebx
cmp    $0x40,%esi
jne    112f <blah+0xf>
xor    %eax,%eax
call   1040 <aa@plt>
cmp    $0x20,%ebx
jne    113c <blah+0x1c>
xor    %eax,%eax
pop    %rbx
jmp    1030 <aob@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @blah(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 32
%9 = zext i1 %8 to i32
store i32 %9, i32* %6
%10 = load i32, i32* %4
%11 = icmp eq i32 %10, 64
br i1 %11, label %12, label %13
12: ; preds = %2
br label %14
13: ; preds = %2
br label %16
14: ; preds = %12
%15 = call i32 (...) @aa()
br label %16
16: ; preds = %14, %13
%17 = load i32, i32* %6
%18 = icmp sgt i32 %17, 1
br i1 %18, label %19, label %20
19: ; preds = %16
br label %21
20: ; preds = %16
br label %23
21: ; preds = %19
%22 = call i32 (...) @aos()
store i32 0, i32* %5
br label %29
23: ; preds = %20
%24 = load i32, i32* %6
%25 = icmp sgt i32 %24, 0
br i1 %25, label %26, label %27
26: ; preds = %23
br label %28
27: ; preds = %23
br label %38
28: ; preds = %26
store i32 0, i32* %5
br label %29
29: ; preds = %36, %28, %21
%30 = call i32 (...) @aob()
%31 = load i32, i32* %5
%32 = add nsw i32 %31, 1
store i32 %32, i32* %5
%33 = load i32, i32* %5
%34 = load i32, i32* %6
%35 = icmp slt i32 %33, %34
br i1 %35, label %36, label %37
36: ; preds = %29
br label %29
37: ; preds = %29
br label %38
38: ; preds = %37, %27
ret void
}

LLVM IR (-O2):
define void @blah(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 32
%4 = icmp eq i32 %1, 64
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @aa()
br label %7
7: ; preds = %5, %2
br i1 %3, label %8, label %10
8: ; preds = %7
%9 = tail call i32 (...) @aob()
br label %10
10: ; preds = %8, %7
ret void
}