#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 compruebaCar(char *, char *);
int convHex(char, char);
int /*<<< orphan*/ printf(char *, char, char, int);
int main() {
  char car1 = '0';
  char car2 = '0';
  int comprueba = 0;
  int devolucion;
  while (!(car1 == 'q' && car2 == 'q')) {
    comprueba = compruebaCar(&car1, &car2);
    devolucion = convHex(car1, car2);
    if (devolucion != -1)
      printf("El valor decimal de 0x%c%c es %d\n", car1, car2, devolucion);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x30,-0x5(%rbp)
movb   $0x30,-0x6(%rbp)
movl   $0x0,-0xc(%rbp)
movsbl -0x5(%rbp),%ecx
xor    %eax,%eax
cmp    $0x71,%ecx
mov    %al,-0x11(%rbp)
jne    116d <main+0x3d>
movsbl -0x6(%rbp),%eax
cmp    $0x71,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
xor    $0xff,%al
test   $0x1,%al
jne    117f <main+0x4f>
jmp    11cb <main+0x9b>
lea    -0x5(%rbp),%rdi
lea    -0x6(%rbp),%rsi
call   1050 <compruebaCar@plt>
mov    %eax,-0xc(%rbp)
mov    -0x5(%rbp),%al
movsbl %al,%edi
movsbl -0x6(%rbp),%esi
call   1040 <convHex@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0xffffffff,-0x10(%rbp)
je     11c6 <main+0x96>
mov    -0x5(%rbp),%dl
mov    -0x6(%rbp),%al
mov    -0x10(%rbp),%ecx
lea    0xe45(%rip),%rdi
movsbl %dl,%esi
movsbl %al,%edx
call   1030 <printf@plt>
jmp    114e <main+0x1e>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movb   $0x30,0xf(%rsp)
movb   $0x30,0xe(%rsp)
lea    0xf(%rsp),%r14
lea    0xe(%rsp),%rbx
lea    0xeac(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <compruebaCar@plt>
movsbl 0xf(%rsp),%edi
movsbl 0xe(%rsp),%esi
call   1040 <convHex@plt>
cmp    $0xffffffff,%eax
je     1193 <main+0x63>
movsbl 0xf(%rsp),%esi
movsbl 0xe(%rsp),%edx
mov    %r15,%rdi
mov    %eax,%ecx
call   1030 <printf@plt>
cmpb   $0x71,0xf(%rsp)
jne    1160 <main+0x30>
cmpb   $0x71,0xe(%rsp)
jne    1160 <main+0x30>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [34 x i8] c"El valor decimal de 0x%c%c es %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i8 48, i8* %2
store i8 48, i8* %3
store i32 0, i32* %4
br label %6
6: ; preds = %29, %0
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 113
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i8, i8* %3
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 113
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ false, %6 ], [ %13, %10 ]
%16 = xor i1 %15, true
br i1 %16, label %17, label %30
17: ; preds = %14
%18 = call i32 @compruebaCar(i8* %2, i8* %3)
store i32 %18, i32* %4
%19 = load i8, i8* %2
%20 = load i8, i8* %3
%21 = call i32 @convHex(i8 signext %19, i8 signext %20)
store i32 %21, i32* %5
%22 = load i32, i32* %5
%23 = icmp ne i32 %22, -1
br i1 %23, label %24, label %29
24: ; preds = %17
%25 = load i8, i8* %2
%26 = load i8, i8* %3
%27 = load i32, i32* %5
%28 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8 signext %25, i8 signext %26, i32 %27)
br label %29
29: ; preds = %24, %17
br label %6
30: ; preds = %14
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"El valor decimal de 0x%c%c es %d\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca i8
store i8 48, i8* %1
store i8 48, i8* %2
br label %3
3: ; preds = %0, %13
%4 = call i32 @compruebaCar(i8* %1, i8* %2)
%5 = load i8, i8* %1
%6 = load i8, i8* %2
%7 = call i32 @convHex(i8 signext %5, i8 signext %6)
%8 = icmp eq i32 %7, -1
br i1 %8, label %13, label %9
9: ; preds = %3
%10 = load i8, i8* %1
%11 = load i8, i8* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8 signext %10, i8 signext %11, i32 %7)
br label %13
13: ; preds = %9, %3
%14 = load i8, i8* %1
%15 = icmp ne i8 %14, 113
%16 = load i8, i8* %2
%17 = icmp ne i8 %16, 113
%18 = select i1 %15, i1 true, i1 %17
br i1 %18, label %3, label %19
19: ; preds = %13
ret i32 0
}