xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ ali1429_init();
int /*<<< orphan*/ at_init();
int /*<<< orphan*/ ide_init();
void at_ali1429_init() {
  at_init();
  ide_init();
  ali1429_init();
}


x86 assembly (clang, -O0):
<at_ali1429_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <at_init@plt>
mov    $0x0,%al
call   1050 <ide_init@plt>
mov    $0x0,%al
call   1040 <ali1429_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<at_ali1429_init>:
push   %rax
xor    %eax,%eax
call   1030 <at_init@plt>
xor    %eax,%eax
call   1050 <ide_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <ali1429_init@plt>

LLVM IR (-O0):
define void @at_ali1429_init() {
%1 = call i32 (...) @at_init()
%2 = call i32 (...) @ide_init()
%3 = call i32 (...) @ali1429_init()
ret void
}

LLVM IR (-O2):
define void @at_ali1429_init() {
%1 = tail call i32 (...) @at_init()
%2 = tail call i32 (...) @ide_init()
%3 = tail call i32 (...) @ali1429_init()
ret void
}
void lt_preloaded_symbols(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fread(unsigned char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, unsigned char,
                         int /*<<< orphan*/);
unsigned char read8(FILE *f, unsigned char offset) {
  fseek(f, offset, SEEK_SET);
  unsigned char c = 0;
  fread(&c, sizeof(unsigned char), 1, f);
  return c;
}


x86 assembly (clang, -O0):
<read8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x9(%rbp),%al
mov    0x2ea0(%rip),%rcx
mov    (%rcx),%edx
movzbl %al,%esi
call   1040 <fseek@plt>
movb   $0x0,-0xa(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0xa(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fread@plt>
movzbl -0xa(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read8>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
call   1040 <fseek@plt>
movb   $0x0,0xf(%rsp)
lea    0xf(%rsp),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
mov    0xf(%rsp),%al
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@SEEK_SET = global i32 0
define zeroext i8 @read8(i32* %0, i8 zeroext %1) {
%3 = alloca i32*
%4 = alloca i8
%5 = alloca i8
store i32* %0, i32** %3
store i8 %1, i8* %4
%6 = load i32*, i32** %3
%7 = load i8, i8* %4
%8 = load i32, i32* @SEEK_SET
%9 = call i32 @fseek(i32* %6, i8 zeroext %7, i32 %8)
store i8 0, i8* %5
%10 = load i32*, i32** %3
%11 = call i32 @fread(i8* %5, i32 1, i32 1, i32* %10)
%12 = load i8, i8* %5
ret i8 %12
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define zeroext i8 @read8(i32* nocapture %0, i8 zeroext %1) {
%3 = alloca i8
%4 = load i32, i32* @SEEK_SET
%5 = tail call i32 @fseek(i32* %0, i8 zeroext %1, i32 %4)
store i8 0, i8* %3
%6 = call i32 @fread(i8* %3, i32 1, i32 1, i32* %0)
%7 = load i8, i8* %3
ret i8 %7
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int, size_t);
void uninitvar_memset(void) {
  void *s;
  int c;
  size_t n;
  (void)memset(s, c, n);
}


x86 assembly (clang, -O0):
<uninitvar_memset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <memset@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_memset>:
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @uninitvar_memset() {
%1 = alloca i8*
%2 = alloca i32
%3 = alloca i64
%4 = load i8*, i8** %1
%5 = load i32, i32* %2
%6 = load i64, i64* %3
%7 = call i32 @memset(i8* %4, i32 %5, i64 %6)
ret void
}

LLVM IR (-O2):
define void @uninitvar_memset() {
%1 = tail call i32 @memset(i8* undef, i32 undef, i64 undef)
ret void
}
/* Variables and functions */
void *__span_alloc(size_t);
void *span_alloc(size_t size) { return __span_alloc(size); }


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

x86 assembly (clang, -O2):
<span_alloc>:
jmp    1030 <__span_alloc@plt>

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

LLVM IR (-O2):
define i8* @span_alloc(i64 %0) {
%2 = tail call i8* @__span_alloc(i64 %0)
ret i8* %2
}
extern unsigned int hweight16(unsigned short w) {
  w = (w & 0x5555) + ((w >> 1) & 0x5555);
  w = (w & 0x3333) + ((w >> 2) & 0x3333);
  w = (w & 0x0F0F) + ((w >> 4) & 0x0F0F);
  w = (w & 0x00FF) + ((w >> 8) & 0x00FF);
  return w;
}


x86 assembly (clang, -O0):
<hweight16>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
and    $0x5555,%eax
movzwl -0x2(%rbp),%ecx
sar    $0x1,%ecx
and    $0x5555,%ecx
add    %ecx,%eax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
and    $0x3333,%eax
movzwl -0x2(%rbp),%ecx
sar    $0x2,%ecx
and    $0x3333,%ecx
add    %ecx,%eax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
and    $0xf0f,%eax
movzwl -0x2(%rbp),%ecx
sar    $0x4,%ecx
and    $0xf0f,%ecx
add    %ecx,%eax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
and    $0xff,%eax
movzwl -0x2(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
add    %ecx,%eax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hweight16>:
mov    %edi,%eax
and    $0x5555,%eax
shr    %edi
and    $0x5555,%edi
add    %eax,%edi
mov    %edi,%eax
and    $0x3333,%eax
shr    $0x2,%edi
and    $0x3333,%edi
add    %eax,%edi
mov    %edi,%eax
and    $0x707,%eax
shr    $0x4,%edi
and    $0x707,%edi
add    %eax,%edi
mov    %edi,%eax
shr    $0x8,%eax
add    %edi,%eax
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @hweight16(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 21845
%6 = load i16, i16* %2
%7 = zext i16 %6 to i32
%8 = ashr i32 %7, 1
%9 = and i32 %8, 21845
%10 = add nsw i32 %5, %9
%11 = trunc i32 %10 to i16
store i16 %11, i16* %2
%12 = load i16, i16* %2
%13 = zext i16 %12 to i32
%14 = and i32 %13, 13107
%15 = load i16, i16* %2
%16 = zext i16 %15 to i32
%17 = ashr i32 %16, 2
%18 = and i32 %17, 13107
%19 = add nsw i32 %14, %18
%20 = trunc i32 %19 to i16
store i16 %20, i16* %2
%21 = load i16, i16* %2
%22 = zext i16 %21 to i32
%23 = and i32 %22, 3855
%24 = load i16, i16* %2
%25 = zext i16 %24 to i32
%26 = ashr i32 %25, 4
%27 = and i32 %26, 3855
%28 = add nsw i32 %23, %27
%29 = trunc i32 %28 to i16
store i16 %29, i16* %2
%30 = load i16, i16* %2
%31 = zext i16 %30 to i32
%32 = and i32 %31, 255
%33 = load i16, i16* %2
%34 = zext i16 %33 to i32
%35 = ashr i32 %34, 8
%36 = and i32 %35, 255
%37 = add nsw i32 %32, %36
%38 = trunc i32 %37 to i16
store i16 %38, i16* %2
%39 = load i16, i16* %2
%40 = zext i16 %39 to i32
ret i32 %40
}

LLVM IR (-O2):
define i32 @hweight16(i16 zeroext %0) {
%2 = and i16 %0, 21845
%3 = lshr i16 %0, 1
%4 = and i16 %3, 21845
%5 = add nuw i16 %4, %2
%6 = and i16 %5, 13107
%7 = lshr i16 %5, 2
%8 = and i16 %7, 13107
%9 = add nuw nsw i16 %8, %6
%10 = and i16 %9, 1799
%11 = lshr i16 %9, 4
%12 = and i16 %11, 1799
%13 = add nuw nsw i16 %12, %10
%14 = and i16 %13, 15
%15 = lshr i16 %13, 8
%16 = add nuw nsw i16 %14, %15
%17 = zext i16 %16 to i32
ret i32 %17
}
_Bool dt_valid_ywd(int y, int w, int d) {
  return ((d >= 1 && d <= 7) &&
          (w >= 1 && (w <= 52 || w == dt_weeks_in_year(y))));
}


x86 assembly (clang, -O0):
<dt_valid_ywd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x1,-0xc(%rbp)
mov    %al,-0xd(%rbp)
jl     1186 <dt_valid_ywd+0x76>
xor    %eax,%eax
cmpl   $0x7,-0xc(%rbp)
mov    %al,-0xd(%rbp)
jg     1186 <dt_valid_ywd+0x76>
xor    %eax,%eax
cmpl   $0x1,-0x8(%rbp)
mov    %al,-0xe(%rbp)
jl     1180 <dt_valid_ywd+0x70>
mov    $0x1,%al
cmpl   $0x34,-0x8(%rbp)
mov    %al,-0xf(%rbp)
jle    117a <dt_valid_ywd+0x6a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <dt_weeks_in_year@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
sete   %al
mov    %al,-0xf(%rbp)
mov    -0xf(%rbp),%al
mov    %al,-0xe(%rbp)
mov    -0xe(%rbp),%al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dt_valid_ywd>:
push   %rbx
xor    %eax,%eax
test   %esi,%esi
jle    1134 <dt_valid_ywd+0x24>
add    $0xffffffff,%edx
cmp    $0x6,%edx
ja     1134 <dt_valid_ywd+0x24>
mov    %esi,%ebx
mov    $0x1,%al
cmp    $0x35,%esi
jb     1134 <dt_valid_ywd+0x24>
xor    %eax,%eax
call   1030 <dt_weeks_in_year@plt>
cmp    %ebx,%eax
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i1 @dt_valid_ywd(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = icmp sge i32 %7, 1
br i1 %8, label %9, label %27
9: ; preds = %3
%10 = load i32, i32* %6
%11 = icmp sle i32 %10, 7
br i1 %11, label %12, label %27
12: ; preds = %9
%13 = load i32, i32* %5
%14 = icmp sge i32 %13, 1
br i1 %14, label %15, label %25
15: ; preds = %12
%16 = load i32, i32* %5
%17 = icmp sle i32 %16, 52
br i1 %17, label %23, label %18
18: ; preds = %15
%19 = load i32, i32* %5
%20 = load i32, i32* %4
%21 = call i32 (i32, ...) bitcast (i32 (...)* @dt_weeks_in_year to i32 (i32, ...)*)(i32 %20)
%22 = icmp eq i32 %19, %21
br label %23
23: ; preds = %18, %15
%24 = phi i1 [ true, %15 ], [ %22, %18 ]
br label %25
25: ; preds = %23, %12
%26 = phi i1 [ false, %12 ], [ %24, %23 ]
br label %27
27: ; preds = %25, %9, %3
%28 = phi i1 [ false, %9 ], [ false, %3 ], [ %26, %25 ]
ret i1 %28
}

LLVM IR (-O2):
define zeroext i1 @dt_valid_ywd(i32 %0, i32 %1, i32 %2) {
%4 = add i32 %2, -1
%5 = icmp ult i32 %4, 7
%6 = icmp sgt i32 %1, 0
%7 = and i1 %6, %5
br i1 %7, label %8, label %13
8: ; preds = %3
%9 = icmp ult i32 %1, 53
br i1 %9, label %13, label %10
10: ; preds = %8
%11 = tail call i32 (i32, ...) bitcast (i32 (...)* @dt_weeks_in_year to i32 (i32, ...)*)(i32 %0)
%12 = icmp eq i32 %11, %1
br label %13
13: ; preds = %10, %8, %3
%14 = phi i1 [ false, %3 ], [ true, %8 ], [ %12, %10 ]
ret i1 %14
}
const char *skipspaces(const char *x) {
  if (x)
    while (*x == ' ' || *x == '\t')
      x++;
  return x;
}


x86 assembly (clang, -O0):
<skipspaces>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1163 <skipspaces+0x63>
jmp    1118 <skipspaces+0x18>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x9(%rbp)
je     113d <skipspaces+0x3d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    114d <skipspaces+0x4d>
jmp    115e <skipspaces+0x5e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1118 <skipspaces+0x18>
jmp    1163 <skipspaces+0x63>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipspaces>:
test   %rdi,%rdi
je     1122 <skipspaces+0x22>
mov    %rdi,%rax
jmp    1114 <skipspaces+0x14>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rax
movzbl (%rax),%ecx
cmp    $0x20,%cl
je     1110 <skipspaces+0x10>
cmp    $0x9,%cl
je     1110 <skipspaces+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @skipspaces(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 %22
5: ; preds = %1
br label %6
6: ; preds = %18, %5
%7 = load i8*, i8** %2
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 32
br i1 %10, label %16, label %11
11: ; preds = %6
%12 = load i8*, i8** %2
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 9
br label %16
16: ; preds = %11, %6
%17 = phi i1 [ true, %6 ], [ %15, %11 ]
br i1 %17, label %18, label %21
18: ; preds = %16
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %2
br label %6
21: ; preds = %16
br label %22
22: ; preds = %21, %1
%23 = load i8*, i8** %2
ret i8* %23
}

LLVM IR (-O2):
define i8* @skipspaces(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1, %6
%4 = phi i8* [ %7, %6 ], [ %0, %1 ]
%5 = load i8, i8* %4
switch i8 %5, label %8 [
i8 32, label %6
i8 9, label %6
]
6: ; preds = %3, %3
%7 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
8: ; preds = %3, %1
%9 = phi i8* [ null, %1 ], [ %4, %3 ]
ret i8* %9
}
void func2(int *ptr1, int *ptr2) {
  if (ptr1 || ptr2) {
    *ptr2 = 400;
    return;
  } else {
    *ptr1 = 100;
  }
  *ptr1 = 200;
  *ptr2 = 300;
}


x86 assembly (clang, -O0):
<func2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1122 <func2+0x22>
cmpq   $0x0,-0x10(%rbp)
je     1131 <func2+0x31>
mov    -0x10(%rbp),%rax
movl   $0x190,(%rax)
jmp    114f <func2+0x4f>
mov    -0x8(%rbp),%rax
movl   $0x64,(%rax)
mov    -0x8(%rbp),%rax
movl   $0xc8,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x12c,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<func2>:
movl   $0x190,(%rsi)
ret

LLVM IR (-O0):
define void @func2(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 = icmp ne i32* %5, null
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32*, i32** %4
%9 = icmp ne i32* %8, null
br i1 %9, label %10, label %12
10: ; preds = %7, %2
%11 = load i32*, i32** %4
store i32 400, i32* %11
br label %17
12: ; preds = %7
%13 = load i32*, i32** %3
store i32 100, i32* %13
br label %14
14: ; preds = %12
%15 = load i32*, i32** %3
store i32 200, i32* %15
%16 = load i32*, i32** %4
store i32 300, i32* %16
br label %17
17: ; preds = %14, %10
ret void
}

LLVM IR (-O2):
define void @func2(i32* readnone %0, i32* writeonly %1) {
%3 = icmp ne i32* %0, null
%4 = icmp ne i32* %1, null
%5 = or i1 %3, %4
tail call void @llvm.assume(i1 %5)
store i32 400, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ICPrintLastIndexByLength(int);
int /*<<< orphan*/ ICPrintLengthByLastIndex(int);
int main(int argc, const char *argv[]) {
  ICPrintLastIndexByLength(24);
  ICPrintLengthByLastIndex(3);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x18,%edi
call   1030 <ICPrintLastIndexByLength@plt>
mov    $0x3,%edi
call   1040 <ICPrintLengthByLastIndex@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x18,%edi
call   1030 <ICPrintLastIndexByLength@plt>
mov    $0x3,%edi
call   1040 <ICPrintLengthByLastIndex@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @ICPrintLastIndexByLength(i32 24)
%6 = call i32 @ICPrintLengthByLastIndex(i32 3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @ICPrintLastIndexByLength(i32 24)
%4 = tail call i32 @ICPrintLengthByLastIndex(i32 3)
ret i32 0
}
int test_imm_3Euint32_reg(unsigned int val) {
  return ((val) & (0x3E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_3Euint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x3e,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_3Euint32_reg>:
test   $0x3e,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_3Euint32_reg(i32 %0) {
%2 = and i32 %0, 62
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
scalar_t__ malloc(int);
int strlen(char *);
char *strcopy(char *ch) {
  int leng = strlen(ch);
  char *t = (char *)malloc(leng + 1);
  char *rp = t;
  while ((*t++ = *ch++) != '\0')
    ;
  return rp;
}


x86 assembly (clang, -O0):
<strcopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     1182 <strcopy+0x62>
jmp    114f <strcopy+0x2f>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcopy>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
lea    0x1(%rax),%edi
call   1040 <malloc@plt>
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rbx,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1140 <strcopy+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @strcopy(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
br label %6
6: ; preds = %6, %1
%7 = phi i8* [ %5, %1 ], [ %11, %6 ]
%8 = phi i8* [ %0, %1 ], [ %9, %6 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %8
%11 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %10, i8* %7
%12 = icmp eq i8 %10, 0
br i1 %12, label %13, label %6
13: ; preds = %6
ret i8* %5
}
/* Variables and functions */
unsigned int __builtin_nyuzi_read_control_reg(int);
unsigned int getCycleCount() { return __builtin_nyuzi_read_control_reg(6); }


x86 assembly (clang, -O0):
<getCycleCount>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
call   1030 <__builtin_nyuzi_read_control_reg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCycleCount>:
mov    $0x6,%edi
jmp    1030 <__builtin_nyuzi_read_control_reg@plt>

LLVM IR (-O0):
define i32 @getCycleCount() {
%1 = call i32 @__builtin_nyuzi_read_control_reg(i32 6)
ret i32 %1
}

LLVM IR (-O2):
define i32 @getCycleCount() {
%1 = tail call i32 @__builtin_nyuzi_read_control_reg(i32 6)
ret i32 %1
}
/* Variables and functions */
int write(int, unsigned char *, int);
int ehnlc_putchar(int c) { return write(1, (unsigned char *)&c, 1); }


x86 assembly (clang, -O0):
<ehnlc_putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rsi
mov    $0x1,%edx
mov    %edx,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ehnlc_putchar>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ehnlc_putchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = bitcast i32* %2 to i8*
%4 = call i32 @write(i32 1, i8* %3, i32 1)
ret i32 %4
}

LLVM IR (-O2):
define i32 @ehnlc_putchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = bitcast i32* %2 to i8*
%4 = call i32 @write(i32 1, i8* %3, i32 1)
ret i32 %4
}
void g_scanner_scope_remove_symbol() {}


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

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

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

LLVM IR (-O2):
define void @g_scanner_scope_remove_symbol() {
ret void
}
ISR(ADC_vect) {
  DEBUG("ISR "
        "ADC"
        " occured");
}


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

x86 assembly (clang, -O2):
<ISR>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <DEBUG@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"ISR ADC occured\00"
define i32 @ISR(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
@.str = [16 x i8] c"ISR ADC occured\00"
define i32 @ISR(i32 %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x11() {
  Assert_real((isspace(17) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isspace.c",
              90, ("isspace should be 0 for 0x11"));
}


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

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

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x11\00"
define void @t_isspace_0x11() {
%1 = call i64 @isspace(i32 17)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 90, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x11\00"
define void @t_isspace_0x11() {
%1 = tail call i64 @isspace(i32 17)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 90, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
unsigned int _check_times(unsigned x, unsigned y) {
  unsigned long long whole_ans =
      ((unsigned long long)x) * ((unsigned long long)y);
  unsigned word_ans = (unsigned)whole_ans;
  if (word_ans < whole_ans || word_ans > (1 << 28))
    (_throw_badalloc_fn("/scratch/repos/new/home/jordi_armengol_estape/"
                        "c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/"
                        "cyclone/refs/heads/master/bin/genfiles/position.c",
                        284));
  return word_ans;
}


x86 assembly (clang, -O0):
<_check_times>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%rax
jb     114d <_check_times+0x3d>
cmpl   $0x10000000,-0x14(%rbp)
jbe    1160 <_check_times+0x50>
lea    0xeac(%rip),%rdi
mov    $0x11c,%esi
mov    $0x0,%al
call   1030 <_throw_badalloc_fn@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_check_times>:
push   %rbx
mov    %edi,%eax
mul    %esi
mov    %eax,%ebx
jo     1121 <_check_times+0x11>
cmp    $0x10000001,%ebx
jb     1134 <_check_times+0x24>
lea    0xed8(%rip),%rdi
mov    $0x11c,%esi
xor    %eax,%eax
call   1030 <_throw_badalloc_fn@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [149 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/position.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = load i32, i32* %4
%10 = zext i32 %9 to i64
%11 = mul i64 %8, %10
store i64 %11, i64* %5
%12 = load i64, i64* %5
%13 = trunc i64 %12 to i32
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = zext i32 %14 to i64
%16 = load i64, i64* %5
%17 = icmp ult i64 %15, %16
br i1 %17, label %21, label %18
18: ; preds = %2
%19 = load i32, i32* %6
%20 = icmp ugt i32 %19, 268435456
br i1 %20, label %21, label %23
21: ; preds = %18, %2
%22 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str, i64 0, i64 0), i32 284)
br label %23
23: ; preds = %21, %18
%24 = load i32, i32* %6
ret i32 %24
}

LLVM IR (-O2):
@.str = [149 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/position.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = tail call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %0, i32 %1)
%4 = extractvalue { i32, i1 } %3, 0
%5 = extractvalue { i32, i1 } %3, 1
%6 = icmp ugt i32 %4, 268435456
%7 = or i1 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str, i64 0, i64 0), i32 284)
br label %10
10: ; preds = %2, %8
ret i32 %4
}
/* Variables and functions */
scalar_t__ system(char *);
int os_check_compiler() {
  if (system("test -f /usr/bin/gcc") == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<os_check_compiler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <system@plt>
cmp    $0x0,%rax
jne    113a <os_check_compiler+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <os_check_compiler+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_check_compiler>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <system@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"test -f /usr/bin/gcc\00"
define i32 @os_check_compiler() {
%1 = alloca i32
%2 = call i64 @system(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 1, i32* %1
br label %6
5: ; preds = %0
store i32 0, i32* %1
br label %6
6: ; preds = %5, %4
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
@.str = [21 x i8] c"test -f /usr/bin/gcc\00"
define i32 @os_check_compiler() {
%1 = tail call i64 @system(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;
typedef int /*<<< orphan*/ __u64;

/* Variables and functions */
scalar_t__ read_file(char *, char *, int);
int /*<<< orphan*/ strtoul(char *, int /*<<< orphan*/ *, int);
__u64 get_hsa_size(void) {
  char buf[128];
  if (read_file("/sys/kernel/debug/zcore/hsa", buf, sizeof(buf)))
    return 0;
  return strtoul(buf, NULL, 16);
}


x86 assembly (clang, -O0):
<get_hsa_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
lea    -0x90(%rbp),%rsi
lea    0xec7(%rip),%rdi
mov    $0x80,%edx
call   1030 <read_file@plt>
cmp    $0x0,%rax
je     1159 <get_hsa_size+0x39>
movl   $0x0,-0x4(%rbp)
jmp    1171 <get_hsa_size+0x51>
lea    -0x90(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x10,%edx
call   1040 <strtoul@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_hsa_size>:
sub    $0x88,%rsp
lea    0xed2(%rip),%rdi
mov    %rsp,%rsi
mov    $0x80,%edx
call   1030 <read_file@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     114d <get_hsa_size+0x2d>
add    $0x88,%rsp
ret
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <strtoul@plt>
add    $0x88,%rsp
ret

LLVM IR (-O0):
@.str = [28 x i8] c"/sys/kernel/debug/zcore/hsa\00"
define i32 @get_hsa_size() {
%1 = alloca i32
%2 = alloca [128 x i8]
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%4 = call i64 @read_file(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %3, i32 128)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 0, i32* %1
br label %10
7: ; preds = %0
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%9 = call i32 @strtoul(i8* %8, i32* null, i32 16)
store i32 %9, i32* %1
br label %10
10: ; preds = %7, %6
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@.str = [28 x i8] c"/sys/kernel/debug/zcore/hsa\00"
define i32 @get_hsa_size() {
%1 = alloca [128 x i8]
%2 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%3 = call i64 @read_file(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %2, i32 128)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @strtoul(i8* nocapture %2, i32* null, i32 16)
br label %7
7: ; preds = %0, %5
%8 = phi i32 [ %6, %5 ], [ 0, %0 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ write_string(char *);
void intro() {
  write_string("Todo-List manager v0.1a\n");
  write_string("Currently, data are not saved when quit.\n");
  write_string("It will be implemented at v0.2\n");
}


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

x86 assembly (clang, -O2):
<intro>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <write_string@plt>
lea    0xef5(%rip),%rdi
call   1030 <write_string@plt>
lea    0xf13(%rip),%rdi
pop    %rax
jmp    1030 <write_string@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Todo-List manager v0.1a\0A\00"
@.str.1 = [42 x i8] c"Currently, data are not saved when quit.\0A\00"
@.str.2 = [32 x i8] c"It will be implemented at v0.2\0A\00"
define void @intro() {
%1 = call i32 @write_string(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @write_string(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @write_string(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"Todo-List manager v0.1a\0A\00"
@.str.1 = [42 x i8] c"Currently, data are not saved when quit.\0A\00"
@.str.2 = [32 x i8] c"It will be implemented at v0.2\0A\00"
define void @intro() {
%1 = tail call i32 @write_string(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @write_string(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @write_string(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
ret void
}
void d2i_ASN1_UTCTIME(void) {}


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

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

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

LLVM IR (-O2):
define void @d2i_ASN1_UTCTIME() {
ret void
}
/* Type definitions */
typedef char *u_long;

/* Variables and functions */
u_long getesp() { __asm__("movl %esp,%eax"); }


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

x86 assembly (clang, -O2):
<getesp>:
mov    %esp,%eax
ret

LLVM IR (-O0):
define i8* @getesp() {
%1 = alloca i8*
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
define i8* @getesp() {
tail call void asm sideeffect "movl %esp,%eax", "~{dirflag},~{fpsr},~{flags}"()
ret i8* undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void peri_write(volatile uint32_t *paddr, uint32_t value) {
  *paddr = value;
  *paddr = value;
}


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

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

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

LLVM IR (-O2):
define void @peri_write(i32* %0, i32 %1) {
store volatile i32 %1, i32* %0
store volatile i32 %1, i32* %0
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t ntohb3(const uint8_t *network3) {
  return (uint32_t)network3[0] << 16 | (uint32_t)network3[1] << 8 | network3[2];
}


x86 assembly (clang, -O0):
<ntohb3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x10,%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
or     0x8(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ntohb3>:
mov    (%rdi),%ecx
mov    0x4(%rdi),%eax
shl    $0x10,%ecx
shl    $0x8,%eax
or     %ecx,%eax
or     0x8(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @ntohb3(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = shl i32 %5, 16
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = shl i32 %9, 8
%11 = or i32 %6, %10
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 2
%14 = load i32, i32* %13
%15 = or i32 %11, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @ntohb3(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 16
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = shl i32 %5, 8
%7 = or i32 %6, %3
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = or i32 %7, %9
ret i32 %10
}
/* Type definitions */
struct timeval {
  double tv_sec;
  int tv_usec;
};

/* Variables and functions */
double time_delta(struct timeval *stop, struct timeval *start) {
  return (stop->tv_sec - start->tv_sec) +
         1e-6 * (stop->tv_usec - start->tv_usec);
}


x86 assembly (clang, -O0):
<time_delta>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
subsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
mov    -0x10(%rbp),%rcx
sub    0x8(%rcx),%eax
cvtsi2sd %eax,%xmm0
movsd  0xeca(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_delta>:
movsd  (%rdi),%xmm1
subsd  (%rsi),%xmm1
mov    0x8(%rdi),%eax
sub    0x8(%rsi),%eax
cvtsi2sd %eax,%xmm0
mulsd  0xee6(%rip),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
%struct.timeval = type { double, i32 }
define double @time_delta(%struct.timeval* %0, %struct.timeval* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timeval* %1, %struct.timeval** %4
%5 = load %struct.timeval*, %struct.timeval** %3
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%7 = load double, double* %6
%8 = load %struct.timeval*, %struct.timeval** %4
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %8, i32 0, i32 0
%10 = load double, double* %9
%11 = fsub double %7, %10
%12 = load %struct.timeval*, %struct.timeval** %3
%13 = getelementptr inbounds %struct.timeval, %struct.timeval* %12, i32 0, i32 1
%14 = load i32, i32* %13
%15 = load %struct.timeval*, %struct.timeval** %4
%16 = getelementptr inbounds %struct.timeval, %struct.timeval* %15, i32 0, i32 1
%17 = load i32, i32* %16
%18 = sub nsw i32 %14, %17
%19 = sitofp i32 %18 to double
%20 = call double @llvm.fmuladd.f64(double 0x3EB0C6F7A0B5ED8D, double %19, double %11)
ret double %20
}

LLVM IR (-O2):
%struct.timeval = type { double, i32 }
define double @time_delta(%struct.timeval* nocapture %0, %struct.timeval* nocapture %1) {
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%4 = load double, double* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%6 = load double, double* %5
%7 = fsub double %4, %6
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%9 = load i32, i32* %8
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%11 = load i32, i32* %10
%12 = sub nsw i32 %9, %11
%13 = sitofp i32 %12 to double
%14 = tail call double @llvm.fmuladd.f64(double %13, double 0x3EB0C6F7A0B5ED8D, double %7)
ret double %14
}
void RGB565ToUVRow_C() {}


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

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

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

LLVM IR (-O2):
define void @RGB565ToUVRow_C() {
ret void
}
int test_imm_7Aint16_reg(short val) {
  return ((val) & (-0x7A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_7Aint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffff86,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_7Aint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -122
%6 = icmp ne i32 %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_7Aint16_reg(i16 signext %0) {
%2 = and i16 %0, -122
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void bert(int arg) { printf("Bert says hi and has %d friends\n", arg); }


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

x86 assembly (clang, -O2):
<bert>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"Bert says hi and has %d friends\0A\00"
define void @bert(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"Bert says hi and has %d friends\0A\00"
define void @bert(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int test();
int main() { return -test(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test()
%2 = sub nsw i32 0, %1
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fileno(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
int isatty(int /*<<< orphan*/);
void txtattr(FILE *f, int attr) {
  if (isatty(fileno(f)) == 1)
    fprintf(f, "\033[%dm", attr);
}


x86 assembly (clang, -O0):
<txtattr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <fileno@plt>
mov    %eax,%edi
call   1030 <isatty@plt>
cmp    $0x1,%eax
jne    116b <txtattr+0x3b>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xe9a(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<txtattr>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1050 <fileno@plt>
mov    %eax,%edi
call   1030 <isatty@plt>
cmp    $0x1,%eax
jne    1160 <txtattr+0x30>
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <fprintf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"\1B[%dm\00"
define void @txtattr(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 = call i32 @fileno(i32* %5)
%7 = call i32 @isatty(i32 %6)
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32*, i32** %3
%11 = load i32, i32* %4
%12 = call i32 @fprintf(i32* %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[%dm\00"
define void @txtattr(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @fileno(i32* %0)
%4 = tail call i32 @isatty(i32 %3)
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1)
br label %8
8: ; preds = %6, %2
ret void
}
/* Variables and functions */
int rand();
int RandomInt() { return rand(); }


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

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

LLVM IR (-O0):
define i32 @RandomInt() {
%1 = call i32 (...) @rand()
ret i32 %1
}

LLVM IR (-O2):
define i32 @RandomInt() {
%1 = tail call i32 (...) @rand()
ret i32 %1
}
int xxx() {
  int *a = &(int){1};
  struct s {
    int a, b, c;
  } *b = &(struct s){1, 2, 3};
  _Complex double *x = &(_Complex double){1.0f};
}


x86 assembly (clang, -O0):
<xxx>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x14(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x1,-0x30(%rbp)
movl   $0x2,-0x2c(%rbp)
movl   $0x3,-0x28(%rbp)
lea    -0x30(%rbp),%rax
mov    %rax,-0x20(%rbp)
movsd  0xec8(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
lea    -0x48(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.s = type { i32, i32, i32 }
define i32 @xxx() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
%4 = alloca %struct.s*
%5 = alloca %struct.s
%6 = alloca { double, double }*
%7 = alloca { double, double }
store i32 1, i32* %3
store i32* %3, i32** %2
%8 = getelementptr inbounds %struct.s, %struct.s* %5, i32 0, i32 0
store i32 1, i32* %8
%9 = getelementptr inbounds %struct.s, %struct.s* %5, i32 0, i32 1
store i32 2, i32* %9
%10 = getelementptr inbounds %struct.s, %struct.s* %5, i32 0, i32 2
store i32 3, i32* %10
store %struct.s* %5, %struct.s** %4
%11 = getelementptr inbounds { double, double }, { double, double }* %7, i32 0, i32 0
%12 = getelementptr inbounds { double, double }, { double, double }* %7, i32 0, i32 1
store double 1.000000e+00, double* %11
store double 0.000000e+00, double* %12
store { double, double }* %7, { double, double }** %6
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
%struct.s = type { i32, i32, i32 }
define i32 @xxx() {
ret i32 undef
}
/* Variables and functions */
char *bufprint_config_path(char *, char *, char *);
char *avm_bufprint_default_root(char *p, char *end) {
  return bufprint_config_path(p, end, "VMs");
}


x86 assembly (clang, -O0):
<avm_bufprint_default_root>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    0xed1(%rip),%rdx
call   1030 <bufprint_config_path@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<avm_bufprint_default_root>:
lea    0xee9(%rip),%rdx
jmp    1030 <bufprint_config_path@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"VMs\00"
define i8* @avm_bufprint_default_root(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 i8* @bufprint_config_path(i8* %5, i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i8* %7
}

LLVM IR (-O2):
@.str = [4 x i8] c"VMs\00"
define i8* @avm_bufprint_default_root(i8* %0, i8* %1) {
%3 = tail call i8* @bufprint_config_path(i8* %0, i8* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}