#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 /*<<< orphan*/ print_int(char);
int /*<<< orphan*/ print_string(char *);
void main(void) {
  int x, y;
  char letter;
  x = 'A' + 'A';
  letter = 'A' + 'A';
  print_string("Should print 130\n");
  print_int(x);
  print_string("\n\n");
  print_string("Should print -126\n");
  print_int(letter);
  print_string("\n\n");
  letter = letter + 'B';
  print_string("Should print -60\n");
  print_int(letter);
  print_string("\n\n");
  letter = letter + 60;
  print_string("Should print 0\n");
  print_int(letter);
  print_string("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x82,-0x4(%rbp)
movb   $0x82,-0x9(%rbp)
lea    0xec6(%rip),%rdi
call   1030 <print_string@plt>
mov    -0x4(%rbp),%eax
movsbl %al,%edi
call   1040 <print_int@plt>
lea    0xec1(%rip),%rdi
call   1030 <print_string@plt>
lea    0xeb8(%rip),%rdi
call   1030 <print_string@plt>
movsbl -0x9(%rbp),%edi
call   1040 <print_int@plt>
lea    0xea0(%rip),%rdi
call   1030 <print_string@plt>
movsbl -0x9(%rbp),%eax
add    $0x42,%eax
mov    %al,-0x9(%rbp)
lea    0xea0(%rip),%rdi
call   1030 <print_string@plt>
movsbl -0x9(%rbp),%edi
call   1040 <print_int@plt>
lea    0xe75(%rip),%rdi
call   1030 <print_string@plt>
movsbl -0x9(%rbp),%eax
add    $0x3c,%eax
mov    %al,-0x9(%rbp)
lea    0xe87(%rip),%rdi
call   1030 <print_string@plt>
movsbl -0x9(%rbp),%edi
call   1040 <print_int@plt>
lea    0xe4b(%rip),%rdi
call   1030 <print_string@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1030 <print_string@plt>
mov    $0xffffff82,%edi
call   1040 <print_int@plt>
lea    0xed4(%rip),%rbx
mov    %rbx,%rdi
call   1030 <print_string@plt>
lea    0xec8(%rip),%rdi
call   1030 <print_string@plt>
mov    $0xffffff82,%edi
call   1040 <print_int@plt>
mov    %rbx,%rdi
call   1030 <print_string@plt>
lea    0xebd(%rip),%rdi
call   1030 <print_string@plt>
mov    $0xffffffc4,%edi
call   1040 <print_int@plt>
mov    %rbx,%rdi
call   1030 <print_string@plt>
lea    0xeb1(%rip),%rdi
call   1030 <print_string@plt>
xor    %edi,%edi
call   1040 <print_int@plt>
lea    0xe77(%rip),%rdi
pop    %rbx
jmp    1030 <print_string@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Should print 130\0A\00"
@.str.1 = [3 x i8] c"\0A\0A\00"
@.str.2 = [19 x i8] c"Should print -126\0A\00"
@.str.3 = [18 x i8] c"Should print -60\0A\00"
@.str.4 = [16 x i8] c"Should print 0\0A\00"
@.str.5 = [2 x i8] c"\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
store i32 130, i32* %1
store i8 -126, i8* %3
%4 = call i32 @print_string(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %1
%6 = trunc i32 %5 to i8
%7 = call i32 @print_int(i8 signext %6)
%8 = call i32 @print_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @print_string(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%10 = load i8, i8* %3
%11 = call i32 @print_int(i8 signext %10)
%12 = call i32 @print_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = add nsw i32 %14, 66
%16 = trunc i32 %15 to i8
store i8 %16, i8* %3
%17 = call i32 @print_string(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%18 = load i8, i8* %3
%19 = call i32 @print_int(i8 signext %18)
%20 = call i32 @print_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%21 = load i8, i8* %3
%22 = sext i8 %21 to i32
%23 = add nsw i32 %22, 60
%24 = trunc i32 %23 to i8
store i8 %24, i8* %3
%25 = call i32 @print_string(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
%26 = load i8, i8* %3
%27 = call i32 @print_int(i8 signext %26)
%28 = call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"Should print 130\0A\00"
@.str.1 = [3 x i8] c"\0A\0A\00"
@.str.2 = [19 x i8] c"Should print -126\0A\00"
@.str.3 = [18 x i8] c"Should print -60\0A\00"
@.str.4 = [16 x i8] c"Should print 0\0A\00"
@.str.5 = [2 x i8] c"\0A\00"
define void @main() {
%1 = tail call i32 @print_string(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @print_int(i8 signext -126)
%3 = tail call i32 @print_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @print_string(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @print_int(i8 signext -126)
%6 = tail call i32 @print_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @print_string(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%8 = tail call i32 @print_int(i8 signext -60)
%9 = tail call i32 @print_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%10 = tail call i32 @print_string(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
%11 = tail call i32 @print_int(i8 signext 0)
%12 = tail call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
ret void
}