xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int read(int, char *, int);
int /*<<< orphan*/ write_single(int, char);
char readRegister(int file, char reg) {
  char buf[2];
  write_single(file, reg);
  if (read(file, buf, 1) != 1) {
    printf("error: failed to read\n");
    exit(1);
  }
  return buf[0];
}


x86 assembly (clang, -O0):
<readRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%edi
movsbl -0x5(%rbp),%esi
call   1050 <write_single@plt>
mov    -0x4(%rbp),%edi
lea    -0x7(%rbp),%rsi
mov    $0x1,%edx
call   1040 <read@plt>
cmp    $0x1,%eax
je     118d <readRegister+0x4d>
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
movsbl -0x7(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readRegister>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
call   1050 <write_single@plt>
lea    0xe(%rsp),%rsi
mov    %ebx,%edi
mov    $0x1,%edx
call   1040 <read@plt>
cmp    $0x1,%eax
jne    116c <readRegister+0x2c>
mov    0xe(%rsp),%al
add    $0x10,%rsp
pop    %rbx
ret
lea    0xe8d(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"error: failed to read\0A\00"
define signext i8 @readRegister(i32 %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca [2 x i8]
store i32 %0, i32* %3
store i8 %1, i8* %4
%6 = load i32, i32* %3
%7 = load i8, i8* %4
%8 = call i32 @write_single(i32 %6, i8 signext %7)
%9 = load i32, i32* %3
%10 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%11 = call i32 @read(i32 %9, i8* %10, i32 1)
%12 = icmp ne i32 %11, 1
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %2
%17 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%18 = load i8, i8* %17
ret i8 %18
}

LLVM IR (-O2):
@str = [22 x i8] c"error: failed to read\00"
define signext i8 @readRegister(i32 %0, i8 signext %1) {
%3 = alloca [2 x i8]
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @write_single(i32 %0, i8 signext %1)
%6 = call i32 @read(i32 %0, i8* %4, i32 1)
%7 = icmp eq i32 %6, 1
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %2
%12 = load i8, i8* %4
ret i8 %12
}
int isAvaliable(void) { return 1; }


x86 assembly (clang, -O0):
<isAvaliable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isAvaliable>:
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @isAvaliable() {
ret i32 1
}

LLVM IR (-O2):
define i32 @isAvaliable() {
ret i32 1
}
/* Variables and functions */
int __builtin_arm_crc32h(int, short);
int crc32h(int a, short b) { return __builtin_arm_crc32h(a, b); }


x86 assembly (clang, -O0):
<crc32h>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%edi
movswl -0x6(%rbp),%esi
call   1030 <__builtin_arm_crc32h@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc32h>:
jmp    1030 <__builtin_arm_crc32h@plt>

LLVM IR (-O0):
define i32 @crc32h(i32 %0, i16 signext %1) {
%3 = alloca i32
%4 = alloca i16
store i32 %0, i32* %3
store i16 %1, i16* %4
%5 = load i32, i32* %3
%6 = load i16, i16* %4
%7 = call i32 @__builtin_arm_crc32h(i32 %5, i16 signext %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @crc32h(i32 %0, i16 signext %1) {
%3 = tail call i32 @__builtin_arm_crc32h(i32 %0, i16 signext %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ sys_print(char *, int);
void abort(void) {
  sys_print("Aborted\n", 8);
  exit(EXIT_FAILURE);
  sys_print("FATAL: exit() returned in abort()!\n", 36);
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<abort>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
mov    $0x8,%esi
call   1030 <sys_print@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<abort>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x8,%esi
call   1030 <sys_print@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"Aborted\0A\00"
@EXIT_FAILURE = global i32 0
define void @abort() {
%1 = call i32 @sys_print(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 8)
%2 = load i32, i32* @EXIT_FAILURE
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
@.str = [9 x i8] c"Aborted\0A\00"
@EXIT_FAILURE = global i32 0
define void @abort() {
%1 = tail call i32 @sys_print(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 8)
%2 = load i32, i32* @EXIT_FAILURE
%3 = tail call i32 @exit(i32 %2)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ err_quit(char *);
int /*<<< orphan*/ errno;
scalar_t__ pthread_detach(int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void Pthread_detach(pthread_t tid) {
  if (pthread_detach(tid) != 0)
    do {
      strerror(errno);
      puts("\n");
      err_quit("pthread detach error");
    } while (1);
}


x86 assembly (clang, -O0):
<Pthread_detach>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <pthread_detach@plt>
cmp    $0x0,%rax
je     119c <Pthread_detach+0x5c>
jmp    1162 <Pthread_detach+0x22>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
lea    0xe89(%rip),%rdi
call   1030 <puts@plt>
lea    0xe7f(%rip),%rdi
call   1040 <err_quit@plt>
mov    $0x1,%al
test   $0x1,%al
jne    1162 <Pthread_detach+0x22>
jmp    1197 <Pthread_detach+0x57>
jmp    119c <Pthread_detach+0x5c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Pthread_detach>:
push   %r15
push   %r14
push   %rbx
call   1050 <pthread_detach@plt>
test   %rax,%rax
je     118a <Pthread_detach+0x4a>
mov    0x2e8a(%rip),%r15
lea    0xea3(%rip),%r14
lea    0xe9e(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%r15),%edi
call   1060 <strerror@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1040 <err_quit@plt>
jmp    1170 <Pthread_detach+0x30>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@errno = global i32 0
@.str = [2 x i8] c"\0A\00"
@.str.1 = [21 x i8] c"pthread detach error\00"
define void @Pthread_detach(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @pthread_detach(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %14
6: ; preds = %1
br label %7
7: ; preds = %12, %6
%8 = load i32, i32* @errno
%9 = call i32 @strerror(i32 %8)
%10 = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @err_quit(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %7
br i1 true, label %7, label %13
13: ; preds = %12
br label %14
14: ; preds = %13, %1
ret void
}

LLVM IR (-O2):
@errno = global i32 0
@.str = [2 x i8] c"\0A\00"
@.str.1 = [21 x i8] c"pthread detach error\00"
define void @Pthread_detach(i32 %0) {
%2 = tail call i64 @pthread_detach(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = load i32, i32* @errno
%6 = tail call i32 @strerror(i32 %5)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @err_quit(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
br label %4
9: ; preds = %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int ERR;
int OK;
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
int delwin(WINDOW *win) {
  if (!win)
    return ERR;
  free(win);
  return OK;
}


x86 assembly (clang, -O0):
<delwin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1138 <delwin+0x28>
mov    0x2eba(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    114d <delwin+0x3d>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delwin>:
push   %rax
test   %rdi,%rdi
je     1124 <delwin+0x14>
call   1030 <free@plt>
mov    0x2eb6(%rip),%rax
jmp    112b <delwin+0x1b>
mov    0x2ebd(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@ERR = global i32 0
@OK = global i32 0
define i32 @delwin(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = icmp ne i32* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = load i32, i32* @ERR
store i32 %7, i32* %2
br label %12
8: ; preds = %1
%9 = load i32*, i32** %3
%10 = call i32 @free(i32* %9)
%11 = load i32, i32* @OK
store i32 %11, i32* %2
br label %12
12: ; preds = %8, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@ERR = global i32 0
@OK = global i32 0
define i32 @delwin(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i32* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32* [ @OK, %3 ], [ @ERR, %1 ]
%7 = load i32, i32* %6
ret i32 %7
}
/* Variables and functions */
int strlen(char *);
void concat(char *str, char ch) {
  register int i = strlen(str);
  *(str + i) = ch;
  *(str + (i + 1)) = '\0';
}


x86 assembly (clang, -O0):
<concat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
mov    -0x9(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<concat>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
mov    %bpl,(%rbx,%rax,1)
movb   $0x0,0x1(%rbx,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @concat(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i32
store i8* %0, i8** %3
store i8 %1, i8* %4
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %5
%8 = load i8, i8* %4
%9 = load i8*, i8** %3
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
store i8 %8, i8* %12
%13 = load i8*, i8** %3
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 1
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %13, i64 %16
store i8 0, i8* %17
ret void
}

LLVM IR (-O2):
define void @concat(i8* %0, i8 signext %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 %1, i8* %5
%6 = add nsw i32 %3, 1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 0, i8* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AllocError(char *);
scalar_t__ calloc(unsigned int, int);
int /*<<< orphan*/ printf(char *);
void *Allocate(unsigned nchars) {
  void *ptr;
  ptr = (void *)calloc(nchars, sizeof(char));
  if (ptr == 0)
    AllocError("Allocate");
  if ((unsigned long)ptr & 0x3)
    printf("Warning, pointer not aligned.\n");
  return ptr;
}


x86 assembly (clang, -O0):
<Allocate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1163 <Allocate+0x33>
lea    0xea2(%rip),%rdi
call   1030 <AllocError@plt>
mov    -0x10(%rbp),%rax
and    $0x3,%rax
cmp    $0x0,%rax
je     1181 <Allocate+0x51>
lea    0xe8d(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Allocate>:
push   %rbx
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1156 <Allocate+0x26>
test   $0x3,%bl
je     1162 <Allocate+0x32>
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
jmp    1162 <Allocate+0x32>
lea    0xea3(%rip),%rdi
call   1040 <AllocError@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"Allocate\00"
@.str.1 = [31 x i8] c"Warning, pointer not aligned.\0A\00"
define i8* @Allocate(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i64 @calloc(i32 %4, i32 1)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @AllocError(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
%12 = load i8*, i8** %3
%13 = ptrtoint i8* %12 to i64
%14 = and i64 %13, 3
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %11
%17 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %16, %11
%19 = load i8*, i8** %3
ret i8* %19
}

LLVM IR (-O2):
@.str = [9 x i8] c"Allocate\00"
@str = [30 x i8] c"Warning, pointer not aligned.\00"
define i8* @Allocate(i32 %0) {
%2 = tail call i64 @calloc(i32 %0, i32 1)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @AllocError(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %11
6: ; preds = %1
%7 = and i64 %2, 3
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
br label %11
11: ; preds = %4, %9, %6
%12 = inttoptr i64 %2 to i8*
ret i8* %12
}
char *SkipSpaces(const char *line) {
  int i = 0;
  while (line[i] == ' ' || line[i] == '\t')
    i++;
  return (char *)(line + i);
}


x86 assembly (clang, -O0):
<SkipSpaces>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0xd(%rbp)
je     113e <SkipSpaces+0x3e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    114e <SkipSpaces+0x4e>
jmp    115c <SkipSpaces+0x5c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <SkipSpaces+0xf>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SkipSpaces>:
mov    %rdi,%rax
xor    %ecx,%ecx
jmp    1114 <SkipSpaces+0x14>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rcx
movzbl (%rax,%rcx,1),%edx
cmp    $0x20,%dl
je     1110 <SkipSpaces+0x10>
cmp    $0x9,%dl
je     1110 <SkipSpaces+0x10>
mov    %ecx,%ecx
add    %rcx,%rax
ret

LLVM IR (-O0):
define i8* @SkipSpaces(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %22, %1
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 32
br i1 %11, label %20, label %12
12: ; preds = %4
%13 = load i8*, i8** %2
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 9
br label %20
20: ; preds = %12, %4
%21 = phi i1 [ true, %4 ], [ %19, %12 ]
br i1 %21, label %22, label %25
22: ; preds = %20
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
store i32 %24, i32* %3
br label %4
25: ; preds = %20
%26 = load i8*, i8** %2
%27 = load i32, i32* %3
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8, i8* %26, i64 %28
ret i8* %29
}

LLVM IR (-O2):
define i8* @SkipSpaces(i8* %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i64 [ %7, %6 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
switch i8 %5, label %8 [
i8 32, label %6
i8 9, label %6
]
6: ; preds = %2, %2
%7 = add nuw i64 %3, 1
br label %2
8: ; preds = %2
%9 = and i64 %3, 4294967295
%10 = getelementptr inbounds i8, i8* %0, i64 %9
ret i8* %10
}
/* Variables and functions */
int scanf(char *, char *, char *);
int read_line(char *str, char *substr) {
  if (2 == scanf("%s %s", str, substr))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<read_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xed1(%rip),%rdi
call   1030 <scanf@plt>
mov    %eax,%ecx
mov    $0x2,%eax
cmp    %ecx,%eax
jne    114f <read_line+0x3f>
movl   $0x1,-0x4(%rbp)
jmp    1156 <read_line+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_line>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee2(%rip),%rdi
call   1030 <scanf@plt>
xor    %ecx,%ecx
cmp    $0x2,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s %s\00"
define i32 @read_line(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = load i8*, i8** %5
%8 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
%9 = icmp eq i32 2, %8
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 1, i32* %3
br label %12
11: ; preds = %2
store i32 0, i32* %3
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s %s\00"
define i32 @read_line(i8* %0, i8* %1) {
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%4 = icmp eq i32 %3, 2
%5 = zext i1 %4 to i32
ret i32 %5
}
float fang(int x) { return x * x * x - 5 * x * x + 16 * x - 80; }


x86 assembly (clang, -O0):
<fang>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
imul   $0x5,-0x4(%rbp),%ecx
imul   -0x4(%rbp),%ecx
sub    %ecx,%eax
mov    -0x4(%rbp),%ecx
shl    $0x4,%ecx
add    %ecx,%eax
sub    $0x50,%eax
cvtsi2ss %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fang>:
lea    -0x5(%rdi),%eax
imul   %edi,%eax
add    $0x10,%eax
imul   %edi,%eax
add    $0xffffffb0,%eax
cvtsi2ss %eax,%xmm0
ret

LLVM IR (-O0):
define float @fang(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 %3, %4
%6 = load i32, i32* %2
%7 = mul nsw i32 %5, %6
%8 = load i32, i32* %2
%9 = mul nsw i32 5, %8
%10 = load i32, i32* %2
%11 = mul nsw i32 %9, %10
%12 = sub nsw i32 %7, %11
%13 = load i32, i32* %2
%14 = mul nsw i32 16, %13
%15 = add nsw i32 %12, %14
%16 = sub nsw i32 %15, 80
%17 = sitofp i32 %16 to float
ret float %17
}

LLVM IR (-O2):
define float @fang(i32 %0) {
%2 = add i32 %0, -5
%3 = mul i32 %2, %0
%4 = add i32 %3, 16
%5 = mul i32 %4, %0
%6 = add nsw i32 %5, -80
%7 = sitofp i32 %6 to float
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void c_write_string(char *string) { printf(string); }


x86 assembly (clang, -O0):
<c_write_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_write_string>:
jmp    1030 <printf@plt>

LLVM IR (-O0):
define void @c_write_string(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* %3)
ret void
}

LLVM IR (-O2):
define void @c_write_string(i8* nocapture %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) %0)
ret void
}
/* Variables and functions */
char *btostr(int, int);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, char *);
void bitPrintf(float *fptr, int numBits) {
  int *iptr;
  iptr = (int *)fptr;
  char *tmp;
  printf("%s ", tmp = btostr(*iptr, numBits));
  free(tmp);
}


x86 assembly (clang, -O0):
<bitPrintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%esi
call   1050 <btostr@plt>
mov    %rax,%rsi
mov    %rsi,-0x20(%rbp)
lea    0xe9d(%rip),%rdi
call   1040 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitPrintf>:
push   %rbx
mov    (%rdi),%edi
call   1050 <btostr@plt>
mov    %rax,%rbx
lea    0xebe(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s \00"
define void @bitPrintf(float* %0, i32 %1) {
%3 = alloca float*
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i8*
store float* %0, float** %3
store i32 %1, i32* %4
%7 = load float*, float** %3
%8 = bitcast float* %7 to i32*
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = load i32, i32* %4
%12 = call i8* @btostr(i32 %10, i32 %11)
store i8* %12, i8** %6
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = load i8*, i8** %6
%15 = call i32 @free(i8* %14)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s \00"
define void @bitPrintf(float* nocapture %0, i32 %1) {
%3 = bitcast float* %0 to i32*
%4 = load i32, i32* %3
%5 = tail call i8* @btostr(i32 %4, i32 %1)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = tail call i32 @free(i8* %5)
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
double double_pos_inf() {
  union {
    double d;
    int64_t i;
  } u;
  u.i = 0x7FF0000000000000;
  return u.d;
}


x86 assembly (clang, -O0):
<double_pos_inf>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_pos_inf>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
%union.anon = type { double }
define double @double_pos_inf() {
%1 = alloca %union.anon
%2 = bitcast %union.anon* %1 to i32*
store i32 0, i32* %2
%3 = bitcast %union.anon* %1 to double*
%4 = load double, double* %3
ret double %4
}

LLVM IR (-O2):
define double @double_pos_inf() {
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int);
int printIp4(int ip) {
  printf("%d.%d.%d.%d\n", (ip & 0xff000000) >> 24, (ip & 0x00ff0000) >> 16,
         (ip & 0x0000ff00) >> 8, (ip & 0x000000ff));
  return 0;
}


x86 assembly (clang, -O0):
<printIp4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
and    $0xff000000,%esi
shr    $0x18,%esi
mov    -0x4(%rbp),%edx
and    $0xff0000,%edx
sar    $0x10,%edx
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
sar    $0x8,%ecx
mov    -0x4(%rbp),%r8d
and    $0xff,%r8d
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printIp4>:
push   %rax
mov    %edi,%eax
mov    %edi,%edx
movzbl %ah,%ecx
movzbl %al,%r8d
shr    $0x18,%eax
shr    $0x10,%edx
movzbl %dl,%edx
lea    0xed4(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"%d.%d.%d.%d\0A\00"
define i32 @printIp4(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -16777216
%5 = lshr i32 %4, 24
%6 = load i32, i32* %2
%7 = and i32 %6, 16711680
%8 = ashr i32 %7, 16
%9 = load i32, i32* %2
%10 = and i32 %9, 65280
%11 = ashr i32 %10, 8
%12 = load i32, i32* %2
%13 = and i32 %12, 255
%14 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %8, i32 %11, i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"%d.%d.%d.%d\0A\00"
define i32 @printIp4(i32 %0) {
%2 = lshr i32 %0, 24
%3 = lshr i32 %0, 16
%4 = and i32 %3, 255
%5 = lshr i32 %0, 8
%6 = and i32 %5, 255
%7 = and i32 %0, 255
%8 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %4, i32 %6, i32 %7)
ret i32 0
}
int getColOrRow(int rc) {
  rc -= 1;
  return rc == 0 ? 5 : rc;
}


x86 assembly (clang, -O0):
<getColOrRow>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1127 <getColOrRow+0x27>
mov    $0x5,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <getColOrRow+0x2d>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getColOrRow>:
add    $0xffffffff,%edi
mov    $0x5,%eax
cmovne %edi,%eax
ret

LLVM IR (-O0):
define i32 @getColOrRow(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
br label %10
8: ; preds = %1
%9 = load i32, i32* %2
br label %10
10: ; preds = %8, %7
%11 = phi i32 [ 5, %7 ], [ %9, %8 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @getColOrRow(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 5, i32 %2
ret i32 %4
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int celcon_copy_target_dobldobl_solution_to_container(int k, int i) {
  int fail;
  double *c;
  fail = _ada_use_c2phc4c(468, &k, &i, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<celcon_copy_target_dobldobl_solution_to_container>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x18(%rbp),%rcx
mov    $0x1d4,%edi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<celcon_copy_target_dobldobl_solution_to_container>:
push   %rax
mov    %edi,0x4(%rsp)
mov    %esi,(%rsp)
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
mov    $0x1d4,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @celcon_copy_target_dobldobl_solution_to_container(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca double*
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load double*, double** %6
%8 = call i32 @_ada_use_c2phc4c(i32 468, i32* %3, i32* %4, double* %7, i32 0)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @celcon_copy_target_dobldobl_solution_to_container(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @_ada_use_c2phc4c(i32 468, i32* %3, i32* %4, double* undef, i32 0)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "\n"
                  "Usage:\txotd [-v] device_name remote_name [ circuits ]\n"
                  "or:\txotd [-v] -f config-file\n"
                  "\n"
                  "Config file format:\n"
                  "\n"
                  "device-name remote name [ circuits]\n"
                  "\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [144 x i8] c"\0AUsage:\09xotd [-v] device_name remote_name [ circuits ]\0Aor:\09xotd [-v] -f config-file\0A\0AConfig file format:\0A\0Adevice-name remote name [ circuits]\0A\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [144 x i8] c"\0AUsage:\09xotd [-v] device_name remote_name [ circuits ]\0Aor:\09xotd [-v] -f config-file\0A\0AConfig file format:\0A\0Adevice-name remote name [ circuits]\0A\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned long long pack754(double, int, int);
int /*<<< orphan*/ put_8bytes(unsigned char *, unsigned long long);
void put_double(unsigned char *p, double v) {
  unsigned long long ull = (pack754((v), 64, 11));
  put_8bytes(p, ull);
}


x86 assembly (clang, -O0):
<put_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x40,%edi
mov    $0xb,%esi
call   1040 <pack754@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <put_8bytes@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_double>:
push   %rbx
mov    %rdi,%rbx
mov    $0x40,%edi
mov    $0xb,%esi
call   1040 <pack754@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1030 <put_8bytes@plt>

LLVM IR (-O0):
define void @put_double(i8* %0, double %1) {
%3 = alloca i8*
%4 = alloca double
%5 = alloca i64
store i8* %0, i8** %3
store double %1, double* %4
%6 = load double, double* %4
%7 = call i64 @pack754(double %6, i32 64, i32 11)
store i64 %7, i64* %5
%8 = load i8*, i8** %3
%9 = load i64, i64* %5
%10 = call i32 @put_8bytes(i8* %8, i64 %9)
ret void
}

LLVM IR (-O2):
define void @put_double(i8* %0, double %1) {
%3 = tail call i64 @pack754(double %1, i32 64, i32 11)
%4 = tail call i32 @put_8bytes(i8* %0, i64 %3)
ret void
}
int c_fun(void) { return 3; }


x86 assembly (clang, -O0):
<c_fun>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_fun>:
mov    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @c_fun() {
ret i32 3
}

LLVM IR (-O2):
define i32 @c_fun() {
ret i32 3
}
/* Variables and functions */
int /*<<< orphan*/ _I8080_RST(int);
void do0xF7() { _I8080_RST(6); }


x86 assembly (clang, -O0):
<do0xF7>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
call   1030 <_I8080_RST@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do0xF7>:
mov    $0x6,%edi
jmp    1030 <_I8080_RST@plt>

LLVM IR (-O0):
define void @do0xF7() {
%1 = call i32 @_I8080_RST(i32 6)
ret void
}

LLVM IR (-O2):
define void @do0xF7() {
%1 = tail call i32 @_I8080_RST(i32 6)
ret void
}
unsigned __attribute__((nonnull(1))) int hash_from_string(void *k) {
  char *rkey = (char *)k;
  unsigned hashval = 1;
  while (*rkey)
    hashval = hashval * 33 + *rkey++;
  return hashval;
}


x86 assembly (clang, -O0):
<hash_from_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1144 <hash_from_string+0x44>
imul   $0x21,-0x14(%rbp),%eax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <hash_from_string+0x17>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_from_string>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <hash_from_string+0x28>
add    $0x1,%rdi
mov    $0x1,%eax
nop
mov    %eax,%edx
shl    $0x5,%edx
add    %eax,%edx
movsbl %cl,%eax
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_from_string+0x10>
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @hash_from_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %3
store i32 1, i32* %4
br label %6
6: ; preds = %10, %1
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %18
10: ; preds = %6
%11 = load i32, i32* %4
%12 = mul i32 %11, 33
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %3
%15 = load i8, i8* %13
%16 = sext i8 %15 to i32
%17 = add i32 %12, %16
store i32 %17, i32* %4
br label %6
18: ; preds = %6
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
define i32 @hash_from_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 1, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = mul i32 %6, 33
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i32
%11 = add i32 %8, %10
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 1, %1 ], [ %11, %4 ]
ret i32 %15
}
void nested_outer() {
  while (1) {
    int i = 0;
    while (i < 10)
      i++;
  }
}


x86 assembly (clang, -O0):
<nested_outer>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1123 <nested_outer+0x23>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <nested_outer+0xb>
jmp    1104 <nested_outer+0x4>

x86 assembly (clang, -O2):
<nested_outer>:
jmp    1100 <nested_outer>

LLVM IR (-O0):
define void @nested_outer() {
%1 = alloca i32
br label %2
2: ; preds = %0, %9
store i32 0, i32* %1
br label %3
3: ; preds = %6, %2
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
br label %3
9: ; preds = %3
br label %2
}

LLVM IR (-O2):
define void @nested_outer() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int int32_t;
typedef int int16_t;

/* Variables and functions */
int I2C_Recv2(int /*<<< orphan*/);
int /*<<< orphan*/ I2C_Send1(int /*<<< orphan*/, int);
void tempsensorend(uint8_t slaveAddress, int32_t *sensorV, int32_t *localT) {
  int16_t raw;
  I2C_Send1(slaveAddress, 0x00);
  raw = I2C_Recv2(slaveAddress);
  *sensorV = raw * 15625;
  I2C_Send1(slaveAddress, 0x01);
  raw = I2C_Recv2(slaveAddress);
  *localT = (raw >> 2) * 3125;
}


x86 assembly (clang, -O0):
<tempsensorend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1040 <I2C_Send1@plt>
mov    -0x4(%rbp),%edi
call   1030 <I2C_Recv2@plt>
mov    %eax,-0x1c(%rbp)
imul   $0x3d09,-0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1040 <I2C_Send1@plt>
mov    -0x4(%rbp),%edi
call   1030 <I2C_Recv2@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
sar    $0x2,%eax
imul   $0xc35,%eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tempsensorend>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %esi,%esi
call   1040 <I2C_Send1@plt>
mov    %ebp,%edi
call   1030 <I2C_Recv2@plt>
imul   $0x3d09,%eax,%eax
mov    %eax,(%rbx)
mov    %ebp,%edi
mov    $0x1,%esi
call   1040 <I2C_Send1@plt>
mov    %ebp,%edi
call   1030 <I2C_Recv2@plt>
sar    $0x2,%eax
imul   $0xc35,%eax,%eax
mov    %eax,(%r14)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @tempsensorend(i32 %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%8 = load i32, i32* %4
%9 = call i32 @I2C_Send1(i32 %8, i32 0)
%10 = load i32, i32* %4
%11 = call i32 @I2C_Recv2(i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = mul nsw i32 %12, 15625
%14 = load i32*, i32** %5
store i32 %13, i32* %14
%15 = load i32, i32* %4
%16 = call i32 @I2C_Send1(i32 %15, i32 1)
%17 = load i32, i32* %4
%18 = call i32 @I2C_Recv2(i32 %17)
store i32 %18, i32* %7
%19 = load i32, i32* %7
%20 = ashr i32 %19, 2
%21 = mul nsw i32 %20, 3125
%22 = load i32*, i32** %6
store i32 %21, i32* %22
ret void
}

LLVM IR (-O2):
define void @tempsensorend(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = tail call i32 @I2C_Send1(i32 %0, i32 0)
%5 = tail call i32 @I2C_Recv2(i32 %0)
%6 = mul nsw i32 %5, 15625
store i32 %6, i32* %1
%7 = tail call i32 @I2C_Send1(i32 %0, i32 1)
%8 = tail call i32 @I2C_Recv2(i32 %0)
%9 = ashr i32 %8, 2
%10 = mul nsw i32 %9, 3125
store i32 %10, i32* %2
ret void
}
int ZEXT(int value, int topbit) { return (value & ((1 << (topbit + 1)) - 1)); }


x86 assembly (clang, -O0):
<ZEXT>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
sub    $0x1,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ZEXT>:
lea    0x1(%rsi),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @ZEXT(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %6, 1
%8 = shl i32 1, %7
%9 = sub nsw i32 %8, 1
%10 = and i32 %5, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @ZEXT(i32 %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = shl nsw i32 -1, %3
%5 = xor i32 %4, -1
%6 = and i32 %5, %0
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int matriz[][4] = {{1, 2, 3, 4}, {5, 6, 7, 8}};
  int *tmp;
  tmp = (int *)matriz;
  printf("=>%d\n", *((tmp + 1 * 4) + 2));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed1(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    0x18(%rax),%esi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x7,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"=>%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 7)
ret i32 0
}
/* Type definitions */
struct tcb {
  int dummy;
};

/* Variables and functions */
int sys_accept(struct tcb *);
int sys_getsockname(struct tcb *tcp) { return sys_accept(tcp); }


x86 assembly (clang, -O0):
<sys_getsockname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <sys_accept@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_getsockname>:
jmp    1030 <sys_accept@plt>

LLVM IR (-O0):
%struct.tcb = type { i32 }
define i32 @sys_getsockname(%struct.tcb* %0) {
%2 = alloca %struct.tcb*
store %struct.tcb* %0, %struct.tcb** %2
%3 = load %struct.tcb*, %struct.tcb** %2
%4 = call i32 @sys_accept(%struct.tcb* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.tcb = type { i32 }
define i32 @sys_getsockname(%struct.tcb* %0) {
%2 = tail call i32 @sys_accept(%struct.tcb* %0)
ret i32 %2
}
void arm_backtrace_eabi(int cpu, struct pt_regs *const regs,
                        unsigned int depth) {}


x86 assembly (clang, -O0):
<arm_backtrace_eabi>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<arm_backtrace_eabi>:
ret

LLVM IR (-O0):
%struct.pt_regs = type opaque
define void @arm_backtrace_eabi(i32 %0, %struct.pt_regs* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.pt_regs*
%6 = alloca i32
store i32 %0, i32* %4
store %struct.pt_regs* %1, %struct.pt_regs** %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
%struct.pt_regs = type opaque
define void @arm_backtrace_eabi(i32 %0, %struct.pt_regs* nocapture %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_adapted(void *ptr, void *UNUSED_data __attribute__((unused))) {
  free(ptr);
}


x86 assembly (clang, -O0):
<free_adapted>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_adapted>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_adapted(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i32 @free(i8* %5)
ret void
}

LLVM IR (-O2):
define void @free_adapted(i8* nocapture %0, i8* nocapture readnone %1) {
%3 = tail call i32 @free(i8* %0)
ret void
}
float getfloat(float x) {
  char *p1, *p2;
  float y;
  p1 = (char *)(&x);
  p2 = (char *)(&y);
  p2[3] = p1[0];
  p2[2] = p1[1];
  p2[1] = p1[2];
  p2[0] = p1[3];
  return (y);
}


x86 assembly (clang, -O0):
<getfloat>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x1c(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x10(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
movss  -0x1c(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<getfloat>:
movd   %xmm0,%eax
bswap  %eax
movd   %eax,%xmm0
ret

LLVM IR (-O0):
define float @getfloat(float %0) {
%2 = alloca float
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca float
store float %0, float* %2
%6 = bitcast float* %2 to i8*
store i8* %6, i8** %3
%7 = bitcast float* %5 to i8*
store i8* %7, i8** %4
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 0
%10 = load i8, i8* %9
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i64 3
store i8 %10, i8* %12
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = load i8, i8* %14
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i64 2
store i8 %15, i8* %17
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i64 2
%20 = load i8, i8* %19
%21 = load i8*, i8** %4
%22 = getelementptr inbounds i8, i8* %21, i64 1
store i8 %20, i8* %22
%23 = load i8*, i8** %3
%24 = getelementptr inbounds i8, i8* %23, i64 3
%25 = load i8, i8* %24
%26 = load i8*, i8** %4
%27 = getelementptr inbounds i8, i8* %26, i64 0
store i8 %25, i8* %27
%28 = load float, float* %5
ret float %28
}

LLVM IR (-O2):
define float @getfloat(float %0) {
%2 = bitcast float %0 to i32
%3 = tail call i32 @llvm.bswap.i32(i32 %2)
%4 = bitcast i32 %3 to float
ret float %4
}
void pl_mm_init(void) {}


x86 assembly (clang, -O0):
<pl_mm_init>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pl_mm_init>:
ret

LLVM IR (-O0):
define void @pl_mm_init() {
ret void
}

LLVM IR (-O2):
define void @pl_mm_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CheckRunningInMainThread(char *);
int /*<<< orphan*/ GetXOPIndString(char *, int, int);
int /*<<< orphan*/ XOPNotice(char *);
void XOPResNotice(int strListID, int index) {
  char theString[256];
  if (!CheckRunningInMainThread("XOPResNotice"))
    return;
  GetXOPIndString(theString, strListID, index);
  XOPNotice(theString);
}


x86 assembly (clang, -O0):
<XOPResNotice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xeb8(%rip),%rdi
call   1040 <CheckRunningInMainThread@plt>
cmp    $0x0,%eax
jne    115b <XOPResNotice+0x2b>
jmp    1179 <XOPResNotice+0x49>
lea    -0x110(%rbp),%rdi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1050 <GetXOPIndString@plt>
lea    -0x110(%rbp),%rdi
call   1030 <XOPNotice@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XOPResNotice>:
push   %rbp
push   %r14
push   %rbx
sub    $0x100,%rsp
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xeba(%rip),%rdi
call   1040 <CheckRunningInMainThread@plt>
test   %eax,%eax
je     1166 <XOPResNotice+0x36>
mov    %rsp,%r14
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1050 <GetXOPIndString@plt>
mov    %r14,%rdi
call   1030 <XOPNotice@plt>
add    $0x100,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"XOPResNotice\00"
define void @XOPResNotice(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [256 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = call i32 @CheckRunningInMainThread(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%7 = icmp ne i32 %6, 0
br i1 %7, label %9, label %8
8: ; preds = %2
br label %16
9: ; preds = %2
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = call i32 @GetXOPIndString(i8* %10, i32 %11, i32 %12)
%14 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%15 = call i32 @XOPNotice(i8* %14)
br label %16
16: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"XOPResNotice\00"
define void @XOPResNotice(i32 %0, i32 %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @CheckRunningInMainThread(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = call i32 @GetXOPIndString(i8* %4, i32 %0, i32 %1)
%9 = call i32 @XOPNotice(i8* %4)
br label %10
10: ; preds = %2, %7
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ OCSP_RESPONSE;

/* Variables and functions */
scalar_t__ ASN1_item_new(int /*<<< orphan*/ *);
int /*<<< orphan*/ OCSP_RESPONSE_it;
OCSP_RESPONSE *OCSP_RESPONSE_new(void) {
  return (OCSP_RESPONSE *)ASN1_item_new(&OCSP_RESPONSE_it);
}


x86 assembly (clang, -O0):
<OCSP_RESPONSE_new>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rdi
call   1030 <ASN1_item_new@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<OCSP_RESPONSE_new>:
mov    0x2ed9(%rip),%rdi
jmp    1030 <ASN1_item_new@plt>

LLVM IR (-O0):
@OCSP_RESPONSE_it = global i32 0
define i32* @OCSP_RESPONSE_new() {
%1 = call i64 @ASN1_item_new(i32* @OCSP_RESPONSE_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}

LLVM IR (-O2):
@OCSP_RESPONSE_it = global i32 0
define i32* @OCSP_RESPONSE_new() {
%1 = tail call i64 @ASN1_item_new(i32* @OCSP_RESPONSE_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int syscon_quaddobl_size_limit(int k, int *szl) {
  int fail;
  double *c;
  fail = _ada_use_c2phc(602, &k, szl, c);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_quaddobl_size_limit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x25a,%edi
lea    -0x4(%rbp),%rsi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_quaddobl_size_limit>:
push   %rax
mov    %rsi,%rdx
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x25a,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @syscon_quaddobl_size_limit(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca double*
store i32 %0, i32* %3
store i32* %1, i32** %4
%7 = load i32*, i32** %4
%8 = load double*, double** %6
%9 = call i32 @_ada_use_c2phc(i32 602, i32* %3, i32* %7, double* %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
ret i32 %10
}

LLVM IR (-O2):
define i32 @syscon_quaddobl_size_limit(i32 %0, i32* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @_ada_use_c2phc(i32 602, i32* %3, i32* %1, double* undef)
ret i32 %4
}