xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int /*<<< orphan*/ fsfr_fetch_uid(char *);
uid_t getuid(void) { return fsfr_fetch_uid("FSFR_UID"); }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"FSFR_UID\00"
define i32 @getuid() {
%1 = call i32 @fsfr_fetch_uid(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [9 x i8] c"FSFR_UID\00"
define i32 @getuid() {
%1 = tail call i32 @fsfr_fetch_uid(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
unsigned int get_hash_size(uint8_t hash_alg) {
  return (hash_alg == 0) ? 20 : 0;
}


x86 assembly (clang, -O0):
<get_hash_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
xor    %eax,%eax
mov    $0x14,%ecx
cmp    $0x0,%rdx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_hash_size>:
xor    %ecx,%ecx
test   %rdi,%rdi
mov    $0x14,%eax
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @get_hash_size(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = select i1 %2, i32 20, i32 0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int fileno(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
int main(void) {
  int fd = fileno(stdout);
  printf("before!\n");
  close(fd);
  printf("after!\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
call   1050 <fileno@plt>
mov    %eax,-0x4(%rbp)
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1050 <fileno@plt>
mov    %eax,%ebx
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1040 <close@plt>
lea    0xead(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [9 x i8] c"before!\0A\00"
@.str.1 = [8 x i8] c"after!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = load i32, i32* @stdout
%3 = call i32 @fileno(i32 %2)
store i32 %3, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %1
%6 = call i32 @close(i32 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@str = [8 x i8] c"before!\00"
@str.2 = [7 x i8] c"after!\00"
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fileno(i32 %1)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @close(i32 %2)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int x = 10, y = 20;
  x += y;
  printf("integer addition: %d\n", x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [22 x i8] c"integer addition: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 20, i32* %3
%4 = load i32, i32* %3
%5 = load i32, i32* %2
%6 = add nsw i32 %5, %4
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"integer addition: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 30)
ret i32 0
}
OP(ed, cd) { illegal_2(); }


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_2()
ret i32 undef
}
void AESReset(void) {
  (*((volatile unsigned long *)(0x40024000 + 0x00000740))) = 0x00000001;
}


x86 assembly (clang, -O0):
<AESReset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40024740,%eax
movq   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<AESReset>:
movq   $0x1,0x40024740
ret

LLVM IR (-O0):
define void @AESReset() {
store volatile i64 1, i64* inttoptr (i64 1073891136 to i64*)
ret void
}

LLVM IR (-O2):
define void @AESReset() {
store volatile i64 1, i64* inttoptr (i64 1073891136 to i64*)
ret void
}
float bar(float x, float y, float z) { return x + (-y * z * z); }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  -0xc(%rbp),%xmm0
movss  -0xc(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
mulss  %xmm2,%xmm1
mulss  %xmm2,%xmm1
subss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @bar(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = fneg float %8
%10 = load float, float* %6
%11 = fmul float %9, %10
%12 = load float, float* %6
%13 = call float @llvm.fmuladd.f32(float %11, float %12, float %7)
ret float %13
}

LLVM IR (-O2):
define float @bar(float %0, float %1, float %2) {
%4 = fneg float %1
%5 = fmul float %4, %2
%6 = tail call float @llvm.fmuladd.f32(float %5, float %2, float %0)
ret float %6
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ approx_wait(int);
int /*<<< orphan*/ led_init(int /*<<< orphan*/ volatile *, int);
int /*<<< orphan*/ toggle(int /*<<< orphan*/ volatile *, int);
int main() {
  volatile uint32_t *base = (volatile uint32_t *)(0x2009C020);
  uint8_t pin = 18;
  led_init(base, pin);
  while (1) {
    toggle(base, pin);
    approx_wait(1000);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2009c020,%eax
mov    %rax,-0x10(%rbp)
movl   $0x12,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <led_init@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1050 <toggle@plt>
mov    $0x3e8,%edi
call   1030 <approx_wait@plt>
jmp    115b <main+0x2b>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2009c020,%edi
mov    $0x12,%esi
call   1040 <led_init@plt>
mov    $0x2009c020,%edi
mov    $0x12,%esi
call   1050 <toggle@plt>
mov    $0x3e8,%edi
call   1030 <approx_wait@plt>
jmp    1140 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
store i32 0, i32* %1
store i32* inttoptr (i64 537509920 to i32*), i32** %2
store i32 18, i32* %3
%4 = load i32*, i32** %2
%5 = load i32, i32* %3
%6 = call i32 @led_init(i32* %4, i32 %5)
br label %7
7: ; preds = %0, %7
%8 = load i32*, i32** %2
%9 = load i32, i32* %3
%10 = call i32 @toggle(i32* %8, i32 %9)
%11 = call i32 @approx_wait(i32 1000)
br label %7
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @led_init(i32* inttoptr (i64 537509920 to i32*), i32 18)
br label %2
2: ; preds = %2, %0
%3 = tail call i32 @toggle(i32* inttoptr (i64 537509920 to i32*), i32 18)
%4 = tail call i32 @approx_wait(i32 1000)
br label %2
}
_Complex long pass_complex_long(_Complex long arg) { return arg; }


x86 assembly (clang, -O0):
<pass_complex_long>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
pop    %rbp
ret

x86 assembly (clang, -O2):
<pass_complex_long>:
mov    %rsi,%rdx
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define { i64, i64 } @pass_complex_long(i64 %0, i64 %1) {
%3 = insertvalue { i64, i64 } poison, i64 %0, 0
%4 = insertvalue { i64, i64 } %3, i64 %1, 1
ret { i64, i64 } %4
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
uint32_t Sched_GetTick(void) {
  return (*(volatile unsigned long *)(0xE0004000 + 0x08));
}


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

x86 assembly (clang, -O2):
<Sched_GetTick>:
mov    $0xe0004008,%eax
mov    (%rax),%rax
ret

LLVM IR (-O0):
define i64 @Sched_GetTick() {
%1 = load volatile i64, i64* inttoptr (i64 3758112776 to i64*)
ret i64 %1
}

LLVM IR (-O2):
define i64 @Sched_GetTick() {
%1 = load volatile i64, i64* inttoptr (i64 3758112776 to i64*)
ret i64 %1
}
/* Variables and functions */
float get_difference(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ get_hour_angle(int, int);
int /*<<< orphan*/ get_min_angle(int);
float calc_angle(int hour, int min) {
  return get_difference(get_hour_angle(hour, min), get_min_angle(min));
}


x86 assembly (clang, -O0):
<calc_angle>:
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   1050 <get_hour_angle@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <get_min_angle@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
call   1030 <get_difference@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_angle>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
call   1050 <get_hour_angle@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1040 <get_min_angle@plt>
mov    %ebp,%edi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <get_difference@plt>

LLVM IR (-O0):
define float @calc_angle(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @get_hour_angle(i32 %5, i32 %6)
%8 = load i32, i32* %4
%9 = call i32 @get_min_angle(i32 %8)
%10 = call float @get_difference(i32 %7, i32 %9)
ret float %10
}

LLVM IR (-O2):
define float @calc_angle(i32 %0, i32 %1) {
%3 = tail call i32 @get_hour_angle(i32 %0, i32 %1)
%4 = tail call i32 @get_min_angle(i32 %1)
%5 = tail call float @get_difference(i32 %3, i32 %4)
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int pipe(int *);
int main() {
  int pipefd[2];
  if (pipe(pipefd) == -1) {
    perror("pipe");
    exit(EXIT_FAILURE);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <pipe@plt>
cmp    $0xffffffff,%eax
jne    116b <main+0x3b>
lea    0xea8(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rdi
call   1030 <pipe@plt>
cmp    $0xffffffff,%eax
je     1142 <main+0x12>
xor    %eax,%eax
pop    %rcx
ret
lea    0xeb7(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"pipe\00"
@EXIT_FAILURE = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i32]
store i32 0, i32* %1
%3 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%4 = call i32 @pipe(i32* %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = call i32 @exit(i32 %8)
unreachable
10: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"pipe\00"
@EXIT_FAILURE = global i32 0
define i32 @main() {
%1 = alloca [2 x i32]
%2 = bitcast [2 x i32]* %1 to i8*
%3 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%4 = call i32 @pipe(i32* %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = call i32 @exit(i32 %8)
unreachable
10: ; preds = %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *StringBuilder_malloc(size_t size) {
  void *p = malloc(size);
  if (p == NULL) {
    fprintf(stderr, "StringBuilder: OUT OF MEMORY\n");
    exit(EXIT_FAILURE);
  }
  return p;
}


x86 assembly (clang, -O0):
<StringBuilder_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1177 <StringBuilder_malloc+0x47>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StringBuilder_malloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <StringBuilder_malloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [30 x i8] c"StringBuilder: OUT OF MEMORY\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @StringBuilder_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"StringBuilder: OUT OF MEMORY\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @StringBuilder_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int backtrace(void **, size_t);
int /*<<< orphan*/ backtrace_symbols_fd(void **, int, int);
int diminuto_stacktrace_fd(void **buffer, size_t size, int fd) {
  int rc;
  backtrace_symbols_fd(buffer, rc = backtrace(buffer, size), fd);
  return rc;
}


x86 assembly (clang, -O0):
<diminuto_stacktrace_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <backtrace@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
mov    %esi,-0x18(%rbp)
mov    -0x14(%rbp),%edx
call   1030 <backtrace_symbols_fd@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<diminuto_stacktrace_fd>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rdi,%rbx
call   1040 <backtrace@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r14d,%edx
call   1030 <backtrace_symbols_fd@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @diminuto_stacktrace_fd(i8** %0, i64 %1, i32 %2) {
%4 = alloca i8**
%5 = alloca i64
%6 = alloca i32
%7 = alloca i32
store i8** %0, i8*** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%8 = load i8**, i8*** %4
%9 = load i8**, i8*** %4
%10 = load i64, i64* %5
%11 = call i32 @backtrace(i8** %9, i64 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %6
%13 = call i32 @backtrace_symbols_fd(i8** %8, i32 %11, i32 %12)
%14 = load i32, i32* %7
ret i32 %14
}

LLVM IR (-O2):
define i32 @diminuto_stacktrace_fd(i8** %0, i64 %1, i32 %2) {
%4 = tail call i32 @backtrace(i8** %0, i64 %1)
%5 = tail call i32 @backtrace_symbols_fd(i8** %0, i32 %4, i32 %2)
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
uint32_t myabs(int x) {
  uint32_t n;
  int y;
  int z;
  y = x >> 31;
  z = x + y;
  n = z ^ y;
  printf("x=0x%x, y=0x%x, z=0x%x\n", x, y, z);
  return n;
}


x86 assembly (clang, -O0):
<myabs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myabs>:
push   %rbx
mov    %edi,%esi
mov    %edi,%edx
sar    $0x1f,%edx
lea    (%rdx,%rsi,1),%ecx
mov    %edi,%ebx
neg    %ebx
cmovs  %edi,%ebx
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"x=0x%x, y=0x%x, z=0x%x\0A\00"
define i32 @myabs(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = ashr i32 %6, 31
store i32 %7, i32* %4
%8 = load i32, i32* %2
%9 = load i32, i32* %4
%10 = add nsw i32 %8, %9
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = xor i32 %11, %12
store i32 %13, i32* %3
%14 = load i32, i32* %2
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %15, i32 %16)
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@.str = [24 x i8] c"x=0x%x, y=0x%x, z=0x%x\0A\00"
define i32 @myabs(i32 %0) {
%2 = ashr i32 %0, 31
%3 = add nsw i32 %2, %0
%4 = xor i32 %3, %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %2, i32 %3)
ret i32 %4
}
void rop3_25_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = T & S;
  stk3 = ~stk3;
  stk2 = *D & stk3;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_25_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xd(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_25_0_0>:
and    %esi,%edx
not    %dl
and    (%rdi),%dl
xor    %sil,%dl
not    %dl
mov    %dl,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_25_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %6
%11 = zext i8 %10 to i32
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = and i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %9
%16 = load i8, i8* %9
%17 = zext i8 %16 to i32
%18 = xor i32 %17, -1
%19 = trunc i32 %18 to i8
store i8 %19, i8* %9
%20 = load i8*, i8** %4
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = load i8, i8* %9
%24 = zext i8 %23 to i32
%25 = and i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %8
%27 = load i8, i8* %5
%28 = zext i8 %27 to i32
%29 = load i8, i8* %8
%30 = zext i8 %29 to i32
%31 = xor i32 %28, %30
%32 = trunc i32 %31 to i8
store i8 %32, i8* %7
%33 = load i8, i8* %7
%34 = zext i8 %33 to i32
%35 = xor i32 %34, -1
%36 = trunc i32 %35 to i8
store i8 %36, i8* %7
%37 = load i8, i8* %7
%38 = load i8*, i8** %4
store i8 %37, i8* %38
ret void
}

LLVM IR (-O2):
define void @rop3_25_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = and i8 %2, %1
%5 = xor i8 %4, -1
%6 = load i8, i8* %0
%7 = and i8 %6, %5
%8 = xor i8 %7, %1
%9 = xor i8 %8, -1
store i8 %9, i8* %0
ret void
}
int test_imm_EFuint16_reg(unsigned short val) {
  return ((val) & (0xEF << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_EFuint16_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, 239
%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_EFuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 239
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
char *current_dir() {
  return "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/manateelazycat/mrkeyboard/refs/heads/"
         "master/app/musicplayer/current_dir.c";
}


x86 assembly (clang, -O0):
<current_dir>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<current_dir>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [164 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/manateelazycat/mrkeyboard/refs/heads/master/app/musicplayer/current_dir.c\00"
define i8* @current_dir() {
ret i8* getelementptr inbounds ([164 x i8], [164 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [164 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/manateelazycat/mrkeyboard/refs/heads/master/app/musicplayer/current_dir.c\00"
define i8* @current_dir() {
ret i8* getelementptr inbounds ([164 x i8], [164 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ ispunct(int);
void t_ispunct_0x2c() {
  Assert_real((ispunct(44)),
              "/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_ispunct.c",
              225, ("ispunct should be 1 for ,"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0x2c>:
push   %rax
mov    $0x2c,%edi
call   1030 <ispunct@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0xe1,%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_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 1 for ,\00"
define void @t_ispunct_0x2c() {
%1 = call i32 @ispunct(i32 44)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 225, 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_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 1 for ,\00"
define void @t_ispunct_0x2c() {
%1 = tail call i32 @ispunct(i32 44)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 225, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ get_pin(int /*<<< orphan*/, int, int);
uint8_t io_get_pin_pullup(uint8_t pin) { return get_pin(pin, 0x0C, 0x0D); }


x86 assembly (clang, -O0):
<io_get_pin_pullup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xc,%esi
mov    $0xd,%edx
call   1030 <get_pin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_get_pin_pullup>:
mov    $0xc,%esi
mov    $0xd,%edx
jmp    1030 <get_pin@plt>

LLVM IR (-O0):
define i32 @io_get_pin_pullup(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @get_pin(i32 %3, i32 12, i32 13)
ret i32 %4
}

LLVM IR (-O2):
define i32 @io_get_pin_pullup(i32 %0) {
%2 = tail call i32 @get_pin(i32 %0, i32 12, i32 13)
ret i32 %2
}
unsigned long PSEgetLibType() { return 16; }


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

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

LLVM IR (-O0):
define i64 @PSEgetLibType() {
ret i64 16
}

LLVM IR (-O2):
define i64 @PSEgetLibType() {
ret i64 16
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_slli_epi32(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i __attribute__((no, unused)) test0(__m128i s1) {
  return _mm_slli_epi32(s1, 0);
}


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

x86 assembly (clang, -O2):
<test0>:
xor    %esi,%esi
jmp    1030 <_mm_slli_epi32@plt>

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

LLVM IR (-O2):
define i32 @test0(i32 %0) {
%2 = tail call i32 @_mm_slli_epi32(i32 %0, i32 0)
ret i32 %2
}
/* Variables and functions */
int close(int);
int i2c_close(int flhndl) { return close(flhndl); }


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

x86 assembly (clang, -O2):
<i2c_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @i2c_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void printPowerPackRailPwmDuty(int pwm_duty) {
  int pwm_duty_ratio;
  pwm_duty_ratio = (int)(((double)pwm_duty / 255) * 100);
  printf("PWM Duty: %4d / %4d ( %3d %%)\n", pwm_duty, 255, pwm_duty_ratio);
  return;
}


x86 assembly (clang, -O0):
<printPowerPackRailPwmDuty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xee0(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xecc(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%ecx
lea    0xec4(%rip),%rdi
mov    $0xff,%edx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printPowerPackRailPwmDuty>:
mov    %edi,%esi
cvtsi2sd %edi,%xmm0
divsd  0xee2(%rip),%xmm0
mulsd  0xee2(%rip),%xmm0
cvttsd2si %xmm0,%ecx
lea    0xedf(%rip),%rdi
mov    $0xff,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"PWM Duty: %4d / %4d ( %3d %%)\0A\00"
define void @printPowerPackRailPwmDuty(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sitofp i32 %4 to double
%6 = fdiv double %5, 2.550000e+02
%7 = fmul double %6, 1.000000e+02
%8 = fptosi double %7 to i32
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %9, i32 255, i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"PWM Duty: %4d / %4d ( %3d %%)\0A\00"
define void @printPowerPackRailPwmDuty(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fdiv double %2, 2.550000e+02
%4 = fmul double %3, 1.000000e+02
%5 = fptosi double %4 to i32
%6 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %0, i32 255, i32 %5)
ret void
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ valid;
};
typedef int /*<<< orphan*/ ASN1_VALUE;
typedef TYPE_1__ ASN1_TLC;
typedef int /*<<< orphan*/ ASN1_TEMPLATE;

/* Variables and functions */
int asn1_template_ex_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                         int /*<<< orphan*/ const *, int /*<<< orphan*/,
                         TYPE_1__ *);
int ASN1_template_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
                      const ASN1_TEMPLATE *tt) {
  ASN1_TLC c;
  c.valid = 0;
  return asn1_template_ex_d2i(pval, in, len, tt, 0, &c);
}


x86 assembly (clang, -O0):
<ASN1_template_d2i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
xor    %r8d,%r8d
lea    -0x28(%rbp),%r9
call   1030 <asn1_template_ex_d2i@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ASN1_template_d2i>:
push   %rax
movq   $0x0,(%rsp)
mov    %rsp,%r9
xor    %r8d,%r8d
call   1030 <asn1_template_ex_d2i@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64 }
define i32 @ASN1_template_d2i(i32** %0, i8** %1, i64 %2, i32* %3) {
%5 = alloca i32**
%6 = alloca i8**
%7 = alloca i64
%8 = alloca i32*
%9 = alloca %struct.TYPE_3__
store i32** %0, i32*** %5
store i8** %1, i8*** %6
store i64 %2, i64* %7
store i32* %3, i32** %8
%10 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %9, i32 0, i32 0
store i64 0, i64* %10
%11 = load i32**, i32*** %5
%12 = load i8**, i8*** %6
%13 = load i64, i64* %7
%14 = load i32*, i32** %8
%15 = call i32 @asn1_template_ex_d2i(i32** %11, i8** %12, i64 %13, i32* %14, i32 0, %struct.TYPE_3__* %9)
ret i32 %15
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i64 }
define i32 @ASN1_template_d2i(i32** %0, i8** %1, i64 %2, i32* %3) {
%5 = alloca %struct.TYPE_3__
%6 = bitcast %struct.TYPE_3__* %5 to i8*
%7 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i64 0, i32 0
store i64 0, i64* %7
%8 = call i32 @asn1_template_ex_d2i(i32** %0, i8** %1, i64 %2, i32* %3, i32 0, %struct.TYPE_3__* %5)
ret i32 %8
}
/* Variables and functions */
int helloworld(int);
int helloworld2(int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  printf("Hello World!.\n");
  printf("%d\n", helloworld(5));
  printf("%d\n", helloworld2(5));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x5,%edi
call   1050 <helloworld@plt>
mov    %eax,%esi
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x5,%edi
call   1030 <helloworld2@plt>
mov    %eax,%esi
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
mov    $0x5,%edi
call   1060 <helloworld@plt>
lea    0xea2(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x5,%edi
call   1040 <helloworld2@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Hello World!.\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @helloworld(i32 5)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = call i32 @helloworld2(i32 5)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%d\0A\00"
@str = [14 x i8] c"Hello World!.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @helloworld(i32 5)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = tail call i32 @helloworld2(i32 5)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x66() {
  Assert_real((isbdigit(102) == 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_isbdigit.c",
              515, ("isbdigit should be 0 for f"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0x66>:
push   %rax
mov    $0x66,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x203,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for f\00"
define void @t_isbdigit_0x66() {
%1 = call i64 @isbdigit(i32 102)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 515, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for f\00"
define void @t_isbdigit_0x66() {
%1 = tail call i64 @isbdigit(i32 102)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 515, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void gtk_entry_new() {}


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

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

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

LLVM IR (-O2):
define void @gtk_entry_new() {
ret void
}
double complement(double x) { return 1 - x; }


x86 assembly (clang, -O0):
<complement>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<complement>:
movsd  0xef8(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @complement(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double 1.000000e+00, %3
ret double %4
}

LLVM IR (-O2):
define double @complement(double %0) {
%2 = fsub double 1.000000e+00, %0
ret double %2
}
/* Variables and functions */
int MPI_Add_error_class(int *);
int MPI_Add_error_string(int, char *);
int PyMPI_MPICH2_MPI_Add_error_class(int *errorclass) {
  int ierr;
  char errstr[1] = {0};
  ierr = MPI_Add_error_class(errorclass);
  if (ierr)
    return ierr;
  return MPI_Add_error_string(*errorclass, errstr);
}


x86 assembly (clang, -O0):
<PyMPI_MPICH2_MPI_Add_error_class>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x15(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <memset@plt>
mov    -0x10(%rbp),%rdi
call   1040 <MPI_Add_error_class@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     116d <PyMPI_MPICH2_MPI_Add_error_class+0x3d>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117f <PyMPI_MPICH2_MPI_Add_error_class+0x4f>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
lea    -0x15(%rbp),%rsi
call   1050 <MPI_Add_error_string@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PyMPI_MPICH2_MPI_Add_error_class>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movb   $0x0,0xf(%rsp)
call   1030 <MPI_Add_error_class@plt>
test   %eax,%eax
jne    1142 <PyMPI_MPICH2_MPI_Add_error_class+0x22>
mov    (%rbx),%edi
lea    0xf(%rsp),%rsi
call   1040 <MPI_Add_error_string@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @PyMPI_MPICH2_MPI_Add_error_class(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
%5 = alloca [1 x i8]
store i32* %0, i32** %3
%6 = bitcast [1 x i8]* %5 to i8*
%7 = load i32*, i32** %3
%8 = call i32 @MPI_Add_error_class(i32* %7)
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = load i32, i32* %4
store i32 %12, i32* %2
br label %18
13: ; preds = %1
%14 = load i32*, i32** %3
%15 = load i32, i32* %14
%16 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%17 = call i32 @MPI_Add_error_string(i32 %15, i8* %16)
store i32 %17, i32* %2
br label %18
18: ; preds = %13, %11
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @PyMPI_MPICH2_MPI_Add_error_class(i32* %0) {
%2 = alloca [1 x i8]
%3 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
store i8 0, i8* %3
%4 = tail call i32 @MPI_Add_error_class(i32* %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %0
%8 = call i32 @MPI_Add_error_string(i32 %7, i8* %3)
br label %9
9: ; preds = %1, %6
%10 = phi i32 [ %8, %6 ], [ %4, %1 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int recv(int, char *, int, int /*<<< orphan*/);
int readSocket(int sockfd, char *buff_in, int len) {
  int bytesRead = recv(sockfd, buff_in, len, 0);
  if (bytesRead < 0) {
    perror("ReadSocket error");
  } else {
    buff_in[bytesRead] = '\0';
  }
  return bytesRead;
}


x86 assembly (clang, -O0):
<readSocket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    1161 <readSocket+0x41>
lea    0xea9(%rip),%rdi
call   1040 <perror@plt>
jmp    116d <readSocket+0x4d>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readSocket>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,%ebp
test   %eax,%eax
js     1142 <readSocket+0x22>
mov    %ebp,%eax
movb   $0x0,(%rbx,%rax,1)
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xeb7(%rip),%rdi
call   1040 <perror@plt>
jmp    1139 <readSocket+0x19>

LLVM IR (-O0):
@.str = [17 x i8] c"ReadSocket error\00"
define i32 @readSocket(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @recv(i32 %8, i8* %9, i32 %10, i32 0)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %3
%15 = call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %21
16: ; preds = %3
%17 = load i8*, i8** %5
%18 = load i32, i32* %7
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
store i8 0, i8* %20
br label %21
21: ; preds = %16, %14
%22 = load i32, i32* %7
ret i32 %22
}

LLVM IR (-O2):
@.str = [17 x i8] c"ReadSocket error\00"
define i32 @readSocket(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @recv(i32 %0, i8* %1, i32 %2, i32 0)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %11
8: ; preds = %3
%9 = zext i32 %4 to i64
%10 = getelementptr inbounds i8, i8* %1, i64 %9
store i8 0, i8* %10
br label %11
11: ; preds = %8, %6
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ cleanExit();
int /*<<< orphan*/ exit(int);
void int_leave(int sig) {
  cleanExit();
  exit(sig);
}


x86 assembly (clang, -O0):
<int_leave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <cleanExit@plt>
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<int_leave>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <cleanExit@plt>
mov    %ebx,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @int_leave(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @cleanExit()
%4 = load i32, i32* %2
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
define void @int_leave(i32 %0) {
%2 = tail call i32 (...) @cleanExit()
%3 = tail call i32 @exit(i32 %0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t reverse32(uint32_t n) {
  uint64_t retval;
  uint8_t *np = (uint8_t *)&n;
  uint8_t *retvalp = (uint8_t *)&retval;
  for (int i = 0; i < sizeof(uint32_t); i++)
    retvalp[i] = np[sizeof(uint32_t) - 1 - i];
  return retval;
}


x86 assembly (clang, -O0):
<reverse32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
cmp    $0x4,%rax
jae    1158 <reverse32+0x58>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rdx
mov    $0x3,%ecx
sub    %rdx,%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111e <reverse32+0x1e>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @reverse32(i32 %0) {
ret i32 %0
}
int MAX(int a, int b) {
  int max = a;
  if (b > a)
    max = b;
  return max;
}


x86 assembly (clang, -O0):
<MAX>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jle    1122 <MAX+0x22>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @MAX(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
store i32 %6, i32* %5
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = icmp sgt i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32, i32* %4
store i32 %11, i32* %5
br label %12
12: ; preds = %10, %2
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
define i32 @MAX(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, %0
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int /*<<< orphan*/ xxx();
int main() {
  foo();
  xxx();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <foo@plt>
mov    $0x0,%al
call   1030 <xxx@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @foo()
%2 = call i32 (...) @xxx()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 (...) @xxx()
ret i32 0
}