xunge/DecIR huggingface dataset:
void free2c(char **p, int row) {
  int i;
  for (i = 0; i < row; i++)
    free(p[i]);
  free(p);
}


x86 assembly (clang, -O0):
<free2c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <free2c+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <free2c+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free2c>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <free2c+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free2c+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free2c(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
tail call void @free(i8* %9)
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
%13 = bitcast i8** %0 to i8*
tail call void @free(i8* %13)
ret void
}
const int func(const int x) { return x * x * x; }


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @func(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 %3, %4
%6 = load i32, i32* %2
%7 = mul nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @func(i32 %0) {
%2 = mul nsw i32 %0, %0
%3 = mul nsw i32 %2, %0
ret i32 %3
}
/* Variables and functions */
int ordered_example(int /*<<< orphan*/, int, int);
int main() { return ordered_example(0, 100, 5); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
mov    $0x64,%esi
mov    $0x5,%edx
call   1030 <ordered_example@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %edi,%edi
mov    $0x64,%esi
mov    $0x5,%edx
jmp    1030 <ordered_example@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @ordered_example(i32 0, i32 100, i32 5)
ret i32 %2
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @ordered_example(i32 0, i32 100, i32 5)
ret i32 %1
}
/* Variables and functions */
void *__memset(void *, int, size_t);
void *memset(void *s, int c, size_t count) { return __memset(s, c, count); }


x86 assembly (clang, -O0):
<memset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
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):
<memset>:
jmp    1030 <__memset@plt>

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

LLVM IR (-O2):
define i8* @memset(i8* %0, i32 %1, i64 %2) {
%4 = tail call i8* @__memset(i8* %0, i32 %1, i64 %2)
ret i8* %4
}
int test_06(unsigned char x, int y, int z) { return ((x << 3) & 192) == 0; }


