#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 *, ...);
int main(int argc, char *argv[]) {
  char a = 254;
  unsigned char b = (unsigned char)a;
  char i;
  unsigned char j;
  int k;
  for (k = 0; k < 300; ++k) {
    i = k;
    printf("%d:%x ", i, i);
  }
  printf("\n");
  for (k = 0; k < 300; ++k) {
    j = k;
    printf("%d:%x ", j, j);
  }
  printf("\n");
  printf("%d %d\n", a, b);
  char i2;
  short x = -31998;
  i = x & 0xff;
  i2 = (x >> 8) & 0xff;
  printf("%x) %d:%d - %x:%x\n", x, i, i2, i, i2);
  short combine;
  combine = i & 0x00ff;
  combine |= (i2 & 0x00ff) << 8;
  printf("%d:%x\n", combine, combine);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0xfe,-0x11(%rbp)
mov    -0x11(%rbp),%al
mov    %al,-0x12(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x12c,-0x18(%rbp)
jge    116e <main+0x5e>
mov    -0x18(%rbp),%eax
mov    %al,-0x13(%rbp)
movsbl -0x13(%rbp),%esi
movsbl -0x13(%rbp),%edx
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1137 <main+0x27>
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x18(%rbp)
cmpl   $0x12c,-0x18(%rbp)
jge    11ba <main+0xaa>
mov    -0x18(%rbp),%eax
mov    %al,-0x14(%rbp)
movzbl -0x14(%rbp),%esi
movzbl -0x14(%rbp),%edx
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1183 <main+0x73>
lea    0xe4b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x11(%rbp),%esi
movzbl -0x12(%rbp),%edx
lea    0xe30(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movw   $0x8302,-0x1c(%rbp)
movswl -0x1c(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x13(%rbp)
movswl -0x1c(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,-0x19(%rbp)
movswl -0x1c(%rbp),%esi
movsbl -0x13(%rbp),%edx
movsbl -0x19(%rbp),%ecx
movsbl -0x13(%rbp),%r8d
movsbl -0x19(%rbp),%r9d
lea    0xdf2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x13(%rbp),%eax
and    $0xff,%eax
mov    %ax,-0x1e(%rbp)
movsbl -0x19(%rbp),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
movswl -0x1e(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0x1e(%rbp)
movswl -0x1e(%rbp),%esi
movswl -0x1e(%rbp),%edx
lea    0xdcb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    $0x12c,%ebp
lea    0xed0(%rip),%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebx,%edx
sar    $0x18,%edx
mov    %r14,%rdi
mov    %edx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1000000,%ebx
add    $0xffffffff,%ebp
jne    1140 <main+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe93(%rip),%rbx
xor    %ebp,%ebp
nop
movzbl %bpl,%edx
mov    %rbx,%rdi
mov    %edx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebp
cmp    $0x12c,%ebp
jne    1170 <main+0x50>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe6b(%rip),%rdi
mov    $0xfffffffe,%esi
mov    $0xfe,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe5a(%rip),%rdi
mov    $0xffff8302,%esi
mov    $0x2,%edx
mov    $0xffffff83,%ecx
mov    $0x2,%r8d
mov    $0xffffff83,%r9d
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe44(%rip),%rdi
mov    $0xffff8302,%esi
mov    $0xffff8302,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%d:%x \00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [7 x i8] c"%d %d\0A\00"
@.str.3 = [19 x i8] c"%x) %d:%d - %x:%x\0A\00"
@.str.4 = [7 x i8] c"%d:%x\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
%10 = alloca i32
%11 = alloca i8
%12 = alloca i16
%13 = alloca i16
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8 -2, i8* %6
%14 = load i8, i8* %6
store i8 %14, i8* %7
store i32 0, i32* %10
br label %15
15: ; preds = %26, %2
%16 = load i32, i32* %10
%17 = icmp slt i32 %16, 300
br i1 %17, label %18, label %29
18: ; preds = %15
%19 = load i32, i32* %10
%20 = trunc i32 %19 to i8
store i8 %20, i8* %8
%21 = load i8, i8* %8
%22 = sext i8 %21 to i32
%23 = load i8, i8* %8
%24 = sext i8 %23 to i32
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %22, i32 %24)
br label %26
26: ; preds = %18
%27 = load i32, i32* %10
%28 = add nsw i32 %27, 1
store i32 %28, i32* %10
br label %15
29: ; preds = %15
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %10
br label %31
31: ; preds = %42, %29
%32 = load i32, i32* %10
%33 = icmp slt i32 %32, 300
br i1 %33, label %34, label %45
34: ; preds = %31
%35 = load i32, i32* %10
%36 = trunc i32 %35 to i8
store i8 %36, i8* %9
%37 = load i8, i8* %9
%38 = zext i8 %37 to i32
%39 = load i8, i8* %9
%40 = zext i8 %39 to i32
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %38, i32 %40)
br label %42
42: ; preds = %34
%43 = load i32, i32* %10
%44 = add nsw i32 %43, 1
store i32 %44, i32* %10
br label %31
45: ; preds = %31
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%47 = load i8, i8* %6
%48 = sext i8 %47 to i32
%49 = load i8, i8* %7
%50 = zext i8 %49 to i32
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %48, i32 %50)
store i16 -31998, i16* %12
%52 = load i16, i16* %12
%53 = sext i16 %52 to i32
%54 = and i32 %53, 255
%55 = trunc i32 %54 to i8
store i8 %55, i8* %8
%56 = load i16, i16* %12
%57 = sext i16 %56 to i32
%58 = ashr i32 %57, 8
%59 = and i32 %58, 255
%60 = trunc i32 %59 to i8
store i8 %60, i8* %11
%61 = load i16, i16* %12
%62 = sext i16 %61 to i32
%63 = load i8, i8* %8
%64 = sext i8 %63 to i32
%65 = load i8, i8* %11
%66 = sext i8 %65 to i32
%67 = load i8, i8* %8
%68 = sext i8 %67 to i32
%69 = load i8, i8* %11
%70 = sext i8 %69 to i32
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 %62, i32 %64, i32 %66, i32 %68, i32 %70)
%72 = load i8, i8* %8
%73 = sext i8 %72 to i32
%74 = and i32 %73, 255
%75 = trunc i32 %74 to i16
store i16 %75, i16* %13
%76 = load i8, i8* %11
%77 = sext i8 %76 to i32
%78 = and i32 %77, 255
%79 = shl i32 %78, 8
%80 = load i16, i16* %13
%81 = sext i16 %80 to i32
%82 = or i32 %81, %79
%83 = trunc i32 %82 to i16
store i16 %83, i16* %13
%84 = load i16, i16* %13
%85 = sext i16 %84 to i32
%86 = load i16, i16* %13
%87 = sext i16 %86 to i32
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 %85, i32 %87)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d:%x \00"
@.str.2 = [7 x i8] c"%d %d\0A\00"
@.str.3 = [19 x i8] c"%x) %d:%d - %x:%x\0A\00"
@.str.4 = [7 x i8] c"%d:%x\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i32 [ 0, %2 ], [ %8, %3 ]
%5 = shl i32 %4, 24
%6 = ashr exact i32 %5, 24
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %6)
%8 = add nuw nsw i32 %4, 1
%9 = icmp eq i32 %8, 300
br i1 %9, label %10, label %3
10: ; preds = %3
%11 = tail call i32 @putchar(i32 10)
br label %12
12: ; preds = %10, %12
%13 = phi i32 [ 0, %10 ], [ %16, %12 ]
%14 = and i32 %13, 255
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %14)
%16 = add nuw nsw i32 %13, 1
%17 = icmp eq i32 %16, 300
br i1 %17, label %18, label %12
18: ; preds = %12
%19 = tail call i32 @putchar(i32 10)
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 -2, i32 254)
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 -31998, i32 2, i32 -125, i32 2, i32 -125)
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 -31998, i32 -31998)
ret i32 0
}