#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 BinStrToInt(char *);
int atoi(char *);
int /*<<< orphan*/ byte2bits(char, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ system(char *);
main() {
  char c, bits[9], dg1[4] = "", dg2[4] = "", op[3] = "";
  int i, k = 0, l = 0, m = 0, opi;
  float div;
  printf("Char: \n");
  scanf("%c", &c);
  byte2bits(c, bits);
  fprintf(stdout, "No sistema binario %s\n", bits);
  for (i = 0; i < 8; i++) {
    if (i < 3) {
      dg1[k] = bits[i];
      k++;
    } else if (i > 4) {
      dg2[l] = bits[i];
      l++;
    } else {
      op[m] = bits[i];
      m++;
    }
  }
  printf("%s \n", dg1);
  printf("%s \n", dg2);
  printf("%s \n", op);
  opi = atoi(op);
  switch (opi) {
  case 00:
    printf("Soma:");
    printf("%d + %d = %d \n", BinStrToInt(dg1), BinStrToInt(dg2),
           BinStrToInt(dg1) + BinStrToInt(dg2));
    break;
  case 01:
    printf("Subtração \n");
    printf("%d - %d = %d \n", BinStrToInt(dg1), BinStrToInt(dg2),
           BinStrToInt(dg1) - BinStrToInt(dg2));
    break;
  case 10:
    printf("Multiplicação \n");
    printf("%d * %d = %d \n", BinStrToInt(dg1), BinStrToInt(dg2),
           BinStrToInt(dg1) * BinStrToInt(dg2));
    break;
  case 11:
    printf("Divisão \n");
    div = (float)BinStrToInt(dg1) / BinStrToInt(dg2);
    printf("%d / %d = %f \n", BinStrToInt(dg1), BinStrToInt(dg2), div);
    break;
  }
  if (0 == 1)
    system("pause");
  else
    system("read -p \"Pressione enter para sair\" saindo");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x12(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1050 <memset@plt>
lea    -0x16(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1050 <memset@plt>
lea    -0x19(%rbp),%rdi
xor    %esi,%esi
mov    $0x3,%edx
call   1050 <memset@plt>
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
lea    0xe52(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe4c(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1080 <scanf@plt>
mov    -0x5(%rbp),%al
lea    -0xe(%rbp),%rsi
movsbl %al,%edi
call   10a0 <byte2bits@plt>
mov    0x2dd5(%rip),%rax
mov    (%rax),%edi
lea    -0xe(%rbp),%rdx
lea    0xe23(%rip),%rsi
call   1060 <fprintf@plt>
movl   $0x0,-0x20(%rbp)
cmpl   $0x8,-0x20(%rbp)
jge    12af <main+0x12f>
cmpl   $0x3,-0x20(%rbp)
jge    1256 <main+0xd6>
movslq -0x20(%rbp),%rax
mov    -0xe(%rbp,%rax,1),%cl
movslq -0x24(%rbp),%rax
mov    %cl,-0x12(%rbp,%rax,1)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    129c <main+0x11c>
cmpl   $0x4,-0x20(%rbp)
jle    127e <main+0xfe>
movslq -0x20(%rbp),%rax
mov    -0xe(%rbp,%rax,1),%cl
movslq -0x28(%rbp),%rax
mov    %cl,-0x16(%rbp,%rax,1)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1297 <main+0x117>
movslq -0x20(%rbp),%rax
mov    -0xe(%rbp,%rax,1),%cl
movslq -0x2c(%rbp),%rax
mov    %cl,-0x19(%rbp,%rax,1)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    129c <main+0x11c>
jmp    12a1 <main+0x121>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1224 <main+0xa4>
lea    0xd9c(%rip),%rdi
mov    %rdi,-0x58(%rbp)
xor    %eax,%eax
mov    %al,-0x49(%rbp)
lea    -0x12(%rbp),%rsi
call   1040 <printf@plt>
mov    -0x58(%rbp),%rdi
mov    -0x49(%rbp),%al
lea    -0x16(%rbp),%rsi
call   1040 <printf@plt>
mov    -0x58(%rbp),%rdi
mov    -0x49(%rbp),%al
lea    -0x19(%rbp),%rsi
mov    %rsi,-0x48(%rbp)
call   1040 <printf@plt>
mov    -0x48(%rbp),%rdi
call   1090 <atoi@plt>
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    %rax,-0x40(%rbp)
sub    $0xb,%rax
ja     149b <main+0x31b>
mov    -0x40(%rbp),%rax
lea    0xcec(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xd33(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x12(%rbp),%rdi
call   1070 <BinStrToInt@plt>
mov    %eax,-0x60(%rbp)
lea    -0x16(%rbp),%rdi
call   1070 <BinStrToInt@plt>
mov    %eax,-0x5c(%rbp)
lea    -0x12(%rbp),%rdi
call   1070 <BinStrToInt@plt>
mov    %eax,-0x64(%rbp)
lea    -0x16(%rbp),%rdi
call   1070 <BinStrToInt@plt>
mov    -0x64(%rbp),%ecx
mov    -0x60(%rbp),%esi
mov    -0x5c(%rbp),%edx
add    %eax,%ecx
lea    0xcf3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    149b <main+0x31b>
lea    0xcef(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x12(%rbp),%rdi
call   1070 <BinStrToInt@plt>
mov    %eax,-0x6c(%rbp)
lea    -0x16(%rbp),%rdi
call   1070 <BinStrToInt@plt>
mov    %eax,-0x68(%rbp)
lea    -0x12(%rbp),%rdi
call   1070 <BinStrToInt@plt>
mov    %eax,-0x70(%rbp)
lea    -0x16(%rbp),%rdi
call   1070 <BinStrToInt@plt>
mov    -0x70(%rbp),%ecx
mov    -0x6c(%rbp),%esi
mov    -0x68(%rbp),%edx
sub    %eax,%ecx
lea    0xcb7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    149b <main+0x31b>
lea    0xcb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x12(%rbp),%rdi
call   1070 <BinStrToInt@plt>
mov    %eax,-0x78(%rbp)
lea    -0x16(%rbp),%rdi
call   1070 <BinStrToInt@plt>
mov    %eax,-0x74(%rbp)
lea    -0x12(%rbp),%rdi
call   1070 <BinStrToInt@plt>
mov    %eax,-0x7c(%rbp)
lea    -0x16(%rbp),%rdi
call   1070 <BinStrToInt@plt>
mov    -0x7c(%rbp),%ecx
mov    -0x78(%rbp),%esi
mov    -0x74(%rbp),%edx
imul   %eax,%ecx
lea    0xc7e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    149b <main+0x31b>
lea    0xc7a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x12(%rbp),%rdi
call   1070 <BinStrToInt@plt>
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x84(%rbp)
ff
lea    -0x16(%rbp),%rdi
call   1070 <BinStrToInt@plt>
movss  -0x84(%rbp),%xmm0
ff
cvtsi2ss %eax,%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x34(%rbp)
lea    -0x12(%rbp),%rdi
call   1070 <BinStrToInt@plt>
mov    %eax,-0x80(%rbp)
lea    -0x16(%rbp),%rdi
call   1070 <BinStrToInt@plt>
mov    -0x80(%rbp),%esi
mov    %eax,%edx
movss  -0x34(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc21(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xc22(%rip),%rdi
call   1030 <system@plt>
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x20,%rsp
movl   $0x0,0x8(%rsp)
movl   $0x0,0x4(%rsp)
movb   $0x0,0x16(%rsp)
lea    0xf14(%rip),%rdi
call   1030 <puts@plt>
lea    0xe7c(%rip),%rdi
lea    0xf(%rsp),%rsi
call   1080 <scanf@plt>
movsbl 0xf(%rsp),%edi
lea    0x17(%rsp),%rbx
mov    %rbx,%rsi
call   10a0 <byte2bits@plt>
mov    0x2e09(%rip),%rax
mov    (%rax),%edi
lea    0xe53(%rip),%rsi
mov    %rbx,%rdx
call   1060 <fprintf@plt>
mov    0x17(%rsp),%al
mov    %al,0x8(%rsp)
movzwl 0x18(%rsp),%eax
mov    %ax,0x9(%rsp)
movzwl 0x1a(%rsp),%eax
mov    %ax,0x14(%rsp)
mov    0x1c(%rsp),%al
mov    %al,0x4(%rsp)
movzwl 0x1d(%rsp),%eax
mov    %ax,0x5(%rsp)
lea    0xe2d(%rip),%r14
lea    0x8(%rsp),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x14(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1090 <atoi@plt>
cmp    $0xb,%eax
ja     13d8 <main+0x258>
mov    %eax,%eax
lea    0xd99(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xdd8(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x8(%rsp),%r14
mov    %r14,%rdi
call   1070 <BinStrToInt@plt>
mov    %eax,%r12d
lea    0x4(%rsp),%r15
mov    %r15,%rdi
call   1070 <BinStrToInt@plt>
mov    %eax,%ebx
mov    %r14,%rdi
call   1070 <BinStrToInt@plt>
mov    %eax,%ebp
mov    %r15,%rdi
call   1070 <BinStrToInt@plt>
add    %eax,%ebp
lea    0xd9d(%rip),%rdi
mov    %r12d,%esi
mov    %ebx,%edx
mov    %ebp,%ecx
jmp    135a <main+0x1da>
lea    0xe13(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%r14
mov    %r14,%rdi
call   1070 <BinStrToInt@plt>
mov    %eax,%r15d
lea    0x4(%rsp),%r12
mov    %r12,%rdi
call   1070 <BinStrToInt@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1070 <BinStrToInt@plt>
mov    %eax,%ebx
mov    %r12,%rdi
call   1070 <BinStrToInt@plt>
sub    %eax,%ebx
lea    0xd5a(%rip),%rdi
jmp    1353 <main+0x1d3>
lea    0xdba(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%r14
mov    %r14,%rdi
call   1070 <BinStrToInt@plt>
mov    %eax,%r15d
lea    0x4(%rsp),%r12
mov    %r12,%rdi
call   1070 <BinStrToInt@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1070 <BinStrToInt@plt>
mov    %eax,%ebx
mov    %r12,%rdi
call   1070 <BinStrToInt@plt>
imul   %eax,%ebx
lea    0xd20(%rip),%rdi
mov    %r15d,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
jmp    13d8 <main+0x258>
lea    0xd59(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1070 <BinStrToInt@plt>
cvtsi2ss %eax,%xmm0
movss  %xmm0,0x10(%rsp)
lea    0x4(%rsp),%rbp
mov    %rbp,%rdi
call   1070 <BinStrToInt@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  0x10(%rsp),%xmm1
divss  %xmm0,%xmm1
movss  %xmm1,0x10(%rsp)
mov    %rbx,%rdi
call   1070 <BinStrToInt@plt>
mov    %eax,%ebx
mov    %rbp,%rdi
call   1070 <BinStrToInt@plt>
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xcb5(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xcb2(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"Char: \0A\00"
@.str.1 = [3 x i8] c"%c\00"
@stdout = global i32 0
@.str.2 = [23 x i8] c"No sistema binario %s\0A\00"
@.str.3 = [5 x i8] c"%s \0A\00"
@.str.4 = [6 x i8] c"Soma:\00"
@.str.5 = [15 x i8] c"%d + %d = %d \0A\00"
@.str.6 = [14 x i8] c"Subtra\C3\A7\C3\A3o \0A\00"
@.str.7 = [15 x i8] c"%d - %d = %d \0A\00"
@.str.8 = [18 x i8] c"Multiplica\C3\A7\C3\A3o \0A\00"
@.str.9 = [15 x i8] c"%d * %d = %d \0A\00"
@.str.10 = [11 x i8] c"Divis\C3\A3o \0A\00"
@.str.11 = [15 x i8] c"%d / %d = %f \0A\00"
@.str.12 = [43 x i8] c"read -p \22Pressione enter para sair\22 saindo\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca [9 x i8]
%4 = alloca [4 x i8]
%5 = alloca [4 x i8]
%6 = alloca [3 x i8]
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca float
store i32 0, i32* %1
%13 = bitcast [4 x i8]* %4 to i8*
%14 = bitcast [4 x i8]* %5 to i8*
%15 = bitcast [3 x i8]* %6 to i8*
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%18 = load i8, i8* %2
%19 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%20 = call i32 @byte2bits(i8 signext %18, i8* %19)
%21 = load i32, i32* @stdout
%22 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%23 = call i32 @fprintf(i32 %21, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* %22)
store i32 0, i32* %7
br label %24
24: ; preds = %65, %0
%25 = load i32, i32* %7
%26 = icmp slt i32 %25, 8
br i1 %26, label %27, label %68
27: ; preds = %24
%28 = load i32, i32* %7
%29 = icmp slt i32 %28, 3
br i1 %29, label %30, label %40
30: ; preds = %27
%31 = load i32, i32* %7
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 %32
%34 = load i8, i8* %33
%35 = load i32, i32* %8
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 %36
store i8 %34, i8* %37
%38 = load i32, i32* %8
%39 = add nsw i32 %38, 1
store i32 %39, i32* %8
br label %64
40: ; preds = %27
%41 = load i32, i32* %7
%42 = icmp sgt i32 %41, 4
br i1 %42, label %43, label %53
43: ; preds = %40
%44 = load i32, i32* %7
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 %45
%47 = load i8, i8* %46
%48 = load i32, i32* %9
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 %49
store i8 %47, i8* %50
%51 = load i32, i32* %9
%52 = add nsw i32 %51, 1
store i32 %52, i32* %9
br label %63
53: ; preds = %40
%54 = load i32, i32* %7
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 %55
%57 = load i8, i8* %56
%58 = load i32, i32* %10
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [3 x i8], [3 x i8]* %6, i64 0, i64 %59
store i8 %57, i8* %60
%61 = load i32, i32* %10
%62 = add nsw i32 %61, 1
store i32 %62, i32* %10
br label %63
63: ; preds = %53, %43
br label %64
64: ; preds = %63, %30
br label %65
65: ; preds = %64
%66 = load i32, i32* %7
%67 = add nsw i32 %66, 1
store i32 %67, i32* %7
br label %24
68: ; preds = %24
%69 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %69)
%71 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %71)
%73 = getelementptr inbounds [3 x i8], [3 x i8]* %6, i64 0, i64 0
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %73)
%75 = getelementptr inbounds [3 x i8], [3 x i8]* %6, i64 0, i64 0
%76 = call i32 @atoi(i8* %75)
store i32 %76, i32* %11
%77 = load i32, i32* %11
switch i32 %77, label %130 [
i32 0, label %78
i32 1, label %90
i32 10, label %102
i32 11, label %114
]
78: ; preds = %68
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%80 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%81 = call i32 @BinStrToInt(i8* %80)
%82 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%83 = call i32 @BinStrToInt(i8* %82)
%84 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%85 = call i32 @BinStrToInt(i8* %84)
%86 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%87 = call i32 @BinStrToInt(i8* %86)
%88 = add nsw i32 %85, %87
%89 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i32 %81, i32 %83, i32 %88)
br label %130
90: ; preds = %68
%91 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0))
%92 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%93 = call i32 @BinStrToInt(i8* %92)
%94 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%95 = call i32 @BinStrToInt(i8* %94)
%96 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%97 = call i32 @BinStrToInt(i8* %96)
%98 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%99 = call i32 @BinStrToInt(i8* %98)
%100 = sub nsw i32 %97, %99
%101 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0), i32 %93, i32 %95, i32 %100)
br label %130
102: ; preds = %68
%103 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0))
%104 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%105 = call i32 @BinStrToInt(i8* %104)
%106 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%107 = call i32 @BinStrToInt(i8* %106)
%108 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%109 = call i32 @BinStrToInt(i8* %108)
%110 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%111 = call i32 @BinStrToInt(i8* %110)
%112 = mul nsw i32 %109, %111
%113 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0), i32 %105, i32 %107, i32 %112)
br label %130
114: ; preds = %68
%115 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0))
%116 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%117 = call i32 @BinStrToInt(i8* %116)
%118 = sitofp i32 %117 to float
%119 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%120 = call i32 @BinStrToInt(i8* %119)
%121 = sitofp i32 %120 to float
%122 = fdiv float %118, %121
store float %122, float* %12
%123 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%124 = call i32 @BinStrToInt(i8* %123)
%125 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%126 = call i32 @BinStrToInt(i8* %125)
%127 = load float, float* %12
%128 = fpext float %127 to double
%129 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.11, i64 0, i64 0), i32 %124, i32 %126, double %128)
br label %130
130: ; preds = %68, %114, %102, %90, %78
%131 = call i32 @system(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.12, i64 0, i64 0))
%132 = load i32, i32* %1
ret i32 %132
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%c\00"
@stdout = global i32 0
@.str.2 = [23 x i8] c"No sistema binario %s\0A\00"
@.str.3 = [5 x i8] c"%s \0A\00"
@.str.4 = [6 x i8] c"Soma:\00"
@.str.5 = [15 x i8] c"%d + %d = %d \0A\00"
@.str.7 = [15 x i8] c"%d - %d = %d \0A\00"
@.str.9 = [15 x i8] c"%d * %d = %d \0A\00"
@.str.11 = [15 x i8] c"%d / %d = %f \0A\00"
@.str.12 = [43 x i8] c"read -p \22Pressione enter para sair\22 saindo\00"
@str = [7 x i8] c"Char: \00"
@str.13 = [10 x i8] c"Divis\C3\A3o \00"
@str.14 = [17 x i8] c"Multiplica\C3\A7\C3\A3o \00"
@str.15 = [13 x i8] c"Subtra\C3\A7\C3\A3o \00"
define i32 @main() {
%1 = alloca i8
%2 = alloca [9 x i8]
%3 = alloca i32
%4 = bitcast i32* %3 to [4 x i8]*
%5 = alloca i32
%6 = bitcast i32* %5 to [4 x i8]*
%7 = alloca [3 x i8]
%8 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 0
%9 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%10 = bitcast i32* %5 to i8*
store i32 0, i32* %5
%11 = getelementptr inbounds [3 x i8], [3 x i8]* %7, i64 0, i64 0
%12 = getelementptr inbounds [3 x i8], [3 x i8]* %7, i64 0, i64 2
store i8 0, i8* %12
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%15 = load i8, i8* %1
%16 = call i32 @byte2bits(i8 signext %15, i8* %8)
%17 = load i32, i32* @stdout
%18 = call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* %8)
%19 = load i8, i8* %8
%20 = bitcast i32* %3 to i8*
store i8 %19, i8* %20
%21 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 1
%22 = load i8, i8* %21
%23 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 1
store i8 %22, i8* %23
%24 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 2
%25 = load i8, i8* %24
%26 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 2
store i8 %25, i8* %26
%27 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 3
%28 = load i8, i8* %27
store i8 %28, i8* %11
%29 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 4
%30 = load i8, i8* %29
%31 = getelementptr inbounds [3 x i8], [3 x i8]* %7, i64 0, i64 1
store i8 %30, i8* %31
%32 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 5
%33 = load i8, i8* %32
%34 = bitcast i32* %5 to i8*
store i8 %33, i8* %34
%35 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 6
%36 = load i8, i8* %35
%37 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 1
store i8 %36, i8* %37
%38 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 7
%39 = load i8, i8* %38
%40 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 2
store i8 %39, i8* %40
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32* %3)
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32* %5)
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %11)
%44 = call i32 @atoi(i8* %11)
switch i32 %44, label %80 [
i32 0, label %45
i32 1, label %53
i32 10, label %61
i32 11, label %69
]
45: ; preds = %0
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%47 = call i32 @BinStrToInt(i8* %9)
%48 = call i32 @BinStrToInt(i8* %10)
%49 = call i32 @BinStrToInt(i8* %9)
%50 = call i32 @BinStrToInt(i8* %10)
%51 = add nsw i32 %50, %49
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i32 %47, i32 %48, i32 %51)
br label %80
53: ; preds = %0
%54 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.15, i64 0, i64 0))
%55 = call i32 @BinStrToInt(i8* %9)
%56 = call i32 @BinStrToInt(i8* %10)
%57 = call i32 @BinStrToInt(i8* %9)
%58 = call i32 @BinStrToInt(i8* %10)
%59 = sub nsw i32 %57, %58
%60 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0), i32 %55, i32 %56, i32 %59)
br label %80
61: ; preds = %0
%62 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.14, i64 0, i64 0))
%63 = call i32 @BinStrToInt(i8* %9)
%64 = call i32 @BinStrToInt(i8* %10)
%65 = call i32 @BinStrToInt(i8* %9)
%66 = call i32 @BinStrToInt(i8* %10)
%67 = mul nsw i32 %66, %65
%68 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0), i32 %63, i32 %64, i32 %67)
br label %80
69: ; preds = %0
%70 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.13, i64 0, i64 0))
%71 = call i32 @BinStrToInt(i8* %9)
%72 = sitofp i32 %71 to float
%73 = call i32 @BinStrToInt(i8* %10)
%74 = sitofp i32 %73 to float
%75 = fdiv float %72, %74
%76 = call i32 @BinStrToInt(i8* %9)
%77 = call i32 @BinStrToInt(i8* %10)
%78 = fpext float %75 to double
%79 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.11, i64 0, i64 0), i32 %76, i32 %77, double %78)
br label %80
80: ; preds = %0, %69, %61, %53, %45
%81 = call i32 @system(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.12, i64 0, i64 0))
ret i32 0
}