#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*/ getBin(long, char *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *args[]) {
  char str[10];
  long number = 0;
  getBin(number, str);
  printf("num is now: %s \n\n", str);
  number |= 1 << 4;
  printf("4.th bit setted using |=");
  getBin(number, str);
  printf("num is now: %s \n\n", str);
  number &= ~(1 << 4);
  printf("4.th bit cleared using &=");
  getBin(number, str);
  printf("num is now: %s \n\n", str);
  number ^= 1 << 6;
  printf("6.th bit toggled using ^=");
  getBin(number, str);
  printf("num is now: %s \n\n", str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
lea    -0x1a(%rbp),%rsi
call   1040 <getBin@plt>
lea    -0x1a(%rbp),%rsi
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
or     $0x10,%rax
mov    %rax,-0x28(%rbp)
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rdi
lea    -0x1a(%rbp),%rsi
call   1040 <getBin@plt>
lea    -0x1a(%rbp),%rsi
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
and    $0xffffffffffffffef,%rax
mov    %rax,-0x28(%rbp)
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rdi
lea    -0x1a(%rbp),%rsi
call   1040 <getBin@plt>
lea    -0x1a(%rbp),%rsi
lea    0xe38(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
xor    $0x40,%rax
mov    %rax,-0x28(%rbp)
lea    0xe63(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rdi
lea    -0x1a(%rbp),%rsi
call   1040 <getBin@plt>
lea    -0x1a(%rbp),%rsi
lea    0xdff(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xe(%rsp),%rbx
xor    %edi,%edi
mov    %rbx,%rsi
call   1040 <getBin@plt>
lea    0xec3(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x10,%edi
mov    %rbx,%rsi
call   1040 <getBin@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1040 <getBin@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xea7(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x40,%edi
mov    %rbx,%rsi
call   1040 <getBin@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [18 x i8] c"num is now: %s \0A\0A\00"
@.str.1 = [25 x i8] c"4.th bit setted using |=\00"
@.str.2 = [26 x i8] c"4.th bit cleared using &=\00"
@.str.3 = [26 x i8] c"6.th bit toggled using ^=\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [10 x i8]
%7 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 0, i64* %7
%8 = load i64, i64* %7
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%10 = call i32 @getBin(i64 %8, i8* %9)
%11 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = load i64, i64* %7
%14 = or i64 %13, 16
store i64 %14, i64* %7
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%16 = load i64, i64* %7
%17 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%18 = call i32 @getBin(i64 %16, i8* %17)
%19 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %19)
%21 = load i64, i64* %7
%22 = and i64 %21, -17
store i64 %22, i64* %7
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%24 = load i64, i64* %7
%25 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%26 = call i32 @getBin(i64 %24, i8* %25)
%27 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %27)
%29 = load i64, i64* %7
%30 = xor i64 %29, 64
store i64 %30, i64* %7
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
%32 = load i64, i64* %7
%33 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%34 = call i32 @getBin(i64 %32, i8* %33)
%35 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %35)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"num is now: %s \0A\0A\00"
@.str.1 = [25 x i8] c"4.th bit setted using |=\00"
@.str.2 = [26 x i8] c"4.th bit cleared using &=\00"
@.str.3 = [26 x i8] c"6.th bit toggled using ^=\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [10 x i8]
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = call i32 @getBin(i64 0, i8* %4)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %4)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @getBin(i64 16, i8* %4)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %4)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @getBin(i64 0, i8* %4)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %4)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 @getBin(i64 64, i8* %4)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}