xunge/DecIR huggingface dataset:
unsigned char containsLetter(char const *const word, char const letter,
                             unsigned int length) {
  for (unsigned int i = 0; i < length; ++i) {
    if (word[i] == letter)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<containsLetter>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jae    1157 <containsLetter+0x57>
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    1144 <containsLetter+0x44>
movb   $0x1,-0x1(%rbp)
jmp    115b <containsLetter+0x5b>
jmp    1149 <containsLetter+0x49>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1118 <containsLetter+0x18>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<containsLetter>:
test   %edx,%edx
je     1139 <containsLetter+0x39>
mov    $0x1,%al
cmp    %sil,(%rdi)
je     1138 <containsLetter+0x38>
mov    %edx,%eax
mov    $0x1,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rdx,%rcx
cmp    %rdx,%rax
je     1132 <containsLetter+0x32>
lea    0x1(%rcx),%rdx
cmp    %sil,(%rdi,%rcx,1)
jne    1120 <containsLetter+0x20>
cmp    %rax,%rcx
setb   %al
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define zeroext i8 @containsLetter(i8* nocapture %0, i8 signext %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %20, label %5
5: ; preds = %3
%6 = zext i32 %2 to i64
%7 = load i8, i8* %0
%8 = icmp eq i8 %7, %1
br i1 %8, label %20, label %9
9: ; preds = %5, %12
%10 = phi i64 [ %16, %12 ], [ 1, %5 ]
%11 = icmp eq i64 %10, %6
br i1 %11, label %17, label %12
12: ; preds = %9
%13 = getelementptr inbounds i8, i8* %0, i64 %10
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, %1
%16 = add nuw nsw i64 %10, 1
br i1 %15, label %17, label %9
17: ; preds = %9, %12
%18 = icmp ult i64 %10, %6
%19 = zext i1 %18 to i8
br label %20
20: ; preds = %17, %5, %3
%21 = phi i8 [ 0, %3 ], [ 1, %5 ], [ %19, %17 ]
ret i8 %21
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M22_f(char *s) {
  debug("M22_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M22_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M22_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf05(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"M22_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M22_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [46 x i8] c"M22_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M22_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
void put_string(s) char *s;
{
  if (s == 0)
    s = " <NULL> ";
  while (*s) {
    put(*s++);
  }
}


x86 assembly (clang, -O0):
<put_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1132 <put_string+0x22>
lea    0xed2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1137 <put_string+0x27>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1162 <put_string+0x52>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
mov    $0x0,%al
call   1030 <put@plt>
jmp    1137 <put_string+0x27>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_string>:
push   %rbx
test   %rdi,%rdi
lea    0xee5(%rip),%rbx
cmovne %rdi,%rbx
mov    (%rbx),%al
test   %al,%al
je     1145 <put_string+0x35>
add    $0x1,%rbx
nopl   0x0(%rax)
movsbl %al,%edi
xor    %eax,%eax
call   1030 <put@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <put_string+0x20>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c" <NULL> \00"
define void @put_string(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %2
br label %6
6: ; preds = %5, %1
br label %7
7: ; preds = %11, %6
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %7
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %2
%14 = load i8, i8* %12
%15 = sext i8 %14 to i32
%16 = call i32 (i32, ...) bitcast (i32 (...)* @put to i32 (i32, ...)*)(i32 %15)
br label %7
17: ; preds = %7
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c" <NULL> \00"
define void @put_string(i8* %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %1, %6
%7 = phi i8 [ %12, %6 ], [ %4, %1 ]
%8 = phi i8* [ %9, %6 ], [ %3, %1 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = sext i8 %7 to i32
%11 = tail call i32 (i32, ...) bitcast (i32 (...)* @put to i32 (i32, ...)*)(i32 %10)
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %6
14: ; preds = %6, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ p3dfft_ftran_r2c(double *, double *, unsigned char *);
void Cp3dfft_ftran_r2c(double *A, double *B, unsigned char *op) {
  p3dfft_ftran_r2c(A, B, op);
}


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

x86 assembly (clang, -O2):
<Cp3dfft_ftran_r2c>:
jmp    1030 <p3dfft_ftran_r2c@plt>

LLVM IR (-O0):
define void @Cp3dfft_ftran_r2c(double* %0, double* %1, i8* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca i8*
store double* %0, double** %4
store double* %1, double** %5
store i8* %2, i8** %6
%7 = load double*, double** %4
%8 = load double*, double** %5
%9 = load i8*, i8** %6
%10 = call i32 @p3dfft_ftran_r2c(double* %7, double* %8, i8* %9)
ret void
}

LLVM IR (-O2):
define void @Cp3dfft_ftran_r2c(double* %0, double* %1, i8* %2) {
%4 = tail call i32 @p3dfft_ftran_r2c(double* %0, double* %1, i8* %2)
ret void
}
unsigned int tiimage_swap32(unsigned int data) {
  unsigned int result = 0;
  result = (data & 0xFF000000) >> 24;
  result |= (data & 0x00FF0000) >> 8;
  result |= (data & 0x0000FF00) << 8;
  result |= (data & 0x000000FF) << 24;
  return result;
}


x86 assembly (clang, -O0):
<tiimage_swap32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff000000,%eax
shr    $0x18,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff0000,%eax
shr    $0x8,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00,%eax
shl    $0x8,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x18,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tiimage_swap32>:
mov    %edi,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @tiimage_swap32(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = and i32 %4, -16777216
%6 = lshr i32 %5, 24
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = and i32 %7, 16711680
%9 = lshr i32 %8, 8
%10 = load i32, i32* %3
%11 = or i32 %10, %9
store i32 %11, i32* %3
%12 = load i32, i32* %2
%13 = and i32 %12, 65280
%14 = shl i32 %13, 8
%15 = load i32, i32* %3
%16 = or i32 %15, %14
store i32 %16, i32* %3
%17 = load i32, i32* %2
%18 = and i32 %17, 255
%19 = shl i32 %18, 24
%20 = load i32, i32* %3
%21 = or i32 %20, %19
store i32 %21, i32* %3
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @tiimage_swap32(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printc(char const);
void print(const char *c) {
  int i = 0;
  while (c[i]) {
    printc(c[i++]);
  }
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1155 <print+0x45>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <printc@plt>
jmp    1123 <print+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <print+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <printc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <print+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @print(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8 [ %10, %4 ], [ %2, %1 ]
%7 = add nuw i64 %5, 1
%8 = tail call i32 @printc(i8 signext %6)
%9 = getelementptr inbounds i8, i8* %0, i64 %7
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SCL_Read();
int /*<<< orphan*/ SCL_Up();
void I2CSCLHigh(void) {
  register char timeout = 100;
  SCL_Up();
  while (!SCL_Read()) {
    timeout--;
    if (!timeout) {
      return;
    }
  }
}


x86 assembly (clang, -O0):
<I2CSCLHigh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x64,-0x1(%rbp)
mov    $0x0,%al
call   1040 <SCL_Up@plt>
mov    $0x0,%al
call   1030 <SCL_Read@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    114f <I2CSCLHigh+0x2f>
jmp    116b <I2CSCLHigh+0x4b>
mov    -0x1(%rbp),%al
add    $0xff,%al
mov    %al,-0x1(%rbp)
cmpb   $0x0,-0x1(%rbp)
jne    1166 <I2CSCLHigh+0x46>
jmp    116b <I2CSCLHigh+0x4b>
jmp    1133 <I2CSCLHigh+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CSCLHigh>:
push   %rbx
xor    %eax,%eax
call   1040 <SCL_Up@plt>
mov    $0x9d,%bl
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <SCL_Read@plt>
test   %eax,%eax
jne    1144 <I2CSCLHigh+0x24>
lea    0x1(%rbx),%eax
test   %bl,%bl
mov    %eax,%ebx
jne    1130 <I2CSCLHigh+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @I2CSCLHigh() {
%1 = alloca i8
store i8 100, i8* %1
%2 = call i32 (...) @SCL_Up()
br label %3
3: ; preds = %13, %0
%4 = call i32 (...) @SCL_Read()
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
br i1 %6, label %7, label %14
7: ; preds = %3
%8 = load i8, i8* %1
%9 = add i8 %8, -1
store i8 %9, i8* %1
%10 = load i8, i8* %1
%11 = icmp ne i8 %10, 0
br i1 %11, label %13, label %12
12: ; preds = %7
br label %14
13: ; preds = %7
br label %3
14: ; preds = %12, %3
ret void
}

LLVM IR (-O2):
define void @I2CSCLHigh() {
%1 = tail call i32 (...) @SCL_Up()
br label %2
2: ; preds = %2, %0
%3 = phi i8 [ 100, %0 ], [ %6, %2 ]
%4 = tail call i32 (...) @SCL_Read()
%5 = icmp ne i32 %4, 0
%6 = add nsw i8 %3, -1
%7 = icmp eq i8 %6, 0
%8 = select i1 %5, i1 true, i1 %7
br i1 %8, label %9, label %2
9: ; preds = %2
ret void
}
int is_absolute_file_path(const char *filePath) {
  return filePath && *filePath == '/';
}


x86 assembly (clang, -O0):
<is_absolute_file_path>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1128 <is_absolute_file_path+0x28>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_absolute_file_path>:
xor    %eax,%eax
test   %rdi,%rdi
je     110d <is_absolute_file_path+0xd>
cmpb   $0x2f,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @is_absolute_file_path(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 47
br label %10
10: ; preds = %5, %1
%11 = phi i1 [ false, %1 ], [ %9, %5 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_absolute_file_path(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 47
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
int extract_ev6hwjhint(insn, invalid)
unsigned insn;
int *invalid __attribute__((unused));
{ return 4 * (((insn & 0x1FFF) ^ 0x1000) - 0x1000); }


x86 assembly (clang, -O0):
<extract_ev6hwjhint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1fff,%eax
xor    $0x1000,%eax
sub    $0x1000,%eax
shl    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_ev6hwjhint>:
mov    %edi,%eax
shl    $0x13,%eax
sar    $0x11,%eax
ret

LLVM IR (-O0):
define i32 @extract_ev6hwjhint(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 = and i32 %5, 8191
%7 = xor i32 %6, 4096
%8 = sub i32 %7, 4096
%9 = mul i32 4, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @extract_ev6hwjhint(i32 %0, i32* nocapture readnone %1) {
%3 = shl i32 %0, 19
%4 = ashr exact i32 %3, 17
ret i32 %4
}
void fib1() {}


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

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

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

LLVM IR (-O2):
define void @fib1() {
ret void
}
void perf_rest(void) {}


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

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

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

LLVM IR (-O2):
define void @perf_rest() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
void abort(const char *msg) {
  perror(msg);
  exit(1);
}


x86 assembly (clang, -O0):
<abort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<abort>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @abort(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @abort(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
void cleanUp() {}


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

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

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

LLVM IR (-O2):
define void @cleanUp() {
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
int isin_S4(int);
int32_t Sine(uint32_t phase) {
  int32_t P = phase >> 17;
  return isin_S4(P) << 17;
}


x86 assembly (clang, -O0):
<Sine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x11,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <isin_S4@plt>
shl    $0x11,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sine>:
push   %rax
sar    $0x11,%edi
call   1030 <isin_S4@plt>
shl    $0x11,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @Sine(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 17
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @isin_S4(i32 %6)
%8 = shl i32 %7, 17
ret i32 %8
}

LLVM IR (-O2):
define i32 @Sine(i32 %0) {
%2 = ashr i32 %0, 17
%3 = tail call i32 @isin_S4(i32 %2)
%4 = shl i32 %3, 17
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0xee() {
  Assert_real((isxdigit(238) == 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",
              1195, ("isxdigit should be 0 for 0xee"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0xee>:
push   %rax
mov    $0xee,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x4ab,%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 0xee\00"
define void @t_isxdigit_0xee() {
%1 = call i64 @isxdigit(i32 238)
%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 1195, 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 0xee\00"
define void @t_isxdigit_0xee() {
%1 = tail call i64 @isxdigit(i32 238)
%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 1195, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void parse_udp(uint8_t *packet, int len) { printf("udp\n"); }


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

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

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

LLVM IR (-O2):
@str = [4 x i8] c"udp\00"
define void @parse_udp(i32* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PIN_INT1_DriverIRQHandler();
__attribute__((weak)) void PIN_INT1_IRQHandler(void) {
  PIN_INT1_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @PIN_INT1_IRQHandler() {
%1 = call i32 (...) @PIN_INT1_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @PIN_INT1_IRQHandler() {
%1 = tail call i32 (...) @PIN_INT1_DriverIRQHandler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ system(char *);
void *threadCommand(void *command) {
  char strCom[255];
  strcpy(strCom, (char *)command);
  system(strCom);
  return NULL;
}


x86 assembly (clang, -O0):
<threadCommand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x110(%rbp),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<threadCommand>:
push   %rbx
sub    $0x100,%rsp
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @threadCommand(i8* %0) {
%2 = alloca i8*
%3 = alloca [255 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @strcpy(i8* %4, i8* %5)
%7 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%8 = call i32 @system(i8* %7)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @threadCommand(i8* %0) {
%2 = alloca [255 x i8]
%3 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* %0)
%5 = call i32 @system(i8* %3)
ret i8* null
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ window;
};
typedef TYPE_1__ XAnyEvent;

/* Variables and functions */
unsigned long get_XAnyEvent_window(void *_p) {
  return (unsigned long)((XAnyEvent *)_p)->window;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XAnyEvent_window(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XAnyEvent_window(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
void allocate_and_memset(int size) {
  char mem[size];
  memset(mem, 0, size);
}


x86 assembly (clang, -O0):
<allocate_and_memset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,%rsp
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocate_and_memset>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,%edx
mov    %edi,%eax
mov    %rsp,%rdi
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rdi
mov    %rdi,%rsp
xor    %esi,%esi
call   1030 <memset@plt>
mov    %rbp,%rsp
pop    %rbp
ret

LLVM IR (-O0):
define void @allocate_and_memset(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %3
%8 = alloca i8, i64 %6
store i64 %6, i64* %4
%9 = load i32, i32* %2
%10 = call i32 @memset(i8* %8, i32 0, i32 %9)
%11 = load i8*, i8** %3
ret void
}

LLVM IR (-O2):
define void @allocate_and_memset(i32 %0) {
%2 = zext i32 %0 to i64
%3 = alloca i8, i64 %2
%4 = call i32 @memset(i8* %3, i32 0, i32 %0)
ret void
}
/* Variables and functions */
float sqrtf(float);
float dist(float x1, float y1, float x2, float y2) {
  return sqrtf((float)((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)));
}


x86 assembly (clang, -O0):
<dist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
subss  -0xc(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
subss  -0x10(%rbp),%xmm1
movss  -0x8(%rbp),%xmm3
subss  -0x10(%rbp),%xmm3
mulss  %xmm3,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrtf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dist>:
subss  %xmm2,%xmm0
subss  %xmm3,%xmm1
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1131 <dist+0x21>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrtf@plt>

LLVM IR (-O0):
define float @dist(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %5
%10 = load float, float* %7
%11 = fsub float %9, %10
%12 = load float, float* %5
%13 = load float, float* %7
%14 = fsub float %12, %13
%15 = load float, float* %6
%16 = load float, float* %8
%17 = fsub float %15, %16
%18 = load float, float* %6
%19 = load float, float* %8
%20 = fsub float %18, %19
%21 = fmul float %17, %20
%22 = call float @llvm.fmuladd.f32(float %11, float %14, float %21)
%23 = call float @sqrtf(float %22)
ret float %23
}

LLVM IR (-O2):
define float @dist(float %0, float %1, float %2, float %3) {
%5 = fsub float %0, %2
%6 = fsub float %1, %3
%7 = fmul float %6, %6
%8 = tail call float @llvm.fmuladd.f32(float %5, float %5, float %7)
%9 = tail call float @sqrtf(float %8)
ret float %9
}
void nseel_asm_invsqrt_end(void) {}


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

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

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

LLVM IR (-O2):
define void @nseel_asm_invsqrt_end() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
scalar_t__ test_point_double(unsigned int);
void check_double_point(unsigned int number_of_tests) {
  printf("Point double:\n");
  if (test_point_double(number_of_tests)) {
    printf("Success\n");
  } else {
    printf("Failed\n");
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<check_double_point>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <test_point_double@plt>
cmp    $0x0,%rax
je     115a <check_double_point+0x3a>
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
jmp    1166 <check_double_point+0x46>
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_double_point>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rdi
call   1040 <puts@plt>
mov    %ebx,%edi
call   1050 <test_point_double@plt>
test   %rax,%rax
lea    0xebe(%rip),%rax
lea    0xebe(%rip),%rdi
cmove  %rax,%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Point double:\0A\00"
@.str.1 = [9 x i8] c"Success\0A\00"
@.str.2 = [8 x i8] c"Failed\0A\00"
@.str.3 = [2 x i8] c"\0A\00"
define void @check_double_point(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i64 @test_point_double(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %11
9: ; preds = %1
%10 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
%12 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [14 x i8] c"Point double:\00"
@str.4 = [7 x i8] c"Failed\00"
@str.5 = [8 x i8] c"Success\00"
define void @check_double_point(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%3 = tail call i64 @test_point_double(i32 %0)
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @str.4, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @str.5, i64 0, i64 0)
%6 = tail call i32 @puts(i8* dereferenceable(1) %5)
%7 = tail call i32 @putchar(i32 10)
ret void
}
void process_operation(struct operation *operation, char *message, int *len) {
  return;
}


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

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

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

LLVM IR (-O2):
%struct.operation = type opaque
define void @process_operation(%struct.operation* nocapture %0, i8* nocapture %1, i32* nocapture %2) {
ret void
}
void main() {
  int *y;
  int z;
  z = &y;
  y = 4;
  printid(z);
  y = -4;
  printid(z);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
movq   $0x4,0x8(%rsp)
mov    %ebx,%edi
xor    %eax,%eax
call   1030 <printid@plt>
movq   $0xfffffffffffffffc,0x8(%rsp)
ff ff
mov    %ebx,%edi
xor    %eax,%eax
call   1030 <printid@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @main() {
%1 = alloca i32*
%2 = alloca i32
%3 = ptrtoint i32** %1 to i32
store i32 %3, i32* %2
store i32* inttoptr (i64 4 to i32*), i32** %1
%4 = load i32, i32* %2
%5 = call i32 (i32, ...) bitcast (i32 (...)* @printid to i32 (i32, ...)*)(i32 %4)
store i32* inttoptr (i64 -4 to i32*), i32** %1
%6 = load i32, i32* %2
%7 = call i32 (i32, ...) bitcast (i32 (...)* @printid to i32 (i32, ...)*)(i32 %6)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = alloca i32*
%2 = bitcast i32** %1 to i8*
%3 = ptrtoint i32** %1 to i64
%4 = trunc i64 %3 to i32
store i32* inttoptr (i64 4 to i32*), i32** %1
%5 = call i32 (i32, ...) bitcast (i32 (...)* @printid to i32 (i32, ...)*)(i32 %4)
store i32* inttoptr (i64 -4 to i32*), i32** %1
%6 = call i32 (i32, ...) bitcast (i32 (...)* @printid to i32 (i32, ...)*)(i32 %4)
ret void
}
unsigned int get4b(unsigned char *p) {
  return p[0] | p[1] << 8 | p[2] << 16 | p[3] << 24;
}


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

x86 assembly (clang, -O2):
<get4b>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @get4b(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl nuw i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
void initQue(int list[], int max) {
  int i;
  for (i = 0; i < max; i++) {
    list[i] = -1;
  }
}


x86 assembly (clang, -O0):
<initQue>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113b <initQue+0x3b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <initQue+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initQue>:
test   %esi,%esi
jle    1129 <initQue+0x19>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
mov    $0xff,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @initQue(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast i32* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret void
}
/* Variables and functions */
int fibbo(int);
int /*<<< orphan*/ printf(char *, int);
void main(void) {
  int max = 5;
  printf("%d\n", fibbo(max));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <fibbo@plt>
mov    %eax,%esi
lea    0xec0(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1030 <fibbo@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @main() {
%1 = tail call i32 @fibbo(i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("hello,world!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"hello,world!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"hello,world!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int _ftrylockfile_stub(FILE *fp) { return (0); }


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @per_cycle() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main(int argc) { printf("Hello world"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"Hello world\00"
define void @main(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello world\00"
define void @main(i32 %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
HelpScale(scale) { scale = 1; }


x86 assembly (clang, -O0):
<HelpScale>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @HelpScale(i32 %0) {
ret i32 undef
}
unsigned long string_hash(const char *str) {
  const char *c;
  unsigned long h;
  c = str;
  h = 0;
  if (!c)
    return 0;
  while (*c)
    h = 33 * h + 720 + *c++;
  return h;
}


x86 assembly (clang, -O0):
<string_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1130 <string_hash+0x30>
movq   $0x0,-0x8(%rbp)
jmp    1174 <string_hash+0x74>
jmp    1135 <string_hash+0x35>
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     116c <string_hash+0x6c>
imul   $0x21,-0x20(%rbp),%rax
add    $0x2d0,%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbq (%rcx),%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
jmp    1135 <string_hash+0x35>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_hash>:
test   %rdi,%rdi
je     1143 <string_hash+0x43>
mov    (%rdi),%cl
test   %cl,%cl
je     1143 <string_hash+0x43>
add    $0x1,%rdi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movsbq %cl,%rax
add    %rdx,%rax
add    $0x2d0,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1120 <string_hash+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @string_hash(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %17, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %17, label %6
6: ; preds = %3, %6
%7 = phi i8 [ %15, %6 ], [ %4, %3 ]
%8 = phi i64 [ %14, %6 ], [ 0, %3 ]
%9 = phi i8* [ %12, %6 ], [ %0, %3 ]
%10 = mul i64 %8, 33
%11 = add i64 %10, 720
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = sext i8 %7 to i64
%14 = add i64 %11, %13
%15 = load i8, i8* %12
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %6
17: ; preds = %6, %3, %1
%18 = phi i64 [ 0, %1 ], [ 0, %3 ], [ %14, %6 ]
ret i64 %18
}
/* Variables and functions */
int mmio_get_cpsr();
int /*<<< orphan*/ mmio_set_cpsr(int);
void interrupt_std_enable(void) { mmio_set_cpsr(mmio_get_cpsr() & ~(1 << 7)); }


x86 assembly (clang, -O0):
<interrupt_std_enable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <mmio_get_cpsr@plt>
mov    %eax,%edi
and    $0xffffff7f,%edi
call   1030 <mmio_set_cpsr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<interrupt_std_enable>:
push   %rax
xor    %eax,%eax
call   1040 <mmio_get_cpsr@plt>
and    $0xffffff7f,%eax
mov    %eax,%edi
pop    %rax
jmp    1030 <mmio_set_cpsr@plt>

LLVM IR (-O0):
define void @interrupt_std_enable() {
%1 = call i32 (...) @mmio_get_cpsr()
%2 = and i32 %1, -129
%3 = call i32 @mmio_set_cpsr(i32 %2)
ret void
}

LLVM IR (-O2):
define void @interrupt_std_enable() {
%1 = tail call i32 (...) @mmio_get_cpsr()
%2 = and i32 %1, -129
%3 = tail call i32 @mmio_set_cpsr(i32 %2)
ret void
}
/* Type definitions */
typedef size_t ssize_t;

/* Variables and functions */
ssize_t fuzz_write(int fd, const void *buf, size_t count) { return count; }


x86 assembly (clang, -O0):
<fuzz_write>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fuzz_write>:
mov    %rdx,%rax
ret

LLVM IR (-O0):
define i64 @fuzz_write(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i64, i64* %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @fuzz_write(i32 %0, i8* nocapture readnone %1, i64 returned %2) {
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ divideDate(char *);
int main(void) {
  char fecha[] = "04/10/1993";
  divideDate(fecha);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0xb(%rbp)
mov    0xede(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xed6(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0xb(%rbp),%rdi
call   1030 <divideDate@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x39312f30312f3430,%rax
2f 31 39
mov    %rax,0x8(%rsp)
movl   $0x333939,0xf(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <divideDate@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.fecha = [11 x i8] c"04/10/1993\00"
define i32 @main() {
%1 = alloca [11 x i8]
%2 = bitcast [11 x i8]* %1 to i8*
%3 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 0
%4 = call i32 @divideDate(i8* %3)
ret i32 0
}

LLVM IR (-O2):
@__const.main.fecha = [11 x i8] c"04/10/1993\00"
define i32 @main() {
%1 = alloca [11 x i8]
%2 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 0
%3 = call i32 @divideDate(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ debug_shut();
int /*<<< orphan*/ eeprom_shut();
int /*<<< orphan*/ leds_shut();
void shut_shell(void) {
  eeprom_shut();
  leds_shut();
  debug_shut();
}


x86 assembly (clang, -O0):
<shut_shell>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <eeprom_shut@plt>
mov    $0x0,%al
call   1040 <leds_shut@plt>
mov    $0x0,%al
call   1030 <debug_shut@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<shut_shell>:
push   %rax
xor    %eax,%eax
call   1050 <eeprom_shut@plt>
xor    %eax,%eax
call   1040 <leds_shut@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <debug_shut@plt>

LLVM IR (-O0):
define void @shut_shell() {
%1 = call i32 (...) @eeprom_shut()
%2 = call i32 (...) @leds_shut()
%3 = call i32 (...) @debug_shut()
ret void
}

LLVM IR (-O2):
define void @shut_shell() {
%1 = tail call i32 (...) @eeprom_shut()
%2 = tail call i32 (...) @leds_shut()
%3 = tail call i32 (...) @debug_shut()
ret void
}
void ff_hevc_put_hevc_uni_qpel_hv12_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_qpel_hv12_10_sse4() {
ret void
}
/* Variables and functions */
double getValueScaleFactor(int);
double scaleValue(double value, int num_updates) {
  return (value + getValueScaleFactor(num_updates));
}


x86 assembly (clang, -O0):
<scaleValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <getValueScaleFactor@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scaleValue>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <getValueScaleFactor@plt>
addsd  (%rsp),%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
define double @scaleValue(double %0, i32 %1) {
%3 = tail call double @getValueScaleFactor(i32 %1)
%4 = fadd double %3, %0
ret double %4
}