x86 assembly (clang, -O0):
<test_06>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x3,%eax
and    $0xc0,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_06>:
xor    %eax,%eax
test   $0x18,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @test_06(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = shl i32 %8, 3
%10 = and i32 %9, 192
%11 = icmp eq i32 %10, 0
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @test_06(i8 zeroext %0, i32 %1, i32 %2) {
%4 = and i8 %0, 24
%5 = icmp eq i8 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
void __attribute__((always_, format(printf, 2, 3)))
mxt_log_null(struct libmaxtouch_ctx *ctx, const char *format, ...) {}


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

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

LLVM IR (-O0):
%struct.libmaxtouch_ctx = type opaque
define void @mxt_log_null(%struct.libmaxtouch_ctx* %0, i8* %1, ...) {
%3 = alloca %struct.libmaxtouch_ctx*
%4 = alloca i8*
store %struct.libmaxtouch_ctx* %0, %struct.libmaxtouch_ctx** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
%struct.libmaxtouch_ctx = type opaque
define void @mxt_log_null(%struct.libmaxtouch_ctx* nocapture %0, i8* nocapture %1, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0xa4() {
  Assert_real((iscntrl(164) == 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_iscntrl.c",
              825, ("iscntrl should be 0 for 0xa4"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0xa4>:
push   %rax
mov    $0xa4,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x339,%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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xa4\00"
define void @t_iscntrl_0xa4() {
%1 = call i64 @iscntrl(i32 164)
%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 825, 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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xa4\00"
define void @t_iscntrl_0xa4() {
%1 = tail call i64 @iscntrl(i32 164)
%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 825, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int HuBenBiFa_cost(struct Ability *self) { return 80; }


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

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

LLVM IR (-O0):
%struct.Ability = type opaque
define i32 @HuBenBiFa_cost(%struct.Ability* %0) {
%2 = alloca %struct.Ability*
store %struct.Ability* %0, %struct.Ability** %2
ret i32 80
}

LLVM IR (-O2):
%struct.Ability = type opaque
define i32 @HuBenBiFa_cost(%struct.Ability* nocapture readnone %0) {
ret i32 80
}
/* Variables and functions */
int /*<<< orphan*/ printAscii();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("\n");
  printf("*************************************\n");
  printf("*** EXTENDED ASCII TABLE EXAMPLE\n");
  printf("*************************************\n");
  printf("\n");
  printAscii();
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xefa(%rip),%rdi
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <printAscii@plt>
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xedf(%rip),%rbx
mov    %rbx,%rdi
call   1040 <puts@plt>
lea    0xeaf(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1050 <printAscii@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [39 x i8] c"*************************************\0A\00"
@.str.2 = [34 x i8] c"*** EXTENDED ASCII TABLE EXAMPLE\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (...) @printAscii()
%7 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str.3 = [33 x i8] c"*** EXTENDED ASCII TABLE EXAMPLE\00"
@str.4 = [38 x i8] c"*************************************\00"
define i32 @main() {
%1 = tail call i32 @putchar(i32 10)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.3, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.4, i64 0, i64 0))
%5 = tail call i32 @putchar(i32 10)
%6 = tail call i32 (...) @printAscii()
%7 = tail call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
char *fill_str(char *from) {
  char *ptr = malloc(sizeof(char) * 10);
  strcpy(ptr, from);
}


x86 assembly (clang, -O0):
<fill_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_str>:
push   %rbx
mov    %rdi,%rbx
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @fill_str(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = call i8* @malloc(i32 10)
store i8* %5, i8** %4
%6 = load i8*, i8** %4
%7 = load i8*, i8** %3
%8 = call i32 @strcpy(i8* %6, i8* %7)
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
define noalias i8* @fill_str(i8* %0) {
%2 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%3 = tail call i32 @strcpy(i8* %2, i8* %0)
ret i8* undef
}
void swap_32_bit_val(void *ptr) {
  char *tptr = (char *)ptr, tchar;
  {
    tchar = tptr[0];
    tptr[0] = tptr[3];
    tptr[3] = tchar;
  };
  {
    tchar = tptr[1];
    tptr[1] = tptr[2];
    tptr[2] = tchar;
  };
}


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

x86 assembly (clang, -O2):
<swap_32_bit_val>:
mov    (%rdi),%al
mov    0x3(%rdi),%cl
mov    %cl,(%rdi)
mov    %al,0x3(%rdi)
rolw   $0x8,0x1(%rdi)
ret

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

LLVM IR (-O2):
define void @swap_32_bit_val(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 3
%4 = load i8, i8* %3
store i8 %4, i8* %0
store i8 %2, i8* %3
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 2
%8 = load i8, i8* %7
store i8 %8, i8* %5
store i8 %6, i8* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void rysuj(char element[], int k) {
  int i = 0;
  while (i < k) {
    printf("%s", element);
    ++i;
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<rysuj>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1152 <rysuj+0x42>
mov    -0x8(%rbp),%rsi
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <rysuj+0x16>
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rysuj>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1152 <rysuj+0x32>
mov    %esi,%ebx
mov    %rdi,%r14
lea    0xecb(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r15,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffff,%ebx
jne    1140 <rysuj+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @rysuj(i8* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 0, %2 ]
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %1
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clk_init();
int /*<<< orphan*/ cortexm_init();
void cpu_init(void) {
  cortexm_init();
  clk_init();
}


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

x86 assembly (clang, -O2):
<cpu_init>:
push   %rax
xor    %eax,%eax
call   1030 <cortexm_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <clk_init@plt>

LLVM IR (-O0):
define void @cpu_init() {
%1 = call i32 (...) @cortexm_init()
%2 = call i32 (...) @clk_init()
ret void
}

LLVM IR (-O2):
define void @cpu_init() {
%1 = tail call i32 (...) @cortexm_init()
%2 = tail call i32 (...) @clk_init()
ret void
}
/* Type definitions */
struct Push {
  int dummy;
};

/* Variables and functions */
char *PushNString(struct Push *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
char *PushString(struct Push *push, const char *append) {
  char *string = NULL;
  return PushNString(push, append, strlen(append));
  return string;
}


x86 assembly (clang, -O0):
<PushString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
call   1040 <PushNString@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PushString>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <PushNString@plt>

LLVM IR (-O0):
%struct.Push = type { i32 }
define i8* @PushString(%struct.Push* %0, i8* %1) {
%3 = alloca %struct.Push*
%4 = alloca i8*
%5 = alloca i8*
store %struct.Push* %0, %struct.Push** %3
store i8* %1, i8** %4
store i8* null, i8** %5
%6 = load %struct.Push*, %struct.Push** %3
%7 = load i8*, i8** %4
%8 = load i8*, i8** %4
%9 = call i32 @strlen(i8* %8)
%10 = call i8* @PushNString(%struct.Push* %6, i8* %7, i32 %9)
ret i8* %10
}

LLVM IR (-O2):
%struct.Push = type { i32 }
define i8* @PushString(%struct.Push* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i8* @PushNString(%struct.Push* %0, i8* %1, i32 %3)
ret i8* %4
}
int vscan_switchover(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @vscan_switchover() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isprint(int);
void t_isprint_0x6e() {
  Assert_real((isprint(110)),
              "/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",
              555, ("isprint should be 1 for n"));
}


x86 assembly (clang, -O0):
<t_isprint_0x6e>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6e,%edi
call   1030 <isprint@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x22b,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0x6e>:
push   %rax
mov    $0x6e,%edi
call   1030 <isprint@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x22b,%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 = [26 x i8] c"isprint should be 1 for n\00"
define void @t_isprint_0x6e() {
%1 = call i32 @isprint(i32 110)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 555, i8* getelementptr inbounds ([26 x i8], [26 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 = [26 x i8] c"isprint should be 1 for n\00"
define void @t_isprint_0x6e() {
%1 = tail call i32 @isprint(i32 110)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 555, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ start_tests();
int main() {
  start_tests();
  return 0xABCDDCBA;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @start_tests()
ret i32 -1412571974
}
/* Type definitions */
typedef char wint_t;

/* Variables and functions */
int iswxdigit(wint_t wc) {
  return (wc >= '0' && wc <= '9') ||
         ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'F');
}


x86 assembly (clang, -O0):
<iswxdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     1129 <iswxdigit+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x39,%ecx
mov    %al,-0x2(%rbp)
jle    1154 <iswxdigit+0x54>
movsbl -0x1(%rbp),%ecx
and    $0xffffffdf,%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x3(%rbp)
jl     114e <iswxdigit+0x4e>
movsbl -0x1(%rbp),%eax
and    $0xffffffdf,%eax
cmp    $0x46,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iswxdigit>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%al
setb   %al
and    $0xdf,%dil
add    $0xbf,%dil
cmp    $0x6,%dil
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @iswxdigit(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 i1 %9, label %22, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = and i32 %12, -33
%14 = icmp sge i32 %13, 65
br i1 %14, label %15, label %20
15: ; preds = %10
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
%18 = and i32 %17, -33
%19 = icmp sle i32 %18, 70
br label %20
20: ; preds = %15, %10
%21 = phi i1 [ false, %10 ], [ %19, %15 ]
br label %22
22: ; preds = %20, %6
%23 = phi i1 [ true, %6 ], [ %21, %20 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @iswxdigit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = and i8 %0, -33
%5 = add i8 %4, -65
%6 = icmp ult i8 %5, 6
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
f() {
  int i = g();
  int j = {g()};
  int k[] = {g()};
  int l[] = {{g()}};
  struct {
    int x;
  } s = {g()};
  struct {
    int x;
  } s2[] = {g()};
  struct {
    int x;
  } s3[] = {{g()}};
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    $0x0,%al
call   1030 <g@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <g@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <g@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <g@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <g@plt>
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <g@plt>
mov    %eax,-0x20(%rbp)
mov    $0x0,%al
call   1030 <g@plt>
mov    %eax,-0x28(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.anon = type { i32 }
%struct.anon.0 = type { i32 }
%struct.anon.1 = type { i32 }
define i32 @f() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [1 x i32]
%5 = alloca [1 x i32]
%6 = alloca %struct.anon
%7 = alloca [1 x %struct.anon.0]
%8 = alloca [1 x %struct.anon.1]
%9 = call i32 (...) @g()
store i32 %9, i32* %2
%10 = call i32 (...) @g()
store i32 %10, i32* %3
%11 = getelementptr inbounds [1 x i32], [1 x i32]* %4, i64 0, i64 0
%12 = call i32 (...) @g()
store i32 %12, i32* %11
%13 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%14 = call i32 (...) @g()
store i32 %14, i32* %13
%15 = getelementptr inbounds %struct.anon, %struct.anon* %6, i32 0, i32 0
%16 = call i32 (...) @g()
store i32 %16, i32* %15
%17 = getelementptr inbounds [1 x %struct.anon.0], [1 x %struct.anon.0]* %7, i64 0, i64 0
%18 = getelementptr inbounds %struct.anon.0, %struct.anon.0* %17, i32 0, i32 0
%19 = call i32 (...) @g()
store i32 %19, i32* %18
%20 = getelementptr inbounds [1 x %struct.anon.1], [1 x %struct.anon.1]* %8, i64 0, i64 0
%21 = getelementptr inbounds %struct.anon.1, %struct.anon.1* %20, i32 0, i32 0
%22 = call i32 (...) @g()
store i32 %22, i32* %21
%23 = load i32, i32* %1
ret i32 %23
}

LLVM IR (-O2):
define i32 @f() {
%1 = tail call i32 (...) @g()
%2 = tail call i32 (...) @g()
%3 = tail call i32 (...) @g()
%4 = tail call i32 (...) @g()
%5 = tail call i32 (...) @g()
%6 = tail call i32 (...) @g()
%7 = tail call i32 (...) @g()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ kkybrd_discard_last_key();
int kkybrd_get_last_key();
int getch() {
  int key = 0;
  while (key == 0) {
    key = kkybrd_get_last_key();
  }
  kkybrd_discard_last_key();
  return key;
}


x86 assembly (clang, -O0):
<getch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1148 <getch+0x28>
mov    $0x0,%al
call   1040 <kkybrd_get_last_key@plt>
mov    %eax,-0x4(%rbp)
jmp    112f <getch+0xf>
mov    $0x0,%al
call   1030 <kkybrd_discard_last_key@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getch>:
push   %rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <kkybrd_get_last_key@plt>
test   %eax,%eax
je     1130 <getch+0x10>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <kkybrd_discard_last_key@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @getch() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %5, %0
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = call i32 (...) @kkybrd_get_last_key()
store i32 %6, i32* %1
br label %2
7: ; preds = %2
%8 = call i32 (...) @kkybrd_discard_last_key()
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @getch() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 (...) @kkybrd_get_last_key()
%3 = icmp eq i32 %2, 0
br i1 %3, label %1, label %4
4: ; preds = %1
%5 = tail call i32 (...) @kkybrd_discard_last_key()
ret i32 %2
}
void remove_accelerometer_sensor(struct ssp_data *data) { return; }


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

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

LLVM IR (-O0):
%struct.ssp_data = type opaque
define void @remove_accelerometer_sensor(%struct.ssp_data* %0) {
%2 = alloca %struct.ssp_data*
store %struct.ssp_data* %0, %struct.ssp_data** %2
ret void
}

LLVM IR (-O2):
%struct.ssp_data = type opaque
define void @remove_accelerometer_sensor(%struct.ssp_data* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double area, raio, tt = 3.14159;
  scanf("%lf", &raio);
  area = tt * (raio * raio);
  printf("A=%.4f\n", area);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec9(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
lea    0xec5(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm0
mulsd  %xmm0,%xmm0
mulsd  0xebf(%rip),%xmm0
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [8 x i8] c"A=%.4f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
store double 3.141590e+00, double* %4
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %3)
%6 = load double, double* %4
%7 = load double, double* %3
%8 = load double, double* %3
%9 = fmul double %7, %8
%10 = fmul double %6, %9
store double %10, double* %2
%11 = load double, double* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [8 x i8] c"A=%.4f\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = load double, double* %1
%5 = fmul double %4, %4
%6 = fmul double %5, 3.141590e+00
%7 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %6)
ret i32 0
}
/* Variables and functions */
int mpui_list_length(void *);
void *mpui_list_remove_last(void *list) {
  int n = mpui_list_length(list) - 1;
  void **l = list, *e = NULL;
  if (n >= 0) {
    e = l[n];
    l[n] = NULL;
  }
  return e;
}


x86 assembly (clang, -O0):
<mpui_list_remove_last>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <mpui_list_length@plt>
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1165 <mpui_list_remove_last+0x55>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpui_list_remove_last>:
push   %rbx
mov    %rdi,%rbx
call   1030 <mpui_list_length@plt>
test   %eax,%eax
jle    1130 <mpui_list_remove_last+0x20>
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    (%rbx,%rcx,8),%rax
movq   $0x0,(%rbx,%rcx,8)
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @mpui_list_remove_last(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 @mpui_list_length(i8* %6)
%8 = sub nsw i32 %7, 1
store i32 %8, i32* %3
%9 = load i8*, i8** %2
%10 = bitcast i8* %9 to i8**
store i8** %10, i8*** %4
store i8* null, i8** %5
%11 = load i32, i32* %3
%12 = icmp sge i32 %11, 0
br i1 %12, label %13, label %23
13: ; preds = %1
%14 = load i8**, i8*** %4
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8*, i8** %14, i64 %16
%18 = load i8*, i8** %17
store i8* %18, i8** %5
%19 = load i8**, i8*** %4
%20 = load i32, i32* %3
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8*, i8** %19, i64 %21
store i8* null, i8** %22
br label %23
23: ; preds = %13, %1
%24 = load i8*, i8** %5
ret i8* %24
}

LLVM IR (-O2):
define i8* @mpui_list_remove_last(i8* %0) {
%2 = tail call i32 @mpui_list_length(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = add nsw i32 %2, -1
%6 = bitcast i8* %0 to i8**
%7 = zext i32 %5 to i64
%8 = getelementptr inbounds i8*, i8** %6, i64 %7
%9 = load i8*, i8** %8
store i8* null, i8** %8
br label %10
10: ; preds = %4, %1
%11 = phi i8* [ %9, %4 ], [ null, %1 ]
ret i8* %11
}
void myvm_mkvec(int val, struct myvm_vm *vm) {}


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

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

LLVM IR (-O0):
%struct.myvm_vm = type opaque
define void @myvm_mkvec(i32 %0, %struct.myvm_vm* %1) {
%3 = alloca i32
%4 = alloca %struct.myvm_vm*
store i32 %0, i32* %3
store %struct.myvm_vm* %1, %struct.myvm_vm** %4
ret void
}

LLVM IR (-O2):
%struct.myvm_vm = type opaque
define void @myvm_mkvec(i32 %0, %struct.myvm_vm* nocapture %1) {
ret void
}
void _task_switch(void) {}


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

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

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

LLVM IR (-O2):
define void @_task_switch() {
ret void
}
int Cyc_Toc_is_void_star_or_boxed_tvar(void *t) {
  return ({ Cyc_Toc_is_void_star(t); }) || ({ Cyc_Toc_is_boxed_tvar(t); });
}


x86 assembly (clang, -O0):
<Cyc_Toc_is_void_star_or_boxed_tvar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <Cyc_Toc_is_void_star@plt>
mov    %eax,-0xc(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0x11(%rbp)
jne    1161 <Cyc_Toc_is_void_star_or_boxed_tvar+0x41>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <Cyc_Toc_is_boxed_tvar@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Toc_is_void_star_or_boxed_tvar>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <Cyc_Toc_is_void_star@plt>
mov    %eax,%ecx
mov    $0x1,%eax
test   %ecx,%ecx
je     1138 <Cyc_Toc_is_void_star_or_boxed_tvar+0x18>
pop    %rbx
ret
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <Cyc_Toc_is_boxed_tvar@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @Cyc_Toc_is_void_star_or_boxed_tvar(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @Cyc_Toc_is_void_star to i32 (i8*, ...)*)(i8* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @Cyc_Toc_is_boxed_tvar to i32 (i8*, ...)*)(i8* %10)
store i32 %11, i32* %4
%12 = load i32, i32* %4
%13 = icmp ne i32 %12, 0
br label %14
14: ; preds = %9, %1
%15 = phi i1 [ true, %1 ], [ %13, %9 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @Cyc_Toc_is_void_star_or_boxed_tvar(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @Cyc_Toc_is_void_star to i32 (i8*, ...)*)(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @Cyc_Toc_is_boxed_tvar to i32 (i8*, ...)*)(i8* %0)
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
char test_i2c(int i) { return (char)i; }


x86 assembly (clang, -O0):
<test_i2c>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @test_i2c(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @test_i2c(i32 %0) {
%2 = trunc i32 %0 to i8
ret i8 %2
}
/* Variables and functions */
int minitest_fail(char const *, char const *, int);
int assert_fail(const char *msg, const char *caller, int line) {
  return minitest_fail(msg, caller, line);
}


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

x86 assembly (clang, -O2):
<assert_fail>:
jmp    1030 <minitest_fail@plt>

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

LLVM IR (-O2):
define i32 @assert_fail(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @minitest_fail(i8* %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ I2C_SLAVE;
int /*<<< orphan*/ exit(int);
scalar_t__ ioctl(int, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *);
void setI2cAddress(int fd, int address) {
  if (ioctl(fd, I2C_SLAVE, address) < 0) {
    printf("ERROR: setI2cAddress\n");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<setI2cAddress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ea0(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
call   1040 <ioctl@plt>
cmp    $0x0,%rax
jge    1172 <setI2cAddress+0x42>
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setI2cAddress>:
push   %rax
mov    %esi,%edx
mov    0x2eae(%rip),%rax
mov    (%rax),%esi
call   1040 <ioctl@plt>
test   %rax,%rax
js     1148 <setI2cAddress+0x18>
pop    %rax
ret
lea    0xeb1(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@I2C_SLAVE = global i32 0
@str = [21 x i8] c"ERROR: setI2cAddress\00"
define void @setI2cAddress(i32 %0, i32 %1) {
%3 = load i32, i32* @I2C_SLAVE
%4 = tail call i64 @ioctl(i32 %0, i32 %3, i32 %1)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret void
}
double pentatonic_frequency(int y) {
  static double frequencies[] = {69.2957, 77.7817, 92.4986, 103.826, 116.541};
  int pitch = y % 5;
  int octave = y / 5;
  return frequencies[pitch] * (2 << octave);
}


x86 assembly (clang, -O0):
<pentatonic_frequency>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
movslq -0x8(%rbp),%rcx
lea    0x2f02(%rip),%rax
movsd  (%rax,%rcx,8),%xmm0
mov    -0xc(%rbp),%ecx
mov    $0x2,%eax
shl    %cl,%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pentatonic_frequency>:
movslq %edi,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x21,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%edx
sub    %edx,%eax
cltq
lea    0xedb(%rip),%rdx
mov    $0x2,%esi
shl    %cl,%esi
cvtsi2sd %esi,%xmm0
mulsd  (%rdx,%rax,8),%xmm0
ret

LLVM IR (-O0):
@pentatonic_frequency.frequencies = internal global [5 x double] [double 6.929570e+01, double 7.778170e+01, double 0x40571FE90FF97247, double 1.038260e+02, double 1.165410e+02]
define double @pentatonic_frequency(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = srem i32 %5, 5
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = sdiv i32 %7, 5
store i32 %8, i32* %4
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [5 x double], [5 x double]* @pentatonic_frequency.frequencies, i64 0, i64 %10
%12 = load double, double* %11
%13 = load i32, i32* %4
%14 = shl i32 2, %13
%15 = sitofp i32 %14 to double
%16 = fmul double %12, %15
ret double %16
}

LLVM IR (-O2):
@pentatonic_frequency.frequencies = internal unnamed_addr constant [5 x double] [double 6.929570e+01, double 7.778170e+01, double 0x40571FE90FF97247, double 1.038260e+02, double 1.165410e+02]
define double @pentatonic_frequency(i32 %0) {
%2 = srem i32 %0, 5
%3 = sdiv i32 %0, 5
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds [5 x double], [5 x double]* @pentatonic_frequency.frequencies, i64 0, i64 %4
%6 = load double, double* %5
%7 = shl i32 2, %3
%8 = sitofp i32 %7 to double
%9 = fmul double %6, %8
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ print_indent(int);
int /*<<< orphan*/ printf(char *, char const *);
void print_tagname(int indent, const char *str) {
  print_indent(indent);
  printf("%s packet\n", str);
}


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

x86 assembly (clang, -O2):
<print_tagname>:
push   %rbx
mov    %rsi,%rbx
call   1030 <print_indent@plt>
lea    0xed0(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"%s packet\0A\00"
define void @print_tagname(i32 %0, i8* %1) {
%3 = tail call i32 @print_indent(i32 %0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
float sin(float);
float t(float a) { return sin(a); }


x86 assembly (clang, -O0):
<t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t>:
jmp    1030 <sin@plt>

LLVM IR (-O0):
define float @t(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @sin(float %3)
ret float %4
}

LLVM IR (-O2):
define float @t(float %0) {
%2 = tail call float @sin(float %0)
ret float %2
}
void reverse(char rtol[], char ltor[], int u) {
  int i = 0;
  while ((rtol[(u - 1) - i] = ltor[i]) != '\n')
    ++i;
  rtol[u] = '\0';
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    -0x8(%rbp),%rcx
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
sub    -0x18(%rbp),%edx
movslq %edx,%rdx
mov    %al,(%rcx,%rdx,1)
movsbl %al,%eax
cmp    $0xa,%eax
je     114e <reverse+0x4e>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1116 <reverse+0x16>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
lea    -0x1(%rdx),%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rsi),%ecx
cltq
mov    %cl,(%rdi,%rax,1)
add    $0xffffffff,%eax
add    $0x1,%rsi
cmp    $0xa,%cl
jne    1110 <reverse+0x10>
movslq %edx,%rax
movb   $0x0,(%rdi,%rax,1)
ret

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

LLVM IR (-O2):
define void @reverse(i8* nocapture writeonly %0, i8* nocapture %1, i32 %2) {
br label %4
4: ; preds = %4, %3
%5 = phi i64 [ %14, %4 ], [ 0, %3 ]
%6 = getelementptr inbounds i8, i8* %1, i64 %5
%7 = load i8, i8* %6
%8 = trunc i64 %5 to i32
%9 = xor i32 %8, -1
%10 = add i32 %9, %2
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %0, i64 %11
store i8 %7, i8* %12
%13 = icmp eq i8 %7, 10
%14 = add nuw i64 %5, 1
br i1 %13, label %15, label %4
15: ; preds = %4
%16 = sext i32 %2 to i64
%17 = getelementptr inbounds i8, i8* %0, i64 %16
store i8 0, i8* %17
ret void
}
unsigned short int inw_p(unsigned short int port) {
  unsigned short int value;
  __asm__ __volatile__("inw %w1,%0\noutb %%al,$0x80"
                       : "=a"(value)
                       : "Nd"(port));
  return value;
}


x86 assembly (clang, -O0):
<inw_p>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%ax
out    %al,$0x80
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inw_p>:
mov    %edi,%edx
in     (%dx),%ax
out    %al,$0x80
ret

LLVM IR (-O0):
define zeroext i16 @inw_p(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i16 asm sideeffect "inw ${1:w},$0\0Aoutb %al,$$0x80", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i16 %5, i16* %3
%6 = load i16, i16* %3
ret i16 %6
}

LLVM IR (-O2):
define zeroext i16 @inw_p(i16 zeroext %0) {
%2 = tail call i16 asm sideeffect "inw ${1:w},$0\0Aoutb %al,$$0x80", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i16 %2
}