#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 EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, int, int, unsigned short, ...);
int main(void) {
  unsigned short num1 = 0xEE;
  num1 &= ~0x0040;
  printf("%#x &= ~%#x - %#x\n", 0xEE, 0x40, num1);
  unsigned short num2 = 0xEE;
  unsigned short i = 6;
  num2 &= ~(1 << i);
  printf("%#x &= ~(%d << %d) - %#x\n", 0xEE, 1, i, num2);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movw   $0xee,-0x6(%rbp)
movzwl -0x6(%rbp),%eax
and    $0xffffffbf,%eax
mov    %ax,-0x6(%rbp)
lea    0xec9(%rip),%rdi
mov    $0xee,%esi
mov    $0x40,%edx
movzwl -0x6(%rbp),%ecx
mov    $0x0,%al
call   1030 <printf@plt>
movw   $0xee,-0x8(%rbp)
movw   $0x6,-0xa(%rbp)
movzwl -0xa(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
xor    $0xffffffff,%ecx
movzwl -0x8(%rbp),%eax
and    %ecx,%eax
mov    %ax,-0x8(%rbp)
mov    -0xa(%rbp),%ax
movzwl -0x8(%rbp),%r8d
lea    0xe91(%rip),%rdi
mov    $0xee,%esi
mov    $0x1,%edx
movzwl %ax,%ecx
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e43(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0xee,%esi
mov    $0x40,%edx
mov    $0xae,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
mov    $0xee,%esi
mov    $0x1,%edx
mov    $0x6,%ecx
mov    $0xae,%r8d
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"%#x &= ~%#x - %#x\0A\00"
@.str.1 = [26 x i8] c"%#x &= ~(%d << %d) - %#x\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
%3 = alloca i16
%4 = alloca i16
store i32 0, i32* %1
store i16 238, i16* %2
%5 = load i16, i16* %2
%6 = zext i16 %5 to i32
%7 = and i32 %6, -65
%8 = trunc i32 %7 to i16
store i16 %8, i16* %2
%9 = load i16, i16* %2
%10 = call i32 (i8*, i32, i32, i16, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 238, i32 64, i16 zeroext %9)
store i16 238, i16* %3
store i16 6, i16* %4
%11 = load i16, i16* %4
%12 = zext i16 %11 to i32
%13 = shl i32 1, %12
%14 = xor i32 %13, -1
%15 = load i16, i16* %3
%16 = zext i16 %15 to i32
%17 = and i32 %16, %14
%18 = trunc i32 %17 to i16
store i16 %18, i16* %3
%19 = load i16, i16* %4
%20 = load i16, i16* %3
%21 = zext i16 %20 to i32
%22 = call i32 (i8*, i32, i32, i16, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 238, i32 1, i16 zeroext %19, i32 %21)
%23 = load i32, i32* @EXIT_SUCCESS
ret i32 %23
}

LLVM IR (-O2):
@.str = [19 x i8] c"%#x &= ~%#x - %#x\0A\00"
@.str.1 = [26 x i8] c"%#x &= ~(%d << %d) - %#x\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (i8*, i32, i32, i16, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 238, i32 64, i16 zeroext 174)
%2 = tail call i32 (i8*, i32, i32, i16, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 238, i32 1, i16 zeroext 6, i32 174)
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}