#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*/ convertidor(long, char *);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, long *);
int main() {
  long Dec;
  char Bin[80];
  printf("\n\n Ingrese el numero a convertir : ");
  scanf("%ld", &Dec);
  convertidor(Dec, Bin);
  printf("\n El numero en Binario de: %ld es %s \n", Dec, Bin);
  convertidor(~Dec, Bin);
  printf("\nSu complemento a1 es: %s ", Bin);
  getchar();
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x10(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1060 <convertidor@plt>
mov    -0x10(%rbp),%rsi
lea    -0x60(%rbp),%rdx
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
xor    $0xffffffffffffffff,%rdi
lea    -0x60(%rbp),%rsi
call   1060 <convertidor@plt>
lea    -0x60(%rbp),%rsi
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x60,%rsp
lea    0xeb4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeca(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x8(%rsp),%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
call   1060 <convertidor@plt>
mov    0x8(%rsp),%rsi
lea    0xea6(%rip),%rdi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rsp),%rdi
not    %rdi
mov    %rbx,%rsi
call   1060 <convertidor@plt>
lea    0xeac(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"\0A\0A Ingrese el numero a convertir : \00"
@.str.1 = [4 x i8] c"%ld\00"
@.str.2 = [39 x i8] c"\0A El numero en Binario de: %ld es %s \0A\00"
@.str.3 = [27 x i8] c"\0ASu complemento a1 es: %s \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca [80 x i8]
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64* %2)
%6 = load i64, i64* %2
%7 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%8 = call i32 @convertidor(i64 %6, i8* %7)
%9 = load i64, i64* %2
%10 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i64 %9, i8* %10)
%12 = load i64, i64* %2
%13 = xor i64 %12, -1
%14 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%15 = call i32 @convertidor(i64 %13, i8* %14)
%16 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i8* %16)
%18 = call i32 (...) @getchar()
%19 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [36 x i8] c"\0A\0A Ingrese el numero a convertir : \00"
@.str.1 = [4 x i8] c"%ld\00"
@.str.2 = [39 x i8] c"\0A El numero en Binario de: %ld es %s \0A\00"
@.str.3 = [27 x i8] c"\0ASu complemento a1 es: %s \00"
define i32 @main() {
%1 = alloca i64
%2 = alloca [80 x i8]
%3 = bitcast i64* %1 to i8*
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64* %1)
%7 = load i64, i64* %1
%8 = call i32 @convertidor(i64 %7, i8* %4)
%9 = load i64, i64* %1
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i64 %9, i8* %4)
%11 = load i64, i64* %1
%12 = xor i64 %11, -1
%13 = call i32 @convertidor(i64 %12, i8* %4)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i8* %4)
%15 = call i32 (...) @getchar()
%16 = call i32 (...) @getchar()
ret i32 0
}