#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 EXIT_SUCCESS;
int atoi(char *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  if (argv[2][0] == '+')
    printf("%d + %d = %d \n", atoi(argv[1]), atoi(argv[3]),
           atoi(argv[1]) + atoi(argv[3]));
  else if (argv[2][0] == 'x')
    printf("%d x %d = %d \n", atoi(argv[1]), atoi(argv[3]),
           atoi(argv[1]) * atoi(argv[3]));
  else if (argv[2][0] == '/')
    printf("%d / %d = %d \n", atoi(argv[1]), atoi(argv[3]),
           atoi(argv[1]) / atoi(argv[3]));
  else if (argv[2][0] == '-')
    printf("%d - %d = %d \n", atoi(argv[1]), atoi(argv[3]),
           atoi(argv[1]) - atoi(argv[3]));
  else
    printf("nan mais vous m'avez pris pour texas instruments?\n rentrez un des "
           "4 opérateurs éssentiels : \n + - x / \n");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
movsbl (%rax),%eax
cmp    $0x2b,%eax
jne    11a5 <main+0x85>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1040 <atoi@plt>
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
add    %eax,%ecx
lea    0xe67(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1315 <main+0x1f5>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
movsbl (%rax),%eax
cmp    $0x78,%eax
jne    1215 <main+0xf5>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1040 <atoi@plt>
mov    -0x28(%rbp),%ecx
mov    -0x24(%rbp),%esi
mov    -0x20(%rbp),%edx
imul   %eax,%ecx
lea    0xe06(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1310 <main+0x1f0>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1289 <main+0x169>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x34(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1040 <atoi@plt>
mov    -0x34(%rbp),%esi
mov    %eax,%ecx
mov    -0x30(%rbp),%eax
cltd
idiv   %ecx
mov    -0x2c(%rbp),%edx
mov    %eax,%ecx
lea    0xda1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    130b <main+0x1eb>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    12f8 <main+0x1d8>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1040 <atoi@plt>
mov    -0x40(%rbp),%ecx
mov    -0x3c(%rbp),%esi
mov    -0x38(%rbp),%edx
sub    %eax,%ecx
lea    0xd41(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1306 <main+0x1e6>
lea    0xd3d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    130b <main+0x1eb>
jmp    1310 <main+0x1f0>
jmp    1315 <main+0x1f5>
mov    0x2cc4(%rip),%rax
mov    (%rax),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    0x10(%rsi),%rax
mov    (%rax),%al
cmp    $0x2e,%al
jg     116a <main+0x3a>
cmp    $0x2b,%al
je     11a6 <main+0x76>
cmp    $0x2d,%al
jne    1198 <main+0x68>
mov    0x8(%rbx),%rdi
call   1050 <atoi@plt>
mov    %eax,%ebp
mov    0x18(%rbx),%rdi
call   1050 <atoi@plt>
mov    %ebp,%ecx
sub    %eax,%ecx
lea    0xec5(%rip),%rdi
jmp    1192 <main+0x62>
cmp    $0x2f,%al
je     11cd <main+0x9d>
cmp    $0x78,%al
jne    1198 <main+0x68>
mov    0x8(%rbx),%rdi
call   1050 <atoi@plt>
mov    %eax,%ebp
mov    0x18(%rbx),%rdi
call   1050 <atoi@plt>
mov    %eax,%ecx
imul   %ebp,%ecx
lea    0xe7d(%rip),%rdi
mov    %ebp,%esi
mov    %eax,%edx
jmp    11f5 <main+0xc5>
lea    0xe9d(%rip),%rdi
call   1030 <puts@plt>
jmp    11fc <main+0xcc>
mov    0x8(%rbx),%rdi
call   1050 <atoi@plt>
mov    %eax,%r14d
mov    0x18(%rbx),%rdi
call   1050 <atoi@plt>
lea    (%rax,%r14,1),%ecx
lea    0xe3a(%rip),%rdi
mov    %r14d,%esi
mov    %eax,%edx
jmp    11f5 <main+0xc5>
mov    0x8(%rbx),%rdi
call   1050 <atoi@plt>
mov    %eax,%ebp
mov    0x18(%rbx),%rdi
call   1050 <atoi@plt>
mov    %eax,%ecx
mov    %ebp,%eax
cltd
idiv   %ecx
lea    0xe2f(%rip),%rdi
mov    %ebp,%esi
mov    %ecx,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2ddd(%rip),%rax
mov    (%rax),%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"%d + %d = %d \0A\00"
@.str.1 = [15 x i8] c"%d x %d = %d \0A\00"
@.str.2 = [15 x i8] c"%d / %d = %d \0A\00"
@.str.3 = [15 x i8] c"%d - %d = %d \0A\00"
@.str.4 = [106 x i8] c"nan mais vous m'avez pris pour texas instruments?\0A rentrez un des 4 op\C3\A9rateurs \C3\A9ssentiels : \0A + - x / \0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 2
%8 = load i8*, i8** %7
%9 = getelementptr inbounds i8, i8* %8, i64 0
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 43
br i1 %12, label %13, label %32
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32 @atoi(i8* %16)
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 3
%20 = load i8*, i8** %19
%21 = call i32 @atoi(i8* %20)
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 1
%24 = load i8*, i8** %23
%25 = call i32 @atoi(i8* %24)
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 3
%28 = load i8*, i8** %27
%29 = call i32 @atoi(i8* %28)
%30 = add nsw i32 %25, %29
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %17, i32 %21, i32 %30)
br label %118
32: ; preds = %2
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 2
%35 = load i8*, i8** %34
%36 = getelementptr inbounds i8, i8* %35, i64 0
%37 = load i8, i8* %36
%38 = sext i8 %37 to i32
%39 = icmp eq i32 %38, 120
br i1 %39, label %40, label %59
40: ; preds = %32
%41 = load i8**, i8*** %5
%42 = getelementptr inbounds i8*, i8** %41, i64 1
%43 = load i8*, i8** %42
%44 = call i32 @atoi(i8* %43)
%45 = load i8**, i8*** %5
%46 = getelementptr inbounds i8*, i8** %45, i64 3
%47 = load i8*, i8** %46
%48 = call i32 @atoi(i8* %47)
%49 = load i8**, i8*** %5
%50 = getelementptr inbounds i8*, i8** %49, i64 1
%51 = load i8*, i8** %50
%52 = call i32 @atoi(i8* %51)
%53 = load i8**, i8*** %5
%54 = getelementptr inbounds i8*, i8** %53, i64 3
%55 = load i8*, i8** %54
%56 = call i32 @atoi(i8* %55)
%57 = mul nsw i32 %52, %56
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %44, i32 %48, i32 %57)
br label %117
59: ; preds = %32
%60 = load i8**, i8*** %5
%61 = getelementptr inbounds i8*, i8** %60, i64 2
%62 = load i8*, i8** %61
%63 = getelementptr inbounds i8, i8* %62, i64 0
%64 = load i8, i8* %63
%65 = sext i8 %64 to i32
%66 = icmp eq i32 %65, 47
br i1 %66, label %67, label %86
67: ; preds = %59
%68 = load i8**, i8*** %5
%69 = getelementptr inbounds i8*, i8** %68, i64 1
%70 = load i8*, i8** %69
%71 = call i32 @atoi(i8* %70)
%72 = load i8**, i8*** %5
%73 = getelementptr inbounds i8*, i8** %72, i64 3
%74 = load i8*, i8** %73
%75 = call i32 @atoi(i8* %74)
%76 = load i8**, i8*** %5
%77 = getelementptr inbounds i8*, i8** %76, i64 1
%78 = load i8*, i8** %77
%79 = call i32 @atoi(i8* %78)
%80 = load i8**, i8*** %5
%81 = getelementptr inbounds i8*, i8** %80, i64 3
%82 = load i8*, i8** %81
%83 = call i32 @atoi(i8* %82)
%84 = sdiv i32 %79, %83
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %71, i32 %75, i32 %84)
br label %116
86: ; preds = %59
%87 = load i8**, i8*** %5
%88 = getelementptr inbounds i8*, i8** %87, i64 2
%89 = load i8*, i8** %88
%90 = getelementptr inbounds i8, i8* %89, i64 0
%91 = load i8, i8* %90
%92 = sext i8 %91 to i32
%93 = icmp eq i32 %92, 45
br i1 %93, label %94, label %113
94: ; preds = %86
%95 = load i8**, i8*** %5
%96 = getelementptr inbounds i8*, i8** %95, i64 1
%97 = load i8*, i8** %96
%98 = call i32 @atoi(i8* %97)
%99 = load i8**, i8*** %5
%100 = getelementptr inbounds i8*, i8** %99, i64 3
%101 = load i8*, i8** %100
%102 = call i32 @atoi(i8* %101)
%103 = load i8**, i8*** %5
%104 = getelementptr inbounds i8*, i8** %103, i64 1
%105 = load i8*, i8** %104
%106 = call i32 @atoi(i8* %105)
%107 = load i8**, i8*** %5
%108 = getelementptr inbounds i8*, i8** %107, i64 3
%109 = load i8*, i8** %108
%110 = call i32 @atoi(i8* %109)
%111 = sub nsw i32 %106, %110
%112 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %98, i32 %102, i32 %111)
br label %115
113: ; preds = %86
%114 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str.4, i64 0, i64 0))
br label %115
115: ; preds = %113, %94
br label %116
116: ; preds = %115, %67
br label %117
117: ; preds = %116, %40
br label %118
118: ; preds = %117, %13
%119 = load i32, i32* @EXIT_SUCCESS
ret i32 %119
}

