xunge/DecIR huggingface dataset:
int IsSeparator(char chr) {
  return ((chr <= ',' && chr != '$') || (chr >= ':' && chr < '?'));
}


x86 assembly (clang, -O0):
<IsSeparator>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x2c,%eax
jg     1129 <IsSeparator+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x24,%ecx
mov    %al,-0x2(%rbp)
jne    114e <IsSeparator+0x4e>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x3a,%ecx
mov    %al,-0x3(%rbp)
jl     1148 <IsSeparator+0x48>
movsbl -0x1(%rbp),%eax
cmp    $0x3f,%eax
setl   %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsSeparator>:
cmp    $0x2d,%dil
setl   %al
cmp    $0x24,%dil
setne  %cl
and    %al,%cl
add    $0xc6,%dil
cmp    $0x5,%dil
setb   %al
or     %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @IsSeparator(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, 44
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 36
br i1 %9, label %20, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 58
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp slt i32 %16, 63
br label %18
18: ; preds = %14, %10
%19 = phi i1 [ false, %10 ], [ %17, %14 ]
br label %20
20: ; preds = %18, %6
%21 = phi i1 [ true, %6 ], [ %19, %18 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @IsSeparator(i8 signext %0) {
%2 = icmp slt i8 %0, 45
%3 = icmp ne i8 %0, 36
%4 = and i1 %2, %3
%5 = add i8 %0, -58
%6 = icmp ult i8 %5, 5
%7 = or i1 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
void UARTXON2XOFF2ValProgram(unsigned int baseAdd, unsigned char xon2Value,
                             unsigned char xoff2Value) {
  (*((volatile unsigned int *)(baseAdd + (0x14)))) = xon2Value;
  (*((volatile unsigned int *)(baseAdd + (0x1C)))) = xoff2Value;
}


x86 assembly (clang, -O0):
<UARTXON2XOFF2ValProgram>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %edi,-0x4(%rbp)
mov    %cl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
movzbl -0x5(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x14,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
movzbl -0x6(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x1c,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTXON2XOFF2ValProgram>:
lea    0x14(%rdi),%eax
mov    %esi,(%rax)
add    $0x1c,%edi
mov    %edx,(%rdi)
ret

LLVM IR (-O0):
define void @UARTXON2XOFF2ValProgram(i32 %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i32
%5 = alloca i8
%6 = alloca i8
store i32 %0, i32* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load i8, i8* %5
%8 = zext i8 %7 to i32
%9 = load i32, i32* %4
%10 = add i32 %9, 20
%11 = zext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
store volatile i32 %8, i32* %12
%13 = load i8, i8* %6
%14 = zext i8 %13 to i32
%15 = load i32, i32* %4
%16 = add i32 %15, 28
%17 = zext i32 %16 to i64
%18 = inttoptr i64 %17 to i32*
store volatile i32 %14, i32* %18
ret void
}

LLVM IR (-O2):
define void @UARTXON2XOFF2ValProgram(i32 %0, i8 zeroext %1, i8 zeroext %2) {
%4 = zext i8 %1 to i32
%5 = add i32 %0, 20
%6 = zext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
store volatile i32 %4, i32* %7
%8 = zext i8 %2 to i32
%9 = add i32 %0, 28
%10 = zext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
store volatile i32 %8, i32* %11
ret void
}
void foo_1_2_2_1_2_2_1_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_2_1_2_2_1_1_1() {
ret void
}
/* Variables and functions */
size_t ba_size(void *ptr) {
  if (ptr == NULL)
    return 0;
  return (size_t) * ((char *)ptr - sizeof(size_t));
}


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

x86 assembly (clang, -O2):
<ba_size>:
test   %rdi,%rdi
je     110b <ba_size+0xb>
movsbq -0x8(%rdi),%rax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @ba_size(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = getelementptr inbounds i8, i8* %0, i64 -8
%5 = load i8, i8* %4
%6 = sext i8 %5 to i64
br label %7
7: ; preds = %1, %3
%8 = phi i64 [ %6, %3 ], [ 0, %1 ]
ret i64 %8
}
unsigned xrop3_17_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned stk1;
  stk1 = D | S;
  stk1 = ~stk1;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_17_0_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)
mov    -0x8(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_17_0_0>:
mov    %edi,%eax
not    %eax
shl    $0x8,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_17_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = shl i32 %9, 8
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = or i32 %10, %12
store i32 %13, i32* %6
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = or i32 %14, %15
store i32 %16, i32* %7
%17 = load i32, i32* %7
%18 = xor i32 %17, -1
store i32 %18, i32* %7
%19 = load i32, i32* %7
ret i32 %19
}

LLVM IR (-O2):
define i32 @xrop3_17_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = xor i32 %3, -1
%5 = shl nsw i32 %4, 8
ret i32 %5
}
int hisi_adc_get_value(int adc_channel) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @hisi_adc_get_value(i32 %0) {
ret i32 -1
}
/* Variables and functions */
scalar_t__ floor(int);
int parent(int i) { return (int)floor((i - 1) / 2); }


x86 assembly (clang, -O0):
<parent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <floor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parent>:
mov    %edi,%eax
add    $0xffffffff,%eax
shr    $0x1f,%eax
add    %eax,%edi
add    $0xffffffff,%edi
sar    %edi
jmp    1030 <floor@plt>

LLVM IR (-O0):
define i32 @parent(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 1
%5 = sdiv i32 %4, 2
%6 = call i64 @floor(i32 %5)
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @parent(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = sdiv i32 %2, 2
%4 = tail call i64 @floor(i32 %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}
struct block *gen_less(n)
int n;
{
  struct block *b;
  b = gen_len(0x20, n);
  gen_not(b);
  return b;
}


x86 assembly (clang, -O0):
<gen_less>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x20,%edi
mov    $0x0,%al
call   1040 <gen_len@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <gen_not@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_less>:
push   %rbx
mov    %edi,%esi
mov    $0x20,%edi
xor    %eax,%eax
call   1040 <gen_len@plt>
movslq %eax,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <gen_not@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.block = type opaque
define %struct.block* @gen_less(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.block*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 (i32, i32, ...) bitcast (i32 (...)* @gen_len to i32 (i32, i32, ...)*)(i32 32, i32 %4)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to %struct.block*
store %struct.block* %7, %struct.block** %3
%8 = load %struct.block*, %struct.block** %3
%9 = call i32 (%struct.block*, ...) bitcast (i32 (...)* @gen_not to i32 (%struct.block*, ...)*)(%struct.block* %8)
%10 = load %struct.block*, %struct.block** %3
ret %struct.block* %10
}

LLVM IR (-O2):
%struct.block = type opaque
define %struct.block* @gen_less(i32 %0) {
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @gen_len to i32 (i32, i32, ...)*)(i32 32, i32 %0)
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to %struct.block*
%5 = tail call i32 (%struct.block*, ...) bitcast (i32 (...)* @gen_not to i32 (%struct.block*, ...)*)(%struct.block* %4)
ret %struct.block* %4
}
/* Variables and functions */
size_t len(char *string) {
  char *end = string;
  for (; *end; ++end) {
  }
  return (size_t)(end - string);
}


x86 assembly (clang, -O0):
<len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1133 <len+0x33>
jmp    1122 <len+0x22>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <len+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @len(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
ret i64 %10
}
int read_signed_int(unsigned char *data, long *value) {
  *value = (long)data[0] | (long)(data[1] << 8) | (long)(data[2] << 16) |
           (long)(data[3] << 24);
  return 0;
}


x86 assembly (clang, -O0):
<read_signed_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
shl    $0x8,%eax
cltq
or     %rax,%rcx
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%eax
shl    $0x10,%eax
cltq
or     %rax,%rcx
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
shl    $0x18,%eax
cltq
or     %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_signed_int>:
movzwl (%rdi),%eax
movzbl 0x2(%rdi),%ecx
shl    $0x10,%rcx
or     %rax,%rcx
movzbl 0x3(%rdi),%eax
shl    $0x18,%eax
cltq
or     %rcx,%rax
mov    %rax,(%rsi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @read_signed_int(i8* nocapture %0, i64* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = zext i8 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i64
%8 = shl nuw nsw i64 %7, 8
%9 = or i64 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i64
%13 = shl nuw nsw i64 %12, 16
%14 = or i64 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = shl nuw i32 %17, 24
%19 = sext i32 %18 to i64
%20 = or i64 %14, %19
store i64 %20, i64* %1
ret i32 0
}
/* Type definitions */
struct TreeNode {
  int dummy;
};

/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ traverse(struct TreeNode *, int **, int *);
int *inorderTraversal0(struct TreeNode *root, int *returnSize) {
  if (!root)
    return NULL;
  *returnSize = 0;
  int *arr = (int *)malloc(sizeof(int));
  traverse(root, &arr, returnSize);
  return arr;
}


x86 assembly (clang, -O0):
<inorderTraversal0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1148 <inorderTraversal0+0x28>
movq   $0x0,-0x8(%rbp)
jmp    1179 <inorderTraversal0+0x59>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rsi
call   1030 <traverse@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inorderTraversal0>:
test   %rdi,%rdi
je     115d <inorderTraversal0+0x3d>
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movl   $0x0,(%rsi)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,(%rsp)
mov    %rsp,%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1030 <traverse@plt>
mov    (%rsp),%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.TreeNode = type { i32 }
define i32* @inorderTraversal0(%struct.TreeNode* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca %struct.TreeNode*
%5 = alloca i32*
%6 = alloca i32*
store %struct.TreeNode* %0, %struct.TreeNode** %4
store i32* %1, i32** %5
%7 = load %struct.TreeNode*, %struct.TreeNode** %4
%8 = icmp ne %struct.TreeNode* %7, null
br i1 %8, label %10, label %9
9: ; preds = %2
store i32* null, i32** %3
br label %18
10: ; preds = %2
%11 = load i32*, i32** %5
store i32 0, i32* %11
%12 = call i64 @malloc(i32 4)
%13 = inttoptr i64 %12 to i32*
store i32* %13, i32** %6
%14 = load %struct.TreeNode*, %struct.TreeNode** %4
%15 = load i32*, i32** %5
%16 = call i32 @traverse(%struct.TreeNode* %14, i32** %6, i32* %15)
%17 = load i32*, i32** %6
store i32* %17, i32** %3
br label %18
18: ; preds = %10, %9
%19 = load i32*, i32** %3
ret i32* %19
}

LLVM IR (-O2):
%struct.TreeNode = type { i32 }
define i32* @inorderTraversal0(%struct.TreeNode* %0, i32* %1) {
%3 = alloca i32*
%4 = icmp eq %struct.TreeNode* %0, null
br i1 %4, label %11, label %5
5: ; preds = %2
store i32 0, i32* %1
%6 = bitcast i32** %3 to i8*
%7 = tail call i64 @malloc(i32 4)
%8 = inttoptr i64 %7 to i32*
store i32* %8, i32** %3
%9 = call i32 @traverse(%struct.TreeNode* %0, i32** %3, i32* %1)
%10 = load i32*, i32** %3
br label %11
11: ; preds = %2, %5
%12 = phi i32* [ %10, %5 ], [ null, %2 ]
ret i32* %12
}
float round_float_int(float a) { return (float)(int)a; }


x86 assembly (clang, -O0):
<round_float_int>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
cvttss2si -0x4(%rbp),%eax
cvtsi2ss %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_float_int>:
cvttps2dq %xmm0,%xmm0
cvtdq2ps %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @round_float_int(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fptosi float %3 to i32
%5 = sitofp i32 %4 to float
ret float %5
}

LLVM IR (-O2):
define float @round_float_int(float %0) {
%2 = fptosi float %0 to i32
%3 = sitofp i32 %2 to float
ret float %3
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, int);
char *integer_to_string(int x) {
  char *buffer = malloc(sizeof(char) * sizeof(int) * 4 + 1);
  if (buffer) {
    sprintf(buffer, "%d", x);
  }
  return buffer;
}


x86 assembly (clang, -O0):
<integer_to_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x11,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1157 <integer_to_string+0x37>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xeae(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<integer_to_string>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x11,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1148 <integer_to_string+0x28>
lea    0xec2(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define noalias i8* @integer_to_string(i32 %0) {
%2 = tail call dereferenceable_or_null(17) i8* @malloc(i32 17)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ OpenSSL_add_ssl_algorithms();
int /*<<< orphan*/ SSL_load_error_strings();
void init_openssl() {
  SSL_load_error_strings();
  OpenSSL_add_ssl_algorithms();
}


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

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

LLVM IR (-O0):
define void @init_openssl() {
%1 = call i32 (...) @SSL_load_error_strings()
%2 = call i32 (...) @OpenSSL_add_ssl_algorithms()
ret void
}

LLVM IR (-O2):
define void @init_openssl() {
%1 = tail call i32 (...) @SSL_load_error_strings()
%2 = tail call i32 (...) @OpenSSL_add_ssl_algorithms()
ret void
}
/* Variables and functions */
int i_dim(int *, int *);
int intr_wrap_169(int p1, int p2) { return i_dim(&p1, &p2); }


x86 assembly (clang, -O0):
<intr_wrap_169>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <i_dim@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_wrap_169>:
push   %rax
mov    %edi,0x4(%rsp)
mov    %esi,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <i_dim@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @intr_wrap_169(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @i_dim(i32* %3, i32* %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @intr_wrap_169(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @i_dim(i32* %3, i32* %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0xab() {
  Assert_real((isodigit(171) == 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_isodigit.c",
              860, ("isodigit should be 0 for 0xab"));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0xab>:
push   %rax
mov    $0xab,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x35c,%edx
pop    %rax
jmp    1030 <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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xab\00"
define void @t_isodigit_0xab() {
%1 = call i64 @isodigit(i32 171)
%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 860, 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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xab\00"
define void @t_isodigit_0xab() {
%1 = tail call i64 @isodigit(i32 171)
%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 860, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ little_endian();
void *swap_bytes(void *, size_t);
void *be2ne(void *s, size_t len) {
  return little_endian() ? swap_bytes(s, len) : s;
}


x86 assembly (clang, -O0):
<be2ne>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <little_endian@plt>
cmp    $0x0,%rax
je     1157 <be2ne+0x37>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <swap_bytes@plt>
mov    %rax,-0x18(%rbp)
jmp    115f <be2ne+0x3f>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<be2ne>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <little_endian@plt>
test   %rax,%rax
je     1148 <be2ne+0x28>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <swap_bytes@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @be2ne(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = call i64 (...) @little_endian()
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = load i64, i64* %4
%10 = call i8* @swap_bytes(i8* %8, i64 %9)
br label %13
11: ; preds = %2
%12 = load i8*, i8** %3
br label %13
13: ; preds = %11, %7
%14 = phi i8* [ %10, %7 ], [ %12, %11 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @be2ne(i8* %0, i64 %1) {
%3 = tail call i64 (...) @little_endian()
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i8* @swap_bytes(i8* %0, i64 %1)
br label %7
7: ; preds = %2, %5
%8 = phi i8* [ %6, %5 ], [ %0, %2 ]
ret i8* %8
}
int euclid_gcd(int a, int b) {
  int c = a % b;
  if (c != 0) {
    return euclid_gcd(b, c);
  } else {
    return b;
  }
}


x86 assembly (clang, -O0):
<euclid_gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1145 <euclid_gcd+0x35>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <euclid_gcd@plt>
mov    %eax,-0x4(%rbp)
jmp    114b <euclid_gcd+0x3b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<euclid_gcd>:
mov    %esi,%edx
mov    %edi,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <euclid_gcd+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @euclid_gcd(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* %4
%8 = load i32, i32* %5
%9 = srem i32 %7, %8
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %2
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = call i32 @euclid_gcd(i32 %13, i32 %14)
store i32 %15, i32* %3
br label %18
16: ; preds = %2
%17 = load i32, i32* %5
store i32 %17, i32* %3
br label %18
18: ; preds = %16, %12
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @euclid_gcd(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %0, %2 ], [ %5, %3 ]
%5 = phi i32 [ %1, %2 ], [ %6, %3 ]
%6 = srem i32 %4, %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ unix_error(char *);
int /*<<< orphan*/ waitpid(int /*<<< orphan*/, int *, int);
pid_t Waitpid(pid_t pid, int *iptr, int options) {
  pid_t retpid;
  if ((retpid = waitpid(pid, iptr, options)) < 0)
    unix_error("Waitpid error");
  return (retpid);
}


x86 assembly (clang, -O0):
<Waitpid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <waitpid@plt>
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
jge    1159 <Waitpid+0x39>
lea    0xeac(%rip),%rdi
call   1030 <unix_error@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Waitpid>:
push   %rbx
call   1040 <waitpid@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1138 <Waitpid+0x18>
lea    0xecd(%rip),%rdi
call   1030 <unix_error@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"Waitpid error\00"
define i32 @Waitpid(i32 %0, i32* %1, i32 %2) {
%4 = tail call i32 @waitpid(i32 %0, i32* %1, i32 %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @unix_error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ isBlank(char);
char *skipWord(char *p) {
  while (!isBlank(*p))
    ++p;
  return p;
}


x86 assembly (clang, -O0):
<skipWord>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isBlank@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    113d <skipWord+0x2d>
jmp    114e <skipWord+0x3e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skipWord+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i8* @skipWord(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i32 @isBlank(i8 signext %4)
%6 = icmp eq i32 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %2, label %8
8: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ swapbuffers();
void swapbu_() { swapbuffers(); }


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

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

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

LLVM IR (-O2):
define void @swapbu_() {
%1 = tail call i32 (...) @swapbuffers()
ret void
}
/* Variables and functions */
int strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
void strncpy_no_overflow(char *y) {
  char x[4];
  if (strlen(y) == 3)
    strncpy(x, y, 5);
}


x86 assembly (clang, -O0):
<strncpy_no_overflow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x3,%eax
jne    1150 <strncpy_no_overflow+0x30>
lea    -0xc(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x5,%edx
call   1030 <strncpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncpy_no_overflow>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1040 <strlen@plt>
cmp    $0x3,%eax
jne    1144 <strncpy_no_overflow+0x24>
lea    0xc(%rsp),%rdi
mov    %rbx,%rsi
mov    $0x5,%edx
call   1030 <strncpy@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @strncpy_no_overflow(i8* %0) {
%2 = alloca i8*
%3 = alloca [4 x i8]
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = icmp eq i32 %5, 3
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%9 = load i8*, i8** %2
%10 = call i32 @strncpy(i8* %8, i8* %9, i32 5)
br label %11
11: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
define void @strncpy_no_overflow(i8* %0) {
%2 = alloca [4 x i8]
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @strlen(i8* %0)
%5 = icmp eq i32 %4, 3
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @strncpy(i8* %3, i8* %0, i32 5)
br label %8
8: ; preds = %6, %1
ret void
}
/* Variables and functions */
int g(int);
int *h(int);
int f(int x) {
  int *ptr;
  ptr = h(3);
  return g(*ptr + 1);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x3,%edi
call   1030 <h@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
add    $0x1,%edi
call   1040 <g@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
mov    $0x3,%edi
call   1030 <h@plt>
mov    (%rax),%edi
add    $0x1,%edi
pop    %rax
jmp    1040 <g@plt>

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = call i32* @h(i32 3)
store i32* %4, i32** %3
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = add nsw i32 %6, 1
%8 = call i32 @g(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = tail call i32* @h(i32 3)
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
%5 = tail call i32 @g(i32 %4)
ret i32 %5
}
int ch_perf_write_header_ssv() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ch_perf_write_header_ssv() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ quick_sort_test();
int main() {
  quick_sort_test();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <quick_sort_test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @quick_sort_test()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @quick_sort_test()
ret i32 0
}
int test_imm_4Aint8_mem(signed char *val) {
  return ((*val) & (0x4A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_4Aint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0x4a,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_4Aint8_mem>:
testb  $0x4a,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_4Aint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, 74
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_4Aint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 74
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t sdbm_hash(const char *str) {
  uint32_t hash = 0x0;
  int ch;
  while ((ch = *str++) != '\0') {
    hash = ch + (hash << 6) + (hash << 16) - hash;
  }
  return hash;
}


x86 assembly (clang, -O0):
<sdbm_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
je     114b <sdbm_hash+0x4b>
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x6,%ecx
add    %ecx,%eax
mov    -0xc(%rbp),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <sdbm_hash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdbm_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1127 <sdbm_hash+0x27>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
imul   $0x1003f,%eax,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <sdbm_hash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @sdbm_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = sext i8 %5 to i32
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = mul i32 %7, 65599
%11 = add i32 %10, %8
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %15
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ wt(int, int /*<<< orphan*/);
int clear_entry_counter(uint8_t tableid, int row) {
  wt(0x48000060 | (tableid << 0x14) | (row << 0x08), 0);
  wt(0x48000064 | (tableid << 0x14) | (row << 0x08), 0);
  printf("reset the pkt count and byte count of the flow entry! table_id:%d "
         "prio:%d\n",
         tableid, row);
  return 0;
}


x86 assembly (clang, -O0):
<clear_entry_counter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
shl    $0x14,%edi
or     $0x48000060,%edi
mov    -0x8(%rbp),%eax
shl    $0x8,%eax
or     %eax,%edi
xor    %esi,%esi
call   1040 <wt@plt>
mov    -0x4(%rbp),%edi
shl    $0x14,%edi
or     $0x48000064,%edi
mov    -0x8(%rbp),%eax
shl    $0x8,%eax
or     %eax,%edi
xor    %esi,%esi
call   1040 <wt@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_entry_counter>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebp
mov    %edi,%eax
shl    $0x14,%eax
mov    %esi,%ebx
shl    $0x8,%ebx
or     %eax,%ebx
mov    %ebx,%edi
or     $0x48000060,%edi
xor    %esi,%esi
call   1040 <wt@plt>
or     $0x48000064,%ebx
mov    %ebx,%edi
xor    %esi,%esi
call   1040 <wt@plt>
lea    0xea6(%rip),%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [75 x i8] c"reset the pkt count and byte count of the flow entry! table_id:%d prio:%d\0A\00"
define i32 @clear_entry_counter(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 = shl i32 %5, 20
%7 = or i32 1207959648, %6
%8 = load i32, i32* %4
%9 = shl i32 %8, 8
%10 = or i32 %7, %9
%11 = call i32 @wt(i32 %10, i32 0)
%12 = load i32, i32* %3
%13 = shl i32 %12, 20
%14 = or i32 1207959652, %13
%15 = load i32, i32* %4
%16 = shl i32 %15, 8
%17 = or i32 %14, %16
%18 = call i32 @wt(i32 %17, i32 0)
%19 = load i32, i32* %3
%20 = load i32, i32* %4
%21 = call i32 @printf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0), i32 %19, i32 %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [75 x i8] c"reset the pkt count and byte count of the flow entry! table_id:%d prio:%d\0A\00"
define i32 @clear_entry_counter(i32 %0, i32 %1) {
%3 = shl i32 %0, 20
%4 = shl i32 %1, 8
%5 = or i32 %4, %3
%6 = or i32 %5, 1207959648
%7 = tail call i32 @wt(i32 %6, i32 0)
%8 = or i32 %5, 1207959652
%9 = tail call i32 @wt(i32 %8, i32 0)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ dset_point_gauss_legendre_(int *, int *, double *, double *);
void dset_point_gauss_legendre(int *nbe, int *e, double *xe, double *we) {
  dset_point_gauss_legendre_(nbe, e, xe, we);
}


x86 assembly (clang, -O0):
<dset_point_gauss_legendre>:
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),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <dset_point_gauss_legendre_@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dset_point_gauss_legendre>:
jmp    1030 <dset_point_gauss_legendre_@plt>

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

LLVM IR (-O2):
define void @dset_point_gauss_legendre(i32* %0, i32* %1, double* %2, double* %3) {
%5 = tail call i32 @dset_point_gauss_legendre_(i32* %0, i32* %1, double* %2, double* %3)
ret void
}
char HttpStatus_isRedirection(int code) { return (code >= 300 && code < 400); }


x86 assembly (clang, -O0):
<HttpStatus_isRedirection>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x12c,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <HttpStatus_isRedirection+0x26>
cmpl   $0x190,-0x4(%rbp)
setl   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<HttpStatus_isRedirection>:
add    $0xfffffed4,%edi
cmp    $0x64,%edi
setb   %al
ret

LLVM IR (-O0):
define signext i8 @HttpStatus_isRedirection(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 300
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 400
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
%11 = trunc i32 %10 to i8
ret i8 %11
}

LLVM IR (-O2):
define signext i8 @HttpStatus_isRedirection(i32 %0) {
%2 = add i32 %0, -300
%3 = icmp ult i32 %2, 100
%4 = zext i1 %3 to i8
ret i8 %4
}
/* Variables and functions */
int mfspr(int);
int /*<<< orphan*/ mtspr(int, int);
void tick_init(int period, int hp_int) {
  mtspr(((0 << (11)) + 17), mfspr(((0 << (11)) + 17)) & ~0x00000002);
  mtspr(((10 << (11)) + 0), 0x20000000 | 0x40000000 | (period & 0x0fffffff));
  mtspr(((10 << (11)) + 1), 0);
}


x86 assembly (clang, -O0):
<tick_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x11,%edi
call   1030 <mfspr@plt>
mov    %eax,%esi
and    $0xfffffffd,%esi
mov    $0x11,%edi
call   1040 <mtspr@plt>
mov    -0x4(%rbp),%esi
and    $0xfffffff,%esi
or     $0x60000000,%esi
mov    $0x5000,%edi
call   1040 <mtspr@plt>
mov    $0x5001,%edi
xor    %esi,%esi
call   1040 <mtspr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tick_init>:
push   %rbx
mov    %edi,%ebx
mov    $0x11,%edi
call   1030 <mfspr@plt>
and    $0xfffffffd,%eax
mov    $0x11,%edi
mov    %eax,%esi
call   1040 <mtspr@plt>
and    $0xfffffff,%ebx
or     $0x60000000,%ebx
mov    $0x5000,%edi
mov    %ebx,%esi
call   1040 <mtspr@plt>
mov    $0x5001,%edi
xor    %esi,%esi
pop    %rbx
jmp    1040 <mtspr@plt>

LLVM IR (-O0):
define void @tick_init(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @mfspr(i32 17)
%6 = and i32 %5, -3
%7 = call i32 @mtspr(i32 17, i32 %6)
%8 = load i32, i32* %3
%9 = and i32 %8, 268435455
%10 = or i32 1610612736, %9
%11 = call i32 @mtspr(i32 20480, i32 %10)
%12 = call i32 @mtspr(i32 20481, i32 0)
ret void
}

LLVM IR (-O2):
define void @tick_init(i32 %0, i32 %1) {
%3 = tail call i32 @mfspr(i32 17)
%4 = and i32 %3, -3
%5 = tail call i32 @mtspr(i32 17, i32 %4)
%6 = and i32 %0, 268435455
%7 = or i32 %6, 1610612736
%8 = tail call i32 @mtspr(i32 20480, i32 %7)
%9 = tail call i32 @mtspr(i32 20481, i32 0)
ret void
}
int notmain(void) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @notmain() {
ret i32 0
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
double getdtod(void) {
  struct timeval tv;
  gettimeofday(&tv, 0);
  return (double)tv.tv_sec + ((double)tv.tv_usec / 1000000.0);
}


x86 assembly (clang, -O0):
<getdtod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xec9(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getdtod>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
divsd  0xeca(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @getdtod() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = sitofp i64 %4 to double
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = fdiv double %8, 1.000000e+06
%10 = fadd double %5, %9
ret double %10
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @getdtod() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = fdiv double %9, 1.000000e+06
%11 = fadd double %10, %6
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ swim_ndelay(int);
void swim_udelay(unsigned int us) {
  while (us--) {
    swim_ndelay(1000);
  }
}


x86 assembly (clang, -O0):
<swim_udelay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     113e <swim_udelay+0x2e>
mov    $0x3e8,%edi
call   1030 <swim_ndelay@plt>
jmp    111b <swim_udelay+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swim_udelay>:
push   %rbx
test   %edi,%edi
je     112f <swim_udelay+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x3e8,%edi
call   1030 <swim_ndelay@plt>
add    $0xffffffff,%ebx
jne    1120 <swim_udelay+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @swim_udelay(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add i32 %4, -1
%6 = tail call i32 @swim_ndelay(i32 1000)
%7 = icmp eq i32 %5, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}