#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 */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ uart_putf(char *, int);
void config_vtp_x(void) {
  uart_putf("DEBUG%i\n", (200));
  *(uint32_t *)(0x44E10E0C) =
      (uint32_t)(*(uint32_t *)(0x44E10E0C) | (0x1 << 6));
  uart_putf("DEBUG%i\n", (201));
  *(uint32_t *)(0x44E10E0C) = (uint32_t)(*(uint32_t *)(0x44E10E0C) & (~0x1));
  uart_putf("DEBUG%i\n", (202));
  *(uint32_t *)(0x44E10E0C) = (uint32_t)(*(uint32_t *)(0x44E10E0C) | 0x1);
  uart_putf("DEBUG%i\n", (203));
  while ((*(uint32_t *)(0x44E10E0C) & (0x1 << 5)) != (0x1 << 5))
    ;
  uart_putf("DEBUG%i\n", (204));
}


x86 assembly (clang, -O0):
<config_vtp_x>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0xc8,%esi
call   1030 <uart_putf@plt>
mov    $0x44e10e0c,%eax
mov    (%rax),%ecx
or     $0x40,%ecx
mov    $0x44e10e0c,%eax
mov    %ecx,(%rax)
lea    0xec3(%rip),%rdi
mov    $0xc9,%esi
call   1030 <uart_putf@plt>
mov    $0x44e10e0c,%eax
mov    (%rax),%ecx
and    $0xfffffffe,%ecx
mov    $0x44e10e0c,%eax
mov    %ecx,(%rax)
lea    0xea1(%rip),%rdi
mov    $0xca,%esi
call   1030 <uart_putf@plt>
mov    $0x44e10e0c,%eax
mov    (%rax),%ecx
or     $0x1,%ecx
mov    $0x44e10e0c,%eax
mov    %ecx,(%rax)
lea    0xe7f(%rip),%rdi
mov    $0xcb,%esi
call   1030 <uart_putf@plt>
mov    $0x44e10e0c,%eax
mov    (%rax),%eax
and    $0x20,%eax
cmp    $0x20,%eax
je     11a3 <config_vtp_x+0x93>
jmp    118b <config_vtp_x+0x7b>
lea    0xe56(%rip),%rdi
mov    $0xcc,%esi
call   1030 <uart_putf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<config_vtp_x>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0xc8,%esi
call   1030 <uart_putf@plt>
orb    $0x40,0x44e10e0c
40
mov    %rbx,%rdi
mov    $0xc9,%esi
call   1030 <uart_putf@plt>
andb   $0xfe,0x44e10e0c
fe
mov    %rbx,%rdi
mov    $0xca,%esi
call   1030 <uart_putf@plt>
orb    $0x1,0x44e10e0c
01
mov    %rbx,%rdi
mov    $0xcb,%esi
call   1030 <uart_putf@plt>
testb  $0x20,0x44e10e0c
20
jne    1172 <config_vtp_x+0x62>
xchg   %ax,%ax
jmp    1170 <config_vtp_x+0x60>
lea    0xe87(%rip),%rdi
mov    $0xcc,%esi
pop    %rbx
jmp    1030 <uart_putf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"DEBUG%i\0A\00"
define void @config_vtp_x() {
%1 = call i32 @uart_putf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 200)
%2 = load i32, i32* inttoptr (i64 1155599884 to i32*)
%3 = or i32 %2, 64
store i32 %3, i32* inttoptr (i64 1155599884 to i32*)
%4 = call i32 @uart_putf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 201)
%5 = load i32, i32* inttoptr (i64 1155599884 to i32*)
%6 = and i32 %5, -2
store i32 %6, i32* inttoptr (i64 1155599884 to i32*)
%7 = call i32 @uart_putf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 202)
%8 = load i32, i32* inttoptr (i64 1155599884 to i32*)
%9 = or i32 %8, 1
store i32 %9, i32* inttoptr (i64 1155599884 to i32*)
%10 = call i32 @uart_putf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 203)
br label %11
11: ; preds = %15, %0
%12 = load i32, i32* inttoptr (i64 1155599884 to i32*)
%13 = and i32 %12, 32
%14 = icmp ne i32 %13, 32
br i1 %14, label %15, label %16
15: ; preds = %11
br label %11
16: ; preds = %11
%17 = call i32 @uart_putf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 204)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"DEBUG%i\0A\00"
define void @config_vtp_x() {
%1 = tail call i32 @uart_putf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 200)
%2 = load i32, i32* inttoptr (i64 1155599884 to i32*)
%3 = or i32 %2, 64
store i32 %3, i32* inttoptr (i64 1155599884 to i32*)
%4 = tail call i32 @uart_putf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 201)
%5 = load i32, i32* inttoptr (i64 1155599884 to i32*)
%6 = and i32 %5, -2
store i32 %6, i32* inttoptr (i64 1155599884 to i32*)
%7 = tail call i32 @uart_putf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 202)
%8 = load i32, i32* inttoptr (i64 1155599884 to i32*)
%9 = or i32 %8, 1
store i32 %9, i32* inttoptr (i64 1155599884 to i32*)
%10 = tail call i32 @uart_putf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 203)
%11 = load i32, i32* inttoptr (i64 1155599884 to i32*)
%12 = and i32 %11, 32
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %0, %14
br label %14
15: ; preds = %0
%16 = tail call i32 @uart_putf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 204)
ret void
}