#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*/ get_result(char, int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *, int *, int *);
int main() {
  int a, b;
  float result;
  char ch;
  printf("+,-*,/,%%,numbera numberb\n");
  scanf("%c%d%d", &ch, &a, &b);
  printf("ch=%c\na=%d\nb=%d\n", ch, a, b);
  get_result(ch, a, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xec7(%rip),%rdi
lea    -0x11(%rbp),%rsi
lea    -0x8(%rbp),%rdx
lea    -0xc(%rbp),%rcx
call   1050 <scanf@plt>
movsbl -0x11(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x11(%rbp),%al
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
movsbl %al,%edi
call   1030 <get_result@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed2(%rip),%rdi
lea    0xf(%rsp),%rsi
lea    0x14(%rsp),%rdx
lea    0x10(%rsp),%rcx
call   1050 <scanf@plt>
movsbl 0xf(%rsp),%esi
mov    0x14(%rsp),%edx
mov    0x10(%rsp),%ecx
lea    0xeb1(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0xf(%rsp),%edi
mov    0x14(%rsp),%esi
mov    0x10(%rsp),%edx
call   1030 <get_result@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [27 x i8] c"+,-*,/,%%,numbera numberb\0A\00"
@.str.1 = [7 x i8] c"%c%d%d\00"
@.str.2 = [17 x i8] c"ch=%c\0Aa=%d\0Ab=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = alloca i8
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %5, i32* %2, i32* %3)
%8 = load i8, i8* %5
%9 = sext i8 %8 to i32
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %9, i32 %10, i32 %11)
%13 = load i8, i8* %5
%14 = load i32, i32* %2
%15 = load i32, i32* %3
%16 = call i32 @get_result(i8 signext %13, i32 %14, i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"+,-*,/,%%,numbera numberb\0A\00"
@.str.1 = [7 x i8] c"%c%d%d\00"
@.str.2 = [17 x i8] c"ch=%c\0Aa=%d\0Ab=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %3, i32* %1, i32* %2)
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %9, i32 %10, i32 %11)
%13 = load i8, i8* %3
%14 = load i32, i32* %1
%15 = load i32, i32* %2
%16 = call i32 @get_result(i8 signext %13, i32 %14, i32 %15)
ret i32 0
}