xunge/DecIR huggingface dataset:
void *ll_next(void *ptr) {
  if (!ptr)
    return (0);
  return ((void *)(*(void **)ptr));
}


x86 assembly (clang, -O0):
<ll_next>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1120 <ll_next+0x20>
movq   $0x0,-0x8(%rbp)
jmp    112b <ll_next+0x2b>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ll_next>:
test   %rdi,%rdi
je     1109 <ll_next+0x9>
mov    (%rdi),%rax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @ll_next(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp ne i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %1
store i8* null, i8** %2
br label %11
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
store i8* %10, i8** %2
br label %11
11: ; preds = %7, %6
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
define i8* @ll_next(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = bitcast i8* %0 to i8**
%5 = load i8*, i8** %4
br label %6
6: ; preds = %1, %3
%7 = phi i8* [ %5, %3 ], [ null, %1 ]
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void check_free(char *ptr) {
  if (ptr != NULL)
    free(ptr);
}


x86 assembly (clang, -O0):
<check_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <check_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_free>:
test   %rdi,%rdi
je     111a <check_free+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @check_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @check_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0x10() {
  Assert_real((isprint(16) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              85, ("isprint should be 0 for 0x10"));
}


x86 assembly (clang, -O0):
<t_isprint_0x10>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10,%edi
call   1030 <isprint@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x55,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0x10>:
push   %rax
mov    $0x10,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x55,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x10\00"
define void @t_isprint_0x10() {
%1 = call i64 @isprint(i32 16)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 85, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x10\00"
define void @t_isprint_0x10() {
%1 = tail call i64 @isprint(i32 16)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 85, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int /*<<< orphan*/ err_sys(char *);
char *sock_ntop_host(struct sockaddr const *, int /*<<< orphan*/);
char *Sock_ntop_host(const struct sockaddr *sa, socklen_t salen) {
  char *ptr;
  if ((ptr = sock_ntop_host(sa, salen)) == NULL)
    err_sys("sock_ntop_host error");
  return (ptr);
}


x86 assembly (clang, -O0):
<Sock_ntop_host>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <sock_ntop_host@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1155 <Sock_ntop_host+0x35>
lea    0xeb0(%rip),%rdi
call   1030 <err_sys@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sock_ntop_host>:
push   %rbx
call   1040 <sock_ntop_host@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <Sock_ntop_host+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <err_sys@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
@.str = [21 x i8] c"sock_ntop_host error\00"
define i8* @Sock_ntop_host(%struct.sockaddr* %0, i32 %1) {
%3 = tail call i8* @sock_ntop_host(%struct.sockaddr* %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @err_sys(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void printtext(char *text, int size) {
  int i;
  for (i = 0; i < size; i++) {
    putchar(*(text + i));
  }
}


x86 assembly (clang, -O0):
<printtext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <printtext+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <putchar@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printtext+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printtext>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1143 <printtext+0x33>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <printtext+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @printtext(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call i32 @putchar(i8 signext %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
int roi_get_servo(char *buff, short *pwm_ref) {
  char *pwm;
  pwm = (char *)pwm_ref;
  pwm[1] = buff[1];
  pwm[0] = buff[2];
  return 0;
}


x86 assembly (clang, -O0):
<roi_get_servo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<roi_get_servo>:
mov    0x1(%rdi),%al
mov    %al,0x1(%rsi)
mov    0x2(%rdi),%al
mov    %al,(%rsi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @roi_get_servo(i8* %0, i16* %1) {
%3 = alloca i8*
%4 = alloca i16*
%5 = alloca i8*
store i8* %0, i8** %3
store i16* %1, i16** %4
%6 = load i16*, i16** %4
%7 = bitcast i16* %6 to i8*
store i8* %7, i8** %5
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = load i8*, i8** %5
%12 = getelementptr inbounds i8, i8* %11, i64 1
store i8 %10, i8* %12
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 2
%15 = load i8, i8* %14
%16 = load i8*, i8** %5
%17 = getelementptr inbounds i8, i8* %16, i64 0
store i8 %15, i8* %17
ret i32 0
}

LLVM IR (-O2):
define i32 @roi_get_servo(i8* nocapture %0, i16* nocapture writeonly %1) {
%3 = bitcast i16* %1 to i8*
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = getelementptr inbounds i8, i8* %3, i64 1
store i8 %5, i8* %6
%7 = getelementptr inbounds i8, i8* %0, i64 2
%8 = load i8, i8* %7
store i8 %8, i8* %3
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
time_t __tmin(float a, float b) {
  if (a < b)
    return (time_t)a;
  return (time_t)b;
}


x86 assembly (clang, -O0):
<__tmin>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    112e <__tmin+0x2e>
cvttss2si -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1136 <__tmin+0x36>
cvttss2si -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__tmin>:
minss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @__tmin(float %0, float %1) {
%3 = alloca i32
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = load float, float* %5
%8 = fcmp olt float %6, %7
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load float, float* %4
%11 = fptosi float %10 to i32
store i32 %11, i32* %3
br label %15
12: ; preds = %2
%13 = load float, float* %5
%14 = fptosi float %13 to i32
store i32 %14, i32* %3
br label %15
15: ; preds = %12, %9
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @__tmin(float %0, float %1) {
%3 = fcmp olt float %0, %1
%4 = select i1 %3, float %0, float %1
%5 = fptosi float %4 to i32
ret i32 %5
}
int IsChannelChar(char c) {
  const char kInvalidChars[] = {'\0', 0x07, '\r', '\n', ' ', ',', ':'};
  const int kInvalidCnt = 7;
  int i;
  for (i = 0; i < kInvalidCnt; i++) {
    if (c == kInvalidChars[i])
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<IsChannelChar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    0xef0(%rip),%eax
mov    %eax,-0xc(%rbp)
mov    0xeea(%rip),%ax
mov    %ax,-0x8(%rbp)
mov    0xee2(%rip),%al
mov    %al,-0x6(%rbp)
movl   $0x7,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x7,-0x14(%rbp)
jge    1173 <IsChannelChar+0x73>
movsbl -0x5(%rbp),%eax
movslq -0x14(%rbp),%rcx
movsbl -0xc(%rbp,%rcx,1),%ecx
cmp    %ecx,%eax
jne    1160 <IsChannelChar+0x60>
movl   $0x0,-0x4(%rbp)
jmp    117a <IsChannelChar+0x7a>
jmp    1165 <IsChannelChar+0x65>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1135 <IsChannelChar+0x35>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsChannelChar>:
cmp    $0x3a,%dil
ja     111d <IsChannelChar+0x1d>
xor    %eax,%eax
movzbl %dil,%ecx
movabs $0x400100100002481,%rdx
bt     %rcx,%rdx
jae    111d <IsChannelChar+0x1d>
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
@__const.IsChannelChar.kInvalidChars = [7 x i8] c"\00\07\0D\0A ,:"
define i32 @IsChannelChar(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca [7 x i8]
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %3
%7 = bitcast [7 x i8]* %4 to i8*
store i32 7, i32* %5
store i32 0, i32* %6
br label %8
8: ; preds = %22, %1
%9 = load i32, i32* %6
%10 = icmp slt i32 %9, 7
br i1 %10, label %11, label %25
11: ; preds = %8
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [7 x i8], [7 x i8]* %4, i64 0, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %13, %18
br i1 %19, label %20, label %21
20: ; preds = %11
store i32 0, i32* %2
br label %26
21: ; preds = %11
br label %22
22: ; preds = %21
%23 = load i32, i32* %6
%24 = add nsw i32 %23, 1
store i32 %24, i32* %6
br label %8
25: ; preds = %8
store i32 1, i32* %2
br label %26
26: ; preds = %25, %20
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @IsChannelChar(i8 signext %0) {
switch i8 %0, label %2 [
i8 0, label %3
i8 7, label %3
i8 13, label %3
i8 10, label %3
i8 32, label %3
i8 44, label %3
i8 58, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %1 ], [ 1, %2 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ]
ret i32 %4
}
void jiffies_to_timeval(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<jiffies_to_timeval>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<jiffies_to_timeval>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.jiffies_to_timeval = [19 x i8] c"jiffies_to_timeval\00"
define void @jiffies_to_timeval() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__func__.jiffies_to_timeval, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.jiffies_to_timeval = [19 x i8] c"jiffies_to_timeval\00"
define void @jiffies_to_timeval() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__func__.jiffies_to_timeval, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char **);
void freelist(char *list[]) {
  char **cp = list;
  while (*cp)
    free(*cp++);
  free(list);
}


x86 assembly (clang, -O0):
<freelist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     114e <freelist+0x3e>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rdi
call   1030 <free@plt>
jmp    1124 <freelist+0x14>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freelist>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <freelist+0x31>
lea    0x8(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <freelist+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @freelist(i8** %0) {
%2 = alloca i8**
%3 = alloca i8**
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
store i8** %4, i8*** %3
br label %5
5: ; preds = %9, %1
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = load i8**, i8*** %3
%11 = getelementptr inbounds i8*, i8** %10, i32 1
store i8** %11, i8*** %3
%12 = load i8*, i8** %10
%13 = bitcast i8* %12 to i8**
%14 = call i32 @free(i8** %13)
br label %5
15: ; preds = %5
%16 = load i8**, i8*** %2
%17 = call i32 @free(i8** %16)
ret void
}

LLVM IR (-O2):
define void @freelist(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %10, %4 ], [ %2, %1 ]
%6 = phi i8** [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = bitcast i8* %5 to i8**
%9 = tail call i32 @free(i8** %8)
%10 = load i8*, i8** %7
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %4
12: ; preds = %4, %1
%13 = tail call i32 @free(i8** %0)
ret void
}
void rotr(int *a, int *b, int *c) {
  int d;
  d = *a;
  *a = *c;
  *c = *b;
  *b = d;
}


x86 assembly (clang, -O0):
<rotr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotr>:
mov    (%rdi),%eax
mov    (%rdx),%ecx
mov    %ecx,(%rdi)
mov    (%rsi),%ecx
mov    %ecx,(%rdx)
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @rotr(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 = load i32, i32* %8
store i32 %9, i32* %7
%10 = load i32*, i32** %6
%11 = load i32, i32* %10
%12 = load i32*, i32** %4
store i32 %11, i32* %12
%13 = load i32*, i32** %5
%14 = load i32, i32* %13
%15 = load i32*, i32** %6
store i32 %14, i32* %15
%16 = load i32, i32* %7
%17 = load i32*, i32** %5
store i32 %16, i32* %17
ret void
}

LLVM IR (-O2):
define void @rotr(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %2
store i32 %5, i32* %0
%6 = load i32, i32* %1
store i32 %6, i32* %2
store i32 %4, i32* %1
ret void
}
/* Variables and functions */
int strlen(char *);
long hash(char *word) {
  int i;
  long hashed = 42;
  for (i = 0; i < strlen(word); i++) {
    hashed += word[i] * (i + 1);
  }
  return hashed;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x2a,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
cmp    %ecx,%eax
jge    1174 <hash+0x64>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
cltq
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112b <hash+0x1b>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
mov    $0x2a,%r15d
test   %eax,%eax
jle    1150 <hash+0x40>
xor    %ebx,%ebx
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%eax
add    $0x1,%rbx
imul   %ebx,%eax
cltq
add    %rax,%r15
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1130 <hash+0x20>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i64 @hash(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %18
4: ; preds = %1, %4
%5 = phi i64 [ %10, %4 ], [ 0, %1 ]
%6 = phi i64 [ %14, %4 ], [ 42, %1 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %5
%8 = load i8, i8* %7
%9 = sext i8 %8 to i64
%10 = add nuw nsw i64 %5, 1
%11 = mul i64 %10, %9
%12 = shl i64 %11, 32
%13 = ashr exact i64 %12, 32
%14 = add nsw i64 %6, %13
%15 = tail call i32 @strlen(i8* %0)
%16 = sext i32 %15 to i64
%17 = icmp slt i64 %10, %16
br i1 %17, label %4, label %18
18: ; preds = %4, %1
%19 = phi i64 [ 42, %1 ], [ %14, %4 ]
ret i64 %19
}
void ASN1_put_object(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_put_object() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ displaymode();
int /*<<< orphan*/ pushNumber(int /*<<< orphan*/);
void basDisplayMode() { pushNumber(displaymode()); }


x86 assembly (clang, -O0):
<basDisplayMode>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <displaymode@plt>
mov    %eax,%edi
call   1040 <pushNumber@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<basDisplayMode>:
push   %rax
xor    %eax,%eax
call   1030 <displaymode@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <pushNumber@plt>

LLVM IR (-O0):
define void @basDisplayMode() {
%1 = call i32 (...) @displaymode()
%2 = call i32 @pushNumber(i32 %1)
ret void
}

LLVM IR (-O2):
define void @basDisplayMode() {
%1 = tail call i32 (...) @displaymode()
%2 = tail call i32 @pushNumber(i32 %1)
ret void
}
int ath_rate_control_register(void) { return 0; }


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

x86 assembly (clang, -O2):
<ath_rate_control_register>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @ath_rate_control_register() {
ret i32 0
}

LLVM IR (-O2):
define i32 @ath_rate_control_register() {
ret i32 0
}
long ltohl(long in) { return in; }


x86 assembly (clang, -O0):
<ltohl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ltohl>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @ltohl(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
ret i64 %3
}

LLVM IR (-O2):
define i64 @ltohl(i64 returned %0) {
ret i64 %0
}
int board_is_b_sample(void) { return 0; }


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

x86 assembly (clang, -O2):
<board_is_b_sample>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @board_is_b_sample() {
ret i32 0
}

LLVM IR (-O2):
define i32 @board_is_b_sample() {
ret i32 0
}
/* Variables and functions */
void *__builtin_arm_rsrp(char *);
void *rsrp() { return __builtin_arm_rsrp("1:2:3:4:5"); }


x86 assembly (clang, -O0):
<rsrp>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <__builtin_arm_rsrp@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rsrp>:
lea    0xee9(%rip),%rdi
jmp    1030 <__builtin_arm_rsrp@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"1:2:3:4:5\00"
define i8* @rsrp() {
%1 = call i8* @__builtin_arm_rsrp(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [10 x i8] c"1:2:3:4:5\00"
define i8* @rsrp() {
%1 = tail call i8* @__builtin_arm_rsrp(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Type definitions */
typedef int /*<<< orphan*/ X509_CERT_AUX;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
scalar_t__ ASN1_item_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                         int /*<<< orphan*/ *);
int /*<<< orphan*/ X509_CERT_AUX_it;
X509_CERT_AUX *d2i_X509_CERT_AUX(X509_CERT_AUX **a, const unsigned char **in,
                                 long len) {
  return (X509_CERT_AUX *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
                                        &X509_CERT_AUX_it);
}


x86 assembly (clang, -O0):
<d2i_X509_CERT_AUX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    0x2ea9(%rip),%rcx
call   1030 <ASN1_item_d2i@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2i_X509_CERT_AUX>:
mov    0x2ec9(%rip),%rcx
jmp    1030 <ASN1_item_d2i@plt>

LLVM IR (-O0):
@X509_CERT_AUX_it = global i32 0
define i32* @d2i_X509_CERT_AUX(i32** %0, i8** %1, i64 %2) {
%4 = alloca i32**
%5 = alloca i8**
%6 = alloca i64
store i32** %0, i32*** %4
store i8** %1, i8*** %5
store i64 %2, i64* %6
%7 = load i32**, i32*** %4
%8 = load i8**, i8*** %5
%9 = load i64, i64* %6
%10 = call i64 @ASN1_item_d2i(i32** %7, i8** %8, i64 %9, i32* @X509_CERT_AUX_it)
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
@X509_CERT_AUX_it = global i32 0
define i32* @d2i_X509_CERT_AUX(i32** %0, i8** %1, i64 %2) {
%4 = tail call i64 @ASN1_item_d2i(i32** %0, i8** %1, i64 %2, i32* @X509_CERT_AUX_it)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
scalar_t__ rand();
size_t get_random_size(size_t lower, size_t upper) {
  assert(lower < upper);
  return lower + ((size_t)(rand()) % (upper - lower));
}


x86 assembly (clang, -O0):
<get_random_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    -0x10(%rbp),%rcx
sub    -0x8(%rbp),%rcx
xor    %edx,%edx
div    %rcx
mov    -0x18(%rbp),%rax
add    %rdx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_random_size>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %edi,%edi
sub    %r14,%rbx
seta   %dil
call   1030 <assert@plt>
xor    %eax,%eax
call   1040 <rand@plt>
mov    %rax,%rcx
or     %rbx,%rcx
shr    $0x20,%rcx
je     1155 <get_random_size+0x35>
xor    %edx,%edx
div    %rbx
mov    %rdx,%rax
jmp    115b <get_random_size+0x3b>
xor    %edx,%edx
div    %ebx
mov    %edx,%eax
add    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @get_random_size(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp ult i64 %5, %6
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i64, i64* %3
%11 = call i64 (...) @rand()
%12 = load i64, i64* %4
%13 = load i64, i64* %3
%14 = sub i64 %12, %13
%15 = urem i64 %11, %14
%16 = add i64 %10, %15
ret i64 %16
}

LLVM IR (-O2):
define i64 @get_random_size(i64 %0, i64 %1) {
%3 = icmp ugt i64 %1, %0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i64 (...) @rand()
%7 = sub i64 %1, %0
%8 = urem i64 %6, %7
%9 = add i64 %8, %0
ret i64 %9
}
void computePi(void) { ; }


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

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

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

LLVM IR (-O2):
define void @computePi() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void _acu_std_close(void *fd_voidptr) { close((int)(long)fd_voidptr); }


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

x86 assembly (clang, -O2):
<_acu_std_close>:
jmp    1030 <close@plt>

LLVM IR (-O0):
define void @_acu_std_close(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = trunc i64 %4 to i32
%6 = call i32 @close(i32 %5)
ret void
}

LLVM IR (-O2):
define void @_acu_std_close(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 @close(i32 %3)
ret void
}
/* Variables and functions */
int fibo(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  printf("Unesite n: ");
  scanf("%d", &n);
  printf("%d-ti element Finacijevog niza je: %d", n, fibo(n - 1));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1050 <fibo@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%ebx
lea    -0x1(%rbx),%edi
call   1050 <fibo@plt>
lea    0xea5(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Unesite n: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [38 x i8] c"%d-ti element Finacijevog niza je: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = sub nsw i32 %6, 1
%8 = call i32 @fibo(i32 %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Unesite n: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [38 x i8] c"%d-ti element Finacijevog niza je: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = add nsw i32 %5, -1
%7 = call i32 @fibo(i32 %6)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ add(int);
int /*<<< orphan*/ load();
int /*<<< orphan*/ save();
int /*<<< orphan*/ set();
void ne0fucktheworld() {
  add(0x77e108);
  set();
  load();
  add(-0x97950 + 0x3ed8e8);
  set();
  add(-0x3ed8e8 + 0x4f440);
  save();
}


x86 assembly (clang, -O0):
<ne0fucktheworld>:
push   %rbp
mov    %rsp,%rbp
mov    $0x77e108,%edi
call   1030 <add@plt>
mov    $0x0,%al
call   1060 <set@plt>
mov    $0x0,%al
call   1050 <load@plt>
mov    $0x355f98,%edi
call   1030 <add@plt>
mov    $0x0,%al
call   1060 <set@plt>
mov    $0xffc61b58,%edi
call   1030 <add@plt>
mov    $0x0,%al
call   1040 <save@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ne0fucktheworld>:
push   %rax
mov    $0x77e108,%edi
call   1030 <add@plt>
xor    %eax,%eax
call   1060 <set@plt>
xor    %eax,%eax
call   1050 <load@plt>
mov    $0x355f98,%edi
call   1030 <add@plt>
xor    %eax,%eax
call   1060 <set@plt>
mov    $0xffc61b58,%edi
call   1030 <add@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <save@plt>

LLVM IR (-O0):
define void @ne0fucktheworld() {
%1 = call i32 @add(i32 7856392)
%2 = call i32 (...) @set()
%3 = call i32 (...) @load()
%4 = call i32 @add(i32 3497880)
%5 = call i32 (...) @set()
%6 = call i32 @add(i32 -3794088)
%7 = call i32 (...) @save()
ret void
}

LLVM IR (-O2):
define void @ne0fucktheworld() {
%1 = tail call i32 @add(i32 7856392)
%2 = tail call i32 (...) @set()
%3 = tail call i32 (...) @load()
%4 = tail call i32 @add(i32 3497880)
%5 = tail call i32 (...) @set()
%6 = tail call i32 @add(i32 -3794088)
%7 = tail call i32 (...) @save()
ret void
}
char *ui_to_a(unsigned int i) {
  static char buf[20 + 1];
  char *p = buf + 20;
  do {
    *--p = '0' + (i % 10);
    i /= 10;
  } while (i != 0);
  return p;
}


x86 assembly (clang, -O0):
<ui_to_a>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    0x2f22(%rip),%rax
add    $0x14,%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
add    $0x30,%edx
mov    %dl,%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,-0x1(%rax)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1116 <ui_to_a+0x16>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ui_to_a>:
lea    0x2f3d(%rip),%rax
mov    $0xcccccccd,%r8d
nopl   (%rax)
mov    %edi,%edx
imul   %r8,%rdx
shr    $0x23,%rdx
lea    (%rdx,%rdx,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %edi,%ecx
sub    %esi,%ecx
or     $0x30,%cl
mov    %cl,-0x1(%rax)
add    $0xffffffffffffffff,%rax
cmp    $0x9,%edi
mov    %edx,%edi
ja     1110 <ui_to_a+0x10>
ret

LLVM IR (-O0):
@ui_to_a.buf = internal global [21 x i8] zeroinitializer
define i8* @ui_to_a(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* getelementptr inbounds ([21 x i8], [21 x i8]* @ui_to_a.buf, i64 0, i64 20), i8** %3
br label %4
4: ; preds = %13, %1
%5 = load i32, i32* %2
%6 = urem i32 %5, 10
%7 = add i32 48, %6
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i32 -1
store i8* %10, i8** %3
store i8 %8, i8* %10
%11 = load i32, i32* %2
%12 = udiv i32 %11, 10
store i32 %12, i32* %2
br label %13
13: ; preds = %4
%14 = load i32, i32* %2
%15 = icmp ne i32 %14, 0
br i1 %15, label %4, label %16
16: ; preds = %13
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
@ui_to_a.buf = internal global [21 x i8] zeroinitializer
define i8* @ui_to_a(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %9, %2 ]
%4 = phi i8* [ getelementptr inbounds ([21 x i8], [21 x i8]* @ui_to_a.buf, i64 0, i64 20), %1 ], [ %8, %2 ]
%5 = urem i32 %3, 10
%6 = trunc i32 %5 to i8
%7 = or i8 %6, 48
%8 = getelementptr inbounds i8, i8* %4, i64 -1
store i8 %7, i8* %8
%9 = udiv i32 %3, 10
%10 = icmp ult i32 %3, 10
br i1 %10, label %11, label %2
11: ; preds = %2
ret i8* %8
}
void rop3_187_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = ~S;
  stk1 = *D | stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_187_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_187_1_0>:
not    %sil
or     %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_187_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %5
%10 = zext i8 %9 to i32
%11 = xor i32 %10, -1
%12 = trunc i32 %11 to i8
store i8 %12, i8* %8
%13 = load i8*, i8** %4
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = load i8, i8* %8
%17 = zext i8 %16 to i32
%18 = or i32 %15, %17
%19 = trunc i32 %18 to i8
store i8 %19, i8* %7
%20 = load i8, i8* %7
%21 = zext i8 %20 to i32
%22 = load i8, i8* %5
%23 = zext i8 %22 to i32
%24 = xor i32 %23, -1
%25 = and i32 %21, %24
%26 = load i8*, i8** %4
%27 = load i8, i8* %26
%28 = zext i8 %27 to i32
%29 = load i8, i8* %5
%30 = zext i8 %29 to i32
%31 = and i32 %28, %30
%32 = or i32 %25, %31
%33 = trunc i32 %32 to i8
%34 = load i8*, i8** %4
store i8 %33, i8* %34
ret void
}

LLVM IR (-O2):
define void @rop3_187_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %1, -1
%5 = load i8, i8* %0
%6 = or i8 %5, %4
store i8 %6, i8* %0
ret void
}
char *strip_newline(char *str) {
  char *cur = str;
  while (*cur) {
    cur++;
  }
  char *prev = cur - 1;
  if (cur != str && *prev == '\n') {
    *prev = '\0';
  }
  return str;
}


x86 assembly (clang, -O0):
<strip_newline>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     112e <strip_newline+0x2e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strip_newline+0x10>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
je     115f <strip_newline+0x5f>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    115f <strip_newline+0x5f>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strip_newline>:
mov    %rdi,%rax
mov    $0xffffffffffffffff,%rcx
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rax,%rcx,1)
lea    0x1(%rcx),%rcx
jne    1110 <strip_newline+0x10>
test   %rcx,%rcx
je     112c <strip_newline+0x2c>
cmpb   $0xa,-0x1(%rax,%rcx,1)
jne    112c <strip_newline+0x2c>
movb   $0x0,-0x1(%rax,%rcx,1)
ret

LLVM IR (-O0):
define i8* @strip_newline(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %3
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 %13
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %3
br label %6
13: ; preds = %6
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 -1
store i8* %15, i8** %4
%16 = load i8*, i8** %3
%17 = load i8*, i8** %2
%18 = icmp ne i8* %16, %17
br i1 %18, label %19, label %26
19: ; preds = %13
%20 = load i8*, i8** %4
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %22, 10
br i1 %23, label %24, label %26
24: ; preds = %19
%25 = load i8*, i8** %4
store i8 0, i8* %25
br label %26
26: ; preds = %24, %19, %13
%27 = load i8*, i8** %2
ret i8* %27
}

LLVM IR (-O2):
define i8* @strip_newline(i8* returned %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = getelementptr inbounds i8, i8* %3, i64 -1
%9 = icmp eq i8* %3, %0
br i1 %9, label %14, label %10
10: ; preds = %7
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 10
br i1 %12, label %13, label %14
13: ; preds = %10
store i8 0, i8* %8
br label %14
14: ; preds = %13, %10, %7
ret i8* %0
}
/* Variables and functions */
size_t strlen(const char *s) {
  const char *p = ((void *)0);
  for (p = s; *p != '\0'; p++)
    continue;
  return (p - s);
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     113e <strlen+0x3e>
jmp    112d <strlen+0x2d>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1118 <strlen+0x18>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
ret i64 %10
}
int FILE_FLIP(int x) { return 14 - x; }


x86 assembly (clang, -O0):
<FILE_FLIP>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0xe,%eax
sub    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FILE_FLIP>:
mov    $0xe,%eax
sub    %edi,%eax
ret

LLVM IR (-O0):
define i32 @FILE_FLIP(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 14, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @FILE_FLIP(i32 %0) {
%2 = sub nsw i32 14, %0
ret i32 %2
}
unsigned short buf_get_uint16_le(const void *buf, unsigned long addr) {
  const unsigned char *tmp = (const unsigned char *)buf + addr;
  unsigned short ret;
  ret = tmp[1];
  ret = (ret << 8) | tmp[0];
  return (ret);
}


x86 assembly (clang, -O0):
<buf_get_uint16_le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movzbl 0x1(%rax),%eax
mov    %ax,-0x1a(%rbp)
movzwl -0x1a(%rbp),%eax
shl    $0x8,%eax
mov    -0x18(%rbp),%rcx
movzbl (%rcx),%ecx
or     %ecx,%eax
mov    %ax,-0x1a(%rbp)
movzwl -0x1a(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<buf_get_uint16_le>:
movzwl (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define zeroext i16 @buf_get_uint16_le(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i16
store i8* %0, i8** %3
store i64 %1, i64* %4
%7 = load i8*, i8** %3
%8 = load i64, i64* %4
%9 = getelementptr inbounds i8, i8* %7, i64 %8
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i16
store i16 %13, i16* %6
%14 = load i16, i16* %6
%15 = zext i16 %14 to i32
%16 = shl i32 %15, 8
%17 = load i8*, i8** %5
%18 = getelementptr inbounds i8, i8* %17, i64 0
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = or i32 %16, %20
%22 = trunc i32 %21 to i16
store i16 %22, i16* %6
%23 = load i16, i16* %6
ret i16 %23
}

LLVM IR (-O2):
define zeroext i16 @buf_get_uint16_le(i8* nocapture %0, i64 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 %1
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i16
%7 = shl nuw i16 %6, 8
%8 = load i8, i8* %3
%9 = zext i8 %8 to i16
%10 = or i16 %7, %9
ret i16 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ X509_VAL;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int ASN1_item_i2d(int /*<<< orphan*/ *, unsigned char **, int /*<<< orphan*/ *);
int /*<<< orphan*/ X509_VAL_it;
int i2d_X509_VAL(X509_VAL *a, unsigned char **out) {
  return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_VAL_it);
}


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

x86 assembly (clang, -O2):
<i2d_X509_VAL>:
mov    0x2ed1(%rip),%rdx
jmp    1030 <ASN1_item_i2d@plt>

LLVM IR (-O0):
@X509_VAL_it = global i32 0
define i32 @i2d_X509_VAL(i32* %0, i8** %1) {
%3 = alloca i32*
%4 = alloca i8**
store i32* %0, i32** %3
store i8** %1, i8*** %4
%5 = load i32*, i32** %3
%6 = load i8**, i8*** %4
%7 = call i32 @ASN1_item_i2d(i32* %5, i8** %6, i32* @X509_VAL_it)
ret i32 %7
}

LLVM IR (-O2):
@X509_VAL_it = global i32 0
define i32 @i2d_X509_VAL(i32* %0, i8** %1) {
%3 = tail call i32 @ASN1_item_i2d(i32* %0, i8** %1, i32* @X509_VAL_it)
ret i32 %3
}
/* Variables and functions */
int test();
int main() { return test() + test() + test(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <test@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <test@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <test@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <test@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <test@plt>
mov    %eax,%ebp
add    %ebx,%ebp
xor    %eax,%eax
call   1030 <test@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test()
%3 = call i32 (...) @test()
%4 = add nsw i32 %2, %3
%5 = call i32 (...) @test()
%6 = add nsw i32 %4, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test()
%2 = tail call i32 (...) @test()
%3 = add nsw i32 %2, %1
%4 = tail call i32 (...) @test()
%5 = add nsw i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
int main(void) {
  int *array;
  array = malloc(10 * sizeof(int));
  free(array);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x28,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x28,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @malloc(i32 40)
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @free(i32* %4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @malloc(i32 40)
%2 = tail call i32 @free(i32* %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ posix_spawnattr_t;

/* Variables and functions */
int posix_spawnattr_destroy(posix_spawnattr_t *attr) { return 0; }


x86 assembly (clang, -O0):
<posix_spawnattr_destroy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<posix_spawnattr_destroy>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @posix_spawnattr_destroy(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @posix_spawnattr_destroy(i32* nocapture readnone %0) {
ret i32 0
}