#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*/ EXIT_FAILURE;
int EXIT_SUCCESS;
long atol(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ free(char *);
int fscanf(int /*<<< orphan*/, char *, char *);
scalar_t__ malloc(int);
scalar_t__ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, int, ...);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) {
  char value;
  char *scanf_input;
  int nchars;
  long seq_len;
  scanf_input = (char *)malloc(4096 * sizeof(char));
  if (scanf_input == NULL) {
    fprintf(stdout, "Error during input allocation\n");
    exit(EXIT_FAILURE);
  }
  scanf_input = (char *)memset(scanf_input, 0, 4096 * sizeof(char));
  nchars = fscanf(stdin, "%s", scanf_input);
  seq_len = atol(scanf_input);
  fprintf(stdout, "Sequence length: %li\n", seq_len);
  for (; seq_len > 0; seq_len--) {
    printf("%li\n", seq_len);
  }
  free(scanf_input);
  value = 1;
  value = value & 0x0;
  printf("%d %x\n", 256, 255);
  printf("%d \n", 0x0f);
  return EXIT_SUCCESS;
}


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)
mov    $0x1000,%edi
call   1080 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    11d4 <main+0x54>
mov    0x2e1a(%rip),%rax
mov    (%rax),%edi
lea    0xe41(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    0x2e0b(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>
mov    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x1000,%edx
call   1050 <memset@plt>
mov    %rax,-0x20(%rbp)
mov    0x2df9(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rdx
lea    0xe23(%rip),%rsi
call   1060 <fscanf@plt>
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
call   1090 <atol@plt>
mov    %rax,-0x30(%rbp)
mov    0x2db8(%rip),%rax
mov    (%rax),%edi
mov    -0x30(%rbp),%rdx
lea    0xdfd(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
cmpq   $0x0,-0x30(%rbp)
jle    125c <main+0xdc>
mov    -0x30(%rbp),%rax
mov    %eax,%esi
lea    0xdef(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x30(%rbp)
jmp    122c <main+0xac>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
movb   $0x1,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
and    $0x0,%eax
mov    %al,-0x11(%rbp)
lea    0xdbe(%rip),%rdi
mov    $0x100,%esi
mov    $0xff,%edx
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xdad(%rip),%rdi
mov    $0xf,%esi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2d23(%rip),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    $0x1000,%edi
call   1080 <malloc@plt>
test   %rax,%rax
je     125b <main+0xdb>
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x1000,%edx
call   1050 <memset@plt>
mov    %rax,%r14
mov    0x2e37(%rip),%rax
mov    (%rax),%edi
lea    0xe65(%rip),%rsi
mov    %r14,%rdx
call   1060 <fscanf@plt>
mov    %r14,%rdi
call   1090 <atol@plt>
mov    %rax,%rbx
mov    0x2dfc(%rip),%rax
mov    (%rax),%edi
lea    0xe45(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
test   %rbx,%rbx
jle    1219 <main+0x99>
lea    0xe40(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    -0x1(%rbx),%rax
cmp    $0x1,%rbx
mov    %rax,%rbx
ja     1200 <main+0x80>
mov    %r14,%rdi
call   1030 <free@plt>
lea    0xe10(%rip),%rdi
mov    $0x100,%esi
mov    $0xff,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xdff(%rip),%rdi
mov    $0xf,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2d75(%rip),%rax
mov    (%rax),%eax
pop    %rbx
pop    %r14
pop    %r15
ret
mov    0x2d6e(%rip),%rax
mov    (%rax),%edi
lea    0xd95(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    0x2d5f(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [31 x i8] c"Error during input allocation\0A\00"
@EXIT_FAILURE = global i32 0
@stdin = global i32 0
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [22 x i8] c"Sequence length: %li\0A\00"
@.str.3 = [5 x i8] c"%li\0A\00"
@.str.4 = [7 x i8] c"%d %x\0A\00"
@.str.5 = [5 x i8] c"%d \0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = call i64 @malloc(i32 4096)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %7
%12 = load i8*, i8** %7
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %19
14: ; preds = %2
%15 = load i32, i32* @stdout
%16 = call i32 (i32, i8*, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%17 = load i32, i32* @EXIT_FAILURE
%18 = call i32 @exit(i32 %17)
unreachable
19: ; preds = %2
%20 = load i8*, i8** %7
%21 = call i64 @memset(i8* %20, i32 0, i32 4096)
%22 = inttoptr i64 %21 to i8*
store i8* %22, i8** %7
%23 = load i32, i32* @stdin
%24 = load i8*, i8** %7
%25 = call i32 @fscanf(i32 %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %24)
store i32 %25, i32* %8
%26 = load i8*, i8** %7
%27 = call i64 @atol(i8* %26)
store i64 %27, i64* %9
%28 = load i32, i32* @stdout
%29 = load i64, i64* %9
%30 = call i32 (i32, i8*, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i64 %29)
br label %31
31: ; preds = %38, %19
%32 = load i64, i64* %9
%33 = icmp sgt i64 %32, 0
br i1 %33, label %34, label %41
34: ; preds = %31
%35 = load i64, i64* %9
%36 = trunc i64 %35 to i32
%37 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 %36)
br label %38
38: ; preds = %34
%39 = load i64, i64* %9
%40 = add nsw i64 %39, -1
store i64 %40, i64* %9
br label %31
41: ; preds = %31
%42 = load i8*, i8** %7
%43 = call i32 @free(i8* %42)
store i8 1, i8* %6
%44 = load i8, i8* %6
%45 = sext i8 %44 to i32
%46 = and i32 %45, 0
%47 = trunc i32 %46 to i8
store i8 %47, i8* %6
%48 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 256, i32 255)
%49 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 15)
%50 = load i32, i32* @EXIT_SUCCESS
ret i32 %50
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [31 x i8] c"Error during input allocation\0A\00"
@EXIT_FAILURE = global i32 0
@stdin = global i32 0
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [22 x i8] c"Sequence length: %li\0A\00"
@.str.3 = [5 x i8] c"%li\0A\00"
@.str.4 = [7 x i8] c"%d %x\0A\00"
@.str.5 = [5 x i8] c"%d \0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @malloc(i32 4096)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = load i32, i32* @stdout
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %2
%11 = inttoptr i64 %3 to i8*
%12 = tail call i64 @memset(i8* %11, i32 0, i32 4096)
%13 = inttoptr i64 %12 to i8*
%14 = load i32, i32* @stdin
%15 = tail call i32 @fscanf(i32 %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %13)
%16 = tail call i64 @atol(i8* %13)
%17 = load i32, i32* @stdout
%18 = tail call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i64 %16)
%19 = icmp sgt i64 %16, 0
br i1 %19, label %20, label %26
20: ; preds = %10, %20
%21 = phi i64 [ %24, %20 ], [ %16, %10 ]
%22 = trunc i64 %21 to i32
%23 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 %22)
%24 = add nsw i64 %21, -1
%25 = icmp ugt i64 %21, 1
br i1 %25, label %20, label %26
26: ; preds = %20, %10
%27 = tail call i32 @free(i8* %13)
%28 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 256, i32 255)
%29 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 15)
%30 = load i32, i32* @EXIT_SUCCESS
ret i32 %30
}