#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 */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *, char);
scalar_t__ scanf(char *, int *);
void main() {
  int num2 = 0;
  int num1 = 0;
  scanf("%x", &num1);
  while (scanf("%x", &num2) != EOF) {
    printf("%c", (char)num2 - num1);
    num1 = num2;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeb3(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    0x2e8b(%rip),%rcx
cmp    (%rcx),%rax
je     1189 <main+0x69>
mov    -0x4(%rbp),%eax
movsbl %al,%eax
sub    -0x8(%rbp),%eax
lea    0xe8d(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1146 <main+0x26>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
movl   $0x0,(%rsp)
movl   $0x0,0x4(%rsp)
lea    0xec2(%rip),%rbx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0x2e8b(%rip),%r12
cmp    (%r12),%rax
je     11aa <main+0x8a>
lea    0xe99(%rip),%r14
lea    0xe8f(%rip),%r15
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%rsp),%eax
sub    0x4(%rsp),%eax
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    (%rsp),%eax
mov    %eax,0x4(%rsp)
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmp    (%r12),%rax
jne    1180 <main+0x60>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%x\00"
@EOF = global i64 0
@.str.1 = [3 x i8] c"%c\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %4
4: ; preds = %8, %0
%5 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = load i64, i64* @EOF
%7 = icmp ne i64 %5, %6
br i1 %7, label %8, label %17
8: ; preds = %4
%9 = load i32, i32* %1
%10 = trunc i32 %9 to i8
%11 = sext i8 %10 to i32
%12 = load i32, i32* %2
%13 = sub nsw i32 %11, %12
%14 = trunc i32 %13 to i8
%15 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %14)
%16 = load i32, i32* %1
store i32 %16, i32* %2
br label %4
17: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%x\00"
@EOF = global i64 0
@.str.1 = [3 x i8] c"%c\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%7 = load i64, i64* @EOF
%8 = icmp eq i64 %6, %7
br i1 %8, label %19, label %9
9: ; preds = %0, %9
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = sub i32 %10, %11
%13 = trunc i32 %12 to i8
%14 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %13)
%15 = load i32, i32* %1
store i32 %15, i32* %2
%16 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%17 = load i64, i64* @EOF
%18 = icmp eq i64 %16, %17
br i1 %18, label %19, label %9
19: ; preds = %9, %0
ret void
}