#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*/ printf(char *, unsigned char);
int main(void) {
  char c1;
  unsigned char c2;
  c1 = -128;
  printf("%d\n", --c1);
  printf("%d\n", c1);
  c1 = -128;
  printf("%d\n", c1++);
  printf("%d\n", c1);
  c2 = 255;
  printf("%d\n", ++c2);
  printf("%d\n", c2);
  c2 = 255;
  printf("%d\n", c2++);
  printf("%d\n", c2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x80,-0x5(%rbp)
mov    -0x5(%rbp),%al
add    $0xff,%al
mov    %al,-0x5(%rbp)
lea    0xece(%rip),%rdi
movzbl %al,%esi
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
movzbl -0x5(%rbp),%esi
call   1030 <printf@plt>
movb   $0x80,-0x5(%rbp)
mov    -0x5(%rbp),%al
mov    %al,%cl
add    $0x1,%cl
mov    %cl,-0x5(%rbp)
lea    0xea0(%rip),%rdi
movzbl %al,%esi
call   1030 <printf@plt>
lea    0xe91(%rip),%rdi
movzbl -0x5(%rbp),%esi
call   1030 <printf@plt>
movb   $0xff,-0x6(%rbp)
mov    -0x6(%rbp),%al
add    $0x1,%al
mov    %al,-0x6(%rbp)
lea    0xe75(%rip),%rdi
movzbl %al,%esi
call   1030 <printf@plt>
lea    0xe66(%rip),%rdi
movzbl -0x6(%rbp),%esi
call   1030 <printf@plt>
movb   $0xff,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,%cl
add    $0x1,%cl
mov    %cl,-0x6(%rbp)
lea    0xe47(%rip),%rdi
movzbl %al,%esi
call   1030 <printf@plt>
lea    0xe38(%rip),%rdi
movzbl -0x6(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x7f,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x7f,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x80,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x81,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xff,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
store i32 0, i32* %1
store i8 -128, i8* %2
%4 = load i8, i8* %2
%5 = add i8 %4, -1
store i8 %5, i8* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 zeroext %5)
%7 = load i8, i8* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 zeroext %7)
store i8 -128, i8* %2
%9 = load i8, i8* %2
%10 = add i8 %9, 1
store i8 %10, i8* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 zeroext %9)
%12 = load i8, i8* %2
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 zeroext %12)
store i8 -1, i8* %3
%14 = load i8, i8* %3
%15 = add i8 %14, 1
store i8 %15, i8* %3
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 zeroext %15)
%17 = load i8, i8* %3
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 zeroext %17)
store i8 -1, i8* %3
%19 = load i8, i8* %3
%20 = add i8 %19, 1
store i8 %20, i8* %3
%21 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 zeroext %19)
%22 = load i8, i8* %3
%23 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 zeroext %22)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 zeroext 127)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 zeroext 127)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 zeroext -128)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 zeroext -127)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 zeroext 0)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 zeroext 0)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 zeroext -1)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 zeroext 0)
ret i32 0
}