xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ isspace(unsigned char);
void strip_nonspace(const char *buf, int *ip) {
  int i = *ip;
  while (!isspace((unsigned char)buf[i]))
    i++;
  *ip = i;
}


x86 assembly (clang, -O0):
<strip_nonspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movzbl (%rax,%rcx,1),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    114f <strip_nonspace+0x3f>
jmp    115d <strip_nonspace+0x4d>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <strip_nonspace+0x19>
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strip_nonspace>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
movslq (%rsi),%rax
lea    -0x1(%rax),%ebp
add    %rax,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rbx),%edi
call   1030 <isspace@plt>
add    $0x1,%ebp
add    $0x1,%rbx
test   %eax,%eax
je     1130 <strip_nonspace+0x20>
mov    %ebp,(%r14)
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @strip_nonspace(i8* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = sext i32 %3 to i64
br label %5
5: ; preds = %5, %2
%6 = phi i64 [ %11, %5 ], [ %4, %2 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = tail call i32 @isspace(i8 zeroext %8)
%10 = icmp eq i32 %9, 0
%11 = add i64 %6, 1
br i1 %10, label %5, label %12
12: ; preds = %5
%13 = trunc i64 %6 to i32
store i32 %13, i32* %1
ret void
}
long double byte_to_human_size(unsigned long long abytes) {
  long double mem = abytes;
  do {
    mem = mem / 1024.0;
  } while (mem > 1024.0);
  return mem;
}


x86 assembly (clang, -O0):
<byte_to_human_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
test   %rax,%rax
sets   %al
movzbl %al,%eax
mov    %eax,%ecx
fildll -0x28(%rbp)
lea    0xedb(%rip),%rax
flds   (%rax,%rcx,4)
faddp  %st,%st(1)
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
flds   0xed2(%rip)
fdivrp %st,%st(1)
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
flds   0xec4(%rip)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
ja     112d <byte_to_human_size+0x2d>
jmp    1155 <byte_to_human_size+0x55>
fldt   -0x20(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<byte_to_human_size>:
mov    %rdi,-0x8(%rsp)
xor    %eax,%eax
test   %rdi,%rdi
sets   %al
fildll -0x8(%rsp)
lea    0xee8(%rip),%rcx
fadds  (%rcx,%rax,4)
flds   0xeeb(%rip)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
fxch   %st(1)
fmuls  0xed0(%rip)
fucomi %st(1),%st
fxch   %st(1)
ja     1130 <byte_to_human_size+0x30>
fstp   %st(0)
ret

LLVM IR (-O0):
define x86_fp80 @byte_to_human_size(i64 %0) {
%2 = alloca i64
%3 = alloca x86_fp80
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = uitofp i64 %4 to x86_fp80
store x86_fp80 %5, x86_fp80* %3
br label %6
6: ; preds = %9, %1
%7 = load x86_fp80, x86_fp80* %3
%8 = fdiv x86_fp80 %7, 0xK40098000000000000000
store x86_fp80 %8, x86_fp80* %3
br label %9
9: ; preds = %6
%10 = load x86_fp80, x86_fp80* %3
%11 = fcmp ogt x86_fp80 %10, 0xK40098000000000000000
br i1 %11, label %6, label %12
12: ; preds = %9
%13 = load x86_fp80, x86_fp80* %3
ret x86_fp80 %13
}

LLVM IR (-O2):
define x86_fp80 @byte_to_human_size(i64 %0) {
%2 = uitofp i64 %0 to x86_fp80
br label %3
3: ; preds = %3, %1
%4 = phi x86_fp80 [ %2, %1 ], [ %5, %3 ]
%5 = fmul x86_fp80 %4, 0xK3FF58000000000000000
%6 = fcmp ogt x86_fp80 %5, 0xK40098000000000000000
br i1 %6, label %3, label %7
7: ; preds = %3
ret x86_fp80 %5
}
unsigned xrop3_121_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  unsigned stk4;
  stk4 = D | S;
  stk3 = T & stk4;
  stk2 = S ^ stk3;
  stk1 = D ^ stk2;
  stk1 = ~stk1;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_121_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%eax
and    -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_121_1_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
lea    (%rcx,%rdi,1),%eax
mov    %esi,%edx
shl    $0x8,%edx
or     %esi,%edx
or     $0xff,%ecx
and    %edx,%ecx
xor    %eax,%ecx
xor    $0xffffff00,%ecx
not    %eax
and    %ecx,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_121_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = shl i32 %13, 8
%15 = load i8, i8* %3
%16 = zext i8 %15 to i32
%17 = or i32 %14, %16
store i32 %17, i32* %6
%18 = load i8, i8* %4
%19 = zext i8 %18 to i32
%20 = shl i32 %19, 8
%21 = load i8, i8* %4
%22 = zext i8 %21 to i32
%23 = or i32 %20, %22
store i32 %23, i32* %7
%24 = load i32, i32* %5
%25 = load i32, i32* %6
%26 = or i32 %24, %25
store i32 %26, i32* %11
%27 = load i32, i32* %7
%28 = load i32, i32* %11
%29 = and i32 %27, %28
store i32 %29, i32* %10
%30 = load i32, i32* %6
%31 = load i32, i32* %10
%32 = xor i32 %30, %31
store i32 %32, i32* %9
%33 = load i32, i32* %5
%34 = load i32, i32* %9
%35 = xor i32 %33, %34
store i32 %35, i32* %8
%36 = load i32, i32* %8
%37 = xor i32 %36, -1
store i32 %37, i32* %8
%38 = load i32, i32* %8
%39 = load i32, i32* %6
%40 = xor i32 %39, -1
%41 = and i32 %38, %40
%42 = load i32, i32* %5
%43 = load i32, i32* %6
%44 = and i32 %42, %43
%45 = or i32 %41, %44
ret i32 %45
}

LLVM IR (-O2):
define i32 @xrop3_121_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = or i32 %4, %3
%6 = zext i8 %1 to i32
%7 = mul nuw nsw i32 %6, 257
%8 = or i32 %4, 255
%9 = and i32 %7, %8
%10 = xor i32 %5, %9
%11 = xor i32 %10, -256
%12 = xor i32 %5, -1
%13 = and i32 %11, %12
%14 = or i32 %13, %3
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int pthread_cond_broadcast(int /*<<< orphan*/ *);
int gen_posix_cond_broadcast(pthread_cond_t *cond) {
  return pthread_cond_broadcast(cond);
}


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

x86 assembly (clang, -O2):
<gen_posix_cond_broadcast>:
jmp    1030 <pthread_cond_broadcast@plt>

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

LLVM IR (-O2):
define i32 @gen_posix_cond_broadcast(i32* %0) {
%2 = tail call i32 @pthread_cond_broadcast(i32* %0)
ret i32 %2
}
int f2(int a, int *b, int c) { return a + *b + c; }


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

x86 assembly (clang, -O2):
<f2>:
lea    (%rdi,%rdx,1),%eax
add    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @f2(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32*, i32** %5
%9 = load i32, i32* %8
%10 = add nsw i32 %7, %9
%11 = load i32, i32* %6
%12 = add nsw i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @f2(i32 %0, i32* nocapture %1, i32 %2) {
%4 = load i32, i32* %1
%5 = add i32 %2, %0
%6 = add i32 %5, %4
ret i32 %6
}
int max(int x, int y) {
  if (x > y)
    return x;
  else
    return y;
  return 0;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1121 <max+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <max+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @max(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = icmp sgt i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %4
store i32 %10, i32* %3
br label %13
11: ; preds = %2
%12 = load i32, i32* %5
store i32 %12, i32* %3
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
int ocorrencias(char palavra[], char letra, int i) {
  if (palavra[i] == '\0')
    return 0;
  return (letra == palavra[i]) + ocorrencias(palavra, letra, i + 1);
}


x86 assembly (clang, -O0):
<ocorrencias>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    1146 <ocorrencias+0x36>
movl   $0x0,-0x4(%rbp)
jmp    1182 <ocorrencias+0x72>
movsbl -0x11(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x18(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x11(%rbp),%al
mov    -0x18(%rbp),%edx
add    $0x1,%edx
movsbl %al,%esi
call   1030 <ocorrencias@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ocorrencias>:
movslq %edx,%rax
mov    (%rdi,%rax,1),%dl
test   %dl,%dl
je     1137 <ocorrencias+0x37>
lea    (%rax,%rdi,1),%rcx
add    $0x1,%rcx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %edi,%edi
cmp    %sil,%dl
sete   %dil
add    %edi,%eax
movzbl (%rcx),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1120 <ocorrencias+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ocorrencias(i8* nocapture %0, i8 signext %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %19, label %8
8: ; preds = %3, %8
%9 = phi i64 [ %14, %8 ], [ %4, %3 ]
%10 = phi i8 [ %17, %8 ], [ %6, %3 ]
%11 = phi i32 [ %15, %8 ], [ 0, %3 ]
%12 = icmp eq i8 %10, %1
%13 = zext i1 %12 to i32
%14 = add i64 %9, 1
%15 = add nuw nsw i32 %11, %13
%16 = getelementptr inbounds i8, i8* %0, i64 %14
%17 = load i8, i8* %16
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %8
19: ; preds = %8, %3
%20 = phi i32 [ 0, %3 ], [ %15, %8 ]
ret i32 %20
}
/* Type definitions */
struct stat {
  int st_size;
};

/* Variables and functions */
int fstat(int, struct stat *);
int wrapc_filesize(int f, unsigned int *low, unsigned int *high) {
  struct stat s;
  int res = fstat(f, (struct stat *)&s);
  if (res == 0) {
    *low = (unsigned int)s.st_size;
    *high = (unsigned int)(s.st_size >> (sizeof(unsigned int) * 8));
  }
  return res;
}


x86 assembly (clang, -O0):
<wrapc_filesize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x20(%rbp),%rsi
call   1030 <fstat@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jne    1157 <wrapc_filesize+0x47>
mov    -0x20(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrapc_filesize>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0x8(%rsp),%rsi
call   1030 <fstat@plt>
test   %eax,%eax
jne    112c <wrapc_filesize+0x1c>
mov    0x8(%rsp),%ecx
mov    %ecx,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @wrapc_filesize(i32 %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca %struct.stat
%8 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%9 = load i32, i32* %4
%10 = call i32 @fstat(i32 %9, %struct.stat* %7)
store i32 %10, i32* %8
%11 = load i32, i32* %8
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %21
13: ; preds = %3
%14 = getelementptr inbounds %struct.stat, %struct.stat* %7, i32 0, i32 0
%15 = load i32, i32* %14
%16 = load i32*, i32** %5
store i32 %15, i32* %16
%17 = getelementptr inbounds %struct.stat, %struct.stat* %7, i32 0, i32 0
%18 = load i32, i32* %17
%19 = ashr i32 %18, 32
%20 = load i32*, i32** %6
store i32 %19, i32* %20
br label %21
21: ; preds = %13, %3
%22 = load i32, i32* %8
ret i32 %22
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @wrapc_filesize(i32 %0, i32* nocapture writeonly %1, i32* nocapture readnone %2) {
%4 = alloca %struct.stat
%5 = bitcast %struct.stat* %4 to i8*
%6 = call i32 @fstat(i32 %0, %struct.stat* %4)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = getelementptr inbounds %struct.stat, %struct.stat* %4, i64 0, i32 0
%10 = load i32, i32* %9
store i32 %10, i32* %1
br label %11
11: ; preds = %8, %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ pop(char *);
void make_empty(char stack[], int coun) {
  int o;
  for (o = 0; o < coun; o++) {
    pop(stack);
  }
}


x86 assembly (clang, -O0):
<make_empty>:
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    1149 <make_empty+0x39>
mov    -0x8(%rbp),%rdi
call   1030 <pop@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <make_empty+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_empty>:
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    112d <make_empty+0x1d>
mov    %esi,%ebx
mov    %rdi,%r14
nopl   (%rax)
mov    %r14,%rdi
call   1030 <pop@plt>
add    $0xffffffff,%ebx
jne    1120 <make_empty+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @make_empty(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 = %13, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = call i32 @pop(i8* %11)
br label %13
13: ; preds = %10
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 1
store i32 %15, i32* %5
br label %6
16: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @make_empty(i8* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 0, %2 ]
%6 = tail call i32 @pop(i8* %0)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %1
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}
/* Type definitions */
struct tsm_screen {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ screen_inc_age(struct tsm_screen *);
int /*<<< orphan*/ tsm_screen_move_down(struct tsm_screen *, int, int);
int /*<<< orphan*/ tsm_screen_move_line_home(struct tsm_screen *);
__attribute__((visibility("default"))) void
tsm_screen_newline(struct tsm_screen *con) {
  if (!con)
    return;
  screen_inc_age(con);
  tsm_screen_move_down(con, 1, true);
  tsm_screen_move_line_home(con);
}


x86 assembly (clang, -O0):
<tsm_screen_newline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    114c <tsm_screen_newline+0x1c>
jmp    116e <tsm_screen_newline+0x3e>
mov    -0x8(%rbp),%rdi
call   1040 <screen_inc_age@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <tsm_screen_move_down@plt>
mov    -0x8(%rbp),%rdi
call   1050 <tsm_screen_move_line_home@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tsm_screen_newline>:
test   %rdi,%rdi
je     1159 <tsm_screen_newline+0x29>
push   %rbx
mov    %rdi,%rbx
call   1040 <screen_inc_age@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <tsm_screen_move_down@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <tsm_screen_move_line_home@plt>
ret

LLVM IR (-O0):
%struct.tsm_screen = type { i32 }
define void @tsm_screen_newline(%struct.tsm_screen* %0) {
%2 = alloca %struct.tsm_screen*
store %struct.tsm_screen* %0, %struct.tsm_screen** %2
%3 = load %struct.tsm_screen*, %struct.tsm_screen** %2
%4 = icmp ne %struct.tsm_screen* %3, null
br i1 %4, label %6, label %5
5: ; preds = %1
br label %13
6: ; preds = %1
%7 = load %struct.tsm_screen*, %struct.tsm_screen** %2
%8 = call i32 @screen_inc_age(%struct.tsm_screen* %7)
%9 = load %struct.tsm_screen*, %struct.tsm_screen** %2
%10 = call i32 @tsm_screen_move_down(%struct.tsm_screen* %9, i32 1, i32 1)
%11 = load %struct.tsm_screen*, %struct.tsm_screen** %2
%12 = call i32 @tsm_screen_move_line_home(%struct.tsm_screen* %11)
br label %13
13: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
%struct.tsm_screen = type { i32 }
define void @tsm_screen_newline(%struct.tsm_screen* %0) {
%2 = icmp eq %struct.tsm_screen* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 @screen_inc_age(%struct.tsm_screen* %0)
%5 = tail call i32 @tsm_screen_move_down(%struct.tsm_screen* %0, i32 1, i32 1)
%6 = tail call i32 @tsm_screen_move_line_home(%struct.tsm_screen* %0)
br label %7
7: ; preds = %1, %3
ret void
}
const char *get() { return "abc"; }


x86 assembly (clang, -O0):
<get>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"abc\00"
define i8* @get() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [4 x i8] c"abc\00"
define i8* @get() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fread(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ otfcc_endian_convert32(int /*<<< orphan*/);
uint32_t otfcc_get32u(FILE *file) {
  uint32_t tmp;
  fread(&tmp, 4, 1, file);
  return otfcc_endian_convert32(tmp);
}


x86 assembly (clang, -O0):
<otfcc_get32u>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0xc(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    -0xc(%rbp),%edi
call   1040 <otfcc_endian_convert32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<otfcc_get32u>:
push   %rax
mov    %rdi,%rcx
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    0x4(%rsp),%edi
pop    %rax
jmp    1040 <otfcc_endian_convert32@plt>

LLVM IR (-O0):
define i32 @otfcc_get32u(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fread(i32* %3, i32 4, i32 1, i32* %4)
%6 = load i32, i32* %3
%7 = call i32 @otfcc_endian_convert32(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @otfcc_get32u(i32* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @fread(i32* %2, i32 4, i32 1, i32* %0)
%5 = load i32, i32* %2
%6 = tail call i32 @otfcc_endian_convert32(i32 %5)
ret i32 %6
}
void i2d_POLICYQUALINFO(void) {}


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

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

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

LLVM IR (-O2):
define void @i2d_POLICYQUALINFO() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_syscall(char *);
void CE_UnLock(void) { do_syscall("CE_UnLock"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"CE_UnLock\00"
define void @CE_UnLock() {
%1 = call i32 @do_syscall(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"CE_UnLock\00"
define void @CE_UnLock() {
%1 = tail call i32 @do_syscall(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
float xs();
float ys(float a) { return xs() * a; }


x86 assembly (clang, -O0):
<ys>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <xs@plt>
mulss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ys>:
push   %rax
movss  %xmm0,0x4(%rsp)
xor    %eax,%eax
call   1030 <xs@plt>
mulss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @ys(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = call float (...) @xs()
%4 = load float, float* %2
%5 = fmul float %3, %4
ret float %5
}

LLVM IR (-O2):
define float @ys(float %0) {
%2 = tail call float (...) @xs()
%3 = fmul float %2, %0
ret float %3
}
int libnet_build_snmp() { return (-1); }


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

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

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

LLVM IR (-O2):
define i32 @libnet_build_snmp() {
ret i32 -1
}
void NETpause() {}


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

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

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

LLVM IR (-O2):
define void @NETpause() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
uint8_t get_byte(uint32_t string, int place) {
  assert(place < 4);
  uint8_t result = (uint8_t)(string >> 18 - 6 * place);
}


x86 assembly (clang, -O0):
<get_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%eax
imul   $0x6,-0xc(%rbp),%edx
mov    $0x12,%ecx
sub    %edx,%ecx
sar    %cl,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_byte>:
xor    %edi,%edi
cmp    $0x4,%esi
setl   %dil
jmp    1030 <assert@plt>

LLVM IR (-O0):
define i32 @get_byte(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 4
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = mul nsw i32 6, %12
%14 = sub nsw i32 18, %13
%15 = ashr i32 %11, %14
store i32 %15, i32* %6
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @get_byte(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 4
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
ret i32 undef
}
long double test_infl(void) { return __builtin_infl(); }


x86 assembly (clang, -O0):
<test_infl>:
push   %rbp
mov    %rsp,%rbp
flds   0xef6(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_infl>:
flds   0xefa(%rip)
ret

LLVM IR (-O0):
define x86_fp80 @test_infl() {
ret x86_fp80 0xK7FFF8000000000000000
}

LLVM IR (-O2):
define x86_fp80 @test_infl() {
ret x86_fp80 0xK7FFF8000000000000000
}
/* Variables and functions */
scalar_t__ RAND_MAX;
float rand();
float ranfrac() { return rand() / (float)RAND_MAX; }


x86 assembly (clang, -O0):
<ranfrac>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    0x2ec6(%rip),%rax
cvtsi2ssq (%rax),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ranfrac>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ec9(%rip),%rax
cvtsi2ssq (%rax),%xmm1
divss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define float @ranfrac() {
%1 = call float (...) @rand()
%2 = load i64, i64* @RAND_MAX
%3 = sitofp i64 %2 to float
%4 = fdiv float %1, %3
ret float %4
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define float @ranfrac() {
%1 = tail call float (...) @rand()
%2 = load i64, i64* @RAND_MAX
%3 = sitofp i64 %2 to float
%4 = fdiv float %1, %3
ret float %4
}
int zerotest2(int a) { return (a == 0); }


x86 assembly (clang, -O0):
<zerotest2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zerotest2>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @zerotest2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @zerotest2(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int /*<<< orphan*/ be16_to_cpu(int /*<<< orphan*/);
int16_t cpu_to_be16(int16_t x) { return (be16_to_cpu(x)); }


x86 assembly (clang, -O0):
<cpu_to_be16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <be16_to_cpu@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_to_be16>:
jmp    1030 <be16_to_cpu@plt>

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

LLVM IR (-O2):
define i32 @cpu_to_be16(i32 %0) {
%2 = tail call i32 @be16_to_cpu(i32 %0)
ret i32 %2
}
/* Variables and functions */
int quickSort(int *, int, int);
void quick(int *arr, int beg, int last) {
  int pos;
  if (beg > last)
    return;
  pos = quickSort(arr, beg, last);
  quick(arr, beg, pos - 1);
  quick(arr, pos + 1, last);
}


x86 assembly (clang, -O0):
<quick>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1143 <quick+0x23>
jmp    1179 <quick+0x59>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <quickSort@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quick@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quick@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jg     1164 <quick+0x44>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <quickSort@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quick@plt>
lea    0x1(%rbx),%ebp
cmp    %r14d,%ebx
jl     1140 <quick+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @quick(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* %5
%9 = load i32, i32* %6
%10 = icmp sgt i32 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %3
br label %25
12: ; preds = %3
%13 = load i32*, i32** %4
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = call i32 @quickSort(i32* %13, i32 %14, i32 %15)
store i32 %16, i32* %7
%17 = load i32*, i32** %4
%18 = load i32, i32* %5
%19 = load i32, i32* %7
%20 = sub nsw i32 %19, 1
%21 = load i32*, i32** %4
%22 = load i32, i32* %7
%23 = add nsw i32 %22, 1
%24 = load i32, i32* %6
br label %25
25: ; preds = %12, %11
ret void
}

LLVM IR (-O2):
define void @quick(i32* %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, %2
br i1 %4, label %11, label %5
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @quickSort(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quick(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %7, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
void XExtendedMaxRequestSize() {}


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

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

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

LLVM IR (-O2):
define void @XExtendedMaxRequestSize() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int errno;
int pthread_cond_wait(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int tosCondition_wait(pthread_cond_t *cond, pthread_mutex_t *mx) {
  int res = 0;
  res = pthread_cond_wait(cond, mx);
  if (res) {
    errno = res;
    res = -1;
  }
  return res;
}


x86 assembly (clang, -O0):
<tosCondition_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <pthread_cond_wait@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1154 <tosCondition_wait+0x44>
mov    -0x14(%rbp),%ecx
mov    0x2e95(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tosCondition_wait>:
push   %rax
call   1030 <pthread_cond_wait@plt>
test   %eax,%eax
je     112a <tosCondition_wait+0x1a>
mov    0x2ebf(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @tosCondition_wait(i32* %0, i32* %1) {
%3 = tail call i32 @pthread_cond_wait(i32* %0, i32* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %2
store i32 %3, i32* @errno
br label %6
6: ; preds = %5, %2
%7 = phi i32 [ -1, %5 ], [ 0, %2 ]
ret i32 %7
}
/* Variables and functions */
int fatfs_fileop_init(void **, char *, int /*<<< orphan*/);
int fatfs_fileop_xinit(void **fsctx, void *dev) {
  char *devname = (char *)dev;
  return fatfs_fileop_init(fsctx, devname, 0);
}


x86 assembly (clang, -O0):
<fatfs_fileop_xinit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
xor    %edx,%edx
call   1030 <fatfs_fileop_init@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fatfs_fileop_xinit>:
xor    %edx,%edx
jmp    1030 <fatfs_fileop_init@plt>

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

LLVM IR (-O2):
define i32 @fatfs_fileop_xinit(i8** %0, i8* %1) {
%3 = tail call i32 @fatfs_fileop_init(i8** %0, i8* %1, i32 0)
ret i32 %3
}
/* Variables and functions */
unsigned int PCGetSystemUpdateID();
int /*<<< orphan*/
UpnpResponse_ContentDirectory_GetSystemUpdateID(void *, unsigned int);
int /*<<< orphan*/ printf(char *);
void UpnpContentDirectory_GetSystemUpdateID(void *upnptoken) {
  unsigned int sid;
  printf("UPnP Invoke: UpnpContentDirectory_GetSystemUpdateID();\r\n");
  sid = PCGetSystemUpdateID();
  UpnpResponse_ContentDirectory_GetSystemUpdateID(upnptoken, sid);
}


x86 assembly (clang, -O0):
<UpnpContentDirectory_GetSystemUpdateID>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <PCGetSystemUpdateID@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <UpnpResponse_ContentDirectory_GetSystemUpdateID@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UpnpContentDirectory_GetSystemUpdateID>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <PCGetSystemUpdateID@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1050 <UpnpResponse_ContentDirectory_GetSystemUpdateID@plt>

LLVM IR (-O0):
@.str = [57 x i8] c"UPnP Invoke: UpnpContentDirectory_GetSystemUpdateID();\0D\0A\00"
define void @UpnpContentDirectory_GetSystemUpdateID(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (...) @PCGetSystemUpdateID()
store i32 %5, i32* %3
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = call i32 @UpnpResponse_ContentDirectory_GetSystemUpdateID(i8* %6, i32 %7)
ret void
}

LLVM IR (-O2):
@str = [56 x i8] c"UPnP Invoke: UpnpContentDirectory_GetSystemUpdateID();\0D\00"
define void @UpnpContentDirectory_GetSystemUpdateID(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @PCGetSystemUpdateID()
%4 = tail call i32 @UpnpResponse_ContentDirectory_GetSystemUpdateID(i8* %0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clearSConsole(int /*<<< orphan*/);
int /*<<< orphan*/ getCurrentSConsole();
void clear(unsigned int argc, unsigned char (*argv_pointer)[10]) {
  clearSConsole(getCurrentSConsole());
}


x86 assembly (clang, -O0):
<clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getCurrentSConsole@plt>
mov    %eax,%edi
call   1030 <clearSConsole@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @clear(i32 %0, [10 x i8]* %1) {
%3 = alloca i32
%4 = alloca [10 x i8]*
store i32 %0, i32* %3
store [10 x i8]* %1, [10 x i8]** %4
%5 = call i32 (...) @getCurrentSConsole()
%6 = call i32 @clearSConsole(i32 %5)
ret void
}

LLVM IR (-O2):
define void @clear(i32 %0, [10 x i8]* nocapture readnone %1) {
%3 = tail call i32 (...) @getCurrentSConsole()
%4 = tail call i32 @clearSConsole(i32 %3)
ret void
}
/* Variables and functions */
int _ForkptyX(int *, char *, int /*<<< orphan*/, int /*<<< orphan*/);
int _Forkpty(int *pty, char *name) { return _ForkptyX(pty, name, 0, 0); }


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

x86 assembly (clang, -O2):
<_Forkpty>:
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <_ForkptyX@plt>

LLVM IR (-O0):
define i32 @_Forkpty(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 @_ForkptyX(i32* %5, i8* %6, i32 0, i32 0)
ret i32 %7
}

LLVM IR (-O2):
define i32 @_Forkpty(i32* %0, i8* %1) {
%3 = tail call i32 @_ForkptyX(i32* %0, i8* %1, i32 0, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char const *);
void gen_filename(char *filename, int swap_obase, const char *obase,
                  const char *suffix) {
  if (swap_obase)
    strcat(filename, obase);
  if (suffix[0])
    strcat(filename, suffix);
}


x86 assembly (clang, -O0):
<gen_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     113e <gen_filename+0x2e>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcat@plt>
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     1158 <gen_filename+0x48>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <strcat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_filename>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %rdi,%r14
test   %esi,%esi
je     1129 <gen_filename+0x19>
mov    %r14,%rdi
mov    %rdx,%rsi
call   1030 <strcat@plt>
cmpb   $0x0,(%rbx)
je     1140 <gen_filename+0x30>
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strcat@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @gen_filename(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i32, i32* %6
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %4
%12 = load i8*, i8** %5
%13 = load i8*, i8** %7
%14 = call i32 @strcat(i8* %12, i8* %13)
br label %15
15: ; preds = %11, %4
%16 = load i8*, i8** %8
%17 = getelementptr inbounds i8, i8* %16, i64 0
%18 = load i8, i8* %17
%19 = icmp ne i8 %18, 0
br i1 %19, label %20, label %24
20: ; preds = %15
%21 = load i8*, i8** %5
%22 = load i8*, i8** %8
%23 = call i32 @strcat(i8* %21, i8* %22)
br label %24
24: ; preds = %20, %15
ret void
}

LLVM IR (-O2):
define void @gen_filename(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = icmp eq i32 %1, 0
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = tail call i32 @strcat(i8* %0, i8* %2)
br label %8
8: ; preds = %6, %4
%9 = load i8, i8* %3
%10 = icmp eq i8 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %8
%12 = tail call i32 @strcat(i8* %0, i8* %3)
br label %13
13: ; preds = %11, %8
ret void
}
void testClosureLLLLLLrV(void (*closure)(long long, long long, long long),
                         long long a1, long long a2, long long a3) {
  (*closure)(a1, a2, a3);
}


x86 assembly (clang, -O0):
<testClosureLLLLLLrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureLLLLLLrV>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
jmp    *%rax

LLVM IR (-O0):
define void @testClosureLLLLLLrV(void (i64, i64, i64)* %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca void (i64, i64, i64)*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store void (i64, i64, i64)* %0, void (i64, i64, i64)** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load void (i64, i64, i64)*, void (i64, i64, i64)** %5
%10 = load i64, i64* %6
%11 = load i64, i64* %7
%12 = load i64, i64* %8
ret void
}

LLVM IR (-O2):
define void @testClosureLLLLLLrV(void (i64, i64, i64)* nocapture %0, i64 %1, i64 %2, i64 %3) {
tail call void %0(i64 %1, i64 %2, i64 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help(void) {
  printf("\n");
  printf(
      "Forma de uso:   chronopic-serial-conf dispositivo_serie [opciones]\n");
  printf("Opciones:\n");
  printf("    -h : Mostrar esta ayuda\n\n");
  printf("Ejemplo: chronopic-serial-conf /dev/ttyUSB0\n");
  printf("\n");
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
lea    0xf50(%rip),%rdi
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
lea    0xf11(%rip),%rdi
call   1030 <printf@plt>
lea    0xf10(%rip),%rdi
call   1030 <printf@plt>
lea    0xf22(%rip),%rdi
call   1030 <printf@plt>
lea    0xf14(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
push   %rax
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xece(%rip),%rdi
call   1040 <puts@plt>
lea    0xf05(%rip),%rdi
call   1040 <puts@plt>
lea    0xf03(%rip),%rdi
call   1040 <puts@plt>
lea    0xf14(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [68 x i8] c"Forma de uso: chronopic-serial-conf dispositivo_serie [opciones]\0A\00"
@.str.2 = [11 x i8] c"Opciones:\0A\00"
@.str.3 = [30 x i8] c" -h : Mostrar esta ayuda\0A\0A\00"
@.str.4 = [45 x i8] c"Ejemplo: chronopic-serial-conf /dev/ttyUSB0\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.4, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [67 x i8] c"Forma de uso: chronopic-serial-conf dispositivo_serie [opciones]\00"
@str.5 = [10 x i8] c"Opciones:\00"
@str.6 = [29 x i8] c" -h : Mostrar esta ayuda\0A\00"
@str.7 = [44 x i8] c"Ejemplo: chronopic-serial-conf /dev/ttyUSB0\00"
define void @help() {
%1 = tail call i32 @putchar(i32 10)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.6, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.7, i64 0, i64 0))
%6 = tail call i32 @putchar(i32 10)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_CUR;
int fseek(int /*<<< orphan*/ *, unsigned int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int a3dsSkipChunk(FILE *f, unsigned int skip) {
  printf("3ds: "
         " Skipping chunk ...\n");
  return fseek(f, skip - (sizeof(unsigned short) + sizeof(unsigned int)),
               SEEK_CUR);
}


x86 assembly (clang, -O0):
<a3dsSkipChunk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
sub    $0x6,%rax
mov    %eax,%esi
mov    0x2e99(%rip),%rax
mov    (%rax),%edx
call   1040 <fseek@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a3dsSkipChunk>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
lea    0xed0(%rip),%rdi
call   1030 <puts@plt>
add    $0xfffffffa,%ebx
mov    0x2ea9(%rip),%rax
mov    (%rax),%edx
mov    %r14,%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <fseek@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"3ds: Skipping chunk ...\0A\00"
@SEEK_CUR = global i32 0
define i32 @a3dsSkipChunk(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%6 = load i32*, i32** %3
%7 = load i32, i32* %4
%8 = zext i32 %7 to i64
%9 = sub i64 %8, 6
%10 = trunc i64 %9 to i32
%11 = load i32, i32* @SEEK_CUR
%12 = call i32 @fseek(i32* %6, i32 %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
@SEEK_CUR = global i32 0
@str = [25 x i8] c"3ds: Skipping chunk ...\00"
define i32 @a3dsSkipChunk(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%4 = add i32 %1, -6
%5 = load i32, i32* @SEEK_CUR
%6 = tail call i32 @fseek(i32* %0, i32 %4, i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ pir_port_config();
void pir_init() { pir_port_config(); }


x86 assembly (clang, -O0):
<pir_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <pir_port_config@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pir_init>:
xor    %eax,%eax
jmp    1030 <pir_port_config@plt>

LLVM IR (-O0):
define void @pir_init() {
%1 = call i32 (...) @pir_port_config()
ret void
}

LLVM IR (-O2):
define void @pir_init() {
%1 = tail call i32 (...) @pir_port_config()
ret void
}