#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*/ free(void *);
void *my1(int, int);
int branches(int check, int against) {
  if (check < against && check * 2 < against * 2 && check * 3 < against * 3 &&
      check * 4 < against * 4 && check / 2 < against / 2) {
    void *mem = my1(check, against);
    free(mem);
    return 0;
  }
  return -1;
}


x86 assembly (clang, -O0):
<branches>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11bc <branches+0x9c>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
jge    11bc <branches+0x9c>
imul   $0x3,-0x8(%rbp),%eax
imul   $0x3,-0xc(%rbp),%ecx
cmp    %ecx,%eax
jge    11bc <branches+0x9c>
mov    -0x8(%rbp),%eax
shl    $0x2,%eax
mov    -0xc(%rbp),%ecx
shl    $0x2,%ecx
cmp    %ecx,%eax
jge    11bc <branches+0x9c>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
cmp    %ecx,%eax
jge    11bc <branches+0x9c>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <my1@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
jmp    11c3 <branches+0xa3>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<branches>:
mov    $0xffffffff,%eax
cmp    %esi,%edi
jge    115d <branches+0x3d>
lea    (%rdi,%rdi,2),%ecx
lea    (%rsi,%rsi,2),%edx
cmp    %edx,%ecx
jge    115d <branches+0x3d>
mov    %edi,%ecx
shr    $0x1f,%ecx
add    %edi,%ecx
sar    %ecx
mov    %esi,%edx
shr    $0x1f,%edx
add    %esi,%edx
sar    %edx
cmp    %edx,%ecx
jge    115d <branches+0x3d>
push   %rax
call   1040 <my1@plt>
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @branches(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %40
10: ; preds = %2
%11 = load i32, i32* %4
%12 = mul nsw i32 %11, 2
%13 = load i32, i32* %5
%14 = mul nsw i32 %13, 2
%15 = icmp slt i32 %12, %14
br i1 %15, label %16, label %40
16: ; preds = %10
%17 = load i32, i32* %4
%18 = mul nsw i32 %17, 3
%19 = load i32, i32* %5
%20 = mul nsw i32 %19, 3
%21 = icmp slt i32 %18, %20
br i1 %21, label %22, label %40
22: ; preds = %16
%23 = load i32, i32* %4
%24 = mul nsw i32 %23, 4
%25 = load i32, i32* %5
%26 = mul nsw i32 %25, 4
%27 = icmp slt i32 %24, %26
br i1 %27, label %28, label %40
28: ; preds = %22
%29 = load i32, i32* %4
%30 = sdiv i32 %29, 2
%31 = load i32, i32* %5
%32 = sdiv i32 %31, 2
%33 = icmp slt i32 %30, %32
br i1 %33, label %34, label %40
34: ; preds = %28
%35 = load i32, i32* %4
%36 = load i32, i32* %5
%37 = call i8* @my1(i32 %35, i32 %36)
store i8* %37, i8** %6
%38 = load i8*, i8** %6
%39 = call i32 @free(i8* %38)
store i32 0, i32* %3
br label %41
40: ; preds = %28, %22, %16, %10, %2
store i32 -1, i32* %3
br label %41
41: ; preds = %40, %34
%42 = load i32, i32* %3
ret i32 %42
}

LLVM IR (-O2):
define i32 @branches(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
br i1 %3, label %4, label %15
4: ; preds = %2
%5 = mul nsw i32 %0, 3
%6 = mul nsw i32 %1, 3
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %15
8: ; preds = %4
%9 = sdiv i32 %0, 2
%10 = sdiv i32 %1, 2
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %15
12: ; preds = %8
%13 = tail call i8* @my1(i32 %0, i32 %1)
%14 = tail call i32 @free(i8* %13)
br label %15
15: ; preds = %2, %4, %8, %12
%16 = phi i32 [ 0, %12 ], [ -1, %8 ], [ -1, %4 ], [ -1, %2 ]
ret i32 %16
}