LLVM IR (-O2):
@.str = [15 x i8] c"%d + %d = %d \0A\00"
@.str.1 = [15 x i8] c"%d x %d = %d \0A\00"
@.str.2 = [15 x i8] c"%d / %d = %d \0A\00"
@.str.3 = [15 x i8] c"%d - %d = %d \0A\00"
@EXIT_SUCCESS = global i32 0
@str = [105 x i8] c"nan mais vous m'avez pris pour texas instruments?\0A rentrez un des 4 op\C3\A9rateurs \C3\A9ssentiels : \0A + - x / \00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 2
%4 = load i8*, i8** %3
%5 = load i8, i8* %4
switch i8 %5, label %42 [
i8 43, label %6
i8 120, label %15
i8 47, label %24
i8 45, label %33
]
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @atoi(i8* %8)
%10 = getelementptr inbounds i8*, i8** %1, i64 3
%11 = load i8*, i8** %10
%12 = tail call i32 @atoi(i8* %11)
%13 = add nsw i32 %12, %9
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %12, i32 %13)
br label %44
15: ; preds = %2
%16 = getelementptr inbounds i8*, i8** %1, i64 1
%17 = load i8*, i8** %16
%18 = tail call i32 @atoi(i8* %17)
%19 = getelementptr inbounds i8*, i8** %1, i64 3
%20 = load i8*, i8** %19
%21 = tail call i32 @atoi(i8* %20)
%22 = mul nsw i32 %21, %18
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %18, i32 %21, i32 %22)
br label %44
24: ; preds = %2
%25 = getelementptr inbounds i8*, i8** %1, i64 1
%26 = load i8*, i8** %25
%27 = tail call i32 @atoi(i8* %26)
%28 = getelementptr inbounds i8*, i8** %1, i64 3
%29 = load i8*, i8** %28
%30 = tail call i32 @atoi(i8* %29)
%31 = sdiv i32 %27, %30
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %27, i32 %30, i32 %31)
br label %44
33: ; preds = %2
%34 = getelementptr inbounds i8*, i8** %1, i64 1
%35 = load i8*, i8** %34
%36 = tail call i32 @atoi(i8* %35)
%37 = getelementptr inbounds i8*, i8** %1, i64 3
%38 = load i8*, i8** %37
%39 = tail call i32 @atoi(i8* %38)
%40 = sub nsw i32 %36, %39
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %36, i32 %39, i32 %40)
br label %44
42: ; preds = %2
%43 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([105 x i8], [105 x i8]* @str, i64 0, i64 0))
br label %44
44: ; preds = %15, %33, %42, %24, %6
%45 = load i32, i32* @EXIT_SUCCESS
ret i32 %45
}