#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 exec_cmd(int, char *, int);
scalar_t__ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sscanf(char *, char *, ...);
int /*<<< orphan*/ stdin;
int strlen(char *);
int main() {
  char input[100];
  while (fgets(input, 100, stdin)) {
    if (input[0] == '+' || input[0] == '!') {
      char operation[2];
      int secondNumber = 0;
      sscanf(input, "%s %d", operation, &secondNumber);
      if (operation[0] == '+' && operation[1] == '+') {
        secondNumber++;
        printf("%d", secondNumber);
      } else if (operation[0] == '!') {
        secondNumber = secondNumber * (-1);
        printf("%d", secondNumber);
      } else {
        printf("invalid input");
      }
    } else {
      int breaked = 0;
      int i;
      for (i = 0; i < strlen(input) - 1; i++) {
        if (input[i] == ',') {
          printf("invalid command arguments");
          breaked = 1;
          break;
        }
        if (input[i] == ' ' || input[i] == '+' || input[i] == '-' ||
            input[i] == '/' || input[i] == '*' || input[i] == '%' ||
            input[i] == '!') {
          continue;
        }
        if (input[i] < '0' || input[i] > '9') {
          printf("invalid command arguments");
          breaked = 1;
          break;
        }
      }
      if (breaked) {
        continue;
      }
      int firstNumber = 0;
      char operation[2];
      int secondNumber = 0;
      sscanf(input, "%d %s %d", &firstNumber, operation, &secondNumber);
      if (secondNumber == 0 && operation[0] == '/') {
        printf("invalid arithmetic operation");
        continue;
      }
      int result = exec_cmd(firstNumber, operation, secondNumber);
      if (result == -1) {
        printf("operation not supported");
      } else if (result == 42) {
        printf("the answer to life, the universe and everything else");
      } else if (result == -2) {
        printf("invalid input");
      } else {
        printf("%d", result);
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
mov    0x2e7b(%rip),%rax
mov    (%rax),%edx
mov    $0x64,%esi
call   1050 <fgets@plt>
cmp    $0x0,%rax
je     148c <main+0x33c>
movsbl -0x70(%rbp),%eax
cmp    $0x2b,%eax
je     119d <main+0x4d>
movsbl -0x70(%rbp),%eax
cmp    $0x21,%eax
jne    1239 <main+0xe9>
movl   $0x0,-0x78(%rbp)
lea    -0x70(%rbp),%rdi
lea    -0x72(%rbp),%rdx
lea    0xe78(%rip),%rsi
lea    -0x78(%rbp),%rcx
mov    $0x0,%al
call   1070 <sscanf@plt>
movsbl -0x72(%rbp),%eax
cmp    $0x2b,%eax
jne    11f7 <main+0xa7>
movsbl -0x71(%rbp),%eax
cmp    $0x2b,%eax
jne    11f7 <main+0xa7>
mov    -0x78(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x78(%rbp)
mov    -0x78(%rbp),%esi
lea    0xe43(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1234 <main+0xe4>
movsbl -0x72(%rbp),%eax
cmp    $0x21,%eax
jne    1221 <main+0xd1>
imul   $0xffffffff,-0x78(%rbp),%eax
mov    %eax,-0x78(%rbp)
mov    -0x78(%rbp),%esi
lea    0xe19(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    122f <main+0xdf>
lea    0xdd8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1234 <main+0xe4>
jmp    1487 <main+0x337>
movl   $0x0,-0x7c(%rbp)
movl   $0x0,-0x80(%rbp)
mov    -0x80(%rbp),%eax
mov    %eax,-0x94(%rbp)
lea    -0x70(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x94(%rbp),%eax
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    136c <main+0x21c>
movslq -0x80(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x2c,%eax
jne    1298 <main+0x148>
lea    0xd89(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x7c(%rbp)
jmp    136c <main+0x21c>
movslq -0x80(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x20,%eax
je     1316 <main+0x1c6>
movslq -0x80(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x2b,%eax
je     1316 <main+0x1c6>
movslq -0x80(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x2d,%eax
je     1316 <main+0x1c6>
movslq -0x80(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x2f,%eax
je     1316 <main+0x1c6>
movslq -0x80(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x2a,%eax
je     1316 <main+0x1c6>
movslq -0x80(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x25,%eax
je     1316 <main+0x1c6>
movslq -0x80(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x21,%eax
jne    131b <main+0x1cb>
jmp    135e <main+0x20e>
movslq -0x80(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x30,%eax
jl     133f <main+0x1ef>
movslq -0x80(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x39,%eax
jle    1359 <main+0x209>
lea    0xcc8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x7c(%rbp)
jmp    136c <main+0x21c>
jmp    135e <main+0x20e>
mov    -0x80(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x80(%rbp)
jmp    1247 <main+0xf7>
cmpl   $0x0,-0x7c(%rbp)
je     137b <main+0x22b>
jmp    1162 <main+0x12>
movl   $0x0,-0x84(%rbp)
movl   $0x0,-0x8c(%rbp)
lea    -0x70(%rbp),%rdi
lea    -0x86(%rbp),%rcx
lea    0xc87(%rip),%rsi
lea    -0x84(%rbp),%rdx
lea    -0x8c(%rbp),%r8
mov    $0x0,%al
call   1070 <sscanf@plt>
cmpl   $0x0,-0x8c(%rbp)
jne    13e6 <main+0x296>
movsbl -0x86(%rbp),%eax
cmp    $0x2f,%eax
jne    13e6 <main+0x296>
lea    0xc57(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1162 <main+0x12>
mov    -0x84(%rbp),%edi
lea    -0x86(%rbp),%rsi
mov    -0x8c(%rbp),%edx
call   1060 <exec_cmd@plt>
mov    %eax,-0x90(%rbp)
cmpl   $0xffffffff,-0x90(%rbp)
jne    1424 <main+0x2d4>
lea    0xc36(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1482 <main+0x332>
cmpl   $0x2a,-0x90(%rbp)
jne    1444 <main+0x2f4>
lea    0xc2e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    147d <main+0x32d>
cmpl   $0xfffffffe,-0x90(%rbp)
jne    1464 <main+0x314>
lea    0xba8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1478 <main+0x328>
mov    -0x90(%rbp),%esi
lea    0xbbd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    147d <main+0x32d>
jmp    1482 <main+0x332>
jmp    1487 <main+0x337>
jmp    1162 <main+0x12>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    0x2e83(%rip),%r15
mov    (%r15),%edx
lea    0x10(%rsp),%rdi
mov    $0x64,%esi
call   1050 <fgets@plt>
test   %rax,%rax
je     1330 <main+0x1e0>
lea    0xea4(%rip),%rbp
lea    0x10(%rsp),%rbx
lea    0xc(%rsp),%r12
movabs $0xac2300000000,%r13
jmp    11c7 <main+0x77>
nopl   (%rax)
lea    0xe59(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%r15),%edx
mov    %rbx,%rdi
mov    $0x64,%esi
call   1050 <fgets@plt>
test   %rax,%rax
je     1330 <main+0x1e0>
mov    0x10(%rsp),%al
cmp    $0x21,%al
je     11d3 <main+0x83>
cmp    $0x2b,%al
jne    1210 <main+0xc0>
movl   $0x0,0x4(%rsp)
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r12,%rdx
lea    0x4(%rsp),%rcx
xor    %eax,%eax
call   1070 <sscanf@plt>
mov    0xc(%rsp),%al
cmp    $0x2b,%al
jne    1270 <main+0x120>
cmpb   $0x2b,0xd(%rsp)
jne    1270 <main+0x120>
mov    0x4(%rsp),%esi
add    $0x1,%esi
jmp    127e <main+0x12e>
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <strlen@plt>
cmp    $0x2,%eax
jl     12a0 <main+0x150>
xor    %r14d,%r14d
jmp    1246 <main+0xf6>
add    $0xc6,%al
cmp    $0xf5,%al
jbe    125e <main+0x10e>
nopl   0x0(%rax)
add    $0x1,%r14
mov    %rbx,%rdi
call   1030 <strlen@plt>
add    $0xffffffff,%eax
cltq
cmp    %rax,%r14
jge    12a0 <main+0x150>
movzbl 0x10(%rsp,%r14,1),%eax
cmp    $0x2f,%rax
ja     1226 <main+0xd6>
bt     %rax,%r13
jb     1230 <main+0xe0>
cmp    $0x2c,%rax
jne    1226 <main+0xd6>
lea    0xda9(%rip),%rdi
jmp    11a7 <main+0x57>
nopw   0x0(%rax,%rax,1)
cmp    $0x21,%al
jne    11a0 <main+0x50>
xor    %esi,%esi
sub    0x4(%rsp),%esi
mov    %esi,0x4(%rsp)
lea    0xda5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11ae <main+0x5e>
cs nopw 0x0(%rax,%rax,1)
nop
movl   $0x0,0x4(%rsp)
movl   $0x0,0xc(%rsp)
mov    %rbx,%rdi
lea    0xd6e(%rip),%rsi
lea    0x4(%rsp),%rdx
lea    0xa(%rsp),%rcx
mov    %r12,%r8
xor    %eax,%eax
call   1070 <sscanf@plt>
mov    0xc(%rsp),%edx
test   %edx,%edx
jne    12e9 <main+0x199>
cmpb   $0x2f,0xa(%rsp)
jne    12e9 <main+0x199>
lea    0xd4d(%rip),%rdi
jmp    11a7 <main+0x57>
mov    0x4(%rsp),%edi
lea    0xa(%rsp),%rsi
call   1060 <exec_cmd@plt>
cmp    $0xfffffffe,%eax
je     11a0 <main+0x50>
cmp    $0x2a,%eax
je     1316 <main+0x1c6>
cmp    $0xffffffff,%eax
jne    1322 <main+0x1d2>
lea    0xd3d(%rip),%rdi
jmp    11a7 <main+0x57>
lea    0xd49(%rip),%rdi
jmp    11a7 <main+0x57>
lea    0xd05(%rip),%rdi
mov    %eax,%esi
jmp    1289 <main+0x139>
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [6 x i8] c"%s %d\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [14 x i8] c"invalid input\00"
@.str.3 = [26 x i8] c"invalid command arguments\00"
@.str.4 = [9 x i8] c"%d %s %d\00"
@.str.5 = [29 x i8] c"invalid arithmetic operation\00"
@.str.6 = [24 x i8] c"operation not supported\00"
@.str.7 = [53 x i8] c"the answer to life, the universe and everything else\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca [2 x i8]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca [2 x i8]
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %1
br label %11
11: ; preds = %186, %159, %147, %0
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%13 = load i32, i32* @stdin
%14 = call i64 @fgets(i8* %12, i32 100, i32 %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %187
16: ; preds = %11
%17 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 43
br i1 %20, label %26, label %21
21: ; preds = %16
%22 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 33
br i1 %25, label %26, label %58
26: ; preds = %21, %16
store i32 0, i32* %4
%27 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%28 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%29 = call i32 (i8*, i8*, ...) @sscanf(i8* %27, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %28, i32* %4)
%30 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %32, 43
br i1 %33, label %34, label %44
34: ; preds = %26
%35 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
%36 = load i8, i8* %35
%37 = sext i8 %36 to i32
%38 = icmp eq i32 %37, 43
br i1 %38, label %39, label %44
39: ; preds = %34
%40 = load i32, i32* %4
%41 = add nsw i32 %40, 1
store i32 %41, i32* %4
%42 = load i32, i32* %4
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %42)
br label %57
44: ; preds = %34, %26
%45 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%46 = load i8, i8* %45
%47 = sext i8 %46 to i32
%48 = icmp eq i32 %47, 33
br i1 %48, label %49, label %54
49: ; preds = %44
%50 = load i32, i32* %4
%51 = mul nsw i32 %50, -1
store i32 %51, i32* %4
%52 = load i32, i32* %4
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %52)
br label %56
54: ; preds = %44
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %56
56: ; preds = %54, %49
br label %57
57: ; preds = %56, %39
br label %186
58: ; preds = %21
store i32 0, i32* %5
store i32 0, i32* %6
br label %59
59: ; preds = %141, %58
%60 = load i32, i32* %6
%61 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%62 = call i32 @strlen(i8* %61)
%63 = sub nsw i32 %62, 1
%64 = icmp slt i32 %60, %63
br i1 %64, label %65, label %144
65: ; preds = %59
%66 = load i32, i32* %6
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %67
%69 = load i8, i8* %68
%70 = sext i8 %69 to i32
%71 = icmp eq i32 %70, 44
br i1 %71, label %72, label %74
72: ; preds = %65
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %5
br label %144
74: ; preds = %65
%75 = load i32, i32* %6
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %76
%78 = load i8, i8* %77
%79 = sext i8 %78 to i32
%80 = icmp eq i32 %79, 32
br i1 %80, label %123, label %81
81: ; preds = %74
%82 = load i32, i32* %6
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %83
%85 = load i8, i8* %84
%86 = sext i8 %85 to i32
%87 = icmp eq i32 %86, 43
br i1 %87, label %123, label %88
88: ; preds = %81
%89 = load i32, i32* %6
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %90
%92 = load i8, i8* %91
%93 = sext i8 %92 to i32
%94 = icmp eq i32 %93, 45
br i1 %94, label %123, label %95
95: ; preds = %88
%96 = load i32, i32* %6
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %97
%99 = load i8, i8* %98
%100 = sext i8 %99 to i32
%101 = icmp eq i32 %100, 47
br i1 %101, label %123, label %102
102: ; preds = %95
%103 = load i32, i32* %6
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %104
%106 = load i8, i8* %105
%107 = sext i8 %106 to i32
%108 = icmp eq i32 %107, 42
br i1 %108, label %123, label %109
109: ; preds = %102
%110 = load i32, i32* %6
%111 = sext i32 %110 to i64
%112 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %111
%113 = load i8, i8* %112
%114 = sext i8 %113 to i32
%115 = icmp eq i32 %114, 37
br i1 %115, label %123, label %116
116: ; preds = %109
%117 = load i32, i32* %6
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %118
%120 = load i8, i8* %119
%121 = sext i8 %120 to i32
%122 = icmp eq i32 %121, 33
br i1 %122, label %123, label %124
123: ; preds = %116, %109, %102, %95, %88, %81, %74
br label %141
124: ; preds = %116
%125 = load i32, i32* %6
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %126
%128 = load i8, i8* %127
%129 = sext i8 %128 to i32
%130 = icmp slt i32 %129, 48
br i1 %130, label %138, label %131
131: ; preds = %124
%132 = load i32, i32* %6
%133 = sext i32 %132 to i64
%134 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %133
%135 = load i8, i8* %134
%136 = sext i8 %135 to i32
%137 = icmp sgt i32 %136, 57
br i1 %137, label %138, label %140
138: ; preds = %131, %124
%139 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %5
br label %144
140: ; preds = %131
br label %141
141: ; preds = %140, %123
%142 = load i32, i32* %6
%143 = add nsw i32 %142, 1
store i32 %143, i32* %6
br label %59
144: ; preds = %138, %72, %59
%145 = load i32, i32* %5
%146 = icmp ne i32 %145, 0
br i1 %146, label %147, label %148
147: ; preds = %144
br label %11
148: ; preds = %144
store i32 0, i32* %7
store i32 0, i32* %9
%149 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%150 = getelementptr inbounds [2 x i8], [2 x i8]* %8, i64 0, i64 0
%151 = call i32 (i8*, i8*, ...) @sscanf(i8* %149, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32* %7, i8* %150, i32* %9)
%152 = load i32, i32* %9
%153 = icmp eq i32 %152, 0
br i1 %153, label %154, label %161
154: ; preds = %148
%155 = getelementptr inbounds [2 x i8], [2 x i8]* %8, i64 0, i64 0
%156 = load i8, i8* %155
%157 = sext i8 %156 to i32
%158 = icmp eq i32 %157, 47
br i1 %158, label %159, label %161
159: ; preds = %154
%160 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0))
br label %11
161: ; preds = %154, %148
%162 = load i32, i32* %7
%163 = getelementptr inbounds [2 x i8], [2 x i8]* %8, i64 0, i64 0
%164 = load i32, i32* %9
%165 = call i32 @exec_cmd(i32 %162, i8* %163, i32 %164)
store i32 %165, i32* %10
%166 = load i32, i32* %10
%167 = icmp eq i32 %166, -1
br i1 %167, label %168, label %170
168: ; preds = %161
%169 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0))
br label %185
170: ; preds = %161
%171 = load i32, i32* %10
%172 = icmp eq i32 %171, 42
br i1 %172, label %173, label %175
173: ; preds = %170
%174 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.7, i64 0, i64 0))
br label %184
175: ; preds = %170
%176 = load i32, i32* %10
%177 = icmp eq i32 %176, -2
br i1 %177, label %178, label %180
178: ; preds = %175
%179 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %183
180: ; preds = %175
%181 = load i32, i32* %10
%182 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %181)
br label %183
183: ; preds = %180, %178
br label %184
184: ; preds = %183, %173
br label %185
185: ; preds = %184, %168
br label %186
186: ; preds = %185, %57
br label %11
187: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [6 x i8] c"%s %d\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [14 x i8] c"invalid input\00"
@.str.3 = [26 x i8] c"invalid command arguments\00"
@.str.4 = [9 x i8] c"%d %s %d\00"
@.str.5 = [29 x i8] c"invalid arithmetic operation\00"
@.str.6 = [24 x i8] c"operation not supported\00"
@.str.7 = [53 x i8] c"the answer to life, the universe and everything else\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca [2 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca [2 x i8]
%6 = alloca i32
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%8 = load i32, i32* @stdin
%9 = call i64 @fgets(i8* %7, i32 100, i32 %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %85, label %11
11: ; preds = %0
%12 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%13 = bitcast i32* %3 to i8*
%14 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
%15 = bitcast i32* %4 to i8*
%16 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%17 = bitcast i32* %6 to i8*
br label %18
18: ; preds = %11, %81
%19 = load i8, i8* %7
switch i8 %19, label %20 [
i8 43, label %23
i8 33, label %23
]
20: ; preds = %18
%21 = call i32 @strlen(i8* %7)
%22 = icmp sgt i32 %21, 1
br i1 %22, label %43, label %60
23: ; preds = %18, %18
store i32 0, i32* %3
%24 = call i32 (i8*, i8*, ...) @sscanf(i8* %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %12, i32* %3)
%25 = load i8, i8* %12
%26 = icmp eq i8 %25, 43
%27 = load i8, i8* %14
%28 = icmp eq i8 %27, 43
%29 = select i1 %26, i1 %28, i1 false
br i1 %29, label %30, label %34
30: ; preds = %23
%31 = load i32, i32* %3
%32 = add nsw i32 %31, 1
store i32 %32, i32* %3
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %32)
br label %42
34: ; preds = %23
%35 = icmp eq i8 %25, 33
br i1 %35, label %36, label %40
36: ; preds = %34
%37 = load i32, i32* %3
%38 = sub nsw i32 0, %37
store i32 %38, i32* %3
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %38)
br label %42
40: ; preds = %34
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %42
42: ; preds = %36, %40, %30
br label %81
43: ; preds = %20, %54
%44 = phi i64 [ %55, %54 ], [ 0, %20 ]
%45 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %44
%46 = load i8, i8* %45
switch i8 %46, label %49 [
i8 44, label %47
i8 32, label %54
i8 43, label %54
i8 45, label %54
i8 47, label %54
i8 42, label %54
i8 37, label %54
i8 33, label %54
]
47: ; preds = %43
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
br label %81
49: ; preds = %43
%50 = add i8 %46, -58
%51 = icmp ult i8 %50, -10
br i1 %51, label %52, label %54
52: ; preds = %49
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
br label %81
54: ; preds = %49, %43, %43, %43, %43, %43, %43, %43
%55 = add nuw nsw i64 %44, 1
%56 = call i32 @strlen(i8* %7)
%57 = add nsw i32 %56, -1
%58 = sext i32 %57 to i64
%59 = icmp slt i64 %55, %58
br i1 %59, label %43, label %60
60: ; preds = %54, %20
store i32 0, i32* %4
store i32 0, i32* %6
%61 = call i32 (i8*, i8*, ...) @sscanf(i8* %7, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32* %4, i8* %16, i32* %6)
%62 = load i32, i32* %6
%63 = icmp eq i32 %62, 0
%64 = load i8, i8* %16
%65 = icmp eq i8 %64, 47
%66 = select i1 %63, i1 %65, i1 false
br i1 %66, label %67, label %69
67: ; preds = %60
%68 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0))
br label %80
69: ; preds = %60
%70 = load i32, i32* %4
%71 = call i32 @exec_cmd(i32 %70, i8* %16, i32 %62)
switch i32 %71, label %78 [
i32 -1, label %72
i32 42, label %74
i32 -2, label %76
]
72: ; preds = %69
%73 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0))
br label %80
74: ; preds = %69
%75 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.7, i64 0, i64 0))
br label %80
76: ; preds = %69
%77 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %80
78: ; preds = %69
%79 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %71)
br label %80
80: ; preds = %72, %76, %78, %74, %67
br label %81
81: ; preds = %80, %47, %52, %42
%82 = load i32, i32* @stdin
%83 = call i64 @fgets(i8* %7, i32 100, i32 %82)
%84 = icmp eq i64 %83, 0
br i1 %84, label %85, label %18
85: ; preds = %81, %0
ret i32 0
}