xunge/DecIR huggingface dataset:
void tmb_strcrep(char *str, char org, char dst) {
  if (!str) {
    return;
  }
  for (char *pos = str; *pos; pos++) {
    if (*pos == org) {
      *pos = dst;
    }
  }
}


x86 assembly (clang, -O0):
<tmb_strcrep>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1123 <tmb_strcrep+0x23>
jmp    116a <tmb_strcrep+0x6a>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     116a <tmb_strcrep+0x6a>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1154 <tmb_strcrep+0x54>
mov    -0xa(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
jmp    1159 <tmb_strcrep+0x59>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    112b <tmb_strcrep+0x2b>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tmb_strcrep>:
test   %rdi,%rdi
je     1135 <tmb_strcrep+0x35>
mov    (%rdi),%al
test   %al,%al
je     1135 <tmb_strcrep+0x35>
add    $0x1,%rdi
jmp    112b <tmb_strcrep+0x2b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     1135 <tmb_strcrep+0x35>
cmp    %sil,%al
jne    1120 <tmb_strcrep+0x20>
mov    %dl,-0x1(%rdi)
jmp    1120 <tmb_strcrep+0x20>
ret

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

LLVM IR (-O2):
define void @tmb_strcrep(i8* %0, i8 signext %1, i8 signext %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %17, label %5
5: ; preds = %3
%6 = load i8, i8* %0
%7 = icmp eq i8 %6, 0
br i1 %7, label %17, label %8
8: ; preds = %5, %13
%9 = phi i8 [ %15, %13 ], [ %6, %5 ]
%10 = phi i8* [ %14, %13 ], [ %0, %5 ]
%11 = icmp eq i8 %9, %1
br i1 %11, label %12, label %13
12: ; preds = %8
store i8 %2, i8* %10
br label %13
13: ; preds = %8, %12
%14 = getelementptr inbounds i8, i8* %10, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %8
17: ; preds = %13, %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, unsigned long);
void pointer_function(int local_non_init) {
  int local_init = 1;
  printf("The id %s \t\t is at:%8X\n", " LocUninit (inside PtrFct) ",
         (unsigned long int)&local_non_init);
  if (local_non_init > 0) {
    pointer_function(local_non_init - local_init);
  }
}


x86 assembly (clang, -O0):
<pointer_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
lea    -0x4(%rbp),%rdx
lea    0xec3(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1030 <printf@plt>
cmpl   $0x0,-0x4(%rbp)
jle    115e <pointer_function+0x3e>
mov    -0x4(%rbp),%edi
sub    -0x8(%rbp),%edi
call   1040 <pointer_function@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pointer_function>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0xed4(%rip),%rdi
lea    0xee5(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1030 <printf@plt>
mov    0x4(%rsp),%edi
test   %edi,%edi
jle    114d <pointer_function+0x2d>
add    $0xffffffff,%edi
call   1040 <pointer_function@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [24 x i8] c"The id %s \09\09 is at:%8X\0A\00"
@.str.1 = [28 x i8] c" LocUninit (inside PtrFct) \00"
define void @pointer_function(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = ptrtoint i32* %2 to i64
%5 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i64 %4)
%6 = load i32, i32* %2
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = sub nsw i32 %9, %10
br label %12
12: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"The id %s \09\09 is at:%8X\0A\00"
@.str.1 = [28 x i8] c" LocUninit (inside PtrFct) \00"
define void @pointer_function(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = ptrtoint i32* %2 to i64
%4 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i64 %3)
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = add nsw i32 %5, -1
br label %9
9: ; preds = %7, %1
ret void
}
void mut_mem_open(void) {}


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

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

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

LLVM IR (-O2):
define void @mut_mem_open() {
ret void
}
void wide_strcpy(short *d, short *s) {
  int i;
  for (i = 0; s[i] != 0; i++)
    d[i] = s[i];
  d[i] = 0;
}


x86 assembly (clang, -O0):
<wide_strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movswl (%rax,%rcx,2),%eax
cmp    $0x0,%eax
je     114e <wide_strcpy+0x4e>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,2),%dx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dx,(%rax,%rcx,2)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <wide_strcpy+0x13>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movw   $0x0,(%rax,%rcx,2)
pop    %rbp
ret

x86 assembly (clang, -O2):
<wide_strcpy>:
movzwl (%rsi),%eax
test   %ax,%ax
je     112b <wide_strcpy+0x2b>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
mov    %ax,(%rdi,%rcx,2)
movzwl 0x2(%rsi,%rcx,2),%eax
add    $0x1,%rcx
test   %ax,%ax
jne    1110 <wide_strcpy+0x10>
mov    %ecx,%eax
movw   $0x0,(%rdi,%rax,2)
ret
xor    %eax,%eax
movw   $0x0,(%rdi,%rax,2)
ret

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

LLVM IR (-O2):
define void @wide_strcpy(i16* nocapture writeonly %0, i16* nocapture %1) {
%3 = load i16, i16* %1
%4 = icmp eq i16 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = phi i16 [ %11, %5 ], [ %3, %2 ]
%8 = getelementptr inbounds i16, i16* %0, i64 %6
store i16 %7, i16* %8
%9 = add nuw nsw i64 %6, 1
%10 = getelementptr inbounds i16, i16* %1, i64 %9
%11 = load i16, i16* %10
%12 = icmp eq i16 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = and i64 %9, 4294967295
br label %15
15: ; preds = %13, %2
%16 = phi i64 [ 0, %2 ], [ %14, %13 ]
%17 = getelementptr inbounds i16, i16* %0, i64 %16
store i16 0, i16* %17
ret void
}
double rectified_linear(double val) {
  if (val < 0)
    return 0;
  else
    return val;
}


x86 assembly (clang, -O0):
<rectified_linear>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1124 <rectified_linear+0x24>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    112e <rectified_linear+0x2e>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rectified_linear>:
xorpd  %xmm1,%xmm1
maxsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @rectified_linear(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store double 0.000000e+00, double* %2
br label %9
7: ; preds = %1
%8 = load double, double* %3
store double %8, double* %2
br label %9
9: ; preds = %7, %6
%10 = load double, double* %2
ret double %10
}

LLVM IR (-O2):
define double @rectified_linear(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = select i1 %2, double 0.000000e+00, double %0
ret double %3
}
int trivial_compare_func(const void *a, const void *b) {
  return a < b ? -1 : (a > b ? 1 : 0);
}


x86 assembly (clang, -O0):
<trivial_compare_func>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1127 <trivial_compare_func+0x27>
mov    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    113f <trivial_compare_func+0x3f>
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %rsi,%rdx
cmova  %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<trivial_compare_func>:
xor    %ecx,%ecx
cmp    %rsi,%rdi
seta   %cl
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define i32 @trivial_compare_func(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = icmp ult i8* %5, %6
br i1 %7, label %8, label %9
8: ; preds = %2
br label %15
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = load i8*, i8** %4
%12 = icmp ugt i8* %10, %11
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 1, i32 0
br label %15
15: ; preds = %9, %8
%16 = phi i32 [ -1, %8 ], [ %14, %9 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @trivial_compare_func(i8* readnone %0, i8* readnone %1) {
%3 = icmp ult i8* %0, %1
%4 = icmp ugt i8* %0, %1
%5 = zext i1 %4 to i32
%6 = select i1 %3, i32 -1, i32 %5
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_get_timeout(void *bus, uint64_t *timeout_usec) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_get_timeout>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ecb(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_get_timeout>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_get_timeout(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_get_timeout(i8* nocapture readnone %0, i32* nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
void avio_closep() {}


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

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

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

LLVM IR (-O2):
define void @avio_closep() {
ret void
}
/* Variables and functions */
int fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int puts_verbatim(const char *s) { return fputs(s, stdout); }


x86 assembly (clang, -O0):
<puts_verbatim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts_verbatim>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@stdout = global i32 0
define i32 @puts_verbatim(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @stdout
%5 = call i32 @fputs(i8* %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @puts_verbatim(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fputs(i8* %0, i32 %2)
ret i32 %3
}
float pgm_read_float(const void *s) { return *(const float *)s; }


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

x86 assembly (clang, -O2):
<pgm_read_float>:
movss  (%rdi),%xmm0
ret

LLVM IR (-O0):
define float @pgm_read_float(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to float*
%5 = load float, float* %4
ret float %5
}

LLVM IR (-O2):
define float @pgm_read_float(i8* nocapture %0) {
%2 = bitcast i8* %0 to float*
%3 = load float, float* %2
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
newLine(int qtd) {
  int i = 0;
  for (i = 0; i < qtd; i++)
    printf("\n");
}


x86 assembly (clang, -O0):
<newLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    114f <newLine+0x3f>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1129 <newLine+0x19>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @newLine(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @putchar(i32 10)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret i32 undef
}
void RTStrToLower(void) {}


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

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

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

LLVM IR (-O2):
define void @RTStrToLower() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ prt(char *, char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void prterr(char *prefix) {
  prt("%s%s%s\n", prefix, prefix ? ": " : "", strerror(errno));
}


x86 assembly (clang, -O0):
<prterr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xec8(%rip),%rax
lea    0xec2(%rip),%rcx
cmp    $0x0,%rdx
cmovne %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    %eax,%ecx
lea    0xe8f(%rip),%rdi
call   1030 <prt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prterr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
test   %rdi,%rdi
lea    0xed6(%rip),%rax
lea    0xed0(%rip),%rbx
cmove  %rax,%rbx
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
lea    0xeaf(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %eax,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <prt@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%s%s%s\0A\00"
@.str.1 = [3 x i8] c": \00"
@.str.2 = [1 x i8] zeroinitializer
@errno = global i32 0
define void @prterr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
%6 = zext i1 %5 to i64
%7 = select i1 %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0)
%8 = load i32, i32* @errno
%9 = call i32 @strerror(i32 %8)
%10 = call i32 @prt(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %7, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s%s%s\0A\00"
@.str.1 = [3 x i8] c": \00"
@.str.2 = [1 x i8] zeroinitializer
@errno = global i32 0
define void @prterr(i8* %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
%4 = load i32, i32* @errno
%5 = tail call i32 @strerror(i32 %4)
%6 = tail call i32 @prt(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %3, i32 %5)
ret void
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
double timediff(struct timeval s, struct timeval e) {
  return ((((float)(e.tv_sec - s.tv_sec)) +
           ((float)(e.tv_usec - s.tv_usec)) / 1000000));
}


x86 assembly (clang, -O0):
<timediff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
sub    -0x8(%rbp),%rax
cvtsi2ss %rax,%xmm0
mov    -0x20(%rbp),%rax
sub    -0x10(%rbp),%rax
cvtsi2ss %rax,%xmm1
movss  0xeca(%rip),%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<timediff>:
sub    %rsi,%rcx
cvtsi2ss %rcx,%xmm0
sub    %rdi,%rdx
cvtsi2ss %rdx,%xmm1
divss  0xee8(%rip),%xmm1
addss  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @timediff(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca %struct.timeval
%6 = alloca %struct.timeval
%7 = bitcast %struct.timeval* %5 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = bitcast %struct.timeval* %6 to { i64, i64 }*
%11 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %10, i32 0, i32 0
store i64 %2, i64* %11
%12 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %10, i32 0, i32 1
store i64 %3, i64* %12
%13 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 1
%14 = load i64, i64* %13
%15 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 1
%16 = load i64, i64* %15
%17 = sub nsw i64 %14, %16
%18 = sitofp i64 %17 to float
%19 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 0
%20 = load i64, i64* %19
%21 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%22 = load i64, i64* %21
%23 = sub nsw i64 %20, %22
%24 = sitofp i64 %23 to float
%25 = fdiv float %24, 1.000000e+06
%26 = fadd float %18, %25
%27 = fpext float %26 to double
ret double %27
}

LLVM IR (-O2):
define double @timediff(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = sub nsw i64 %3, %1
%6 = sitofp i64 %5 to float
%7 = sub nsw i64 %2, %0
%8 = sitofp i64 %7 to float
%9 = fdiv float %8, 1.000000e+06
%10 = fadd float %9, %6
%11 = fpext float %10 to double
ret double %11
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void write_trace(FILE *file, int fmt) {
  (void)file;
  (void)fmt;
}


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

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

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

LLVM IR (-O2):
define void @write_trace(i32* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ command(char *, char *);
void rmtstatus(int argc, char *argv[]) {
  (void)command(argc > 1 ? "STAT %s" : "STAT", argv[1]);
}


x86 assembly (clang, -O0):
<rmtstatus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
lea    0xedf(%rip),%rdi
lea    0xed0(%rip),%rax
cmp    $0x1,%ecx
cmovg  %rax,%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rmtstatus>:
cmp    $0x2,%edi
lea    0xee6(%rip),%rax
lea    0xee7(%rip),%rdi
cmovge %rax,%rdi
mov    0x8(%rsi),%rsi
jmp    1030 <command@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"STAT %s\00"
@.str.1 = [5 x i8] c"STAT\00"
define void @rmtstatus(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = icmp sgt i32 %5, 1
%7 = zext i1 %6 to i64
%8 = select i1 %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0)
%9 = load i8**, i8*** %4
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @command(i8* %8, i8* %11)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"STAT %s\00"
@.str.1 = [5 x i8] c"STAT\00"
define void @rmtstatus(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
%4 = select i1 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0)
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @command(i8* %4, i8* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int /*<<< orphan*/);
float __VERIFIER_nondet_float();
int main(void) {
  float a = __VERIFIER_nondet_float();
  if (a < 0) {
    return 0;
  }
  if (a < 10) {
    __VERIFIER_assert(0);
  }
  return a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_float@plt>
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1154 <main+0x34>
movl   $0x0,-0x4(%rbp)
jmp    1175 <main+0x55>
movss  0xea4(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    116d <main+0x4d>
xor    %edi,%edi
call   1030 <__VERIFIER_assert@plt>
cvttss2si -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_float@plt>
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
ja     115a <main+0x3a>
movss  0xec2(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    1156 <main+0x36>
xor    %edi,%edi
movss  %xmm0,0xc(%rsp)
call   1030 <__VERIFIER_assert@plt>
movss  0xc(%rsp),%xmm0
cvttss2si %xmm0,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call float (...) @__VERIFIER_nondet_float()
store float %3, float* %2
%4 = load float, float* %2
%5 = fcmp olt float %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 0, i32* %1
br label %15
7: ; preds = %0
%8 = load float, float* %2
%9 = fcmp olt float %8, 1.000000e+01
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 @__VERIFIER_assert(i32 0)
br label %12
12: ; preds = %10, %7
%13 = load float, float* %2
%14 = fptosi float %13 to i32
store i32 %14, i32* %1
br label %15
15: ; preds = %12, %6
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call float (...) @__VERIFIER_nondet_float()
%2 = fcmp olt float %1, 0.000000e+00
br i1 %2, label %9, label %3
3: ; preds = %0
%4 = fcmp olt float %1, 1.000000e+01
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @__VERIFIER_assert(i32 0)
br label %7
7: ; preds = %5, %3
%8 = fptosi float %1 to i32
br label %9
9: ; preds = %0, %7
%10 = phi i32 [ %8, %7 ], [ 0, %0 ]
ret i32 %10
}
/* Variables and functions */
long abs(long v) {
  if (v < 0)
    return (-1) * v;
  return v;
}


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    1121 <abs+0x21>
imul   $0xffffffffffffffff,-0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1129 <abs+0x29>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @abs(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i64, i64* %3
%8 = mul nsw i64 -1, %7
store i64 %8, i64* %2
br label %11
9: ; preds = %1
%10 = load i64, i64* %3
store i64 %10, i64* %2
br label %11
11: ; preds = %9, %6
%12 = load i64, i64* %2
ret i64 %12
}

LLVM IR (-O2):
define i64 @abs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
/* Type definitions */
struct socket {
  int dummy;
};

/* Variables and functions */
int EOPNOTSUPP;
int /*<<< orphan*/ so_needign(struct socket *, _Bool);
int so_pipeok(struct socket *so, _Bool rdonly) {
  if (!so_needign(so, rdonly))
    return 0;
  return EOPNOTSUPP;
}


x86 assembly (clang, -O0):
<so_pipeok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
and    $0x1,%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%esi
call   1030 <so_needign@plt>
cmp    $0x0,%eax
jne    114a <so_pipeok+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    1156 <so_pipeok+0x46>
mov    0x2e8f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<so_pipeok>:
push   %rax
call   1030 <so_needign@plt>
test   %eax,%eax
je     1123 <so_pipeok+0x13>
mov    0x2ebf(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.socket = type { i32 }
@EOPNOTSUPP = global i32 0
define i32 @so_pipeok(%struct.socket* %0, i1 zeroext %1) {
%3 = alloca i32
%4 = alloca %struct.socket*
%5 = alloca i8
store %struct.socket* %0, %struct.socket** %4
%6 = zext i1 %1 to i8
store i8 %6, i8* %5
%7 = load %struct.socket*, %struct.socket** %4
%8 = load i8, i8* %5
%9 = trunc i8 %8 to i1
%10 = call i32 @so_needign(%struct.socket* %7, i1 zeroext %9)
%11 = icmp ne i32 %10, 0
br i1 %11, label %13, label %12
12: ; preds = %2
store i32 0, i32* %3
br label %15
13: ; preds = %2
%14 = load i32, i32* @EOPNOTSUPP
store i32 %14, i32* %3
br label %15
15: ; preds = %13, %12
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
%struct.socket = type { i32 }
@EOPNOTSUPP = global i32 0
define i32 @so_pipeok(%struct.socket* %0, i1 zeroext %1) {
%3 = tail call i32 @so_needign(%struct.socket* %0, i1 zeroext %1)
%4 = icmp eq i32 %3, 0
%5 = load i32, i32* @EOPNOTSUPP
%6 = select i1 %4, i32 0, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int GetFileType(char *pname) {
  if (pname != NULL) {
    strcpy(pname, "GBZ|GZ");
  }
  return 0;
}


x86 assembly (clang, -O0):
<GetFileType>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1137 <GetFileType+0x27>
mov    -0x8(%rbp),%rdi
lea    0xece(%rip),%rsi
call   1030 <strcpy@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetFileType>:
test   %rdi,%rdi
je     1126 <GetFileType+0x16>
push   %rax
lea    0xee3(%rip),%rsi
call   1030 <strcpy@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"GBZ|GZ\00"
define i32 @GetFileType(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @strcpy(i8* %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %5, %1
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"GBZ|GZ\00"
define i32 @GetFileType(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
ret i32 0
}
int f(int b, int c) {
  int a = (short)b * (short)c;
  if (!a)
    return 10;
  return a;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cwtl
mov    -0xc(%rbp),%ecx
movswl %cx,%ecx
imul   %ecx,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    1130 <f+0x30>
movl   $0xa,-0x4(%rbp)
jmp    1136 <f+0x36>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movswl %di,%eax
movswl %si,%ecx
imul   %eax,%ecx
test   %ecx,%ecx
mov    $0xa,%eax
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = shl i32 %0, 16
%4 = ashr exact i32 %3, 16
%5 = shl i32 %1, 16
%6 = ashr exact i32 %5, 16
%7 = mul nsw i32 %6, %4
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i32 10, i32 %7
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
void print_constant(char *name, int val) {
  printf("(defmacro %s %d)\n", name, val);
}


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

x86 assembly (clang, -O2):
<print_constant>:
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xee4(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [18 x i8] c"(defmacro %s %d)\0A\00"
define void @print_constant(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret void
}
int test_imm_99int64_midword_reg(long long val) {
  return ((val >> 16) & (0x99 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_99int64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0x99,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_99int64_midword_reg>:
test   $0x990000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_99int64_midword_reg(i64 %0) {
%2 = and i64 %0, 10027008
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ f();
int g(void) {
  f();
  return 4;
}


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

x86 assembly (clang, -O2):
<g>:
push   %rax
xor    %eax,%eax
call   1030 <f@plt>
mov    $0x4,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @g() {
%1 = call i32 (...) @f()
ret i32 4
}

LLVM IR (-O2):
define i32 @g() {
%1 = tail call i32 (...) @f()
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void printHelloC() {
  printf("Hello from C in "
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/Philips14171/"
         "qt-creator-opensource-src-4.2.1/refs/heads/master/src/shared/qbs/"
         "tests/auto/api/testdata/same-base-name/lib.c"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [230 x i8] c"Hello from C in /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Philips14171/qt-creator-opensource-src-4.2.1/refs/heads/master/src/shared/qbs/tests/auto/api/testdata/same-base-name/lib.c\0A\00"
define void @printHelloC() {
%1 = call i32 @printf(i8* getelementptr inbounds ([230 x i8], [230 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [229 x i8] c"Hello from C in /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Philips14171/qt-creator-opensource-src-4.2.1/refs/heads/master/src/shared/qbs/tests/auto/api/testdata/same-base-name/lib.c\00"
define void @printHelloC() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([229 x i8], [229 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int bfin_read_SICB_SYSCR();
int bfin_read_SYSCR();
int /*<<< orphan*/ bfin_write_SICB_SYSCR(int);
int /*<<< orphan*/ bfin_write_SYSCR(int);
void bfin_coreb_stop(void) {
  bfin_write_SYSCR(bfin_read_SYSCR() | 0x0020);
  bfin_write_SICB_SYSCR(bfin_read_SICB_SYSCR() | 0x0080);
}


x86 assembly (clang, -O0):
<bfin_coreb_stop>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <bfin_read_SYSCR@plt>
mov    %eax,%edi
or     $0x20,%edi
call   1060 <bfin_write_SYSCR@plt>
mov    $0x0,%al
call   1040 <bfin_read_SICB_SYSCR@plt>
mov    %eax,%edi
or     $0x80,%edi
call   1050 <bfin_write_SICB_SYSCR@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bfin_coreb_stop>:
push   %rax
xor    %eax,%eax
call   1030 <bfin_read_SYSCR@plt>
or     $0x20,%eax
mov    %eax,%edi
call   1060 <bfin_write_SYSCR@plt>
xor    %eax,%eax
call   1040 <bfin_read_SICB_SYSCR@plt>
or     $0x80,%eax
mov    %eax,%edi
pop    %rax
jmp    1050 <bfin_write_SICB_SYSCR@plt>

LLVM IR (-O0):
define void @bfin_coreb_stop() {
%1 = call i32 (...) @bfin_read_SYSCR()
%2 = or i32 %1, 32
%3 = call i32 @bfin_write_SYSCR(i32 %2)
%4 = call i32 (...) @bfin_read_SICB_SYSCR()
%5 = or i32 %4, 128
%6 = call i32 @bfin_write_SICB_SYSCR(i32 %5)
ret void
}

LLVM IR (-O2):
define void @bfin_coreb_stop() {
%1 = tail call i32 (...) @bfin_read_SYSCR()
%2 = or i32 %1, 32
%3 = tail call i32 @bfin_write_SYSCR(i32 %2)
%4 = tail call i32 (...) @bfin_read_SICB_SYSCR()
%5 = or i32 %4, 128
%6 = tail call i32 @bfin_write_SICB_SYSCR(i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int *element_check(int N) {
  if (N <= 1) {
    printf("\nERROR: N must be >= 2\n\n");
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<element_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jg     114b <element_check+0x2b>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<element_check>:
cmp    $0x1,%edi
jle    1126 <element_check+0x6>
ret
push   %rax
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"\0AERROR: N must be >= 2\0A\0A\00"
define i32* @element_check(i32 %0) {
%2 = alloca i32*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 %4, 1
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 -1)
unreachable
9: ; preds = %1
%10 = load i32*, i32** %2
ret i32* %10
}

LLVM IR (-O2):
@str = [24 x i8] c"\0AERROR: N must be >= 2\0A\00"
define noalias i32* @element_check(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 -1)
unreachable
6: ; preds = %1
ret i32* undef
}
/* Variables and functions */
int /*<<< orphan*/ AUUSL3(unsigned long volatile *, int, unsigned long);
__attribute__((no)) void LzuvP2(volatile unsigned long *RdZoN,
                                unsigned long TrF875) {
  AUUSL3(RdZoN, 15, (TrF875 >> 24) & 0xFFu);
  AUUSL3(RdZoN, 14, (TrF875 >> 16) & 0xFFu);
  AUUSL3(RdZoN, 015, (TrF875 >> 0x8) & 0xFFu);
  AUUSL3(RdZoN, 12, TrF875 & 0xFFu);
}


x86 assembly (clang, -O0):
<LzuvP2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
shr    $0x18,%rdx
and    $0xff,%rdx
mov    $0xf,%esi
call   1030 <AUUSL3@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
shr    $0x10,%rdx
and    $0xff,%rdx
mov    $0xe,%esi
call   1030 <AUUSL3@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
shr    $0x8,%rdx
and    $0xff,%rdx
mov    $0xd,%esi
call   1030 <AUUSL3@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
and    $0xff,%rdx
mov    $0xc,%esi
call   1030 <AUUSL3@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LzuvP2>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %ebx,%edx
shr    $0x18,%edx
mov    $0xf,%esi
call   1030 <AUUSL3@plt>
mov    %ebx,%eax
shr    $0x10,%eax
movzbl %al,%edx
mov    %r14,%rdi
mov    $0xe,%esi
call   1030 <AUUSL3@plt>
movzbl %bh,%edx
mov    %r14,%rdi
mov    $0xd,%esi
call   1030 <AUUSL3@plt>
movzbl %bl,%edx
mov    %r14,%rdi
mov    $0xc,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <AUUSL3@plt>

LLVM IR (-O0):
define void @LzuvP2(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%5 = load i64*, i64** %3
%6 = load i64, i64* %4
%7 = lshr i64 %6, 24
%8 = and i64 %7, 255
%9 = call i32 @AUUSL3(i64* %5, i32 15, i64 %8)
%10 = load i64*, i64** %3
%11 = load i64, i64* %4
%12 = lshr i64 %11, 16
%13 = and i64 %12, 255
%14 = call i32 @AUUSL3(i64* %10, i32 14, i64 %13)
%15 = load i64*, i64** %3
%16 = load i64, i64* %4
%17 = lshr i64 %16, 8
%18 = and i64 %17, 255
%19 = call i32 @AUUSL3(i64* %15, i32 13, i64 %18)
%20 = load i64*, i64** %3
%21 = load i64, i64* %4
%22 = and i64 %21, 255
%23 = call i32 @AUUSL3(i64* %20, i32 12, i64 %22)
ret void
}

LLVM IR (-O2):
define void @LzuvP2(i64* %0, i64 %1) {
%3 = lshr i64 %1, 24
%4 = and i64 %3, 255
%5 = tail call i32 @AUUSL3(i64* %0, i32 15, i64 %4)
%6 = lshr i64 %1, 16
%7 = and i64 %6, 255
%8 = tail call i32 @AUUSL3(i64* %0, i32 14, i64 %7)
%9 = lshr i64 %1, 8
%10 = and i64 %9, 255
%11 = tail call i32 @AUUSL3(i64* %0, i32 13, i64 %10)
%12 = and i64 %1, 255
%13 = tail call i32 @AUUSL3(i64* %0, i32 12, i64 %12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ flash_write(int, int);
void flash_clear_status(int offset) { flash_write(offset, 0x50); }


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

x86 assembly (clang, -O2):
<flash_clear_status>:
mov    $0x50,%esi
jmp    1030 <flash_write@plt>

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

LLVM IR (-O2):
define void @flash_clear_status(i32 %0) {
%2 = tail call i32 @flash_write(i32 %0, i32 80)
ret void
}
void _f_setlong(void *ptr, unsigned long num) {
  unsigned char *sptr = (unsigned char *)ptr;
  sptr[3] = (unsigned char)(num >> 24);
  sptr[2] = (unsigned char)(num >> 16);
  sptr[1] = (unsigned char)(num >> 8);
  sptr[0] = (unsigned char)(num);
}


x86 assembly (clang, -O0):
<_f_setlong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x18,%rax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x10(%rbp),%rax
shr    $0x10,%rax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x10(%rbp),%rax
shr    $0x8,%rax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_f_setlong>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @_f_setlong(i8* nocapture writeonly %0, i64 %1) {
%3 = lshr i64 %1, 24
%4 = trunc i64 %3 to i8
%5 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %4, i8* %5
%6 = lshr i64 %1, 16
%7 = trunc i64 %6 to i8
%8 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %7, i8* %8
%9 = lshr i64 %1, 8
%10 = trunc i64 %9 to i8
%11 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %10, i8* %11
%12 = trunc i64 %1 to i8
store i8 %12, i8* %0
ret void
}
void function_a() {
  int i;
  int sum = 0;
  for (i = 0; i < 10000; i++) {
    sum += i;
  }
}


x86 assembly (clang, -O0):
<function_a>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x2710,-0x4(%rbp)
jge    1136 <function_a+0x36>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1112 <function_a+0x12>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @function_a() {
ret void
}
unsigned long AlphaMemoryHashValue(struct patternNodeHeader *theHeader,
                                   unsigned long hashOffset) {
  unsigned long hashValue;
  union {
    void *vv;
    unsigned uv;
  } fis;
  fis.uv = 0;
  fis.vv = theHeader;
  hashValue = fis.uv + hashOffset;
  hashValue = hashValue % 63559L;
  return hashValue;
}


x86 assembly (clang, -O0):
<AlphaMemoryHashValue>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
add    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    $0xf847,%ecx
xor    %edx,%edx
div    %rcx
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AlphaMemoryHashValue>:
mov    %edi,%ecx
add    %rsi,%rcx
movabs $0x83fb3f4bd07d15ff,%rdx
3f fb 83
mov    %rcx,%rax
mul    %rdx
shr    $0xf,%rdx
imul   $0xf847,%rdx,%rax
sub    %rax,%rcx
mov    %rcx,%rax
ret

LLVM IR (-O0):
%struct.patternNodeHeader = type opaque
%union.anon = type { i8* }
define i64 @AlphaMemoryHashValue(%struct.patternNodeHeader* %0, i64 %1) {
%3 = alloca %struct.patternNodeHeader*
%4 = alloca i64
%5 = alloca i64
%6 = alloca %union.anon
store %struct.patternNodeHeader* %0, %struct.patternNodeHeader** %3
store i64 %1, i64* %4
%7 = bitcast %union.anon* %6 to i32*
store i32 0, i32* %7
%8 = load %struct.patternNodeHeader*, %struct.patternNodeHeader** %3
%9 = bitcast %struct.patternNodeHeader* %8 to i8*
%10 = bitcast %union.anon* %6 to i8**
store i8* %9, i8** %10
%11 = bitcast %union.anon* %6 to i32*
%12 = load i32, i32* %11
%13 = zext i32 %12 to i64
%14 = load i64, i64* %4
%15 = add i64 %13, %14
store i64 %15, i64* %5
%16 = load i64, i64* %5
%17 = urem i64 %16, 63559
store i64 %17, i64* %5
%18 = load i64, i64* %5
ret i64 %18
}

LLVM IR (-O2):
%struct.patternNodeHeader = type opaque
define i64 @AlphaMemoryHashValue(%struct.patternNodeHeader* %0, i64 %1) {
%3 = ptrtoint %struct.patternNodeHeader* %0 to i64
%4 = and i64 %3, 4294967295
%5 = add i64 %4, %1
%6 = urem i64 %5, 63559
ret i64 %6
}