#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*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *, ...);
int main() {
  int N, n1, n2;
  char op;
  scanf("%d", &N);
  scanf(" %d %c %d", &n1, &op, &n2);
  switch (op) {
  case '*':
    N >= n1 *n2 ? printf("OK") : printf("OVERFLOW");
    break;
  case '+':
    N >= n1 + n2 ? printf("OK") : printf("OVERFLOW");
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed1(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x19(%rbp)
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x19(%rbp),%al
lea    0xeb2(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x11(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
movsbl -0x11(%rbp),%eax
mov    %eax,-0x18(%rbp)
sub    $0x2a,%eax
je     1185 <main+0x65>
jmp    1174 <main+0x54>
mov    -0x18(%rbp),%eax
sub    $0x2b,%eax
je     11b9 <main+0x99>
jmp    11e7 <main+0xc7>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   -0x10(%rbp),%ecx
cmp    %ecx,%eax
jl     11a8 <main+0x88>
lea    0xe6c(%rip),%rdi
call   1030 <printf@plt>
jmp    11b4 <main+0x94>
lea    0xe5e(%rip),%rdi
call   1030 <printf@plt>
jmp    11e7 <main+0xc7>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    -0x10(%rbp),%ecx
cmp    %ecx,%eax
jl     11db <main+0xbb>
lea    0xe39(%rip),%rdi
call   1030 <printf@plt>
jmp    11e7 <main+0xc7>
lea    0xe2b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xedc(%rip),%rdi
lea    0x14(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xec2(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0xb(%rsp),%rdx
lea    0xc(%rsp),%rcx
xor    %eax,%eax
call   1040 <scanf@plt>
movsbl 0xb(%rsp),%eax
cmp    $0x2b,%eax
je     116e <main+0x4e>
cmp    $0x2a,%eax
jne    1196 <main+0x76>
mov    0xc(%rsp),%eax
imul   0x10(%rsp),%eax
jmp    1176 <main+0x56>
mov    0xc(%rsp),%eax
add    0x10(%rsp),%eax
cmp    %eax,0x14(%rsp)
setl   %al
lea    0xe89(%rip),%rcx
lea    0xe7f(%rip),%rdi
test   %al,%al
cmovne %rcx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [10 x i8] c" %d %c %d\00"
@.str.2 = [3 x i8] c"OK\00"
@.str.3 = [9 x i8] c"OVERFLOW\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
store i32 0, i32* %1
%6 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32* %3, i8* %5, i32* %4)
%8 = load i8, i8* %5
%9 = sext i8 %8 to i32
switch i32 %9, label %34 [
i32 42, label %10
i32 43, label %22
]
10: ; preds = %0
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = mul nsw i32 %12, %13
%15 = icmp sge i32 %11, %14
br i1 %15, label %16, label %18
16: ; preds = %10
%17 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %20
18: ; preds = %10
%19 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
br label %20
20: ; preds = %18, %16
%21 = phi i32 [ %17, %16 ], [ %19, %18 ]
br label %34
22: ; preds = %0
%23 = load i32, i32* %2
%24 = load i32, i32* %3
%25 = load i32, i32* %4
%26 = add nsw i32 %24, %25
%27 = icmp sge i32 %23, %26
br i1 %27, label %28, label %30
28: ; preds = %22
%29 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %32
30: ; preds = %22
%31 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
br label %32
32: ; preds = %30, %28
%33 = phi i32 [ %29, %28 ], [ %31, %30 ]
br label %34
34: ; preds = %0, %32, %20
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [10 x i8] c" %d %c %d\00"
@.str.2 = [3 x i8] c"OK\00"
@.str.3 = [9 x i8] c"OVERFLOW\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%9 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32* %2, i8* %4, i32* %3)
%10 = load i8, i8* %4
%11 = sext i8 %10 to i32
switch i32 %11, label %28 [
i32 42, label %12
i32 43, label %18
]
12: ; preds = %0
%13 = load i32, i32* %1
%14 = load i32, i32* %2
%15 = load i32, i32* %3
%16 = mul nsw i32 %15, %14
%17 = icmp slt i32 %13, %16
br label %24
18: ; preds = %0
%19 = load i32, i32* %1
%20 = load i32, i32* %2
%21 = load i32, i32* %3
%22 = add nsw i32 %21, %20
%23 = icmp slt i32 %19, %22
br label %24
24: ; preds = %18, %12
%25 = phi i1 [ %23, %18 ], [ %17, %12 ]
%26 = select i1 %25, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%27 = call i32 @printf(i8* dereferenceable(1) %26)
br label %28
28: ; preds = %24, %0
ret i32 0
}