xunge/DecIR huggingface dataset:
int index_valid(int *index, const int length) {
  *index = *index < 0 ? length + *index : *index;
  return (*index >= 0 && *index <= length - 1);
}


x86 assembly (clang, -O0):
<index_valid>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
jge    1129 <index_valid+0x29>
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
add    (%rcx),%eax
mov    %eax,-0x10(%rbp)
jmp    1132 <index_valid+0x32>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmpl   $0x0,(%rcx)
mov    %al,-0x11(%rbp)
jl     1161 <index_valid+0x61>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
setle  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<index_valid>:
mov    (%rdi),%eax
mov    %eax,%ecx
sar    $0x1f,%ecx
and    %esi,%ecx
add    %eax,%ecx
mov    %ecx,(%rdi)
cmp    %esi,%ecx
setl   %al
test   %ecx,%ecx
setns  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @index_valid(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i32, i32* %4
%10 = load i32*, i32** %3
%11 = load i32, i32* %10
%12 = add nsw i32 %9, %11
br label %16
13: ; preds = %2
%14 = load i32*, i32** %3
%15 = load i32, i32* %14
br label %16
16: ; preds = %13, %8
%17 = phi i32 [ %12, %8 ], [ %15, %13 ]
%18 = load i32*, i32** %3
store i32 %17, i32* %18
%19 = load i32*, i32** %3
%20 = load i32, i32* %19
%21 = icmp sge i32 %20, 0
br i1 %21, label %22, label %28
22: ; preds = %16
%23 = load i32*, i32** %3
%24 = load i32, i32* %23
%25 = load i32, i32* %4
%26 = sub nsw i32 %25, 1
%27 = icmp sle i32 %24, %26
br label %28
28: ; preds = %22, %16
%29 = phi i1 [ false, %16 ], [ %27, %22 ]
%30 = zext i1 %29 to i32
ret i32 %30
}

LLVM IR (-O2):
define i32 @index_valid(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = icmp slt i32 %3, 0
%5 = select i1 %4, i32 %1, i32 0
%6 = add nsw i32 %5, %3
store i32 %6, i32* %0
%7 = icmp slt i32 %6, %1
%8 = icmp sgt i32 %6, -1
%9 = and i1 %8, %7
%10 = zext i1 %9 to i32
ret i32 %10
}
int putShortIntoBuffer(unsigned char *sendBuffer, int offset, short value) {
  unsigned char *bPointer;
  bPointer = (unsigned char *)&value;
  sendBuffer[offset] = bPointer[1];
  sendBuffer[offset + 1] = bPointer[0];
  return 0;
}


