#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 get_i();
int get_q();
int get_r();
int get_wt_start(void) {
  if (get_i() - 1 < get_r())
    return (get_q() + 1) * (get_i() - 1) * 10;
  else
    return ((get_q() + 1) * get_r() + get_q() * (get_i() - get_r() - 1)) * 10;
}


x86 assembly (clang, -O0):
<get_wt_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1050 <get_i@plt>
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <get_r@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
jge    1183 <get_wt_start+0x53>
mov    $0x0,%al
call   1040 <get_q@plt>
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1050 <get_i@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
sub    $0x1,%ecx
imul   %ecx,%eax
imul   $0xa,%eax,%eax
mov    %eax,-0x4(%rbp)
jmp    11d8 <get_wt_start+0xa8>
mov    $0x0,%al
call   1040 <get_q@plt>
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1030 <get_r@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <get_q@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1050 <get_i@plt>
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <get_r@plt>
mov    -0x18(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    %eax,%esi
mov    -0x10(%rbp),%eax
sub    %esi,%edx
sub    $0x1,%edx
imul   %edx,%ecx
add    %ecx,%eax
imul   $0xa,%eax,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_wt_start>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1050 <get_i@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1030 <get_r@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1040 <get_q@plt>
mov    %eax,%ebx
add    $0x1,%ebx
xor    %eax,%eax
cmp    %ebp,%r14d
jle    1188 <get_wt_start+0x58>
call   1030 <get_r@plt>
imul   %eax,%ebx
xor    %eax,%eax
call   1040 <get_q@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1050 <get_i@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1030 <get_r@plt>
not    %eax
add    %ebp,%eax
imul   %r14d,%eax
add    %ebx,%eax
jmp    1193 <get_wt_start+0x63>
call   1050 <get_i@plt>
add    $0xffffffff,%eax
imul   %ebx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @get_wt_start() {
%1 = alloca i32
%2 = call i32 (...) @get_i()
%3 = sub nsw i32 %2, 1
%4 = call i32 (...) @get_r()
%5 = icmp slt i32 %3, %4
br i1 %5, label %6, label %13
6: ; preds = %0
%7 = call i32 (...) @get_q()
%8 = add nsw i32 %7, 1
%9 = call i32 (...) @get_i()
%10 = sub nsw i32 %9, 1
%11 = mul nsw i32 %8, %10
%12 = mul nsw i32 %11, 10
store i32 %12, i32* %1
br label %26
13: ; preds = %0
%14 = call i32 (...) @get_q()
%15 = add nsw i32 %14, 1
%16 = call i32 (...) @get_r()
%17 = mul nsw i32 %15, %16
%18 = call i32 (...) @get_q()
%19 = call i32 (...) @get_i()
%20 = call i32 (...) @get_r()
%21 = sub nsw i32 %19, %20
%22 = sub nsw i32 %21, 1
%23 = mul nsw i32 %18, %22
%24 = add nsw i32 %17, %23
%25 = mul nsw i32 %24, 10
store i32 %25, i32* %1
br label %26
26: ; preds = %13, %6
%27 = load i32, i32* %1
ret i32 %27
}

LLVM IR (-O2):
define i32 @get_wt_start() {
%1 = tail call i32 (...) @get_i()
%2 = tail call i32 (...) @get_r()
%3 = icmp sgt i32 %1, %2
%4 = tail call i32 (...) @get_q()
%5 = add nsw i32 %4, 1
br i1 %3, label %10, label %6
6: ; preds = %0
%7 = tail call i32 (...) @get_i()
%8 = add nsw i32 %7, -1
%9 = mul nsw i32 %8, %5
br label %20
10: ; preds = %0
%11 = tail call i32 (...) @get_r()
%12 = mul nsw i32 %5, %11
%13 = tail call i32 (...) @get_q()
%14 = tail call i32 (...) @get_i()
%15 = tail call i32 (...) @get_r()
%16 = xor i32 %15, -1
%17 = add i32 %14, %16
%18 = mul nsw i32 %17, %13
%19 = add nsw i32 %18, %12
br label %20
20: ; preds = %10, %6
%21 = phi i32 [ %9, %6 ], [ %19, %10 ]
%22 = mul nsw i32 %21, 10
ret i32 %22
}