#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 int);
int main(int arg, char *argv[]) {
  int a = 195;
  char c;
  int b, d, e;
  unsigned int f;
  c = (char)a;
  b = (int)c;
  d = (b + 256) % 256;
  e = c;
  f = c;
  printf("c=%i\n", c);
  printf("b=%i\n", b);
  printf("d=%i\n", d);
  printf("e=%i\n", e);
  printf("f=%i\n", f);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xc3,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %al,-0x15(%rbp)
movsbl -0x15(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x100,%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %edx,-0x20(%rbp)
movsbl -0x15(%rbp),%eax
mov    %eax,-0x24(%rbp)
movsbl -0x15(%rbp),%eax
mov    %eax,-0x28(%rbp)
movsbl -0x15(%rbp),%esi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%esi
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x24(%rbp),%esi
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
mov    -0x28(%rbp),%esi
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0xffffffc3,%esi
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
mov    $0xffffffc3,%esi
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
mov    $0xc3,%esi
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
mov    $0xffffffc3,%esi
call   1030 <printf@plt>
lea    0xebc(%rip),%rdi
mov    $0xffffffc3,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"c=%i\0A\00"
@.str.1 = [6 x i8] c"b=%i\0A\00"
@.str.2 = [6 x i8] c"d=%i\0A\00"
@.str.3 = [6 x i8] c"e=%i\0A\00"
@.str.4 = [6 x i8] c"f=%i\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i8
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i32 195, i32* %5
%11 = load i32, i32* %5
%12 = trunc i32 %11 to i8
store i8 %12, i8* %6
%13 = load i8, i8* %6
%14 = sext i8 %13 to i32
store i32 %14, i32* %7
%15 = load i32, i32* %7
%16 = add nsw i32 %15, 256
%17 = srem i32 %16, 256
store i32 %17, i32* %8
%18 = load i8, i8* %6
%19 = sext i8 %18 to i32
store i32 %19, i32* %9
%20 = load i8, i8* %6
%21 = sext i8 %20 to i32
store i32 %21, i32* %10
%22 = load i8, i8* %6
%23 = sext i8 %22 to i32
%24 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %23)
%25 = load i32, i32* %7
%26 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %25)
%27 = load i32, i32* %8
%28 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %27)
%29 = load i32, i32* %9
%30 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %29)
%31 = load i32, i32* %10
%32 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %31)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"c=%i\0A\00"
@.str.1 = [6 x i8] c"b=%i\0A\00"
@.str.2 = [6 x i8] c"d=%i\0A\00"
@.str.3 = [6 x i8] c"e=%i\0A\00"
@.str.4 = [6 x i8] c"f=%i\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 -61)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 -61)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 195)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 -61)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 -61)
ret i32 0
}