xunge/DecIR huggingface dataset:
int prefix_underscores_count(const char *str) {
  const char *tail = str;
  while (*tail == '_') {
    tail++;
  }
  return tail - str;
}


x86 assembly (clang, -O0):
<prefix_underscores_count>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5f,%eax
jne    1131 <prefix_underscores_count+0x31>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <prefix_underscores_count+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prefix_underscores_count>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x5f,(%rdi)
lea    0x1(%rdi),%rdi
je     1110 <prefix_underscores_count+0x10>
ret

LLVM IR (-O0):
define i32 @prefix_underscores_count(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %10, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 95
br i1 %9, label %10, label %13
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %3
br label %5
13: ; preds = %5
%14 = load i8*, i8** %3
%15 = load i8*, i8** %2
%16 = ptrtoint i8* %14 to i64
%17 = ptrtoint i8* %15 to i64
%18 = sub i64 %16, %17
%19 = trunc i64 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @prefix_underscores_count(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 95
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %2, label %7
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
void foo73() {}


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

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

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

LLVM IR (-O2):
define void @foo73() {
ret void
}
int elog_init(void) { return -1; }


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

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

LLVM IR (-O0):
define i32 @elog_init() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @elog_init() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void main() {
  int a, b;
  a = 077;
  b = a | 3;
  printf("\40:The a | b(decimal) is %d\n", b);
  b |= 7;
  printf("\40:The a | b(decimal) is %d\n", b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3f,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     $0x3,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
or     $0x7,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x3f,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3f,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [28 x i8] c" :The a | b(decimal) is %d\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
store i32 63, i32* %1
%3 = load i32, i32* %1
%4 = or i32 %3, 3
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %2
%8 = or i32 %7, 7
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c" :The a | b(decimal) is %d\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 63)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 63)
ret void
}
/* Type definitions */
union bpf_attr {
  scalar_t__ prog_flags;
  scalar_t__ kern_version;
  scalar_t__ log_level;
  scalar_t__ log_size;
  scalar_t__ log_buf;
  scalar_t__ license;
  scalar_t__ insns;
  scalar_t__ insn_cnt;
  int /*<<< orphan*/ prog_type;
};
typedef int /*<<< orphan*/ attr;

/* Variables and functions */
int /*<<< orphan*/ BPF_PROG_LOAD;
int /*<<< orphan*/ BPF_PROG_TYPE_KPROBE;
int syscall(int, int /*<<< orphan*/, union bpf_attr *, int);
int main(void) {
  union bpf_attr attr;
  attr.prog_type = BPF_PROG_TYPE_KPROBE;
  attr.insn_cnt = 0;
  attr.insns = 0;
  attr.license = 0;
  attr.log_buf = 0;
  attr.log_size = 0;
  attr.log_level = 0;
  attr.kern_version = 0;
  attr.prog_flags = 0;
  return syscall(321, BPF_PROG_LOAD, &attr, sizeof(attr));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x10(%rbp)
mov    0x2e76(%rip),%rax
mov    (%rax),%esi
mov    $0x141,%edi
lea    -0x10(%rbp),%rdx
mov    $0x8,%ecx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movq   $0x0,(%rsp)
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
mov    $0x141,%edi
mov    $0x8,%ecx
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
%union.bpf_attr = type { i64 }
@BPF_PROG_TYPE_KPROBE = global i32 0
@BPF_PROG_LOAD = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca %union.bpf_attr
store i32 0, i32* %1
%3 = load i32, i32* @BPF_PROG_TYPE_KPROBE
%4 = bitcast %union.bpf_attr* %2 to i32*
store i32 %3, i32* %4
%5 = bitcast %union.bpf_attr* %2 to i64*
store i64 0, i64* %5
%6 = bitcast %union.bpf_attr* %2 to i64*
store i64 0, i64* %6
%7 = bitcast %union.bpf_attr* %2 to i64*
store i64 0, i64* %7
%8 = bitcast %union.bpf_attr* %2 to i64*
store i64 0, i64* %8
%9 = bitcast %union.bpf_attr* %2 to i64*
store i64 0, i64* %9
%10 = bitcast %union.bpf_attr* %2 to i64*
store i64 0, i64* %10
%11 = bitcast %union.bpf_attr* %2 to i64*
store i64 0, i64* %11
%12 = bitcast %union.bpf_attr* %2 to i64*
store i64 0, i64* %12
%13 = load i32, i32* @BPF_PROG_LOAD
%14 = call i32 @syscall(i32 321, i32 %13, %union.bpf_attr* %2, i32 8)
ret i32 %14
}

LLVM IR (-O2):
%union.bpf_attr = type { i64 }
@BPF_PROG_TYPE_KPROBE = global i32 0
@BPF_PROG_LOAD = global i32 0
define i32 @main() {
%1 = alloca %union.bpf_attr
%2 = bitcast %union.bpf_attr* %1 to i8*
%3 = getelementptr inbounds %union.bpf_attr, %union.bpf_attr* %1, i64 0, i32 0
store i64 0, i64* %3
%4 = load i32, i32* @BPF_PROG_LOAD
%5 = call i32 @syscall(i32 321, i32 %4, %union.bpf_attr* %1, i32 8)
ret i32 %5
}
/* Type definitions */
typedef int uint32_t;
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
uint32_t gettickcount() {
  struct timespec ts;
  clock_gettime(CLOCK_MONOTONIC, &ts);
  return (1000 * ts.tv_sec + ts.tv_nsec / 1000000);
}


x86 assembly (clang, -O0):
<gettickcount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3e8,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettickcount>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
imul   $0x3e8,(%rsp),%ecx
movslq 0x4(%rsp),%rax
imul   $0x431bde83,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x32,%rax
add    %edx,%eax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
@CLOCK_MONOTONIC = global i32 0
define i32 @gettickcount() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 1000, %5
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000000
%10 = add nsw i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
@CLOCK_MONOTONIC = global i32 0
define i32 @gettickcount() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, 1000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%9 = load i32, i32* %8
%10 = sdiv i32 %9, 1000000
%11 = add nsw i32 %10, %7
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0xf2() {
  Assert_real((isodigit(242) == 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_isodigit.c",
              1215, ("isodigit should be 0 for 0xf2"));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0xf2>:
push   %rax
mov    $0xf2,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x4bf,%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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xf2\00"
define void @t_isodigit_0xf2() {
%1 = call i64 @isodigit(i32 242)
%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 1215, i8* getelementptr inbounds ([30 x i8], [30 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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xf2\00"
define void @t_isodigit_0xf2() {
%1 = tail call i64 @isodigit(i32 242)
%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 1215, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int *allocInt(int size) { return (int *)malloc(sizeof(int) * size); }


x86 assembly (clang, -O0):
<allocInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocInt>:
shl    $0x2,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i32* @allocInt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = mul i64 4, %4
%6 = trunc i64 %5 to i32
%7 = call i64 @malloc(i32 %6)
%8 = inttoptr i64 %7 to i32*
ret i32* %8
}

LLVM IR (-O2):
define i32* @allocInt(i32 %0) {
%2 = shl i32 %0, 2
%3 = tail call i64 @malloc(i32 %2)
%4 = inttoptr i64 %3 to i32*
ret i32* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_sndfile_read_channel_map() {
  printf("NOT IMPLEMENTED:"
         "pa_sndfile_read_channel_map"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [44 x i8] c"NOT IMPLEMENTED:pa_sndfile_read_channel_map\00"
define i32 @pa_sndfile_read_channel_map() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ lcd_chr(short, short, short);
void lcd_hex(short row, short col, short val) {
  lcd_chr(row, col, (val < 10) ? ('0' + val) : ('A' + val - 10));
}


x86 assembly (clang, -O0):
<lcd_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dx,%ax
mov    %si,%cx
mov    %di,%dx
mov    %dx,-0x2(%rbp)
mov    %cx,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    -0x2(%rbp),%ax
mov    %ax,-0xa(%rbp)
mov    -0x4(%rbp),%ax
mov    %ax,-0x8(%rbp)
movswl -0x6(%rbp),%eax
cmp    $0xa,%eax
jge    1159 <lcd_hex+0x49>
movswl -0x6(%rbp),%eax
add    $0x30,%eax
mov    %eax,-0x10(%rbp)
jmp    1166 <lcd_hex+0x56>
movswl -0x6(%rbp),%eax
add    $0x41,%eax
sub    $0xa,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%cx
mov    -0xa(%rbp),%dx
mov    -0x10(%rbp),%eax
movswl %dx,%edi
movswl %cx,%esi
movswl %ax,%edx
call   1030 <lcd_chr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_hex>:
lea    0x37(%rdx),%eax
mov    %edx,%ecx
add    $0x30,%ecx
cmp    $0xa,%dx
cmovge %eax,%ecx
movswl %cx,%edx
jmp    1030 <lcd_chr@plt>

LLVM IR (-O0):
define void @lcd_hex(i16 signext %0, i16 signext %1, i16 signext %2) {
%4 = alloca i16
%5 = alloca i16
%6 = alloca i16
store i16 %0, i16* %4
store i16 %1, i16* %5
store i16 %2, i16* %6
%7 = load i16, i16* %4
%8 = load i16, i16* %5
%9 = load i16, i16* %6
%10 = sext i16 %9 to i32
%11 = icmp slt i32 %10, 10
br i1 %11, label %12, label %16
12: ; preds = %3
%13 = load i16, i16* %6
%14 = sext i16 %13 to i32
%15 = add nsw i32 48, %14
br label %21
16: ; preds = %3
%17 = load i16, i16* %6
%18 = sext i16 %17 to i32
%19 = add nsw i32 65, %18
%20 = sub nsw i32 %19, 10
br label %21
21: ; preds = %16, %12
%22 = phi i32 [ %15, %12 ], [ %20, %16 ]
%23 = trunc i32 %22 to i16
%24 = call i32 @lcd_chr(i16 signext %7, i16 signext %8, i16 signext %23)
ret void
}

LLVM IR (-O2):
define void @lcd_hex(i16 signext %0, i16 signext %1, i16 signext %2) {
%4 = icmp slt i16 %2, 10
%5 = select i1 %4, i16 48, i16 55
%6 = add i16 %5, %2
%7 = tail call i32 @lcd_chr(i16 signext %0, i16 signext %1, i16 signext %6)
ret void
}
/* Variables and functions */
char *getenv(char *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  const char *myvar = getenv("GDB_TEST_VAR");
  if (myvar != NULL)
    printf("It worked!  myvar = '%s'\n", myvar);
  else
    printf("It failed.");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1168 <main+0x48>
mov    -0x18(%rbp),%rsi
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1176 <main+0x56>
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     1145 <main+0x25>
lea    0xed4(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1153 <main+0x33>
lea    0xedb(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"GDB_TEST_VAR\00"
@.str.1 = [26 x i8] c"It worked! myvar = '%s'\0A\00"
@.str.2 = [11 x i8] c"It failed.\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i8* @getenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
store i8* %7, i8** %6
%8 = load i8*, i8** %6
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i8*, i8** %6
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %11)
br label %15
13: ; preds = %2
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
br label %15
15: ; preds = %13, %10
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"GDB_TEST_VAR\00"
@.str.1 = [26 x i8] c"It worked! myvar = '%s'\0A\00"
@.str.2 = [11 x i8] c"It failed.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* @getenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %3)
br label %9
7: ; preds = %2
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
ret i32 0
}
int Bematech_FI_LeituraDepartamentos(Var, Retorno) {
  return Formata("\x1b|35|34|\x1b", Var, Retorno);
}


x86 assembly (clang, -O0):
<Bematech_FI_LeituraDepartamentos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <Formata@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bematech_FI_LeituraDepartamentos>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
xor    %eax,%eax
jmp    1030 <Formata@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"\1B|35|34|\1B\00"
define i32 @Bematech_FI_LeituraDepartamentos(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 (i8*, i32, i32, ...) bitcast (i32 (...)* @Formata to i32 (i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
@.str = [10 x i8] c"\1B|35|34|\1B\00"
define i32 @Bematech_FI_LeituraDepartamentos(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @Formata to i32 (i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret i32 %3
}
void strcat2(char *s, char *t) {
  while (*s != '\0')
    s++;
  while ((*s++ = *t++) != '\0')
    ;
}


x86 assembly (clang, -O0):
<strcat2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     112d <strcat2+0x2d>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <strcat2+0xc>
jmp    1132 <strcat2+0x32>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     1165 <strcat2+0x65>
jmp    1132 <strcat2+0x32>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat2>:
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1100 <strcat2>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,-0x1(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strcat2+0x10>
ret

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

LLVM IR (-O2):
define void @strcat2(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %13, %8 ], [ %4, %3 ]
%10 = phi i8* [ %11, %8 ], [ %1, %3 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %10
%13 = getelementptr inbounds i8, i8* %9, i64 1
store i8 %12, i8* %9
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret void
}
int swap(int x) {
  unsigned int firstHalf = 0xFFFF0000 & x;
  unsigned int secondHalf = 0x0000FFFF & x;
  unsigned int shifts = 16;
  firstHalf = firstHalf >> shifts;
  secondHalf = secondHalf << shifts;
  return (firstHalf | secondHalf);
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff0000,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
mov    %eax,-0xc(%rbp)
movl   $0x10,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%ecx
shr    %cl,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
or     -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @swap(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 = and i32 -65536, %6
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = and i32 65535, %8
store i32 %9, i32* %4
store i32 16, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %5
%12 = lshr i32 %10, %11
store i32 %12, i32* %3
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = shl i32 %13, %14
store i32 %15, i32* %4
%16 = load i32, i32* %3
%17 = load i32, i32* %4
%18 = or i32 %16, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @swap(i32 %0) {
%2 = tail call i32 @llvm.fshl.i32(i32 %0, i32 %0, i32 16)
ret i32 %2
}
/* Variables and functions */
scalar_t__ maiusculo_ou_minusculo(char);
char para_maiuscula(char c) {
  if (maiusculo_ou_minusculo(c) == 0)
    return (c - 'a') + 'A';
  else
    return c;
}


x86 assembly (clang, -O0):
<para_maiuscula>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%edi
call   1030 <maiusculo_ou_minusculo@plt>
cmp    $0x0,%rax
jne    1143 <para_maiuscula+0x33>
movsbl -0x2(%rbp),%eax
sub    $0x61,%eax
add    $0x41,%eax
mov    %al,-0x1(%rbp)
jmp    1149 <para_maiuscula+0x39>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<para_maiuscula>:
push   %rbx
mov    %edi,%ebx
call   1030 <maiusculo_ou_minusculo@plt>
lea    -0x20(%rbx),%ecx
test   %rax,%rax
movzbl %cl,%eax
cmovne %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @para_maiuscula(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call i64 @maiusculo_ou_minusculo(i8 signext %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = sub nsw i32 %9, 97
%11 = add nsw i32 %10, 65
%12 = trunc i32 %11 to i8
store i8 %12, i8* %2
br label %15
13: ; preds = %1
%14 = load i8, i8* %3
store i8 %14, i8* %2
br label %15
15: ; preds = %13, %7
%16 = load i8, i8* %2
ret i8 %16
}

LLVM IR (-O2):
define signext i8 @para_maiuscula(i8 signext %0) {
%2 = tail call i64 @maiusculo_ou_minusculo(i8 signext %0)
%3 = icmp eq i64 %2, 0
%4 = add i8 %0, -32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
void ioInit() {}


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

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

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

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

/* Variables and functions */
uint8_t decrypt_byte(uint32_t *pkeys) {
  unsigned temp;
  temp = ((uint32_t)(*(pkeys + 2)) & 0xffff) | 2;
  return (uint8_t)(((temp * (temp ^ 1)) >> 8) & 0xff);
}


x86 assembly (clang, -O0):
<decrypt_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
and    $0xffff,%eax
or     $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0x1,%ecx
imul   %ecx,%eax
shr    $0x8,%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decrypt_byte>:
mov    $0xfffd,%eax
and    0x8(%rdi),%eax
lea    0x2(%rax),%ecx
xor    $0x3,%eax
imul   %ecx,%eax
movzbl %ah,%eax
ret

LLVM IR (-O0):
define i32 @decrypt_byte(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 2
%6 = load i32, i32* %5
%7 = and i32 %6, 65535
%8 = or i32 %7, 2
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = load i32, i32* %3
%11 = xor i32 %10, 1
%12 = mul i32 %9, %11
%13 = lshr i32 %12, 8
%14 = and i32 %13, 255
ret i32 %14
}

LLVM IR (-O2):
define i32 @decrypt_byte(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
%4 = and i32 %3, 65533
%5 = or i32 %4, 2
%6 = xor i32 %4, 3
%7 = mul nuw i32 %5, %6
%8 = lshr i32 %7, 8
%9 = and i32 %8, 255
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ w;

/* Variables and functions */
unsigned long hweight32(unsigned long);
unsigned long hweight64(unsigned long);
__attribute__((always_)) unsigned long hweight_long(unsigned long w) {
  return sizeof(w) == 4 ? hweight32(w) : hweight64(w);
}


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

x86 assembly (clang, -O2):
<hweight_long>:
jmp    1030 <hweight64@plt>

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

LLVM IR (-O2):
define i64 @hweight_long(i64 %0) {
%2 = tail call i64 @hweight64(i64 %0)
ret i64 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ __m256i;

/* Variables and functions */
int /*<<< orphan*/ _mm256_xor_si256(int /*<<< orphan*/, int /*<<< orphan*/);
__attribute__((always_)) __m256i xor_256(__m256i a, __m256i b) {
  return _mm256_xor_si256(a, b);
}


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

x86 assembly (clang, -O2):
<xor_256>:
jmp    1030 <_mm256_xor_si256@plt>

LLVM IR (-O0):
define i32 @xor_256(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 @_mm256_xor_si256(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @xor_256(i32 %0, i32 %1) {
%3 = tail call i32 @_mm256_xor_si256(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x29() {
  Assert_real((isbdigit(41) == 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",
              210, ("isbdigit should be 0 for )"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0x29>:
push   %rax
mov    $0x29,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0xd2,%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 )\00"
define void @t_isbdigit_0x29() {
%1 = call i64 @isbdigit(i32 41)
%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 210, 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 )\00"
define void @t_isbdigit_0x29() {
%1 = tail call i64 @isbdigit(i32 41)
%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 210, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void ASN1_d2i_fp(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_d2i_fp() {
ret void
}
/* Variables and functions */
int funcA();
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", funcA());
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @funcA()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void makegap(char *text, int pos) {}


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

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

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

LLVM IR (-O2):
define void @makegap(i8* nocapture %0, i32 %1) {
ret void
}
int callee0(int n) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @callee0(i32 %0) {
ret i32 0
}
short t3(short a, short b) {
  printf("%s: a: %d\n", __func__, a);
  printf("%s: b: %d\n", __func__, b);
  return a + b;
}


x86 assembly (clang, -O0):
<t3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x2(%rbp),%edx
lea    0xecf(%rip),%rdi
lea    0xed3(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
movswl -0x4(%rbp),%edx
lea    0xec4(%rip),%rdi
lea    0xeba(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
movswl -0x2(%rbp),%eax
movswl -0x4(%rbp),%ecx
add    %ecx,%eax
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t3>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xee1(%rip),%rdi
lea    0xee5(%rip),%r14
mov    %r14,%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
mov    %r14,%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
add    %ebp,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"%s: a: %d\0A\00"
@__func__.t3 = [3 x i8] c"t3\00"
@.str.1 = [11 x i8] c"%s: b: %d\0A\00"
define signext i16 @t3(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = sext i16 %5 to i32
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__func__.t3, i64 0, i64 0), i32 %6)
%8 = load i16, i16* %4
%9 = sext i16 %8 to i32
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__func__.t3, i64 0, i64 0), i32 %9)
%11 = load i16, i16* %3
%12 = sext i16 %11 to i32
%13 = load i16, i16* %4
%14 = sext i16 %13 to i32
%15 = add nsw i32 %12, %14
%16 = trunc i32 %15 to i16
ret i16 %16
}

LLVM IR (-O2):
@.str = [11 x i8] c"%s: a: %d\0A\00"
@__func__.t3 = [3 x i8] c"t3\00"
@.str.1 = [11 x i8] c"%s: b: %d\0A\00"
define signext i16 @t3(i16 signext %0, i16 signext %1) {
%3 = sext i16 %0 to i32
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__func__.t3, i64 0, i64 0), i32 %3)
%5 = sext i16 %1 to i32
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__func__.t3, i64 0, i64 0), i32 %5)
%7 = add i16 %1, %0
ret i16 %7
}
/* Variables and functions */
int /*<<< orphan*/ my_char(char);
void my_digits() {
  char c;
  for (c = '0'; c < '9'; ++c)
    my_char(c);
}


x86 assembly (clang, -O0):
<my_digits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x30,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
jge    113f <my_digits+0x2f>
movsbl -0x1(%rbp),%edi
call   1030 <my_char@plt>
mov    -0x1(%rbp),%al
add    $0x1,%al
mov    %al,-0x1(%rbp)
jmp    111c <my_digits+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_digits>:
push   %rax
mov    $0x30,%edi
call   1030 <my_char@plt>
mov    $0x31,%edi
call   1030 <my_char@plt>
mov    $0x32,%edi
call   1030 <my_char@plt>
mov    $0x33,%edi
call   1030 <my_char@plt>
mov    $0x34,%edi
call   1030 <my_char@plt>
mov    $0x35,%edi
call   1030 <my_char@plt>
mov    $0x36,%edi
call   1030 <my_char@plt>
mov    $0x37,%edi
call   1030 <my_char@plt>
mov    $0x38,%edi
pop    %rax
jmp    1030 <my_char@plt>

LLVM IR (-O0):
define void @my_digits() {
%1 = alloca i8
store i8 48, i8* %1
br label %2
2: ; preds = %9, %0
%3 = load i8, i8* %1
%4 = sext i8 %3 to i32
%5 = icmp slt i32 %4, 57
br i1 %5, label %6, label %12
6: ; preds = %2
%7 = load i8, i8* %1
%8 = call i32 @my_char(i8 signext %7)
br label %9
9: ; preds = %6
%10 = load i8, i8* %1
%11 = add i8 %10, 1
store i8 %11, i8* %1
br label %2
12: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @my_digits() {
%1 = tail call i32 @my_char(i8 signext 48)
%2 = tail call i32 @my_char(i8 signext 49)
%3 = tail call i32 @my_char(i8 signext 50)
%4 = tail call i32 @my_char(i8 signext 51)
%5 = tail call i32 @my_char(i8 signext 52)
%6 = tail call i32 @my_char(i8 signext 53)
%7 = tail call i32 @my_char(i8 signext 54)
%8 = tail call i32 @my_char(i8 signext 55)
%9 = tail call i32 @my_char(i8 signext 56)
ret void
}
void ble_rsp_system_whitelist_remove(
    const struct ble_msg_system_whitelist_remove_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.ble_msg_system_whitelist_remove_rsp_t = type opaque
define void @ble_rsp_system_whitelist_remove(%struct.ble_msg_system_whitelist_remove_rsp_t* nocapture %0) {
ret void
}
vdstrs() {}


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

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

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

LLVM IR (-O2):
define i32 @vdstrs() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printArray(int array[], int arrLen) {
  if (arrLen == 0) {
    return;
  } else {
    printf("%d ", array[0]);
    printArray(++array, arrLen - 1);
  }
}


x86 assembly (clang, -O0):
<printArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    113e <printArray+0x1e>
jmp    1167 <printArray+0x47>
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
add    $0x4,%rdi
mov    %rdi,-0x8(%rbp)
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1040 <printArray@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
je     1145 <printArray+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %ebx,%r12d
jne    1130 <printArray+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printArray(i32* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %10, %4 ], [ %1, %2 ]
%6 = phi i32* [ %9, %4 ], [ %0, %2 ]
%7 = load i32, i32* %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = getelementptr inbounds i32, i32* %6, i64 1
%10 = add nsw i32 %5, -1
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ move(int, int);
int /*<<< orphan*/ refresh();
void end_dialog(int x, int y) {
  move(y, x);
  refresh();
  endwin();
}


x86 assembly (clang, -O0):
<end_dialog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1050 <move@plt>
mov    $0x0,%al
call   1030 <refresh@plt>
mov    $0x0,%al
call   1040 <endwin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<end_dialog>:
push   %rax
mov    %edi,%eax
mov    %esi,%edi
mov    %eax,%esi
call   1050 <move@plt>
xor    %eax,%eax
call   1030 <refresh@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <endwin@plt>

LLVM IR (-O0):
define void @end_dialog(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = call i32 @move(i32 %5, i32 %6)
%8 = call i32 (...) @refresh()
%9 = call i32 (...) @endwin()
ret void
}

LLVM IR (-O2):
define void @end_dialog(i32 %0, i32 %1) {
%3 = tail call i32 @move(i32 %1, i32 %0)
%4 = tail call i32 (...) @refresh()
%5 = tail call i32 (...) @endwin()
ret void
}
/* Type definitions */
struct Var {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pA(char *, char const *, char const *, char const *);
void __func_sub_double(struct Var *avar, const char *areg, const char *lreg,
                       const char *rreg) {
  pA("%s = %s - %s;", areg, lreg, rreg);
}


x86 assembly (clang, -O0):
<__func_sub_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    0xec5(%rip),%rdi
call   1030 <pA@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.Var = type { i32 }
@.str = [14 x i8] c"%s = %s - %s;\00"
define void @__func_sub_double(%struct.Var* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca %struct.Var*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store %struct.Var* %0, %struct.Var** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %6
%10 = load i8*, i8** %7
%11 = load i8*, i8** %8
%12 = call i32 @pA(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10, i8* %11)
ret void
}

LLVM IR (-O2):
%struct.Var = type { i32 }
@.str = [14 x i8] c"%s = %s - %s;\00"
define void @__func_sub_double(%struct.Var* nocapture readnone %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i32 @pA(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2, i8* %3)
ret void
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
pid_t octave_setsid_wrapper(void) { return -1; }


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

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

LLVM IR (-O0):
define i32 @octave_setsid_wrapper() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @octave_setsid_wrapper() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ foo_in_so();
int main(int argc, char *argv[]) {
  foo_in_so();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @foo_in_so()
ret i32 0
}
/* Variables and functions */
double sqrt(double);
double _solve_coll_quad(double c0, double c1, double c2) {
  double mba;
  mba = -c1 / c2;
  return 0.5 * (mba + sqrt(mba * mba - 4. * c0 / c2));
}


x86 assembly (clang, -O0):
<_solve_coll_quad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  0xe9f(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
divsd  -0x18(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movsd  -0x28(%rbp),%xmm1
addsd  %xmm0,%xmm1
movsd  0xe58(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_solve_coll_quad>:
sub    $0x18,%rsp
movapd %xmm1,%xmm3
movapd %xmm0,%xmm1
xorpd  0xedc(%rip),%xmm3
divsd  %xmm2,%xmm3
mulsd  0xee0(%rip),%xmm1
divsd  %xmm2,%xmm1
movapd %xmm3,%xmm0
mulsd  %xmm3,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1150 <_solve_coll_quad+0x40>
sqrtsd %xmm0,%xmm0
jmp    115f <_solve_coll_quad+0x4f>
movapd %xmm3,(%rsp)
call   1030 <sqrt@plt>
movapd (%rsp),%xmm3
addsd  %xmm0,%xmm3
mulsd  0xead(%rip),%xmm3
movapd %xmm3,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @_solve_coll_quad(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %5
%9 = fneg double %8
%10 = load double, double* %6
%11 = fdiv double %9, %10
store double %11, double* %7
%12 = load double, double* %7
%13 = load double, double* %7
%14 = load double, double* %7
%15 = load double, double* %4
%16 = fmul double 4.000000e+00, %15
%17 = load double, double* %6
%18 = fdiv double %16, %17
%19 = fneg double %18
%20 = call double @llvm.fmuladd.f64(double %13, double %14, double %19)
%21 = call double @sqrt(double %20)
%22 = fadd double %12, %21
%23 = fmul double 5.000000e-01, %22
ret double %23
}

LLVM IR (-O2):
define double @_solve_coll_quad(double %0, double %1, double %2) {
%4 = fneg double %1
%5 = fdiv double %4, %2
%6 = fmul double %0, -4.000000e+00
%7 = fdiv double %6, %2
%8 = tail call double @llvm.fmuladd.f64(double %5, double %5, double %7)
%9 = tail call double @sqrt(double %8)
%10 = fadd double %5, %9
%11 = fmul double %10, 5.000000e-01
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ adc8(int /*<<< orphan*/);
int /*<<< orphan*/ readmem65816(int /*<<< orphan*/);
int /*<<< orphan*/ sindirecty();
void adcsIndirecty8(void) { adc8(readmem65816(sindirecty())); }


x86 assembly (clang, -O0):
<adcsIndirecty8>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <sindirecty@plt>
mov    %eax,%edi
call   1050 <readmem65816@plt>
mov    %eax,%edi
call   1030 <adc8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<adcsIndirecty8>:
push   %rax
xor    %eax,%eax
call   1040 <sindirecty@plt>
mov    %eax,%edi
call   1050 <readmem65816@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <adc8@plt>

LLVM IR (-O0):
define void @adcsIndirecty8() {
%1 = call i32 (...) @sindirecty()
%2 = call i32 @readmem65816(i32 %1)
%3 = call i32 @adc8(i32 %2)
ret void
}

LLVM IR (-O2):
define void @adcsIndirecty8() {
%1 = tail call i32 (...) @sindirecty()
%2 = tail call i32 @readmem65816(i32 %1)
%3 = tail call i32 @adc8(i32 %2)
ret void
}