xunge/DecIR huggingface dataset:
/* Type definitions */
struct stat {
  int st_mode;
};

/* Variables and functions */
int __S_IFDIR;
int __S_IFMT;
scalar_t__ stat(char *, struct stat *);
int dashd(char *fname) {
  struct stat st;
  return (stat(fname, &st) == 0 &&
          ((((st.st_mode)) & __S_IFMT) == (__S_IFDIR)));
}


x86 assembly (clang, -O0):
<dashd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
jne    1156 <dashd+0x46>
mov    -0x10(%rbp),%eax
mov    0x2e9b(%rip),%rcx
and    (%rcx),%eax
mov    0x2e9a(%rip),%rcx
cmp    (%rcx),%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dashd>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1125 <dashd+0x15>
pop    %rcx
ret
mov    0x2eb4(%rip),%rax
mov    (%rax),%ecx
and    (%rsp),%ecx
mov    0x2eb0(%rip),%rdx
xor    %eax,%eax
cmp    (%rdx),%ecx
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@__S_IFMT = global i32 0
@__S_IFDIR = global i32 0
define i32 @dashd(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @stat(i8* %4, %struct.stat* %3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %1
%8 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%9 = load i32, i32* %8
%10 = load i32, i32* @__S_IFMT
%11 = and i32 %9, %10
%12 = load i32, i32* @__S_IFDIR
%13 = icmp eq i32 %11, %12
br label %14
14: ; preds = %7, %1
%15 = phi i1 [ false, %1 ], [ %13, %7 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@__S_IFMT = global i32 0
@__S_IFDIR = global i32 0
define i32 @dashd(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %14
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = load i32, i32* @__S_IFMT
%10 = and i32 %9, %8
%11 = load i32, i32* @__S_IFDIR
%12 = icmp eq i32 %10, %11
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %6, %1
%15 = phi i32 [ 0, %1 ], [ %13, %6 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ calulaDec(int, char *);
int /*<<< orphan*/ scanf(char *, char *);
int strlen(char *);
int main() {
  char romano[20];
  int tam;
  scanf("%s", romano);
  tam = strlen(romano);
  calulaDec(tam, romano);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x20(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x20(%rbp),%rsi
call   1050 <calulaDec@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xec4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1050 <calulaDec@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%10 = call i32 @calulaDec(i32 %8, i8* %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @strlen(i8* %2)
%5 = call i32 @calulaDec(i32 %4, i8* %2)
ret i32 0
}
int test_01(volatile short *x) { return x[5]; }


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

x86 assembly (clang, -O2):
<test_01>:
movswl 0xa(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @test_01(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = getelementptr inbounds i16, i16* %3, i64 5
%5 = load volatile i16, i16* %4
%6 = sext i16 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @test_01(i16* %0) {
%2 = getelementptr inbounds i16, i16* %0, i64 5
%3 = load volatile i16, i16* %2
%4 = sext i16 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
int /*<<< orphan*/ match(char *);
void need_semicolon(void) {
  if (!match(";"))
    error("missing semicolon");
}


x86 assembly (clang, -O0):
<need_semicolon>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <match@plt>
cmp    $0x0,%eax
jne    1145 <need_semicolon+0x25>
lea    0xec2(%rip),%rdi
call   1040 <error@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<need_semicolon>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <match@plt>
test   %eax,%eax
je     1133 <need_semicolon+0x13>
pop    %rax
ret
lea    0xec8(%rip),%rdi
pop    %rax
jmp    1040 <error@plt>

LLVM IR (-O0):
@.str = [2 x i8] c";\00"
@.str.1 = [18 x i8] c"missing semicolon\00"
define void @need_semicolon() {
%1 = call i32 @match(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = icmp ne i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = call i32 @error(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c";\00"
@.str.1 = [18 x i8] c"missing semicolon\00"
define void @need_semicolon() {
%1 = tail call i32 @match(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @error(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret void
}
void UsageFaultException(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<UsageFaultException>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <UsageFaultException+0x9>
jmp    1109 <UsageFaultException+0x9>

x86 assembly (clang, -O2):
<UsageFaultException>:
jmp    1100 <UsageFaultException>

LLVM IR (-O0):
define void @UsageFaultException() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @UsageFaultException() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
size_t strcspn(char const *, char const *);
size_t c_strcspn(const char *s, const char *reject) {
  return strcspn(s, reject);
}


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

x86 assembly (clang, -O2):
<c_strcspn>:
jmp    1030 <strcspn@plt>

LLVM IR (-O0):
define i64 @c_strcspn(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 = call i64 @strcspn(i8* %5, i8* %6)
ret i64 %7
}

LLVM IR (-O2):
define i64 @c_strcspn(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strcspn(i8* %0, i8* %1)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
void f(char *a, char *b) { strcpy(a, b); }


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

x86 assembly (clang, -O2):
<f>:
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define void @f(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 = call i32 @strcpy(i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
define void @f(i8* %0, i8* %1) {
%3 = tail call i32 @strcpy(i8* %0, i8* %1)
ret void
}
void sfi_init_late(void) {}


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

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

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

LLVM IR (-O2):
define void @sfi_init_late() {
ret void
}
double satur(double x, double lb, double ub) {
  return ((x < lb) ? lb : ((x >= ub) ? ub : x));
}


x86 assembly (clang, -O0):
<satur>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1136 <satur+0x36>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1169 <satur+0x69>
movsd  -0x8(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     1155 <satur+0x55>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    115f <satur+0x5f>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<satur>:
movapd %xmm2,%xmm3
cmplesd %xmm0,%xmm3
andpd  %xmm3,%xmm2
andnpd %xmm0,%xmm3
orpd   %xmm2,%xmm3
cmpltsd %xmm1,%xmm0
movapd %xmm0,%xmm2
andnpd %xmm3,%xmm2
andpd  %xmm1,%xmm0
orpd   %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @satur(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fcmp olt double %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load double, double* %5
br label %22
12: ; preds = %3
%13 = load double, double* %4
%14 = load double, double* %6
%15 = fcmp oge double %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load double, double* %6
br label %20
18: ; preds = %12
%19 = load double, double* %4
br label %20
20: ; preds = %18, %16
%21 = phi double [ %17, %16 ], [ %19, %18 ]
br label %22
22: ; preds = %20, %10
%23 = phi double [ %11, %10 ], [ %21, %20 ]
ret double %23
}

LLVM IR (-O2):
define double @satur(double %0, double %1, double %2) {
%4 = fcmp olt double %0, %1
%5 = fcmp oge double %0, %2
%6 = select i1 %5, double %2, double %0
%7 = select i1 %4, double %1, double %6
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ putn(int, int);
void put2(int t) { putn(2, t); }


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

x86 assembly (clang, -O2):
<put2>:
mov    %edi,%esi
mov    $0x2,%edi
jmp    1030 <putn@plt>

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

LLVM IR (-O2):
define void @put2(i32 %0) {
%2 = tail call i32 @putn(i32 2, i32 %0)
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef scalar_t__ ui32Base;

/* Variables and functions */
void PWMGenEnable(uint32_t ui32Base, uint32_t ui32Gen) {
  ;
  ;
  (*((volatile uint32_t *)(((ui32Base) + (ui32Gen)) + 0x00000000))) |=
      0x00000001;
}


x86 assembly (clang, -O0):
<PWMGenEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    $0x0,%eax
cltq
mov    (%rax),%ecx
or     $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMGenEnable>:
movslq %esi,%rax
movslq %edi,%rcx
orl    $0x1,(%rax,%rcx,1)
ret

LLVM IR (-O0):
define void @PWMGenEnable(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
%7 = add nsw i32 %5, %6
%8 = add nsw i32 %7, 0
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
%11 = load volatile i32, i32* %10
%12 = or i32 %11, 1
store volatile i32 %12, i32* %10
ret void
}

LLVM IR (-O2):
define void @PWMGenEnable(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = or i32 %6, 1
store volatile i32 %7, i32* %5
ret void
}
/* Variables and functions */
int is32bits(void) { return (sizeof(long) == 4); }


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

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

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

LLVM IR (-O2):
define i32 @is32bits() {
ret i32 0
}
long __ocl_hadd_long(long src1, long src2) {
  long carry = (src1 & 1) & (src2 & 1);
  return (src1 >> 1) + (src2 >> 1) + carry;
}


x86 assembly (clang, -O0):
<__ocl_hadd_long>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
and    $0x1,%rax
mov    -0x10(%rbp),%rcx
and    $0x1,%rcx
and    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x1,%rax
mov    -0x10(%rbp),%rcx
sar    $0x1,%rcx
add    %rcx,%rax
add    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ocl_hadd_long>:
mov    %edi,%eax
and    %esi,%eax
and    $0x1,%eax
sar    %rdi
sar    %rsi
add    %rsi,%rax
add    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @__ocl_hadd_long(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = and i64 %6, 1
%8 = load i64, i64* %4
%9 = and i64 %8, 1
%10 = and i64 %7, %9
store i64 %10, i64* %5
%11 = load i64, i64* %3
%12 = ashr i64 %11, 1
%13 = load i64, i64* %4
%14 = ashr i64 %13, 1
%15 = add nsw i64 %12, %14
%16 = load i64, i64* %5
%17 = add nsw i64 %15, %16
ret i64 %17
}

LLVM IR (-O2):
define i64 @__ocl_hadd_long(i64 %0, i64 %1) {
%3 = and i64 %0, 1
%4 = and i64 %3, %1
%5 = ashr i64 %0, 1
%6 = ashr i64 %1, 1
%7 = add nsw i64 %6, %5
%8 = add nsw i64 %7, %4
ret i64 %8
}
char _Locale_mon_thousands_sep(struct _Locale_monetary *__DUMMY_PAR) {
  return ',';
}


x86 assembly (clang, -O0):
<_Locale_mon_thousands_sep>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x2c,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Locale_mon_thousands_sep>:
mov    $0x2c,%al
ret

LLVM IR (-O0):
%struct._Locale_monetary = type opaque
define signext i8 @_Locale_mon_thousands_sep(%struct._Locale_monetary* %0) {
%2 = alloca %struct._Locale_monetary*
store %struct._Locale_monetary* %0, %struct._Locale_monetary** %2
ret i8 44
}

LLVM IR (-O2):
%struct._Locale_monetary = type opaque
define signext i8 @_Locale_mon_thousands_sep(%struct._Locale_monetary* nocapture readnone %0) {
ret i8 44
}
int fac(int n) {
  if (n < 0)
    return 0;
  else if (n == 0 || n == 1)
    return 1;
  else
    return fac(n - 1) + fac(n - 2);
}


x86 assembly (clang, -O0):
<fac>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1131 <fac+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1174 <fac+0x64>
cmpl   $0x0,-0x8(%rbp)
je     1145 <fac+0x35>
cmpl   $0x1,-0x8(%rbp)
jne    1151 <fac+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1174 <fac+0x64>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fac@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fac@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fac>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
js     1147 <fac+0x37>
mov    %edi,%ebx
mov    $0x1,%ebp
cmp    $0x2,%edi
jb     1149 <fac+0x39>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
lea    -0x1(%rbx),%edi
call   1030 <fac@plt>
add    $0xfffffffe,%ebx
add    %eax,%ebp
cmp    $0x1,%ebx
ja     1130 <fac+0x20>
add    $0x1,%ebp
jmp    1149 <fac+0x39>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fac(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 2
br i1 %4, label %15, label %5
5: ; preds = %3, %5
%6 = phi i32 [ %11, %5 ], [ 0, %3 ]
%7 = phi i32 [ %10, %5 ], [ %0, %3 ]
%8 = add nsw i32 %7, -1
%9 = tail call i32 @fac(i32 %8)
%10 = add nsw i32 %7, -2
%11 = add nsw i32 %9, %6
%12 = icmp ult i32 %10, 2
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = add i32 %11, 1
br label %15
15: ; preds = %3, %13, %1
%16 = phi i32 [ 0, %1 ], [ %14, %13 ], [ 1, %3 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ send_cmd(int /*<<< orphan*/, int);
void SelectShiftDR() {
  send_cmd(0, 1);
  send_cmd(0, 0);
  send_cmd(0, 0);
}


x86 assembly (clang, -O0):
<SelectShiftDR>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <send_cmd@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1030 <send_cmd@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1030 <send_cmd@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SelectShiftDR>:
push   %rax
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <send_cmd@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1030 <send_cmd@plt>
xor    %edi,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <send_cmd@plt>

LLVM IR (-O0):
define void @SelectShiftDR() {
%1 = call i32 @send_cmd(i32 0, i32 1)
%2 = call i32 @send_cmd(i32 0, i32 0)
%3 = call i32 @send_cmd(i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @SelectShiftDR() {
%1 = tail call i32 @send_cmd(i32 0, i32 1)
%2 = tail call i32 @send_cmd(i32 0, i32 0)
%3 = tail call i32 @send_cmd(i32 0, i32 0)
ret void
}
int is_utf_special_byte(unsigned char c) {
  unsigned special_byte = 0X02;
  if (c >> 6 == special_byte)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<is_utf_special_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movl   $0x2,-0xc(%rbp)
movzbl -0x5(%rbp),%eax
sar    $0x6,%eax
cmp    -0xc(%rbp),%eax
jne    112d <is_utf_special_byte+0x2d>
movl   $0x1,-0x4(%rbp)
jmp    1134 <is_utf_special_byte+0x34>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_utf_special_byte>:
and    $0xc0,%dil
xor    %eax,%eax
cmp    $0x80,%dil
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_utf_special_byte(i8 zeroext %0) {
%2 = and i8 %0, -64
%3 = icmp eq i8 %2, -128
%4 = zext i1 %3 to i32
ret i32 %4
}
printt(t, str) int t;
char *str;
{ printf("bool test on value %d %s\n", t, str); }


x86 assembly (clang, -O0):
<printt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printt>:
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xee4(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"bool test on value %d %s\0A\00"
define i32 @printt(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
%6 = load i32, i32* %4
%7 = load i8*, i8** %5
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %6, i8* %7)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
@.str = [26 x i8] c"bool test on value %d %s\0A\00"
define i32 @printt(i32 %0, i8* %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
ret i32 undef
}
void test_one(int x) {
#pragma omp target
#pragma omp teams distribute parallel for
  for (int i = 0; i < x; i++)
    ;
}


x86 assembly (clang, -O0):
<test_one>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    112d <test_one+0x2d>
jmp    111f <test_one+0x1f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <test_one+0xe>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_one(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ new_int(int);
int pop_int();
int /*<<< orphan*/ push(int /*<<< orphan*/);
void builtin_sub() {
  int b = pop_int();
  int a = pop_int();
  push(new_int(a - b));
}


x86 assembly (clang, -O0):
<builtin_sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <pop_int@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <pop_int@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
sub    -0x4(%rbp),%edi
call   1040 <new_int@plt>
mov    %eax,%edi
call   1050 <push@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<builtin_sub>:
push   %rbx
xor    %eax,%eax
call   1030 <pop_int@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <pop_int@plt>
sub    %ebx,%eax
mov    %eax,%edi
call   1040 <new_int@plt>
mov    %eax,%edi
pop    %rbx
jmp    1050 <push@plt>

LLVM IR (-O0):
define void @builtin_sub() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @pop_int()
store i32 %3, i32* %1
%4 = call i32 (...) @pop_int()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = load i32, i32* %1
%7 = sub nsw i32 %5, %6
%8 = call i32 @new_int(i32 %7)
%9 = call i32 @push(i32 %8)
ret void
}

LLVM IR (-O2):
define void @builtin_sub() {
%1 = tail call i32 (...) @pop_int()
%2 = tail call i32 (...) @pop_int()
%3 = sub nsw i32 %2, %1
%4 = tail call i32 @new_int(i32 %3)
%5 = tail call i32 @push(i32 %4)
ret void
}
/* Variables and functions */
scalar_t__ __VERIFIER_nondet_int();
void *my_malloc(int size) {
  static void *guard_malloc_counter;
  ++guard_malloc_counter;
  return (__VERIFIER_nondet_int()) ? guard_malloc_counter : ((void *)0);
}


x86 assembly (clang, -O0):
<my_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2f0e(%rip),%rax
add    $0x1,%rax
mov    %rax,0x2f03(%rip)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%rax
je     114e <my_malloc+0x3e>
mov    0x2eeb(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1159 <my_malloc+0x49>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    1159 <my_malloc+0x49>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_malloc>:
push   %rax
addq   $0x1,0x2f17(%rip)
01
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %rax,%rax
je     112c <my_malloc+0x1c>
mov    0x2f04(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
@my_malloc.guard_malloc_counter = internal global i8* null
define i8* @my_malloc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i8*, i8** @my_malloc.guard_malloc_counter
%4 = getelementptr inbounds i8, i8* %3, i32 1
store i8* %4, i8** @my_malloc.guard_malloc_counter
%5 = call i64 (...) @__VERIFIER_nondet_int()
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i8*, i8** @my_malloc.guard_malloc_counter
br label %10
9: ; preds = %1
br label %10
10: ; preds = %9, %7
%11 = phi i8* [ %8, %7 ], [ null, %9 ]
ret i8* %11
}

LLVM IR (-O2):
@my_malloc.guard_malloc_counter = internal unnamed_addr global i8* null
define i8* @my_malloc(i32 %0) {
%2 = load i8*, i8** @my_malloc.guard_malloc_counter
%3 = getelementptr inbounds i8, i8* %2, i64 1
store i8* %3, i8** @my_malloc.guard_malloc_counter
%4 = tail call i64 (...) @__VERIFIER_nondet_int()
%5 = icmp eq i64 %4, 0
%6 = load i8*, i8** @my_malloc.guard_malloc_counter
%7 = select i1 %5, i8* null, i8* %6
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void *memset(void *, int, unsigned int);
int /*<<< orphan*/ printf(char *, void *, void *);
void checked_memset(void *s, int c, unsigned n) {
  void *ret = memset(s, c, n);
  if (ret != s) {
    printf("Wrong memset return value: %p != %p\n", ret, s);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<checked_memset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <memset@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
je     1181 <checked_memset+0x51>
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%rdx
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checked_memset>:
push   %rbx
mov    %rdi,%rbx
call   1040 <memset@plt>
cmp    %rbx,%rax
jne    1140 <checked_memset+0x10>
pop    %rbx
ret
lea    0xeb9(%rip),%rdi
mov    %rax,%rsi
mov    %rbx,%rdx
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"Wrong memset return value: %p != %p\0A\00"
define void @checked_memset(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i8* @memset(i8* %8, i32 %9, i32 %10)
store i8* %11, i8** %7
%12 = load i8*, i8** %7
%13 = load i8*, i8** %4
%14 = icmp ne i8* %12, %13
br i1 %14, label %15, label %20
15: ; preds = %3
%16 = load i8*, i8** %7
%17 = load i8*, i8** %4
%18 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %16, i8* %17)
%19 = call i32 @exit(i32 1)
unreachable
20: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"Wrong memset return value: %p != %p\0A\00"
define void @checked_memset(i8* %0, i32 %1, i32 %2) {
%4 = tail call i8* @memset(i8* %0, i32 %1, i32 %2)
%5 = icmp eq i8* %4, %0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %0)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ syskill(int, int);
int /*<<< orphan*/ syssleep(int);
void helper() {
  syssleep(10);
  syskill(1, 20);
  syskill(1, 18);
}


x86 assembly (clang, -O0):
<helper>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1030 <syssleep@plt>
mov    $0x1,%edi
mov    $0x14,%esi
call   1040 <syskill@plt>
mov    $0x1,%edi
mov    $0x12,%esi
call   1040 <syskill@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<helper>:
push   %rax
mov    $0xa,%edi
call   1030 <syssleep@plt>
mov    $0x1,%edi
mov    $0x14,%esi
call   1040 <syskill@plt>
mov    $0x1,%edi
mov    $0x12,%esi
pop    %rax
jmp    1040 <syskill@plt>

LLVM IR (-O0):
define void @helper() {
%1 = call i32 @syssleep(i32 10)
%2 = call i32 @syskill(i32 1, i32 20)
%3 = call i32 @syskill(i32 1, i32 18)
ret void
}

LLVM IR (-O2):
define void @helper() {
%1 = tail call i32 @syssleep(i32 10)
%2 = tail call i32 @syskill(i32 1, i32 20)
%3 = tail call i32 @syskill(i32 1, i32 18)
ret void
}
void __DELETE_java_nio_ByteBuffer(void *me, void *client_data) {}


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

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

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

LLVM IR (-O2):
define void @__DELETE_java_nio_ByteBuffer(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cleanup();
void handle_sigint(int dummy) { cleanup(); }


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

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

LLVM IR (-O0):
define void @handle_sigint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @cleanup()
ret void
}

LLVM IR (-O2):
define void @handle_sigint(i32 %0) {
%2 = tail call i32 (...) @cleanup()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello World!\n");
  return 0x1234;
}


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>
mov    $0x1234,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1234,%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 4660
}

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 4660
}
int f11(long X) {
  int A[100];
  return A[X];
}


x86 assembly (clang, -O0):
<f11>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x1a0(%rbp,%rax,4),%eax
add    $0x120,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f11(i64 %0) {
%2 = alloca i64
%3 = alloca [100 x i32]
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 %4
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @f11(i64 %0) {
ret i32 undef
}
/* Variables and functions */
void *malloc(size_t);
void *ldrstdalloc(void *mem, size_t bytes) {
  (void)mem;
  return malloc(bytes);
}


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

x86 assembly (clang, -O2):
<ldrstdalloc>:
mov    %rsi,%rdi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @ldrstdalloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i8* @malloc(i64 %6)
ret i8* %7
}

LLVM IR (-O2):
define noalias i8* @ldrstdalloc(i8* nocapture readnone %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct stat {
  int /*<<< orphan*/ st_mtime;
};

/* Variables and functions */
int stat(char *, struct stat *);
time_t filedate(char *fn) {
  struct stat buf;
  if (-1 == stat(fn, &buf))
    return 0;
  return buf.st_mtime;
}


x86 assembly (clang, -O0):
<filedate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ecx,%eax
jne    1144 <filedate+0x34>
movl   $0x0,-0x4(%rbp)
jmp    114a <filedate+0x3a>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filedate>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
je     1125 <filedate+0x15>
mov    (%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @filedate(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, -1
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = select i1 %5, i32 0, i32 %7
ret i32 %8
}
void testPointer(void) { (void)(1 && testPointer && 0); }


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

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

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

LLVM IR (-O2):
define void @testPointer() {
ret void
}
int trie_get_child_index(char c) {
  int ascii = c;
  int result = ascii - 97;
  return result;
}


x86 assembly (clang, -O0):
<trie_get_child_index>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x61,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<trie_get_child_index>:
lea    -0x61(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @trie_get_child_index(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
%4 = alloca i32
store i8 %0, i8* %2
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = sub nsw i32 %7, 97
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @trie_get_child_index(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -97
ret i32 %3
}
unsigned char clefiamul2(unsigned char x) {
  if (x & 0x80u) {
    x ^= 0x0eu;
  }
  return ((x << 1) | (x >> 7));
}


x86 assembly (clang, -O0):
<clefiamul2>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1126 <clefiamul2+0x26>
movzbl -0x1(%rbp),%eax
xor    $0xe,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x1,%eax
movzbl -0x1(%rbp),%ecx
sar    $0x7,%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clefiamul2>:
mov    %edi,%eax
xor    $0xe,%al
test   %dil,%dil
movzbl %al,%eax
cmovns %edi,%eax
rol    %al
ret

LLVM IR (-O0):
define zeroext i8 @clefiamul2(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 128
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %2
%9 = zext i8 %8 to i32
%10 = xor i32 %9, 14
%11 = trunc i32 %10 to i8
store i8 %11, i8* %2
br label %12
12: ; preds = %7, %1
%13 = load i8, i8* %2
%14 = zext i8 %13 to i32
%15 = shl i32 %14, 1
%16 = load i8, i8* %2
%17 = zext i8 %16 to i32
%18 = ashr i32 %17, 7
%19 = or i32 %15, %18
%20 = trunc i32 %19 to i8
ret i8 %20
}

LLVM IR (-O2):
define zeroext i8 @clefiamul2(i8 zeroext %0) {
%2 = icmp sgt i8 %0, -1
%3 = xor i8 %0, 14
%4 = select i1 %2, i8 %0, i8 %3
%5 = tail call i8 @llvm.fshl.i8(i8 %4, i8 %4, i8 1)
ret i8 %5
}
void Hal_hook_wr_sgnfrec_reca(void) {}


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

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

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

LLVM IR (-O2):
define void @Hal_hook_wr_sgnfrec_reca() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f(int, int, int, int, int, int, int, int, int, int, int, int,
                     int, int, int, int, int, int);
main() { f(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
mov    $0x6,%r9d
movl   $0x7,(%rsp)
movl   $0x8,0x8(%rsp)
movl   $0x9,0x10(%rsp)
movl   $0xa,0x18(%rsp)
movl   $0xb,0x20(%rsp)
movl   $0xc,0x28(%rsp)
movl   $0xd,0x30(%rsp)
movl   $0xe,0x38(%rsp)
movl   $0xf,0x40(%rsp)
movl   $0x10,0x48(%rsp)
movl   $0x11,0x50(%rsp)
movl   $0x12,0x58(%rsp)
call   1030 <f@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
mov    $0x6,%r9d
push   $0x12
push   $0x11
push   $0x10
push   $0xf
push   $0xe
push   $0xd
push   $0xc
push   $0xb
push   $0xa
push   $0x9
push   $0x8
push   $0x7
call   1030 <f@plt>
add    $0x60,%rsp
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @f(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18)
ret i32 0
}
int compareInts(void *p1, void *p2) {
  int i1 = *(int *)p1;
  int i2 = *(int *)p2;
  return i1 - i2;
}


x86 assembly (clang, -O0):
<compareInts>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
sub    -0x18(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @compareInts(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
store i32 %9, i32* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = sub nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @compareInts(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void usage_exit(void) {
  fputs("Usage: ./recover -d [device filename] [other arguments]\n"
        "-i                        Print boot sector information\n"
        "-l                        List all the directory entries\n"
        "-r target -o dest         File recovery with filename (auto handle "
        "8.3 name)\n",
        stdout);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage_exit>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage_exit>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [247 x i8] c"Usage: ./recover -d [device filename] [other arguments]\0A-i Print boot sector information\0A-l List all the directory entries\0A-r target -o dest File recovery with filename (auto handle 8.3 name)\0A\00"
@stdout = global i32 0
@EXIT_FAILURE = global i32 0
define void @usage_exit() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputs(i8* getelementptr inbounds ([247 x i8], [247 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@.str = [247 x i8] c"Usage: ./recover -d [device filename] [other arguments]\0A-i Print boot sector information\0A-l List all the directory entries\0A-r target -o dest File recovery with filename (auto handle 8.3 name)\0A\00"
@stdout = global i32 0
@EXIT_FAILURE = global i32 0
define void @usage_exit() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([247 x i8], [247 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
int create_sparse(const char *filename) {
  int fd = 0;
  return 0;
}


x86 assembly (clang, -O0):
<create_sparse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @create_sparse(i8* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
struct msg_buff {
  int dummy;
};

/* Variables and functions */
int nla_put(struct msg_buff *, int, scalar_t__, char const *);
scalar_t__ strlen(char const *);
int nla_put_string(struct msg_buff *msg, int attrtype, const char *str) {
  return nla_put(msg, attrtype, strlen(str) + 1, str);
}


x86 assembly (clang, -O0):
<nla_put_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    %rax,%rdx
add    $0x1,%rdx
mov    -0x18(%rbp),%rcx
call   1040 <nla_put@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nla_put_string>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %rdi,%rbp
mov    %rdx,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %rbp,%rdi
mov    %r14d,%esi
mov    %rbx,%rcx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <nla_put@plt>

LLVM IR (-O0):
%struct.msg_buff = type { i32 }
define i32 @nla_put_string(%struct.msg_buff* %0, i32 %1, i8* %2) {
%4 = alloca %struct.msg_buff*
%5 = alloca i32
%6 = alloca i8*
store %struct.msg_buff* %0, %struct.msg_buff** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load %struct.msg_buff*, %struct.msg_buff** %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = call i64 @strlen(i8* %9)
%11 = add nsw i64 %10, 1
%12 = load i8*, i8** %6
%13 = call i32 @nla_put(%struct.msg_buff* %7, i32 %8, i64 %11, i8* %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.msg_buff = type { i32 }
define i32 @nla_put_string(%struct.msg_buff* %0, i32 %1, i8* %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %2)
%5 = add nsw i64 %4, 1
%6 = tail call i32 @nla_put(%struct.msg_buff* %0, i32 %1, i64 %5, i8* %2)
ret i32 %6
}
int doo(int x) { return x + 1; }


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

x86 assembly (clang, -O2):
<doo>:
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @doo(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
int main(void) { -2.5e-10; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int putc(int ch __attribute__((unused)), FILE *stream __attribute__((unused))) {
  return 0;
}


x86 assembly (clang, -O0):
<putc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @putc(i32 %0, i32* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
void *calloc(int, size_t);
void *emdns_mem_calloc(size_t newsz) { return calloc(1, newsz); }


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

x86 assembly (clang, -O2):
<emdns_mem_calloc>:
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <calloc@plt>

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

LLVM IR (-O2):
define i8* @emdns_mem_calloc(i64 %0) {
%2 = tail call i8* @calloc(i32 1, i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_40() {
  Assert_real((isqrt(40) == 6),
              "/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/stdlib/isqrt.c",
              205, ("Integer square root of 40 should be 6"));
}


x86 assembly (clang, -O0):
<t_sqrt_40>:
push   %rbp
mov    %rsp,%rbp
mov    $0x28,%edi
call   1030 <isqrt@plt>
cmp    $0x6,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0xcd,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_40>:
push   %rax
mov    $0x28,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x6,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0xcd,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 40 should be 6\00"
define void @t_sqrt_40() {
%1 = call i32 @isqrt(i32 40)
%2 = icmp eq i32 %1, 6
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 205, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 40 should be 6\00"
define void @t_sqrt_40() {
%1 = tail call i32 @isqrt(i32 40)
%2 = icmp eq i32 %1, 6
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 205, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int XpmLibraryVersion() { return ((3 * 100 + 4) * 100 + 11); }


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

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

LLVM IR (-O0):
define i32 @XpmLibraryVersion() {
ret i32 30411
}

LLVM IR (-O2):
define i32 @XpmLibraryVersion() {
ret i32 30411
}