#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, unsigned int, ...);
int main(void) {
  unsigned int w1 = 0525u, w2 = 0707u, w3 = 0122u;
  printf("%o    %o   %o\n", w1 & w2, w1 | w2, w1 ^ w2);
  printf("%o    %o   %o\n", ~w1, ~w2, ~w3);
  printf("%o    %o   %o\n", w1 ^ w2, w1 & ~w2, w1 | w2 | w3);
  printf("%o    %o\n", w1 | w2 & w3, w1 | w2 & ~w3);
  printf("%o    %o \n", ~(~w1 & ~w2), ~(~w1 | ~w2));
  w1 ^= w2;
  w2 ^= w1;
  w1 ^= w2;
  printf("w1 = %o, w2 = %o\n", w1, w2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x155,-0x8(%rbp)
movl   $0x1c7,-0xc(%rbp)
movl   $0x52,-0x10(%rbp)
mov    -0x8(%rbp),%esi
and    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
or     -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
xor    -0xc(%rbp),%ecx
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
xor    $0xffffffff,%esi
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
xor    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
and    %eax,%edx
mov    -0x8(%rbp),%ecx
or     -0xc(%rbp),%ecx
or     -0x10(%rbp),%ecx
lea    0xe6b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%eax
and    -0x10(%rbp),%eax
or     %eax,%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
or     %eax,%edx
lea    0xe51(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
xor    $0xffffffff,%esi
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
and    %eax,%esi
xor    $0xffffffff,%esi
mov    -0x8(%rbp),%edx
xor    $0xffffffff,%edx
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
or     %eax,%edx
xor    $0xffffffff,%edx
lea    0xe2b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe07(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x145,%esi
mov    $0x1d7,%edx
mov    $0x92,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xfffffeaa,%esi
mov    $0xfffffe38,%edx
mov    $0xffffffad,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x92,%esi
mov    $0x10,%edx
mov    $0x1d7,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xea5(%rip),%rdi
mov    $0x157,%esi
mov    $0x1d5,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe97(%rip),%rdi
mov    $0x1d7,%esi
mov    $0x145,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe8a(%rip),%rdi
mov    $0x1c7,%esi
mov    $0x155,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"%o %o %o\0A\00"
@.str.1 = [10 x i8] c"%o %o\0A\00"
@.str.2 = [11 x i8] c"%o %o \0A\00"
@.str.3 = [18 x i8] c"w1 = %o, w2 = %o\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 341, i32* %2
store i32 455, i32* %3
store i32 82, i32* %4
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = and i32 %5, %6
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = or i32 %8, %9
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = xor i32 %11, %12
%14 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %10, i32 %13)
%15 = load i32, i32* %2
%16 = xor i32 %15, -1
%17 = load i32, i32* %3
%18 = xor i32 %17, -1
%19 = load i32, i32* %4
%20 = xor i32 %19, -1
%21 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %16, i32 %18, i32 %20)
%22 = load i32, i32* %2
%23 = load i32, i32* %3
%24 = xor i32 %22, %23
%25 = load i32, i32* %2
%26 = load i32, i32* %3
%27 = xor i32 %26, -1
%28 = and i32 %25, %27
%29 = load i32, i32* %2
%30 = load i32, i32* %3
%31 = or i32 %29, %30
%32 = load i32, i32* %4
%33 = or i32 %31, %32
%34 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %24, i32 %28, i32 %33)
%35 = load i32, i32* %2
%36 = load i32, i32* %3
%37 = load i32, i32* %4
%38 = and i32 %36, %37
%39 = or i32 %35, %38
%40 = load i32, i32* %2
%41 = load i32, i32* %3
%42 = load i32, i32* %4
%43 = xor i32 %42, -1
%44 = and i32 %41, %43
%45 = or i32 %40, %44
%46 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %39, i32 %45)
%47 = load i32, i32* %2
%48 = xor i32 %47, -1
%49 = load i32, i32* %3
%50 = xor i32 %49, -1
%51 = and i32 %48, %50
%52 = xor i32 %51, -1
%53 = load i32, i32* %2
%54 = xor i32 %53, -1
%55 = load i32, i32* %3
%56 = xor i32 %55, -1
%57 = or i32 %54, %56
%58 = xor i32 %57, -1
%59 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %52, i32 %58)
%60 = load i32, i32* %3
%61 = load i32, i32* %2
%62 = xor i32 %61, %60
store i32 %62, i32* %2
%63 = load i32, i32* %2
%64 = load i32, i32* %3
%65 = xor i32 %64, %63
store i32 %65, i32* %3
%66 = load i32, i32* %3
%67 = load i32, i32* %2
%68 = xor i32 %67, %66
store i32 %68, i32* %2
%69 = load i32, i32* %2
%70 = load i32, i32* %3
%71 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %69, i32 %70)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"%o %o %o\0A\00"
@.str.1 = [10 x i8] c"%o %o\0A\00"
@.str.2 = [11 x i8] c"%o %o \0A\00"
@.str.3 = [18 x i8] c"w1 = %o, w2 = %o\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 325, i32 471, i32 146)
%2 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 -342, i32 -456, i32 -83)
%3 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 146, i32 16, i32 471)
%4 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 343, i32 469)
%5 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 471, i32 325)
%6 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 455, i32 341)
ret i32 0
}