#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 long);
int /*<<< orphan*/ set_bit(unsigned long *, int);
int main(void) {
  unsigned long int n;
  n = 1024;
  set_bit(&n, 5);
  printf("%lu\n", n);
  n = 0;
  set_bit(&n, 10);
  printf("%lu\n", n);
  n = 98;
  set_bit(&n, 0);
  printf("%lu\n", n);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x400,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x5,%esi
call   1040 <set_bit@plt>
mov    -0x10(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
movq   $0x0,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1040 <set_bit@plt>
mov    -0x10(%rbp),%rsi
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
movq   $0x62,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1040 <set_bit@plt>
mov    -0x10(%rbp),%rsi
lea    0xe67(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movq   $0x400,(%rsp)
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x5,%esi
call   1040 <set_bit@plt>
mov    (%rsp),%rsi
lea    0xeb9(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
movq   $0x0,(%rsp)
mov    %r14,%rdi
mov    $0xa,%esi
call   1040 <set_bit@plt>
mov    (%rsp),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
movq   $0x62,(%rsp)
mov    %r14,%rdi
xor    %esi,%esi
call   1040 <set_bit@plt>
mov    (%rsp),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%lu\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
store i64 1024, i64* %2
%3 = call i32 @set_bit(i64* %2, i32 5)
%4 = load i64, i64* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %4)
store i64 0, i64* %2
%6 = call i32 @set_bit(i64* %2, i32 10)
%7 = load i64, i64* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %7)
store i64 98, i64* %2
%9 = call i32 @set_bit(i64* %2, i32 0)
%10 = load i64, i64* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lu\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store i64 1024, i64* %1
%3 = call i32 @set_bit(i64* %1, i32 5)
%4 = load i64, i64* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %4)
store i64 0, i64* %1
%6 = call i32 @set_bit(i64* %1, i32 10)
%7 = load i64, i64* %1
%8 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %7)
store i64 98, i64* %1
%9 = call i32 @set_bit(i64* %1, i32 0)
%10 = load i64, i64* %1
%11 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %10)
ret i32 0
}