#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*/ mt_string_size(char *, int *, int *, int *);
void GetBinButtonDims(int *x, int *y) {
  int wlab, wplus, wminus;
  int h, b;
  mt_string_size("Bin Size", &wlab, &h, &b);
  mt_string_size("+", &wplus, &h, &b);
  mt_string_size("-", &wminus, &h, &b);
  if (wlab + 4 > wplus + wminus + 2 * 16 + 8)
    *x = wlab + 4;
  else
    *x = wplus + wminus + 2 * 16 + 8;
  *y = h + 16;
}


x86 assembly (clang, -O0):
<GetBinButtonDims>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed9(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x20(%rbp),%rdx
lea    -0x24(%rbp),%rcx
call   1030 <mt_string_size@plt>
lea    0xeca(%rip),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
lea    -0x24(%rbp),%rcx
call   1030 <mt_string_size@plt>
lea    0xeb4(%rip),%rdi
lea    -0x1c(%rbp),%rsi
lea    -0x20(%rbp),%rdx
lea    -0x24(%rbp),%rcx
call   1030 <mt_string_size@plt>
mov    -0x14(%rbp),%eax
add    $0x4,%eax
mov    -0x18(%rbp),%ecx
add    -0x1c(%rbp),%ecx
add    $0x20,%ecx
add    $0x8,%ecx
cmp    %ecx,%eax
jle    1193 <GetBinButtonDims+0x83>
mov    -0x14(%rbp),%ecx
add    $0x4,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
jmp    11a5 <GetBinButtonDims+0x95>
mov    -0x18(%rbp),%ecx
add    -0x1c(%rbp),%ecx
add    $0x20,%ecx
add    $0x8,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%ecx
add    $0x10,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetBinButtonDims>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%r15
lea    0xed8(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x4(%rsp),%rbx
lea    0x14(%rsp),%r12
mov    %rbx,%rdx
mov    %r12,%rcx
call   1030 <mt_string_size@plt>
lea    0xec0(%rip),%rdi
lea    0xc(%rsp),%rsi
mov    %rbx,%rdx
mov    %r12,%rcx
call   1030 <mt_string_size@plt>
lea    0xeab(%rip),%rdi
lea    0x8(%rsp),%rsi
mov    %rbx,%rdx
mov    %r12,%rcx
call   1030 <mt_string_size@plt>
mov    0x10(%rsp),%eax
add    $0x4,%eax
mov    0xc(%rsp),%ecx
mov    0x8(%rsp),%edx
add    %edx,%ecx
add    $0x28,%ecx
cmp    %ecx,%eax
cmovle %ecx,%eax
mov    %eax,(%r15)
mov    0x4(%rsp),%eax
add    $0x10,%eax
mov    %eax,(%r14)
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [9 x i8] c"Bin Size\00"
@.str.1 = [2 x i8] c"+\00"
@.str.2 = [2 x i8] c"-\00"
define void @GetBinButtonDims(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%10 = call i32 @mt_string_size(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %5, i32* %8, i32* %9)
%11 = call i32 @mt_string_size(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32* %6, i32* %8, i32* %9)
%12 = call i32 @mt_string_size(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32* %7, i32* %8, i32* %9)
%13 = load i32, i32* %5
%14 = add nsw i32 %13, 4
%15 = load i32, i32* %6
%16 = load i32, i32* %7
%17 = add nsw i32 %15, %16
%18 = add nsw i32 %17, 32
%19 = add nsw i32 %18, 8
%20 = icmp sgt i32 %14, %19
br i1 %20, label %21, label %25
21: ; preds = %2
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 4
%24 = load i32*, i32** %3
store i32 %23, i32* %24
br label %32
25: ; preds = %2
%26 = load i32, i32* %6
%27 = load i32, i32* %7
%28 = add nsw i32 %26, %27
%29 = add nsw i32 %28, 32
%30 = add nsw i32 %29, 8
%31 = load i32*, i32** %3
store i32 %30, i32* %31
br label %32
32: ; preds = %25, %21
%33 = load i32, i32* %8
%34 = add nsw i32 %33, 16
%35 = load i32*, i32** %4
store i32 %34, i32* %35
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"Bin Size\00"
@.str.1 = [2 x i8] c"+\00"
@.str.2 = [2 x i8] c"-\00"
define void @GetBinButtonDims(i32* nocapture writeonly %0, i32* nocapture writeonly %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = bitcast i32* %3 to i8*
%9 = bitcast i32* %4 to i8*
%10 = bitcast i32* %5 to i8*
%11 = bitcast i32* %6 to i8*
%12 = bitcast i32* %7 to i8*
%13 = call i32 @mt_string_size(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %6, i32* %7)
%14 = call i32 @mt_string_size(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32* %4, i32* %6, i32* %7)
%15 = call i32 @mt_string_size(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32* %5, i32* %6, i32* %7)
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 4
%18 = load i32, i32* %4
%19 = load i32, i32* %5
%20 = add i32 %18, 40
%21 = add i32 %20, %19
%22 = icmp sgt i32 %17, %21
%23 = select i1 %22, i32 %17, i32 %21
store i32 %23, i32* %0
%24 = load i32, i32* %6
%25 = add nsw i32 %24, 16
store i32 %25, i32* %1
ret void
}