xunge/DecIR huggingface dataset:
/* Type definitions */
struct menu_st {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void xemugui_cb_quit(const struct menu_st *m, int *query) {
  if (!query)
    exit(0);
}


x86 assembly (clang, -O0):
<xemugui_cb_quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1132 <xemugui_cb_quit+0x22>
xor    %edi,%edi
call   1030 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xemugui_cb_quit>:
test   %rsi,%rsi
je     1116 <xemugui_cb_quit+0x6>
ret
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
%struct.menu_st = type { i32 }
define void @xemugui_cb_quit(%struct.menu_st* %0, i32* %1) {
%3 = alloca %struct.menu_st*
%4 = alloca i32*
store %struct.menu_st* %0, %struct.menu_st** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = icmp ne i32* %5, null
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = call i32 @exit(i32 0)
unreachable
9: ; preds = %2
ret void
}

LLVM IR (-O2):
%struct.menu_st = type { i32 }
define void @xemugui_cb_quit(%struct.menu_st* nocapture readnone %0, i32* readnone %1) {
%3 = icmp eq i32* %1, null
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @exit(i32 0)
unreachable
6: ; preds = %2
ret void
}
void gtk_color_button_new() {}


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

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

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

LLVM IR (-O2):
define void @gtk_color_button_new() {
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ memcpy(char *, char const *, int);
char *pnm_filename(char *fn, int size) {
  const char _pnm_ending[5] = {0x2e, 0x70, 0x6e, 0x6d, 0x00};
  char *newfile = (char *)malloc(size + 5);
  memcpy(newfile, fn, size);
  memcpy(&newfile[size], _pnm_ending, 5);
  return newfile;
}


x86 assembly (clang, -O0):
<pnm_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0x11(%rbp)
mov    0xec6(%rip),%al
mov    %al,-0xd(%rbp)
mov    -0xc(%rbp),%edi
add    $0x5,%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rdi
movslq -0xc(%rbp),%rax
add    %rax,%rdi
lea    -0x11(%rbp),%rsi
mov    $0x5,%edx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pnm_filename>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
mov    %rdi,%r14
movb   $0x0,0xc(%rsp)
movl   $0x6d6e702e,0x8(%rsp)
6d
lea    0x5(%rbx),%edi
call   1040 <malloc@plt>
mov    %rax,%r15
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1030 <memcpy@plt>
movslq %ebx,%rdi
add    %r15,%rdi
lea    0x8(%rsp),%rsi
mov    $0x5,%edx
call   1030 <memcpy@plt>
mov    %r15,%rax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.pnm_filename._pnm_ending = [5 x i8] c".pnm\00"
define i8* @pnm_filename(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [5 x i8]
%6 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = bitcast [5 x i8]* %5 to i8*
%8 = load i32, i32* %4
%9 = add nsw i32 %8, 5
%10 = call i64 @malloc(i32 %9)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %6
%12 = load i8*, i8** %6
%13 = load i8*, i8** %3
%14 = load i32, i32* %4
%15 = call i32 @memcpy(i8* %12, i8* %13, i32 %14)
%16 = load i8*, i8** %6
%17 = load i32, i32* %4
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 0
%21 = call i32 @memcpy(i8* %19, i8* %20, i32 5)
%22 = load i8*, i8** %6
ret i8* %22
}

LLVM IR (-O2):
@__const.pnm_filename._pnm_ending = [5 x i8] c".pnm\00"
define i8* @pnm_filename(i8* %0, i32 %1) {
%3 = alloca [5 x i8]
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%5 = add nsw i32 %1, 5
%6 = tail call i64 @malloc(i32 %5)
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 @memcpy(i8* %7, i8* %0, i32 %1)
%9 = sext i32 %1 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = call i32 @memcpy(i8* %10, i8* %4, i32 5)
ret i8* %7
}
int test_imm_A9uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0xA9 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A9uint64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x20,%rdx
and    $0xa9,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_A9uint64_highword_reg>:
movabs $0xa900000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_A9uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 725849473024
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void VIDDummyVdp1DistortedSpriteDraw(void) {}


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

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

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

LLVM IR (-O2):
define void @VIDDummyVdp1DistortedSpriteDraw() {
ret void
}
int ft_isdigit(char c) { return ((c >= '0' && c <= '9') ? 1 : 0); }


x86 assembly (clang, -O0):
<ft_isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <ft_isdigit+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isdigit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @ft_isdigit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 1, i32 0
ret i32 %13
}

LLVM IR (-O2):
define i32 @ft_isdigit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
int test_imm_5Duint16_reg(unsigned short val) {
  return ((val) & (-0x5D << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_5Duint16_reg(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, -93
%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_5Duint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -93
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void main() {
  int i, j, n, m;
  float a[100], b[100];
#pragma scop
  for (i = 1; i <= n; i++) {
    a[i] = i;
    for (j = 1; j <= m; j++)
      b[j] = b[j] + a[i];
  }
#pragma endscop
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2b0,%rsp
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     118b <main+0x8b>
cvtsi2ssl -0x4(%rbp),%xmm0
movslq -0x4(%rbp),%rax
movss  %xmm0,-0x1a0(%rbp,%rax,4)
ff ff
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1178 <main+0x78>
movslq -0x8(%rbp),%rax
movss  -0x330(%rbp,%rax,4),%xmm0
ff ff
movslq -0x4(%rbp),%rax
addss  -0x1a0(%rbp,%rax,4),%xmm0
ff ff
movslq -0x8(%rbp),%rax
movss  %xmm0,-0x330(%rbp,%rax,4)
ff ff
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1137 <main+0x37>
jmp    117d <main+0x7d>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1112 <main+0x12>
add    $0x2b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x118,%rsp
lea    -0x7c(%rsp),%rax
movss  0xeec(%rip),%xmm0
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movss  (%rax),%xmm1
addss  %xmm0,%xmm1
movss  %xmm1,(%rax)
add    $0x4,%rax
jmp    1120 <main+0x20>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [100 x float]
%6 = alloca [100 x float]
store i32 1, i32* %1
br label %7
7: ; preds = %38, %0
%8 = load i32, i32* %1
%9 = load i32, i32* %3
%10 = icmp sle i32 %8, %9
br i1 %10, label %11, label %41
11: ; preds = %7
%12 = load i32, i32* %1
%13 = sitofp i32 %12 to float
%14 = load i32, i32* %1
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [100 x float], [100 x float]* %5, i64 0, i64 %15
store float %13, float* %16
store i32 1, i32* %2
br label %17
17: ; preds = %34, %11
%18 = load i32, i32* %2
%19 = load i32, i32* %4
%20 = icmp sle i32 %18, %19
br i1 %20, label %21, label %37
21: ; preds = %17
%22 = load i32, i32* %2
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [100 x float], [100 x float]* %6, i64 0, i64 %23
%25 = load float, float* %24
%26 = load i32, i32* %1
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [100 x float], [100 x float]* %5, i64 0, i64 %27
%29 = load float, float* %28
%30 = fadd float %25, %29
%31 = load i32, i32* %2
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [100 x float], [100 x float]* %6, i64 0, i64 %32
store float %30, float* %33
br label %34
34: ; preds = %21
%35 = load i32, i32* %2
%36 = add nsw i32 %35, 1
store i32 %36, i32* %2
br label %17
37: ; preds = %17
br label %38
38: ; preds = %37
%39 = load i32, i32* %1
%40 = add nsw i32 %39, 1
store i32 %40, i32* %1
br label %7
41: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = alloca [100 x float]
%2 = bitcast [100 x float]* %1 to i8*
br label %3
3: ; preds = %3, %0
%4 = phi i64 [ %8, %3 ], [ 1, %0 ]
%5 = getelementptr inbounds [100 x float], [100 x float]* %1, i64 0, i64 %4
%6 = load float, float* %5
%7 = fadd float %6, 1.000000e+00
store float %7, float* %5
%8 = add nuw i64 %4, 1
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void printError(char message[]) { printf("ERROR! %s\n", message); }


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

x86 assembly (clang, -O2):
<printError>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"ERROR! %s\0A\00"
define void @printError(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
int /*<<< orphan*/ system(char *);
void home_task_command(char *command, char *read, char quiet) {
  sprintf(command, "%s \"%s\"", command, read);
  if (!quiet)
    printf("command %s\n", command);
  system(command);
}


x86 assembly (clang, -O0):
<home_task_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xea8(%rip),%rsi
call   1050 <sprintf@plt>
cmpb   $0x0,-0x11(%rbp)
jne    1177 <home_task_command+0x47>
mov    -0x8(%rbp),%rsi
lea    0xe96(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <system@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<home_task_command>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%rcx
mov    %rdi,%rbx
lea    0xebe(%rip),%rsi
mov    %rdi,%rdx
call   1050 <sprintf@plt>
test   %bpl,%bpl
jne    115e <home_task_command+0x2e>
lea    0xeb2(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <system@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%s \22%s\22\00"
@.str.1 = [12 x i8] c"command %s\0A\00"
define void @home_task_command(i8* %0, i8* %1, i8 signext %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8 %2, i8* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9)
%11 = load i8, i8* %6
%12 = icmp ne i8 %11, 0
br i1 %12, label %16, label %13
13: ; preds = %3
%14 = load i8*, i8** %4
%15 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %14)
br label %16
16: ; preds = %13, %3
%17 = load i8*, i8** %4
%18 = call i32 @system(i8* %17)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s \22%s\22\00"
@.str.1 = [12 x i8] c"command %s\0A\00"
define void @home_task_command(i8* %0, i8* %1, i8 signext %2) {
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%5 = icmp eq i8 %2, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %8
8: ; preds = %6, %3
%9 = tail call i32 @system(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void fn_ptr02(char *str) { printf("fn_ptr02: %s\n", str); }


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

x86 assembly (clang, -O2):
<fn_ptr02>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [14 x i8] c"fn_ptr02: %s\0A\00"
define void @fn_ptr02(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glmSqrt3f(float *, float *);
void glmSqrt3f_(float x[3]) { glmSqrt3f(x, x); }


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

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

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

LLVM IR (-O2):
define void @glmSqrt3f_(float* %0) {
%2 = tail call i32 @glmSqrt3f(float* %0, float* %0)
ret void
}
/* Variables and functions */
int foo(int, int);
int __attribute__((no, noclone)) bar(int x, int y) {
  int z;
  z = foo(x, y);
  z += foo(y, x);
  return z;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <foo@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <foo@plt>
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <foo@plt>
mov    %eax,%r14d
mov    %ebx,%edi
mov    %ebp,%esi
call   1030 <foo@plt>
add    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @bar(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @foo(i32 %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %4
%10 = load i32, i32* %3
%11 = call i32 @foo(i32 %9, i32 %10)
%12 = load i32, i32* %5
%13 = add nsw i32 %12, %11
store i32 %13, i32* %5
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
define i32 @bar(i32 %0, i32 %1) {
%3 = tail call i32 @foo(i32 %0, i32 %1)
%4 = tail call i32 @foo(i32 %1, i32 %0)
%5 = add nsw i32 %4, %3
ret i32 %5
}
void FPUStackingEnable(void) {
  (*((volatile unsigned long *)(0xE000EF34))) =
      ((*((volatile unsigned long *)(0xE000EF34))) & ~0x40000000) | 0x80000000;
}


x86 assembly (clang, -O0):
<FPUStackingEnable>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe000ef34,%eax
mov    (%rax),%rcx
and    $0xffffffffbfffffff,%rcx
movabs $0x80000000,%rax
or     %rax,%rcx
mov    $0xe000ef34,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<FPUStackingEnable>:
mov    $0xe000ef34,%eax
movabs $0xffffffff3fffffff,%rcx
ff ff ff
and    (%rax),%rcx
add    %rax,%rcx
add    $0xffffffff9fff10cc,%rcx
mov    %rcx,(%rax)
ret

LLVM IR (-O0):
define void @FPUStackingEnable() {
%1 = load volatile i64, i64* inttoptr (i64 3758157620 to i64*)
%2 = and i64 %1, -1073741825
%3 = or i64 %2, 2147483648
store volatile i64 %3, i64* inttoptr (i64 3758157620 to i64*)
ret void
}

LLVM IR (-O2):
define void @FPUStackingEnable() {
%1 = load volatile i64, i64* inttoptr (i64 3758157620 to i64*)
%2 = and i64 %1, -3221225473
%3 = or i64 %2, 2147483648
store volatile i64 %3, i64* inttoptr (i64 3758157620 to i64*)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main() {
  union {
    uint32_t x;
    uint8_t b[4];
  } e = {1};
  if (e.b[0] == 1) {
    puts("little");
  } else {
    puts("big");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x1,-0x18(%rbp)
jne    1150 <main+0x40>
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
jmp    115c <main+0x4c>
lea    0xec0(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { [4 x i32] }
@__const.main.e = { i32, [12 x i8] } { i32 1, [12 x i8] undef }
@.str = [7 x i8] c"little\00"
@.str.1 = [4 x i8] c"big\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %union.anon
store i32 0, i32* %1
%3 = bitcast %union.anon* %2 to i8*
%4 = bitcast %union.anon* %2 to [4 x i32]*
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %12
10: ; preds = %0
%11 = call i32 @puts(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"little\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int __sigpause(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ sigblock(int /*<<< orphan*/);
int __libc_pause(void) { return (__sigpause(sigblock(0), 0)); }


x86 assembly (clang, -O0):
<__libc_pause>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <sigblock@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1040 <__sigpause@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__libc_pause>:
push   %rax
xor    %edi,%edi
call   1030 <sigblock@plt>
mov    %eax,%edi
xor    %esi,%esi
pop    %rax
jmp    1040 <__sigpause@plt>

LLVM IR (-O0):
define i32 @__libc_pause() {
%1 = call i32 @sigblock(i32 0)
%2 = call i32 @__sigpause(i32 %1, i32 0)
ret i32 %2
}

LLVM IR (-O2):
define i32 @__libc_pause() {
%1 = tail call i32 @sigblock(i32 0)
%2 = tail call i32 @__sigpause(i32 %1, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
char *decimal_to_binary(int /*<<< orphan*/, int);
char *str_replace(char *, char *, char *);
char *decodeReg(char *token) {
  char *decoded = NULL;
  char *number;
  number = str_replace(token, "R", "");
  decoded = decimal_to_binary(atoi(number), 3);
  return decoded;
}


x86 assembly (clang, -O0):
<decodeReg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb1(%rip),%rsi
lea    0xeab(%rip),%rdx
call   1030 <str_replace@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
mov    $0x3,%esi
call   1040 <decimal_to_binary@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decodeReg>:
push   %rax
lea    0xec8(%rip),%rsi
lea    0xec2(%rip),%rdx
call   1030 <str_replace@plt>
mov    %rax,%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
mov    $0x3,%esi
pop    %rax
jmp    1040 <decimal_to_binary@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"R\00"
@.str.1 = [1 x i8] zeroinitializer
define i8* @decodeReg(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
store i8* null, i8** %3
%5 = load i8*, i8** %2
%6 = call i8* @str_replace(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @atoi(i8* %7)
%9 = call i8* @decimal_to_binary(i32 %8, i32 3)
store i8* %9, i8** %3
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
@.str = [2 x i8] c"R\00"
@.str.1 = [1 x i8] zeroinitializer
define i8* @decodeReg(i8* %0) {
%2 = tail call i8* @str_replace(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @atoi(i8* %2)
%4 = tail call i8* @decimal_to_binary(i32 %3, i32 3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ bfalgo(char *);
int /*<<< orphan*/ codeGoTo(int);
void codeConstantDecrement(int x, int q) {
  codeGoTo(x);
  while (q) {
    bfalgo("-");
    q--;
  }
}


x86 assembly (clang, -O0):
<codeConstantDecrement>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <codeGoTo@plt>
cmpl   $0x0,-0x8(%rbp)
je     115a <codeConstantDecrement+0x3a>
lea    0xeb9(%rip),%rdi
call   1040 <bfalgo@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <codeConstantDecrement+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<codeConstantDecrement>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
call   1030 <codeGoTo@plt>
test   %ebx,%ebx
je     114d <codeConstantDecrement+0x2d>
lea    0xeca(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1040 <bfalgo@plt>
add    $0xffffffff,%ebx
jne    1140 <codeConstantDecrement+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c"-\00"
define void @codeConstantDecrement(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 @codeGoTo(i32 %5)
br label %7
7: ; preds = %10, %2
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %7
%11 = call i32 @bfalgo(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* %4
%13 = add nsw i32 %12, -1
store i32 %13, i32* %4
br label %7
14: ; preds = %7
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"-\00"
define void @codeConstantDecrement(i32 %0, i32 %1) {
%3 = tail call i32 @codeGoTo(i32 %0)
%4 = icmp eq i32 %1, 0
br i1 %4, label %10, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %8, %5 ], [ %1, %2 ]
%7 = tail call i32 @bfalgo(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = add nsw i32 %6, -1
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %5
10: ; preds = %5, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
short getc(int /*<<< orphan*/ *);
short get16(FILE *fh) {
  short w = getc(fh);
  w |= (long)getc(fh) << 8l;
  return w;
}


x86 assembly (clang, -O0):
<get16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
movswq %ax,%rcx
shl    $0x8,%rcx
movswq -0xa(%rbp),%rax
or     %rcx,%rax
mov    %ax,-0xa(%rbp)
movswl -0xa(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get16>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <getc@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <getc@plt>
shl    $0x8,%eax
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define signext i16 @get16(i32* %0) {
%2 = alloca i32*
%3 = alloca i16
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call signext i16 @getc(i32* %4)
store i16 %5, i16* %3
%6 = load i32*, i32** %2
%7 = call signext i16 @getc(i32* %6)
%8 = sext i16 %7 to i64
%9 = shl i64 %8, 8
%10 = load i16, i16* %3
%11 = sext i16 %10 to i64
%12 = or i64 %11, %9
%13 = trunc i64 %12 to i16
store i16 %13, i16* %3
%14 = load i16, i16* %3
ret i16 %14
}

LLVM IR (-O2):
define signext i16 @get16(i32* nocapture %0) {
%2 = tail call signext i16 @getc(i32* %0)
%3 = tail call signext i16 @getc(i32* %0)
%4 = shl i16 %3, 8
%5 = or i16 %4, %2
ret i16 %5
}
void PKCS7_RECIP_INFO_free(void) {}


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

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

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

LLVM IR (-O2):
define void @PKCS7_RECIP_INFO_free() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ UART2_send(char);
void EasyVR_Read(void) { UART2_send(' '); }


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

x86 assembly (clang, -O2):
<EasyVR_Read>:
mov    $0x20,%edi
jmp    1030 <UART2_send@plt>

LLVM IR (-O0):
define void @EasyVR_Read() {
%1 = call i32 @UART2_send(i8 signext 32)
ret void
}

LLVM IR (-O2):
define void @EasyVR_Read() {
%1 = tail call i32 @UART2_send(i8 signext 32)
ret void
}
/* Variables and functions */
scalar_t__ fmem_init();
scalar_t__ ihex_parse_line();
scalar_t__ ihex_read_line();
int ihex_read_fp(void) {
  if (fmem_init() == 0)
    return 0;
  for (;;) {
    if (ihex_read_line() == 0)
      break;
    if (ihex_parse_line() == 0)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<ihex_read_fp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <fmem_init@plt>
cmp    $0x0,%rax
jne    1155 <ihex_read_fp+0x25>
movl   $0x0,-0x4(%rbp)
jmp    1199 <ihex_read_fp+0x69>
jmp    115a <ihex_read_fp+0x2a>
mov    $0x0,%al
call   1040 <ihex_read_line@plt>
cmp    $0x0,%rax
jne    1170 <ihex_read_fp+0x40>
jmp    1192 <ihex_read_fp+0x62>
mov    $0x0,%al
call   1030 <ihex_parse_line@plt>
cmp    $0x0,%rax
jne    118d <ihex_read_fp+0x5d>
movl   $0x0,-0x4(%rbp)
jmp    1199 <ihex_read_fp+0x69>
jmp    115a <ihex_read_fp+0x2a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ihex_read_fp>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <fmem_init@plt>
test   %rax,%rax
je     116f <ihex_read_fp+0x3f>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <ihex_read_line@plt>
test   %rax,%rax
je     116a <ihex_read_fp+0x3a>
xor    %eax,%eax
call   1030 <ihex_parse_line@plt>
test   %rax,%rax
jne    1150 <ihex_read_fp+0x20>
jmp    116f <ihex_read_fp+0x3f>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ihex_read_fp() {
%1 = alloca i32
%2 = call i64 (...) @fmem_init()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 0, i32* %1
br label %16
5: ; preds = %0
br label %6
6: ; preds = %14, %5
%7 = call i64 (...) @ihex_read_line()
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %6
br label %15
10: ; preds = %6
%11 = call i64 (...) @ihex_parse_line()
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %10
store i32 0, i32* %1
br label %16
14: ; preds = %10
br label %6
15: ; preds = %9
store i32 1, i32* %1
br label %16
16: ; preds = %15, %13, %4
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
define i32 @ihex_read_fp() {
%1 = tail call i64 (...) @fmem_init()
%2 = icmp eq i64 %1, 0
br i1 %2, label %9, label %3
3: ; preds = %0, %6
%4 = tail call i64 (...) @ihex_read_line()
%5 = icmp eq i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i64 (...) @ihex_parse_line()
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %3
9: ; preds = %3, %6, %0
%10 = phi i32 [ 0, %0 ], [ 1, %3 ], [ 0, %6 ]
ret i32 %10
}
__strsep_1c(char **__s, char __reject) {}


x86 assembly (clang, -O0):
<__strsep_1c>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @__strsep_1c(i8** nocapture readnone %0, i8 signext %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0xbc() {
  Assert_real((isprint(188) == 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_isprint.c",
              945, ("isprint should be 0 for 0xbc"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0xbc>:
push   %rax
mov    $0xbc,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3b1,%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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xbc\00"
define void @t_isprint_0xbc() {
%1 = call i64 @isprint(i32 188)
%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 945, 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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xbc\00"
define void @t_isprint_0xbc() {
%1 = tail call i64 @isprint(i32 188)
%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 945, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
scalar_t__ system(char const *);
int exec_system(const char *command, bool verbose) {
  (void)(0);
  int retval;
  if (verbose)
    printf("Running: %s\n", command);
  retval = system(command) == 0 ? 0 : 4;
  return retval;
}


x86 assembly (clang, -O0):
<exec_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1149 <exec_system+0x29>
mov    -0x8(%rbp),%rsi
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <system@plt>
mov    %rax,%rdx
mov    $0x4,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmove  %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exec_system>:
push   %rbx
mov    %rdi,%rbx
test   %esi,%esi
je     1137 <exec_system+0x17>
lea    0xed1(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
shl    $0x2,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Running: %s\0A\00"
define i32 @exec_system(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %8, %2
%12 = load i8*, i8** %3
%13 = call i64 @system(i8* %12)
%14 = icmp eq i64 %13, 0
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 0, i32 4
store i32 %16, i32* %5
%17 = load i32, i32* %5
ret i32 %17
}

LLVM IR (-O2):
@.str = [13 x i8] c"Running: %s\0A\00"
define i32 @exec_system(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %4, %2
%7 = tail call i64 @system(i8* %0)
%8 = icmp eq i64 %7, 0
%9 = select i1 %8, i32 0, i32 4
ret i32 %9
}
/* Variables and functions */
int ytmodeMain(int, char **);
int main(int argc, char *argv[]) { return ytmodeMain(argc, argv); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <ytmodeMain@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <ytmodeMain@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @ytmodeMain(i32 %0, i8** %1)
ret i32 %3
}
long __sys_write(const int fd, const void *const buffer,
                 const unsigned long count) {
  (void)fd, (void)buffer, (void)count;
  return -1;
}


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

x86 assembly (clang, -O2):
<__sys_write>:
mov    $0xffffffffffffffff,%rax
ret

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

LLVM IR (-O2):
define i64 @__sys_write(i32 %0, i8* nocapture readnone %1, i64 %2) {
ret i64 -1
}
void endhostent() {
  anvil_syslog(0, "%s unimplemented\n", __FUNCTION__);
  while (1)
    ;
}


x86 assembly (clang, -O0):
<endhostent>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
lea    0xeee(%rip),%rdx
mov    $0x0,%al
call   1030 <anvil_syslog@plt>
jmp    112b <endhostent+0x1b>

x86 assembly (clang, -O2):
<endhostent>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0xef3(%rip),%rdx
xor    %edi,%edi
xor    %eax,%eax
call   1030 <anvil_syslog@plt>
nopl   0x0(%rax,%rax,1)
jmp    1130 <endhostent+0x20>

LLVM IR (-O0):
@.str = [18 x i8] c"%s unimplemented\0A\00"
@__FUNCTION__.endhostent = [11 x i8] c"endhostent\00"
define void @endhostent() {
%1 = call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @anvil_syslog to i32 (i32, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.endhostent, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
@.str = [18 x i8] c"%s unimplemented\0A\00"
@__FUNCTION__.endhostent = [11 x i8] c"endhostent\00"
define void @endhostent() {
%1 = tail call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @anvil_syslog to i32 (i32, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.endhostent, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}
/* Type definitions */
typedef scalar_t__ uint64_t;
struct timespec {
  unsigned long long tv_sec;
  scalar_t__ tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int /*<<< orphan*/ abort();
scalar_t__ clock_gettime(int /*<<< orphan*/, struct timespec *);
uint64_t tic(void) {
  struct timespec ts;
  if (clock_gettime(CLOCK_REALTIME, &ts))
    abort();
  return ts.tv_sec * 1000000000ULL + ts.tv_nsec;
}


x86 assembly (clang, -O0):
<tic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1040 <clock_gettime@plt>
cmp    $0x0,%rax
je     114b <tic+0x2b>
mov    $0x0,%al
call   1030 <abort@plt>
imul   $0x3b9aca00,-0x10(%rbp),%rax
3b
add    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tic>:
sub    $0x18,%rsp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1040 <clock_gettime@plt>
test   %rax,%rax
jne    114f <tic+0x2f>
imul   $0x3b9aca00,0x8(%rsp),%rax
9a 3b
add    0x10(%rsp),%rax
add    $0x18,%rsp
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
@CLOCK_REALTIME = global i32 0
define i64 @tic() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_REALTIME
%3 = call i64 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %0
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%9 = load i64, i64* %8
%10 = mul i64 %9, 1000000000
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%12 = load i64, i64* %11
%13 = add i64 %10, %12
ret i64 %13
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
@CLOCK_REALTIME = global i32 0
define i64 @tic() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_REALTIME
%4 = call i64 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%10 = load i64, i64* %9
%11 = mul i64 %10, 1000000000
%12 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%13 = load i64, i64* %12
%14 = add i64 %11, %13
ret i64 %14
}
three_args(a, b, c) {
  echo("a + b =", a + b, ", c = ", c);
  foo();
}


x86 assembly (clang, -O0):
<three_args>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%esi
add    -0xc(%rbp),%esi
mov    -0x10(%rbp),%ecx
lea    0xebf(%rip),%rdi
lea    0xec0(%rip),%rdx
mov    $0x0,%al
call   1030 <echo@plt>
mov    $0x0,%al
call   1040 <foo@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<three_args>:
push   %rax
mov    %edx,%ecx
add    %edi,%esi
lea    0xed4(%rip),%rdi
lea    0xed5(%rip),%rdx
xor    %eax,%eax
call   1030 <echo@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <foo@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"a + b =\00"
@.str.1 = [7 x i8] c", c = \00"
define i32 @three_args(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = add nsw i32 %8, %9
%11 = load i32, i32* %7
%12 = call i32 (i8*, i32, i8*, i32, ...) bitcast (i32 (...)* @echo to i32 (i8*, i32, i8*, i32, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %10, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = call i32 (...) @foo()
%14 = load i32, i32* %4
ret i32 %14
}

LLVM IR (-O2):
@.str = [8 x i8] c"a + b =\00"
@.str.1 = [7 x i8] c", c = \00"
define i32 @three_args(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, %0
%5 = tail call i32 (i8*, i32, i8*, i32, ...) bitcast (i32 (...)* @echo to i32 (i8*, i32, i8*, i32, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%6 = tail call i32 (...) @foo()
ret i32 undef
}
void allocateBlock(int *p) { *(p - 1) = (*(p - 1) | 0x1); }


x86 assembly (clang, -O0):
<allocateBlock>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x4(%rax),%ecx
or     $0x1,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,-0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocateBlock>:
orb    $0x1,-0x4(%rdi)
ret

LLVM IR (-O0):
define void @allocateBlock(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 -1
%5 = load i32, i32* %4
%6 = or i32 %5, 1
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 -1
store i32 %6, i32* %8
ret void
}

LLVM IR (-O2):
define void @allocateBlock(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 -1
%3 = load i32, i32* %2
%4 = or i32 %3, 1
store i32 %4, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int i850intr() {
  printf("in i850intr\n");
  int v = 1;
  return v;
}


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"in i850intr\00"
define i32 @i850intr() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 1
}
__attribute__((no)) int bar(int x, int y) {
  if (__builtin_expect(x, 0) && y != 0)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0x8(%rbp),%rax
cmp    $0x0,%rax
je     112e <bar+0x2e>
cmpl   $0x0,-0xc(%rbp)
je     112e <bar+0x2e>
movl   $0x1,-0x4(%rbp)
jmp    1135 <bar+0x35>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
test   %edi,%edi
jne    1107 <bar+0x7>
xor    %eax,%eax
ret
mov    $0x1,%eax
test   %esi,%esi
jne    1106 <bar+0x6>
jmp    1104 <bar+0x4>

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

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


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

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

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

LLVM IR (-O2):
define void @genbc1t() {
ret void
}
int iso_clip(int v, int vmin, int vmax) {
  if (v > vmax || v < vmin)
    return vmin;
  else
    return v;
}


x86 assembly (clang, -O0):
<iso_clip>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1125 <iso_clip+0x25>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1130 <iso_clip+0x30>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1136 <iso_clip+0x36>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iso_clip>:
cmp    %edx,%edi
mov    %edi,%eax
cmovg  %esi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @iso_clip(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, %2
%5 = icmp slt i32 %0, %1
%6 = or i1 %5, %4
%7 = select i1 %6, i32 %1, i32 %0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void do_print() { printf("do print called\n"); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"do print called\0A\00"
define void @do_print() {
%1 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [16 x i8] c"do print called\00"
define void @do_print() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}