x86 assembly (clang, -O0):
<putShortIntoBuffer>:
push   %rbp
mov    %rsp,%rbp
mov    %dx,%ax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %ax,-0xe(%rbp)
lea    -0xe(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    0x1(%rax),%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
mov    (%rax),%dl
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<putShortIntoBuffer>:
movslq %esi,%rax
rol    $0x8,%dx
mov    %dx,(%rdi,%rax,1)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @putShortIntoBuffer(i8* %0, i32 %1, i16 signext %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i16
%7 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i16 %2, i16* %6
%8 = bitcast i16* %6 to i8*
store i8* %8, i8** %7
%9 = load i8*, i8** %7
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = load i8*, i8** %4
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
store i8 %11, i8* %15
%16 = load i8*, i8** %7
%17 = getelementptr inbounds i8, i8* %16, i64 0
%18 = load i8, i8* %17
%19 = load i8*, i8** %4
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %19, i64 %22
store i8 %18, i8* %23
ret i32 0
}

LLVM IR (-O2):
define i32 @putShortIntoBuffer(i8* nocapture writeonly %0, i32 %1, i16 signext %2) {
%4 = trunc i16 %2 to i8
%5 = lshr i16 %2, 8
%6 = trunc i16 %5 to i8
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %6, i8* %8
%9 = add nsw i32 %1, 1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %0, i64 %10
store i8 %4, i8* %11
ret i32 0
}
void isNeg(char c, char cp, int *flag) {
  if (c == '-' && cp >= '0' && cp <= '9')
    *flag = 1;
}


x86 assembly (clang, -O0):
<isNeg>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    %rdx,-0x10(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x2d,%eax
jne    1145 <isNeg+0x45>
movsbl -0x2(%rbp),%eax
cmp    $0x30,%eax
jl     1145 <isNeg+0x45>
movsbl -0x2(%rbp),%eax
cmp    $0x39,%eax
jg     1145 <isNeg+0x45>
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<isNeg>:
cmp    $0x2d,%dil
jne    1116 <isNeg+0x16>
add    $0xd0,%sil
cmp    $0x9,%sil
ja     1116 <isNeg+0x16>
movl   $0x1,(%rdx)
ret

LLVM IR (-O0):
define void @isNeg(i8 signext %0, i8 signext %1, i32* %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i32*
store i8 %0, i8* %4
store i8 %1, i8* %5
store i32* %2, i32** %6
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 45
br i1 %9, label %10, label %20
10: ; preds = %3
%11 = load i8, i8* %5
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 48
br i1 %13, label %14, label %20
14: ; preds = %10
%15 = load i8, i8* %5
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 57
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = load i32*, i32** %6
store i32 1, i32* %19
br label %20
20: ; preds = %18, %14, %10, %3
ret void
}

LLVM IR (-O2):
define void @isNeg(i8 signext %0, i8 signext %1, i32* nocapture writeonly %2) {
%4 = icmp eq i8 %0, 45
%5 = add i8 %1, -48
%6 = icmp ult i8 %5, 10
%7 = and i1 %4, %6
br i1 %7, label %8, label %9
8: ; preds = %3
store i32 1, i32* %2
br label %9
9: ; preds = %8, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ S_Init();
int /*<<< orphan*/ S_Shutdown();
void CL_Snd_Restart(void) {
  S_Shutdown();
  S_Init();
}


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

x86 assembly (clang, -O2):
<CL_Snd_Restart>:
push   %rax
xor    %eax,%eax
call   1030 <S_Shutdown@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <S_Init@plt>

LLVM IR (-O0):
define void @CL_Snd_Restart() {
%1 = call i32 (...) @S_Shutdown()
%2 = call i32 (...) @S_Init()
ret void
}

LLVM IR (-O2):
define void @CL_Snd_Restart() {
%1 = tail call i32 (...) @S_Shutdown()
%2 = tail call i32 (...) @S_Init()
ret void
}
/* Type definitions */
typedef int uint32_t;
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
uint32_t time_now() {
  struct timespec now;
  clock_gettime(CLOCK_REALTIME, &now);
  return (now.tv_sec * (uint32_t)1000000) + (now.tv_nsec / 1000);
}


x86 assembly (clang, -O0):
<time_now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
imul   $0xf4240,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_now>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
imul   $0xf4240,(%rsp),%ecx
movslq 0x4(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
@CLOCK_REALTIME = global i32 0
define i32 @time_now() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_REALTIME
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = add nsw i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
@CLOCK_REALTIME = global i32 0
define i32 @time_now() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_REALTIME
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, 1000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%9 = load i32, i32* %8
%10 = sdiv i32 %9, 1000
%11 = add nsw i32 %10, %7
ret i32 %11
}
int pthread_mutex_unlock() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pthread_mutex_unlock() {
ret i32 0
}
/* Variables and functions */
int getdtablesize();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int size = getdtablesize();
  printf("%d\n", size);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getdtablesize@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @getdtablesize()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getdtablesize()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int mapping_clear() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @mapping_clear() {
ret i32 0
}
/* Type definitions */
struct lk_list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __lk_list_del_entry(struct lk_list_head *);
int /*<<< orphan*/ lk_list_add(struct lk_list_head *, struct lk_list_head *);
void lk_list_move(struct lk_list_head *list, struct lk_list_head *head) {
  __lk_list_del_entry(list);
  lk_list_add(list, head);
}


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

x86 assembly (clang, -O2):
<lk_list_move>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <__lk_list_del_entry@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <lk_list_add@plt>

LLVM IR (-O0):
%struct.lk_list_head = type { i32 }
define void @lk_list_move(%struct.lk_list_head* %0, %struct.lk_list_head* %1) {
%3 = alloca %struct.lk_list_head*
%4 = alloca %struct.lk_list_head*
store %struct.lk_list_head* %0, %struct.lk_list_head** %3
store %struct.lk_list_head* %1, %struct.lk_list_head** %4
%5 = load %struct.lk_list_head*, %struct.lk_list_head** %3
%6 = call i32 @__lk_list_del_entry(%struct.lk_list_head* %5)
%7 = load %struct.lk_list_head*, %struct.lk_list_head** %3
%8 = load %struct.lk_list_head*, %struct.lk_list_head** %4
%9 = call i32 @lk_list_add(%struct.lk_list_head* %7, %struct.lk_list_head* %8)
ret void
}

LLVM IR (-O2):
%struct.lk_list_head = type { i32 }
define void @lk_list_move(%struct.lk_list_head* %0, %struct.lk_list_head* %1) {
%3 = tail call i32 @__lk_list_del_entry(%struct.lk_list_head* %0)
%4 = tail call i32 @lk_list_add(%struct.lk_list_head* %0, %struct.lk_list_head* %1)
ret void
}
long long hDoubleToLongBits(double d) {
  union {
    double d;
    unsigned long long ll;
  } dtoll;
  dtoll.d = d;
  return dtoll.ll;
}


x86 assembly (clang, -O0):
<hDoubleToLongBits>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hDoubleToLongBits>:
movq   %xmm0,%rax
ret

LLVM IR (-O0):
%union.anon = type { double }
define i64 @hDoubleToLongBits(double %0) {
%2 = alloca double
%3 = alloca %union.anon
store double %0, double* %2
%4 = load double, double* %2
%5 = bitcast %union.anon* %3 to double*
store double %4, double* %5
%6 = bitcast %union.anon* %3 to i64*
%7 = load i64, i64* %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @hDoubleToLongBits(double %0) {
%2 = bitcast double %0 to i64
ret i64 %2
}
/* Type definitions */
struct sockaddr_storage {
  int ss_family;
};
struct sockaddr_in {
  int sin_port;
};

/* Variables and functions */
#define AF_INET 128
int htons(int);
void set_port(struct sockaddr_storage *addr, int port) {
  port = htons(port);
  switch (addr->ss_family) {
  case AF_INET:
    ((struct sockaddr_in *)addr)->sin_port = port;
    break;
  }
}


x86 assembly (clang, -O0):
<set_port>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <htons@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
sub    $0x80,%eax
jne    1149 <set_port+0x39>
jmp    1140 <set_port+0x30>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_port>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <htons@plt>
cmpl   $0x80,(%rbx)
jne    1125 <set_port+0x15>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
%struct.sockaddr_storage = type { i32 }
%struct.sockaddr_in = type { i32 }
define void @set_port(%struct.sockaddr_storage* %0, i32 %1) {
%3 = alloca %struct.sockaddr_storage*
%4 = alloca i32
store %struct.sockaddr_storage* %0, %struct.sockaddr_storage** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @htons(i32 %5)
store i32 %6, i32* %4
%7 = load %struct.sockaddr_storage*, %struct.sockaddr_storage** %3
%8 = getelementptr inbounds %struct.sockaddr_storage, %struct.sockaddr_storage* %7, i32 0, i32 0
%9 = load i32, i32* %8
switch i32 %9, label %15 [
i32 128, label %10
]
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load %struct.sockaddr_storage*, %struct.sockaddr_storage** %3
%13 = bitcast %struct.sockaddr_storage* %12 to %struct.sockaddr_in*
%14 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %13, i32 0, i32 0
store i32 %11, i32* %14
br label %15
15: ; preds = %2, %10
ret void
}

LLVM IR (-O2):
%struct.sockaddr_storage = type { i32 }
define void @set_port(%struct.sockaddr_storage* nocapture %0, i32 %1) {
%3 = tail call i32 @htons(i32 %1)
%4 = getelementptr inbounds %struct.sockaddr_storage, %struct.sockaddr_storage* %0, i64 0, i32 0
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 128
br i1 %6, label %7, label %8
7: ; preds = %2
store i32 %3, i32* %4
br label %8
8: ; preds = %2, %7
ret void
}
int is_lower_case(char c) { return c <= 'z' && 'z' - c < 26; }


x86 assembly (clang, -O0):
<is_lower_case>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x7a,%ecx
mov    %al,-0x2(%rbp)
jg     1130 <is_lower_case+0x30>
movsbl -0x1(%rbp),%ecx
mov    $0x7a,%eax
sub    %ecx,%eax
cmp    $0x1a,%eax
setl   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_lower_case>:
add    $0x9f,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_lower_case(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sle i32 %4, 122
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = sub nsw i32 122, %8
%10 = icmp slt i32 %9, 26
br label %11
11: ; preds = %6, %1
%12 = phi i1 [ false, %1 ], [ %10, %6 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @is_lower_case(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
int ack_recursive(int m, int n) {
  if (m == 0) {
    return n + 1;
  }
  if (n == 0) {
    return ack_recursive(m - 1, 1);
  }
  return ack_recursive(m - 1, ack_recursive(m, n - 1));
}


x86 assembly (clang, -O0):
<ack_recursive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1136 <ack_recursive+0x26>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    117c <ack_recursive+0x6c>
cmpl   $0x0,-0xc(%rbp)
jne    1158 <ack_recursive+0x48>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    $0x1,%esi
call   1030 <ack_recursive@plt>
mov    %eax,-0x4(%rbp)
jmp    117c <ack_recursive+0x6c>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <ack_recursive@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
call   1030 <ack_recursive@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ack_recursive>:
push   %rbx
mov    %esi,%eax
test   %edi,%edi
je     113f <ack_recursive+0x2f>
mov    %edi,%ebx
jmp    112a <ack_recursive+0x1a>
nopl   0x0(%rax,%rax,1)
mov    $0x1,%eax
add    $0xffffffff,%ebx
je     113f <ack_recursive+0x2f>
test   %eax,%eax
je     1120 <ack_recursive+0x10>
add    $0xffffffff,%eax
mov    %ebx,%edi
mov    %eax,%esi
call   1030 <ack_recursive@plt>
add    $0xffffffff,%ebx
jne    112a <ack_recursive+0x1a>
add    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @ack_recursive(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %7
4: ; preds = %11, %2
%5 = phi i32 [ %1, %2 ], [ %12, %11 ]
%6 = add nsw i32 %5, 1
ret i32 %6
7: ; preds = %2, %11
%8 = phi i32 [ %12, %11 ], [ %1, %2 ]
%9 = phi i32 [ %13, %11 ], [ %0, %2 ]
%10 = icmp eq i32 %8, 0
br i1 %10, label %11, label %15
11: ; preds = %7, %15
%12 = phi i32 [ %17, %15 ], [ 1, %7 ]
%13 = add nsw i32 %9, -1
%14 = icmp eq i32 %13, 0
br i1 %14, label %4, label %7
15: ; preds = %7
%16 = add nsw i32 %8, -1
%17 = tail call i32 @ack_recursive(i32 %9, i32 %16)
br label %11
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x11() {
  Assert_real((isxdigit(17) == 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_isxdigit.c",
              90, ("isxdigit should be 0 for 0x11"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0x11>:
push   %rax
mov    $0x11,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x5a,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x11\00"
define void @t_isxdigit_0x11() {
%1 = call i64 @isxdigit(i32 17)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 90, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x11\00"
define void @t_isxdigit_0x11() {
%1 = tail call i64 @isxdigit(i32 17)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 90, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FlightBatterySettingsHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void FlightBatterySettingsUpdated() {
  UAVObjUpdated(FlightBatterySettingsHandle());
}


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

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

LLVM IR (-O0):
define void @FlightBatterySettingsUpdated() {
%1 = call i32 (...) @FlightBatterySettingsHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @FlightBatterySettingsUpdated() {
%1 = tail call i32 (...) @FlightBatterySettingsHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
int do_619() { return 619; }


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

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

LLVM IR (-O0):
define i32 @do_619() {
ret i32 619
}

LLVM IR (-O2):
define i32 @do_619() {
ret i32 619
}
/* Variables and functions */
int /*<<< orphan*/ Decrypt_Done();
void DLLUnRegister() { Decrypt_Done(); }


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

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

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

LLVM IR (-O2):
define void @DLLUnRegister() {
%1 = tail call i32 (...) @Decrypt_Done()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int /*<<< orphan*/ mktemp(char *);
int open(int /*<<< orphan*/, int /*<<< orphan*/);
int mkstemp(char *path) { return open(mktemp(path), O_RDWR); }


x86 assembly (clang, -O0):
<mkstemp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <mktemp@plt>
mov    %eax,%edi
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
call   1030 <open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkstemp>:
push   %rax
call   1040 <mktemp@plt>
mov    0x2ebb(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
pop    %rax
jmp    1030 <open@plt>

LLVM IR (-O0):
@O_RDWR = global i32 0
define i32 @mkstemp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @mktemp(i8* %3)
%5 = load i32, i32* @O_RDWR
%6 = call i32 @open(i32 %4, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
@O_RDWR = global i32 0
define i32 @mkstemp(i8* %0) {
%2 = tail call i32 @mktemp(i8* %0)
%3 = load i32, i32* @O_RDWR
%4 = tail call i32 @open(i32 %2, i32 %3)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ x;

/* Variables and functions */
int /*<<< orphan*/ asbits(unsigned int, int, int);
unsigned int setbits(unsigned int, int, int, unsigned int);
int main() {
  int offset = 27;
  int len = 7;
  unsigned x = 0x12345678;
  unsigned y = 0xffffffff;
  asbits(x, sizeof(x), 1);
  asbits(y, sizeof(x), 1);
  asbits(setbits(x, offset, len, y), sizeof(x), 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1b,-0x8(%rbp)
movl   $0x7,-0xc(%rbp)
movl   $0x12345678,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
mov    -0x10(%rbp),%edi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <asbits@plt>
mov    -0x14(%rbp),%edi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <asbits@plt>
mov    -0x10(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1040 <setbits@plt>
mov    %eax,%edi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <asbits@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x12345678,%edi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <asbits@plt>
mov    $0xffffffff,%edi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <asbits@plt>
mov    $0x12345678,%edi
mov    $0x1b,%esi
mov    $0x7,%edx
mov    $0xffffffff,%ecx
call   1040 <setbits@plt>
mov    %eax,%edi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <asbits@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 27, i32* %2
store i32 7, i32* %3
store i32 305419896, i32* %4
store i32 -1, i32* %5
%6 = load i32, i32* %4
%7 = call i32 @asbits(i32 %6, i32 4, i32 1)
%8 = load i32, i32* %5
%9 = call i32 @asbits(i32 %8, i32 4, i32 1)
%10 = load i32, i32* %4
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = load i32, i32* %5
%14 = call i32 @setbits(i32 %10, i32 %11, i32 %12, i32 %13)
%15 = call i32 @asbits(i32 %14, i32 4, i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @asbits(i32 305419896, i32 4, i32 1)
%2 = tail call i32 @asbits(i32 -1, i32 4, i32 1)
%3 = tail call i32 @setbits(i32 305419896, i32 27, i32 7, i32 -1)
%4 = tail call i32 @asbits(i32 %3, i32 4, i32 1)
ret i32 0
}
void fatal(message) char *message;
{
  print_message_queue();
  error(message, "");
  exit(2);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <print_message_queue@plt>
mov    -0x8(%rbp),%rdi
lea    0xeb2(%rip),%rsi
mov    $0x0,%al
call   1030 <error@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <print_message_queue@plt>
lea    0xebe(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <error@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @print_message_queue()
%4 = load i8*, i8** %2
%5 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @error to i32 (i8*, i8*, ...)*)(i8* %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
unreachable
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @fatal(i8* %0) {
%2 = tail call i32 (...) @print_message_queue()
%3 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @error to i32 (i8*, i8*, ...)*)(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
tail call void @exit(i32 2)
unreachable
}
int bla_rx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid) {
  return 0;
}


x86 assembly (clang, -O0):
<bla_rx>:
push   %rbp
mov    %rsp,%rbp
mov    %dx,%ax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.bat_priv = type opaque
%struct.sk_buff = type opaque
define i32 @bla_rx(%struct.bat_priv* %0, %struct.sk_buff* %1, i16 signext %2) {
%4 = alloca %struct.bat_priv*
%5 = alloca %struct.sk_buff*
%6 = alloca i16
store %struct.bat_priv* %0, %struct.bat_priv** %4
store %struct.sk_buff* %1, %struct.sk_buff** %5
store i16 %2, i16* %6
ret i32 0
}

LLVM IR (-O2):
%struct.bat_priv = type opaque
%struct.sk_buff = type opaque
define i32 @bla_rx(%struct.bat_priv* nocapture readnone %0, %struct.sk_buff* nocapture readnone %1, i16 signext %2) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_create(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                  void *(*)(), int /*<<< orphan*/ *);
void dojob() {
  void *thread_sendjob();
  pthread_t tdsjob;
  pthread_create(&(tdsjob), NULL, thread_sendjob, NULL);
}


x86 assembly (clang, -O0):
<dojob>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%ecx
mov    0x2eb9(%rip),%rdx
mov    %rcx,%rsi
call   1030 <pthread_create@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dojob>:
push   %rax
mov    0x2ec8(%rip),%rdx
lea    0x4(%rsp),%rdi
xor    %esi,%esi
xor    %ecx,%ecx
call   1030 <pthread_create@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @dojob() {
%1 = alloca i32
%2 = call i32 @pthread_create(i32* %1, i32* null, i8* (...)* @thread_sendjob, i32* null)
ret void
}

LLVM IR (-O2):
define void @dojob() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @pthread_create(i32* %1, i32* null, i8* (...)* @thread_sendjob, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ a(int **, int **);
void b() {
  int x[10], y[5];
  a(&x, &y);
  a(&y, &y);
  a(&x, &x);
}


x86 assembly (clang, -O0):
<b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x30(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1030 <a@plt>
lea    -0x50(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1030 <a@plt>
lea    -0x30(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1030 <a@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b>:
push   %r14
push   %rbx
sub    $0x48,%rsp
lea    0x20(%rsp),%r14
mov    %rsp,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <a@plt>
mov    %rbx,%rdi
mov    %rbx,%rsi
call   1030 <a@plt>
mov    %r14,%rdi
mov    %r14,%rsi
call   1030 <a@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @b() {
%1 = alloca [10 x i32]
%2 = alloca [5 x i32]
%3 = bitcast [10 x i32]* %1 to i32**
%4 = bitcast [5 x i32]* %2 to i32**
%5 = call i32 @a(i32** %3, i32** %4)
%6 = bitcast [5 x i32]* %2 to i32**
%7 = bitcast [5 x i32]* %2 to i32**
%8 = call i32 @a(i32** %6, i32** %7)
%9 = bitcast [10 x i32]* %1 to i32**
%10 = bitcast [10 x i32]* %1 to i32**
%11 = call i32 @a(i32** %9, i32** %10)
ret void
}

LLVM IR (-O2):
define void @b() {
%1 = alloca [10 x i32]
%2 = alloca [5 x i32]
%3 = bitcast [10 x i32]* %1 to i8*
%4 = bitcast [5 x i32]* %2 to i8*
%5 = bitcast [10 x i32]* %1 to i32**
%6 = bitcast [5 x i32]* %2 to i32**
%7 = call i32 @a(i32** %5, i32** %6)
%8 = call i32 @a(i32** %6, i32** %6)
%9 = call i32 @a(i32** %5, i32** %5)
ret void
}
void I400ToARGBRow_Any_SSE2() {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @I400ToARGBRow_Any_SSE2() {
ret void
}
/* Variables and functions */
int do_it(char const *, int /*<<< orphan*/,
          int (*)(char const *, struct stat const *, int), int,
          int /*<<< orphan*/);
int ftw(const char *path, int (*fcb)(const char *, const struct stat *, int),
        int descriptors) {
  return do_it(path, 0, fcb, descriptors, 0);
}


x86 assembly (clang, -O0):
<ftw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
xor    %r8d,%r8d
mov    %r8d,%esi
call   1030 <do_it@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftw>:
mov    %edx,%ecx
mov    %rsi,%rdx
xor    %esi,%esi
xor    %r8d,%r8d
jmp    1030 <do_it@plt>

LLVM IR (-O0):
%struct.stat = type opaque
%struct.stat.0 = type opaque
define i32 @ftw(i8* %0, i32 (i8*, %struct.stat*, i32)* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32 (i8*, %struct.stat*, i32)*
%6 = alloca i32
store i8* %0, i8** %4
store i32 (i8*, %struct.stat*, i32)* %1, i32 (i8*, %struct.stat*, i32)** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32 (i8*, %struct.stat*, i32)*, i32 (i8*, %struct.stat*, i32)** %5
%9 = bitcast i32 (i8*, %struct.stat*, i32)* %8 to i32 (i8*, %struct.stat.0*, i32)*
%10 = load i32, i32* %6
%11 = call i32 @do_it(i8* %7, i32 0, i32 (i8*, %struct.stat.0*, i32)* %9, i32 %10, i32 0)
ret i32 %11
}

LLVM IR (-O2):
%struct.stat = type opaque
%struct.stat.0 = type opaque
define i32 @ftw(i8* %0, i32 (i8*, %struct.stat*, i32)* %1, i32 %2) {
%4 = bitcast i32 (i8*, %struct.stat*, i32)* %1 to i32 (i8*, %struct.stat.0*, i32)*
%5 = tail call i32 @do_it(i8* %0, i32 0, i32 (i8*, %struct.stat.0*, i32)* %4, i32 %2, i32 0)
ret i32 %5
}
/* Variables and functions */
scalar_t__ isspace(char);
char *ini__trim_left(char *str) {
  while (isspace(*str))
    ++str;
  return str;
}


x86 assembly (clang, -O0):
<ini__trim_left>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1143 <ini__trim_left+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <ini__trim_left+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ini__trim_left>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1120 <ini__trim_left+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @ini__trim_left(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %8, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = call i64 @isspace(i8 signext %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
br label %3
11: ; preds = %3
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
define i8* @ini__trim_left(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isspace(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
/* Variables and functions */
double DBL_MAX;
double DBL_MIN;
scalar_t__ isinf(double);
int main(void) {
  int result = 0;
  double local_DBL_MAX = DBL_MAX;
  double local_DBL_MIN = DBL_MIN;
  if (isinf(local_DBL_MAX))
    result |= 1;
  if (local_DBL_MIN <= 0.0)
    result |= 1;
  return result;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    0x2eb3(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    0x2e9b(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <isinf@plt>
cmp    $0x0,%rax
je     1163 <main+0x53>
mov    -0x8(%rbp),%eax
or     $0x1,%eax
mov    %eax,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     117a <main+0x6a>
mov    -0x8(%rbp),%eax
or     $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ec8(%rip),%rax
movsd  (%rax),%xmm0
mov    0x2eb5(%rip),%rax
xorpd  %xmm1,%xmm1
ucomisd (%rax),%xmm1
setae  %bl
call   1030 <isinf@plt>
test   %rax,%rax
setne  %al
or     %bl,%al
movzbl %al,%eax
pop    %rbx
ret

LLVM IR (-O0):
@DBL_MAX = global double 0.000000e+00
@DBL_MIN = global double 0.000000e+00
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
store i32 0, i32* %2
%5 = load double, double* @DBL_MAX
store double %5, double* %3
%6 = load double, double* @DBL_MIN
store double %6, double* %4
%7 = load double, double* %3
%8 = call i64 @isinf(double %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %0
%11 = load i32, i32* %2
%12 = or i32 %11, 1
store i32 %12, i32* %2
br label %13
13: ; preds = %10, %0
%14 = load double, double* %4
%15 = fcmp ole double %14, 0.000000e+00
br i1 %15, label %16, label %19
16: ; preds = %13
%17 = load i32, i32* %2
%18 = or i32 %17, 1
store i32 %18, i32* %2
br label %19
19: ; preds = %16, %13
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
@DBL_MAX = global double 0.000000e+00
@DBL_MIN = global double 0.000000e+00
define i32 @main() {
%1 = load double, double* @DBL_MAX
%2 = load double, double* @DBL_MIN
%3 = tail call i64 @isinf(double %1)
%4 = icmp ne i64 %3, 0
%5 = fcmp ole double %2, 0.000000e+00
%6 = select i1 %5, i1 true, i1 %4
%7 = zext i1 %6 to i32
ret i32 %7
}
int is_slip_msg(const unsigned char *buf, int len) {
  int i = len - 1;
  while (i > 0)
    if (buf[i--] == 0300)
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_slip_msg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jle    1150 <is_slip_msg+0x50>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
mov    %ecx,%edx
add    $0xffffffff,%edx
mov    %edx,-0x18(%rbp)
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0xc0,%eax
jne    114b <is_slip_msg+0x4b>
movl   $0x1,-0x4(%rbp)
jmp    1157 <is_slip_msg+0x57>
jmp    1114 <is_slip_msg+0x14>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_slip_msg>:
mov    %esi,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmp    $0x2,%eax
jl     1126 <is_slip_msg+0x26>
cmpb   $0xc0,-0x1(%rdi,%rax,1)
lea    -0x1(%rax),%rax
jne    1110 <is_slip_msg+0x10>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @is_slip_msg(i8* nocapture %0, i32 %1) {
%3 = zext i32 %1 to i64
br label %4
4: ; preds = %9, %2
%5 = phi i64 [ %6, %9 ], [ %3, %2 ]
%6 = add nsw i64 %5, -1
%7 = trunc i64 %5 to i32
%8 = icmp sgt i32 %7, 1
br i1 %8, label %9, label %13
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %0, i64 %6
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, -64
br i1 %12, label %13, label %4
13: ; preds = %4, %9
%14 = phi i32 [ 1, %9 ], [ 0, %4 ]
ret i32 %14
}
__attribute((always_)) void rec(int depth) {
  if (depth < 5)
    rec(depth + 1);
}


x86 assembly (clang, -O0):
<rec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jge    1130 <rec+0x20>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1030 <rec@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @rec(i32 %0) {
ret void
}
int IsEqualShort(void *a, void *b) {
  return *(short int *)a == *(short int *)b;
}


x86 assembly (clang, -O0):
<IsEqualShort>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%eax
mov    -0x10(%rbp),%rcx
movswl (%rcx),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsEqualShort>:
movzwl (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%cx
sete   %al
ret

LLVM IR (-O0):
define i32 @IsEqualShort(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i16*
%7 = load i16, i16* %6
%8 = sext i16 %7 to i32
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i16*
%11 = load i16, i16* %10
%12 = sext i16 %11 to i32
%13 = icmp eq i32 %8, %12
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @IsEqualShort(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i16*
%4 = load i16, i16* %3
%5 = bitcast i8* %1 to i16*
%6 = load i16, i16* %5
%7 = icmp eq i16 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int rmdir(const char *path) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<rmdir>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed9(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec0(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rmdir>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @rmdir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @rmdir(i8* nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
store i32 %2, i32* @errno
ret i32 -1
}
int Operand_bs_decode(unsigned int *valp __attribute__((__unused__))) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @Operand_bs_decode(i32* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int strings_equal(char *str1, char *str2) {
  if (strcmp(str1, str2) == 0) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<strings_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1143 <strings_equal+0x33>
movl   $0x1,-0x4(%rbp)
jmp    114a <strings_equal+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strings_equal>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @strings_equal(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
void _myfree(ptr, lineno) void *ptr;
int lineno;
{ free(ptr); }


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

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

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

LLVM IR (-O2):
define void @_myfree(i8* nocapture %0, i32 %1) {
tail call void @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *prog) {
  fprintf(stderr,
          "Usage: %s\n"
          "\t--vid, -v       USB Vendor ID\n"
          "\t--pid, -p       USB Product ID\n"
          "\t--inum, -i	interface number\n"
          "\t--alt, -a	alternate setting\n"
          "\t--rxep, -r	rx endpoint number\n"
          "\t--txep, -t	tx endpoint number\n"
          "\t--size, -s	Internal buffer size\n"
          "\t--fixed, -f	Use fixed transfer size\n"
          "\t--debug, -d	Enables debugging messages\n"
          "\t--help, -h	This help\n",
          prog);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [326 x i8] c"Usage: %s\0A\09--vid, -v USB Vendor ID\0A\09--pid, -p USB Product ID\0A\09--inum, -i\09interface number\0A\09--alt, -a\09alternate setting\0A\09--rxep, -r\09rx endpoint number\0A\09--txep, -t\09tx endpoint number\0A\09--size, -s\09Internal buffer size\0A\09--fixed, -f\09Use fixed transfer size\0A\09--debug, -d\09Enables debugging messages\0A\09--help, -h\09This help\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([326 x i8], [326 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [326 x i8] c"Usage: %s\0A\09--vid, -v USB Vendor ID\0A\09--pid, -p USB Product ID\0A\09--inum, -i\09interface number\0A\09--alt, -a\09alternate setting\0A\09--rxep, -r\09rx endpoint number\0A\09--txep, -t\09tx endpoint number\0A\09--size, -s\09Internal buffer size\0A\09--fixed, -f\09Use fixed transfer size\0A\09--debug, -d\09Enables debugging messages\0A\09--help, -h\09This help\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([326 x i8], [326 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}