void setup_stepper_pins() {
  *(unsigned char *)0x5007 |= 0x0f;
  *(unsigned char *)0x5008 |= 0x0f;
  *(unsigned char *)0x5009 |= 0x0f;
  *(unsigned char *)0x5011 |= 0x1f;
  *(unsigned char *)0x5012 |= 0x1f;
  *(unsigned char *)0x5013 |= 0x1f;
  do {
    *(unsigned char *)0x5005 &= ~0x0f;
    *(unsigned char *)0x500F &= ~0x07;
    *(unsigned char *)0x500F |= 0x18;
  } while (0);
}


x86 assembly (clang, -O0):
<setup_stepper_pins>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5007,%eax
movzbl (%rax),%eax
or     $0xf,%eax
mov    %al,%cl
mov    $0x5007,%eax
mov    %cl,(%rax)
mov    $0x5008,%eax
movzbl (%rax),%eax
or     $0xf,%eax
mov    %al,%cl
mov    $0x5008,%eax
mov    %cl,(%rax)
mov    $0x5009,%eax
movzbl (%rax),%eax
or     $0xf,%eax
mov    %al,%cl
mov    $0x5009,%eax
mov    %cl,(%rax)
mov    $0x5011,%eax
movzbl (%rax),%eax
or     $0x1f,%eax
mov    %al,%cl
mov    $0x5011,%eax
mov    %cl,(%rax)
mov    $0x5012,%eax
movzbl (%rax),%eax
or     $0x1f,%eax
mov    %al,%cl
mov    $0x5012,%eax
mov    %cl,(%rax)
mov    $0x5013,%eax
movzbl (%rax),%eax
or     $0x1f,%eax
mov    %al,%cl
mov    $0x5013,%eax
mov    %cl,(%rax)
mov    $0x5005,%eax
movzbl (%rax),%eax
and    $0xfffffff0,%eax
mov    %al,%cl
mov    $0x5005,%eax
mov    %cl,(%rax)
mov    $0x500f,%eax
movzbl (%rax),%eax
and    $0xfffffff8,%eax
mov    %al,%cl
mov    $0x500f,%eax
mov    %cl,(%rax)
mov    $0x500f,%eax
movzbl (%rax),%eax
or     $0x18,%eax
mov    %al,%cl
mov    $0x500f,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup_stepper_pins>:
orb    $0xf,0x5007
0f
orb    $0xf,0x5008
0f
orb    $0xf,0x5009
0f
orb    $0x1f,0x5011
1f
orb    $0x1f,0x5012
1f
orb    $0x1f,0x5013
1f
andb   $0xf0,0x5005
f0
mov    0x500f,%al
and    $0xe0,%al
or     $0x18,%al
mov    %al,0x500f
ret

LLVM IR (-O0):
define void @setup_stepper_pins() {
%1 = load i8, i8* inttoptr (i64 20487 to i8*)
%2 = zext i8 %1 to i32
%3 = or i32 %2, 15
%4 = trunc i32 %3 to i8
store i8 %4, i8* inttoptr (i64 20487 to i8*)
%5 = load i8, i8* inttoptr (i64 20488 to i8*)
%6 = zext i8 %5 to i32
%7 = or i32 %6, 15
%8 = trunc i32 %7 to i8
store i8 %8, i8* inttoptr (i64 20488 to i8*)
%9 = load i8, i8* inttoptr (i64 20489 to i8*)
%10 = zext i8 %9 to i32
%11 = or i32 %10, 15
%12 = trunc i32 %11 to i8
store i8 %12, i8* inttoptr (i64 20489 to i8*)
%13 = load i8, i8* inttoptr (i64 20497 to i8*)
%14 = zext i8 %13 to i32
%15 = or i32 %14, 31
%16 = trunc i32 %15 to i8
store i8 %16, i8* inttoptr (i64 20497 to i8*)
%17 = load i8, i8* inttoptr (i64 20498 to i8*)
%18 = zext i8 %17 to i32
%19 = or i32 %18, 31
%20 = trunc i32 %19 to i8
store i8 %20, i8* inttoptr (i64 20498 to i8*)
%21 = load i8, i8* inttoptr (i64 20499 to i8*)
%22 = zext i8 %21 to i32
%23 = or i32 %22, 31
%24 = trunc i32 %23 to i8
store i8 %24, i8* inttoptr (i64 20499 to i8*)
br label %25
25: ; preds = %0
%26 = load i8, i8* inttoptr (i64 20485 to i8*)
%27 = zext i8 %26 to i32
%28 = and i32 %27, -16
%29 = trunc i32 %28 to i8
store i8 %29, i8* inttoptr (i64 20485 to i8*)
%30 = load i8, i8* inttoptr (i64 20495 to i8*)
%31 = zext i8 %30 to i32
%32 = and i32 %31, -8
%33 = trunc i32 %32 to i8
store i8 %33, i8* inttoptr (i64 20495 to i8*)
%34 = load i8, i8* inttoptr (i64 20495 to i8*)
%35 = zext i8 %34 to i32
%36 = or i32 %35, 24
%37 = trunc i32 %36 to i8
store i8 %37, i8* inttoptr (i64 20495 to i8*)
br label %38
38: ; preds = %25
ret void
}

LLVM IR (-O2):
define void @setup_stepper_pins() {
%1 = load i8, i8* inttoptr (i64 20487 to i8*)
%2 = or i8 %1, 15
store i8 %2, i8* inttoptr (i64 20487 to i8*)
%3 = load i8, i8* inttoptr (i64 20488 to i8*)
%4 = or i8 %3, 15
store i8 %4, i8* inttoptr (i64 20488 to i8*)
%5 = load i8, i8* inttoptr (i64 20489 to i8*)
%6 = or i8 %5, 15
store i8 %6, i8* inttoptr (i64 20489 to i8*)
%7 = load i8, i8* inttoptr (i64 20497 to i8*)
%8 = or i8 %7, 31
store i8 %8, i8* inttoptr (i64 20497 to i8*)
%9 = load i8, i8* inttoptr (i64 20498 to i8*)
%10 = or i8 %9, 31
store i8 %10, i8* inttoptr (i64 20498 to i8*)
%11 = load i8, i8* inttoptr (i64 20499 to i8*)
%12 = or i8 %11, 31
store i8 %12, i8* inttoptr (i64 20499 to i8*)
%13 = load i8, i8* inttoptr (i64 20485 to i8*)
%14 = and i8 %13, -16
store i8 %14, i8* inttoptr (i64 20485 to i8*)
%15 = load i8, i8* inttoptr (i64 20495 to i8*)
%16 = and i8 %15, -32
%17 = or i8 %16, 24
store i8 %17, i8* inttoptr (i64 20495 to i8*)
ret void
}