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

/* Variables and functions */
int putchar_exit_c(char c, FILE *stream) {
  (void)stream;
  (*((volatile unsigned char *)(0x32 + 0x20))) = c;
  return 0;
}


x86 assembly (clang, -O0):
<putchar_exit_c>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x1(%rbp),%cl
mov    $0x52,%eax
mov    %cl,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar_exit_c>:
mov    %dil,0x52
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @putchar_exit_c(i8 signext %0, i32* nocapture readnone %1) {
store volatile i8 %0, i8* inttoptr (i64 82 to i8*)
ret i32 0
}
int test_imm_A4int16_reg(short val) {
  return ((val) & (0xA4 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_A4int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 164
%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_A4int16_reg(i16 signext %0) {
%2 = and i16 %0, 164
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
const char *errno_str(int errno) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @errno_str(i32 %0) {
ret i8* null
}
void swr_alloc_set_opts() {}


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

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

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

LLVM IR (-O2):
define void @swr_alloc_set_opts() {
ret void
}
int efuse_init(int gpio_pin) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @efuse_init(i32 %0) {
ret i32 0
}
/* Variables and functions */
int sscanf(char const *, char *, long *);
long int s2long_bsl(const char *string) {
  long int value;
  if (sscanf(string, "%ld", &value) < 1)
    return (0l);
  return (value);
}


x86 assembly (clang, -O0):
<s2long_bsl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
lea    -0x18(%rbp),%rdx
call   1030 <sscanf@plt>
cmp    $0x1,%eax
jge    1146 <s2long_bsl+0x36>
movq   $0x0,-0x8(%rbp)
jmp    114e <s2long_bsl+0x3e>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s2long_bsl>:
push   %rax
lea    0xee8(%rip),%rsi
mov    %rsp,%rdx
call   1030 <sscanf@plt>
test   %eax,%eax
jle    112a <s2long_bsl+0x1a>
mov    (%rsp),%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%ld\00"
define i64 @s2long_bsl(i8* %0) {
%2 = alloca i64
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @sscanf(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %4)
%7 = icmp slt i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %1
store i64 0, i64* %2
br label %11
9: ; preds = %1
%10 = load i64, i64* %4
store i64 %10, i64* %2
br label %11
11: ; preds = %9, %8
%12 = load i64, i64* %2
ret i64 %12
}

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
define i64 @s2long_bsl(i8* nocapture %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %2)
%5 = icmp slt i32 %4, 1
%6 = load i64, i64* %2
%7 = select i1 %5, i64 0, i64 %6
ret i64 %7
}
void init_serial0(unsigned long baudrate) {
  unsigned long Fdiv;
  (*(volatile unsigned long *)(0xE002C000 + 0x00)) = 0x00000005;
  (*(volatile unsigned long *)(0xE000C000 + 0x0C)) = 0x83;
  Fdiv = ((12000000 * 5) / 16) / baudrate;
  (*(volatile unsigned long *)(0xE000C000 + 0x04)) = Fdiv / 256;
  (*(volatile unsigned long *)(0xE000C000 + 0x00)) = Fdiv % 256;
  (*(volatile unsigned long *)(0xE000C000 + 0x0C)) = 0x03;
}


x86 assembly (clang, -O0):
<init_serial0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0xe002c000,%eax
movq   $0x5,(%rax)
mov    $0xe000c00c,%eax
movq   $0x83,(%rax)
mov    $0x393870,%eax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
shr    $0x8,%rcx
mov    $0xe000c004,%eax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rcx
and    $0xff,%rcx
mov    $0xe000c000,%eax
mov    %rcx,(%rax)
mov    $0xe000c00c,%eax
movq   $0x3,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_serial0>:
mov    $0xe000c00c,%ecx
movq   $0x5,0x1fff4(%rcx)
movq   $0x83,(%rcx)
cmp    $0x393870,%rdi
ja     112b <init_serial0+0x2b>
mov    $0x393870,%eax
xor    %edx,%edx
div    %edi
jmp    112d <init_serial0+0x2d>
xor    %eax,%eax
mov    %rax,%rdx
shr    $0x8,%rdx
mov    %rdx,-0x8(%rcx)
movzbl %al,%eax
mov    %rax,-0xc(%rcx)
movq   $0x3,(%rcx)
ret

LLVM IR (-O0):
define void @init_serial0(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store volatile i64 5, i64* inttoptr (i64 3758276608 to i64*)
store volatile i64 131, i64* inttoptr (i64 3758145548 to i64*)
%4 = load i64, i64* %2
%5 = udiv i64 3750000, %4
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = udiv i64 %6, 256
store volatile i64 %7, i64* inttoptr (i64 3758145540 to i64*)
%8 = load i64, i64* %3
%9 = urem i64 %8, 256
store volatile i64 %9, i64* inttoptr (i64 3758145536 to i64*)
store volatile i64 3, i64* inttoptr (i64 3758145548 to i64*)
ret void
}

LLVM IR (-O2):
define void @init_serial0(i64 %0) {
store volatile i64 5, i64* inttoptr (i64 3758276608 to i64*)
store volatile i64 131, i64* inttoptr (i64 3758145548 to i64*)
%2 = udiv i64 3750000, %0
%3 = lshr i64 %2, 8
store volatile i64 %3, i64* inttoptr (i64 3758145540 to i64*)
%4 = and i64 %2, 255
store volatile i64 %4, i64* inttoptr (i64 3758145536 to i64*)
store volatile i64 3, i64* inttoptr (i64 3758145548 to i64*)
ret void
}
/* Variables and functions */
int O_CREAT;
int O_RDWR;
int S_IRUSR;
int S_IWUSR;
int open(char *, int, int);
void resourceLeak_open2(void) {
  int fd = open("file", O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
}


x86 assembly (clang, -O0):
<resourceLeak_open2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
mov    0x2ed0(%rip),%rax
or     (%rax),%esi
mov    0x2e97(%rip),%rax
mov    (%rax),%edx
mov    0x2e9e(%rip),%rax
or     (%rax),%edx
lea    0xebd(%rip),%rdi
call   1030 <open@plt>
mov    %eax,-0x4(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resourceLeak_open2>:
mov    0x2ec9(%rip),%rax
mov    0x2eda(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2e9f(%rip),%rax
mov    0x2ea8(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
lea    0xec5(%rip),%rdi
jmp    1030 <open@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"file\00"
@O_RDWR = global i32 0
@O_CREAT = global i32 0
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
define void @resourceLeak_open2() {
%1 = alloca i32
%2 = load i32, i32* @O_RDWR
%3 = load i32, i32* @O_CREAT
%4 = or i32 %2, %3
%5 = load i32, i32* @S_IRUSR
%6 = load i32, i32* @S_IWUSR
%7 = or i32 %5, %6
%8 = call i32 @open(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %7)
store i32 %8, i32* %1
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"file\00"
@O_RDWR = global i32 0
@O_CREAT = global i32 0
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
define void @resourceLeak_open2() {
%1 = load i32, i32* @O_RDWR
%2 = load i32, i32* @O_CREAT
%3 = or i32 %2, %1
%4 = load i32, i32* @S_IRUSR
%5 = load i32, i32* @S_IWUSR
%6 = or i32 %5, %4
%7 = tail call i32 @open(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x8e() {
  Assert_real((isbdigit(142) == 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",
              715, ("isbdigit should be 0 for 0x8e"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0x8e>:
push   %rax
mov    $0x8e,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x2cb,%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 = [30 x i8] c"isbdigit should be 0 for 0x8e\00"
define void @t_isbdigit_0x8e() {
%1 = call i64 @isbdigit(i32 142)
%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 715, 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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x8e\00"
define void @t_isbdigit_0x8e() {
%1 = tail call i64 @isbdigit(i32 142)
%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 715, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
unsigned SDBMHash(char *str) {
  unsigned hash = 0;
  while (*str)
    hash = (*str++) + (hash << 6) + (hash << 16) - hash;
  return (hash & 0x7fffffff);
}


x86 assembly (clang, -O0):
<SDBMHash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1149 <SDBMHash+0x49>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    -0xc(%rbp),%ecx
shl    $0x6,%ecx
add    %ecx,%eax
mov    -0xc(%rbp),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <SDBMHash+0xf>
mov    -0xc(%rbp),%eax
and    $0x7fffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SDBMHash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112c <SDBMHash+0x2c>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
imul   $0x1003f,%eax,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <SDBMHash+0x10>
and    $0x7fffffff,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @SDBMHash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = sext i8 %5 to i32
%10 = mul i32 %6, 65599
%11 = add i32 %10, %9
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = and i32 %11, 2147483647
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 0, %1 ], [ %15, %14 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0xc6() {
  Assert_real((isdigit(198) == 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_isdigit.c",
              995, ("isdigit should be 0 for 0xc6"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0xc6>:
push   %rax
mov    $0xc6,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3e3,%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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xc6\00"
define void @t_isdigit_0xc6() {
%1 = call i64 @isdigit(i32 198)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 995, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xc6\00"
define void @t_isdigit_0xc6() {
%1 = tail call i64 @isdigit(i32 198)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 995, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
float int_to_float(int);
float qNaNf(int payload) { return int_to_float(0x7fc00000 | payload); }


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

x86 assembly (clang, -O2):
<qNaNf>:
or     $0x7fc00000,%edi
jmp    1030 <int_to_float@plt>

LLVM IR (-O0):
define float @qNaNf(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = or i32 2143289344, %3
%5 = call float @int_to_float(i32 %4)
ret float %5
}

LLVM IR (-O2):
define float @qNaNf(i32 %0) {
%2 = or i32 %0, 2143289344
%3 = tail call float @int_to_float(i32 %2)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage() {
  printf("please give either 0,1,2 or 5, as an argument corresponding\n");
  printf("to the UART header on the Robotics Cape you wish to test\n");
}


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

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf18(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [61 x i8] c"please give either 0,1,2 or 5, as an argument corresponding\0A\00"
@.str.1 = [58 x i8] c"to the UART header on the Robotics Cape you wish to test\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [60 x i8] c"please give either 0,1,2 or 5, as an argument corresponding\00"
@str.2 = [57 x i8] c"to the UART header on the Robotics Cape you wish to test\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.2, i64 0, i64 0))
ret void
}
__attribute__((__weak__)) int _lseek(int file __attribute__((unused)),
                                     int ptr __attribute__((unused)),
                                     int dir __attribute__((unused))) {
  return 0;
}


x86 assembly (clang, -O0):
<_lseek>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define weak i32 @_lseek(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
define weak i32 @_lseek(i32 %0, i32 %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
scalar_t__ isspace(char);
char *memmove(char *, char *, scalar_t__);
scalar_t__ strlen(char *);
char *ltrim_inplace(char *s) {
  char *start = s;
  while (isspace(*start)) {
    start++;
  }
  return memmove(s, start, strlen(start) + 1);
}


x86 assembly (clang, -O0):
<ltrim_inplace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isspace@plt>
cmp    $0x0,%rax
je     116b <ltrim_inplace+0x3b>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1144 <ltrim_inplace+0x14>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
call   1050 <memmove@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ltrim_inplace>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    -0x1(%rdi),%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1040 <isspace@plt>
test   %rax,%rax
jne    1140 <ltrim_inplace+0x10>
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <memmove@plt>

LLVM IR (-O0):
define i8* @ltrim_inplace(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 = call i64 @isspace(i8 signext %7)
%9 = icmp ne i64 %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
%14 = load i8*, i8** %2
%15 = load i8*, i8** %3
%16 = load i8*, i8** %3
%17 = call i64 @strlen(i8* %16)
%18 = add nsw i64 %17, 1
%19 = call i8* @memmove(i8* %14, i8* %15, i64 %18)
ret i8* %19
}

LLVM IR (-O2):
define i8* @ltrim_inplace(i8* returned %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isspace(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = tail call i64 @strlen(i8* %3)
%10 = add nsw i64 %9, 1
tail call void @llvm.memmove.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %3, i64 %10, i1 false)
ret i8* %0
}
int count(int a, int b, int c, int d) {
  return (1000 * a + 100 * b + 10 * c + d);
}


x86 assembly (clang, -O0):
<count>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
imul   $0x3e8,-0x4(%rbp),%eax
imul   $0x64,-0x8(%rbp),%ecx
add    %ecx,%eax
imul   $0xa,-0xc(%rbp),%ecx
add    %ecx,%eax
add    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count>:
imul   $0x3e8,%edi,%eax
imul   $0x64,%esi,%esi
add    %eax,%esi
lea    (%rdx,%rdx,4),%eax
lea    (%rsi,%rax,2),%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @count(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = mul nsw i32 1000, %9
%11 = load i32, i32* %6
%12 = mul nsw i32 100, %11
%13 = add nsw i32 %10, %12
%14 = load i32, i32* %7
%15 = mul nsw i32 10, %14
%16 = add nsw i32 %13, %15
%17 = load i32, i32* %8
%18 = add nsw i32 %16, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @count(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = mul nsw i32 %0, 1000
%6 = mul nsw i32 %1, 100
%7 = add nsw i32 %6, %5
%8 = mul nsw i32 %2, 10
%9 = add nsw i32 %7, %8
%10 = add nsw i32 %9, %3
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void shmem_set_lock(long *lock) { printf("\nOpenSHMEM Analyzer\n"); }


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

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

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

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define void @shmem_set_lock(i64* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
__attribute__((weak)) void _exit(int status) {
  (void)status;
  while (1)
    ;
}


x86 assembly (clang, -O0):
<_exit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <_exit+0x7>

x86 assembly (clang, -O2):
<_exit>:
jmp    1100 <_exit>

LLVM IR (-O0):
define weak void @_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
br label %4
4: ; preds = %1, %4
br label %4
}

LLVM IR (-O2):
define weak void @_exit(i32 %0) {
br label %2
2: ; preds = %1, %2
br label %2
}
void mdp4_lcdc_vsync_ctrl(struct fb_info *info, int enable) {}


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

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

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

LLVM IR (-O2):
%struct.fb_info = type opaque
define void @mdp4_lcdc_vsync_ctrl(%struct.fb_info* nocapture %0, i32 %1) {
ret void
}
void sysfs_remove_files(struct kobject *kobj, const struct attribute **attr) {}


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

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

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

LLVM IR (-O2):
%struct.kobject = type opaque
%struct.attribute = type opaque
define void @sysfs_remove_files(%struct.kobject* nocapture %0, %struct.attribute** nocapture %1) {
ret void
}
int b64idx(int c) {
  if (c < 26) {
    return c + 'A';
  } else if (c < 52) {
    return c - 26 + 'a';
  } else if (c < 62) {
    return c - 52 + '0';
  } else {
    return c == 62 ? '+' : '/';
  }
}


x86 assembly (clang, -O0):
<b64idx>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1a,-0x8(%rbp)
jge    111f <b64idx+0x1f>
mov    -0x8(%rbp),%eax
add    $0x41,%eax
mov    %eax,-0x4(%rbp)
jmp    116b <b64idx+0x6b>
cmpl   $0x34,-0x8(%rbp)
jge    113a <b64idx+0x3a>
mov    -0x8(%rbp),%eax
sub    $0x1a,%eax
add    $0x61,%eax
mov    %eax,-0x4(%rbp)
jmp    116b <b64idx+0x6b>
cmpl   $0x3e,-0x8(%rbp)
jge    1155 <b64idx+0x55>
mov    -0x8(%rbp),%eax
sub    $0x34,%eax
add    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    116b <b64idx+0x6b>
mov    -0x8(%rbp),%edx
mov    $0x2f,%eax
mov    $0x2b,%ecx
cmp    $0x3e,%edx
cmove  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<b64idx>:
mov    %edi,%eax
cmp    $0x19,%edi
jg     110b <b64idx+0xb>
add    $0x41,%eax
ret
cmp    $0x33,%eax
ja     1114 <b64idx+0x14>
add    $0x47,%eax
ret
cmp    $0x3d,%eax
ja     111d <b64idx+0x1d>
add    $0xfffffffc,%eax
ret
xor    %ecx,%ecx
cmp    $0x3e,%eax
setne  %cl
lea    0x2b(,%rcx,4),%eax
ret

LLVM IR (-O0):
define i32 @b64idx(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 26
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 65
store i32 %8, i32* %2
br label %28
9: ; preds = %1
%10 = load i32, i32* %3
%11 = icmp slt i32 %10, 52
br i1 %11, label %12, label %16
12: ; preds = %9
%13 = load i32, i32* %3
%14 = sub nsw i32 %13, 26
%15 = add nsw i32 %14, 97
store i32 %15, i32* %2
br label %28
16: ; preds = %9
%17 = load i32, i32* %3
%18 = icmp slt i32 %17, 62
br i1 %18, label %19, label %23
19: ; preds = %16
%20 = load i32, i32* %3
%21 = sub nsw i32 %20, 52
%22 = add nsw i32 %21, 48
store i32 %22, i32* %2
br label %28
23: ; preds = %16
%24 = load i32, i32* %3
%25 = icmp eq i32 %24, 62
%26 = zext i1 %25 to i64
%27 = select i1 %25, i32 43, i32 47
store i32 %27, i32* %2
br label %28
28: ; preds = %23, %19, %12, %6
%29 = load i32, i32* %2
ret i32 %29
}

LLVM IR (-O2):
define i32 @b64idx(i32 %0) {
%2 = icmp slt i32 %0, 26
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = add nsw i32 %0, 65
br label %16
5: ; preds = %1
%6 = icmp ult i32 %0, 52
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = add nuw nsw i32 %0, 71
br label %16
9: ; preds = %5
%10 = icmp ult i32 %0, 62
br i1 %10, label %11, label %13
11: ; preds = %9
%12 = add nsw i32 %0, -4
br label %16
13: ; preds = %9
%14 = icmp eq i32 %0, 62
%15 = select i1 %14, i32 43, i32 47
br label %16
16: ; preds = %13, %11, %7, %3
%17 = phi i32 [ %4, %3 ], [ %8, %7 ], [ %12, %11 ], [ %15, %13 ]
ret i32 %17
}
/* Type definitions */
struct state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct state *);
void destroy_state(struct state *context) { free(context); }


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

x86 assembly (clang, -O2):
<destroy_state>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.state = type { i32 }
define void @destroy_state(%struct.state* %0) {
%2 = alloca %struct.state*
store %struct.state* %0, %struct.state** %2
%3 = load %struct.state*, %struct.state** %2
%4 = call i32 @free(%struct.state* %3)
ret void
}

LLVM IR (-O2):
%struct.state = type { i32 }
define void @destroy_state(%struct.state* nocapture %0) {
%2 = tail call i32 @free(%struct.state* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __console_tx_hex8(int, unsigned char);
void print_err_hex8(unsigned char value) { __console_tx_hex8(3, value); }


x86 assembly (clang, -O0):
<print_err_hex8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x3,%edi
movzbl -0x1(%rbp),%esi
call   1030 <__console_tx_hex8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_err_hex8>:
mov    %edi,%esi
mov    $0x3,%edi
jmp    1030 <__console_tx_hex8@plt>

LLVM IR (-O0):
define void @print_err_hex8(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @__console_tx_hex8(i32 3, i8 zeroext %3)
ret void
}

LLVM IR (-O2):
define void @print_err_hex8(i8 zeroext %0) {
%2 = tail call i32 @__console_tx_hex8(i32 3, i8 zeroext %0)
ret void
}
/* Variables and functions */
double ranmar();
int aleatorio() {
  if (ranmar() < 0.5) {
    return (1);
  } else {
    return (-1);
  }
}


x86 assembly (clang, -O0):
<aleatorio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <ranmar@plt>
movaps %xmm0,%xmm1
movsd  0xed6(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1140 <aleatorio+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1147 <aleatorio+0x37>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aleatorio>:
push   %rax
xor    %eax,%eax
call   1030 <ranmar@plt>
movsd  0xee0(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
add    %eax,%eax
add    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @aleatorio() {
%1 = alloca i32
%2 = call double (...) @ranmar()
%3 = fcmp olt double %2, 5.000000e-01
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 1, i32* %1
br label %6
5: ; preds = %0
store i32 -1, i32* %1
br label %6
6: ; preds = %5, %4
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @aleatorio() {
%1 = tail call double (...) @ranmar()
%2 = fcmp olt double %1, 5.000000e-01
%3 = select i1 %2, i32 1, i32 -1
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ arr;

/* Variables and functions */
int /*<<< orphan*/ insertionSort(int *, int);
int /*<<< orphan*/ printArray(int *, int);
int main() {
  int arr[] = {20, 15, 33, 15, 56};
  int n = sizeof(arr) / sizeof(arr[0]);
  insertionSort(arr, n);
  printArray(arr, n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x10(%rbp)
movl   $0x5,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1030 <insertionSort@plt>
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1040 <printArray@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
mov    0xee5(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xeca(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <insertionSort@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1040 <printArray@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.arr = [5 x i32] [i32 20, i32 15, i32 33, i32 15, i32 56]
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [5 x i32]* %2 to i8*
store i32 5, i32* %3
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* %3
%7 = call i32 @insertionSort(i32* %5, i32 %6)
%8 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%9 = load i32, i32* %3
%10 = call i32 @printArray(i32* %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [5 x i32] [i32 20, i32 15, i32 33, i32 15, i32 56]
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @insertionSort(i32* %3, i32 5)
%5 = call i32 @printArray(i32* %3, i32 5)
ret i32 0
}
void foo07() {}


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

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

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

LLVM IR (-O2):
define void @foo07() {
ret void
}
void initMat(char tab[10][10]) {
  int i, j;
  for (i = 0; i < 10; i++)
    for (j = 0; j < 10; j++) {
      tab[i][j] = '~';
    }
}


x86 assembly (clang, -O0):
<initMat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1162 <initMat+0x62>
movl   $0x0,-0x10(%rbp)
cmpl   $0xa,-0x10(%rbp)
jge    114f <initMat+0x4f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0xa,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movb   $0x7e,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1120 <initMat+0x20>
jmp    1154 <initMat+0x54>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <initMat+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initMat>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,0x50(%rdi)
movups %xmm0,0x40(%rdi)
movups %xmm0,0x30(%rdi)
movups %xmm0,0x20(%rdi)
movups %xmm0,0x10(%rdi)
movups %xmm0,(%rdi)
movl   $0x7e7e7e7e,0x60(%rdi)
ret

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

LLVM IR (-O2):
define void @initMat([10 x i8]* nocapture writeonly %0) {
%2 = getelementptr [10 x i8], [10 x i8]* %0, i64 0, i64 0
ret void
}
int f3(int a, int b, int c, int d) { return ((b & c) | (a & d)) ^ (b & c); }


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x4(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
mov    %esi,%eax
and    %edx,%eax
and    %ecx,%edi
not    %eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f3(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = load i32, i32* %7
%11 = and i32 %9, %10
%12 = load i32, i32* %5
%13 = load i32, i32* %8
%14 = and i32 %12, %13
%15 = or i32 %11, %14
%16 = load i32, i32* %6
%17 = load i32, i32* %7
%18 = and i32 %16, %17
%19 = xor i32 %15, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @f3(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = and i32 %2, %1
%6 = and i32 %3, %0
%7 = xor i32 %5, -1
%8 = and i32 %6, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int, int);
void Xmove(int dir, unsigned int Nsteps) {
  printf("Move x axis to %u in dir %d\n", Nsteps, dir);
}


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

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

LLVM IR (-O0):
@.str = [29 x i8] c"Move x axis to %u in dir %d\0A\00"
define void @Xmove(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 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"Move x axis to %u in dir %d\0A\00"
define void @Xmove(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errnoAbort(char *, char *);
int remove(char *);
void mustRemove(char *path) {
  int err = remove(path);
  if (err < 0)
    errnoAbort("Couldn't remove %s", path);
}


x86 assembly (clang, -O0):
<mustRemove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <remove@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1152 <mustRemove+0x32>
mov    -0x8(%rbp),%rsi
lea    0xeb3(%rip),%rdi
call   1040 <errnoAbort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mustRemove>:
push   %rbx
mov    %rdi,%rbx
call   1030 <remove@plt>
test   %eax,%eax
js     112f <mustRemove+0xf>
pop    %rbx
ret
lea    0xeca(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <errnoAbort@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Couldn't remove %s\00"
define void @mustRemove(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @remove(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i32 @errnoAbort(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"Couldn't remove %s\00"
define void @mustRemove(i8* %0) {
%2 = tail call i32 @remove(i8* %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @errnoAbort(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %4, %1
ret void
}
void sincos_f(float angle, float *s, float *c) {
  __asm__ __volatile__("fsincos" : "=t"(*c), "=u"(*s) : "0"(angle));
}


x86 assembly (clang, -O0):
<sincos_f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
flds   -0x1c(%rbp)
fsincos
fxch   %st(1)
fstps  -0x24(%rbp)
fstps  -0x20(%rbp)
movss  -0x24(%rbp),%xmm0
movss  -0x20(%rbp),%xmm1
movss  %xmm1,(%rcx)
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<sincos_f>:
movss  %xmm0,-0x4(%rsp)
flds   -0x4(%rsp)
fsincos
fstps  (%rsi)
fstps  (%rdi)
ret

LLVM IR (-O0):
define void @sincos_f(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** %6
%8 = load float*, float** %5
%9 = load float, float* %4
%10 = call { float, float } asm sideeffect "fsincos", "={st},={st(1)},0,~{dirflag},~{fpsr},~{flags}"(float %9)
%11 = extractvalue { float, float } %10, 0
%12 = extractvalue { float, float } %10, 1
store float %11, float* %7
store float %12, float* %8
ret void
}

LLVM IR (-O2):
define void @sincos_f(float %0, float* nocapture writeonly %1, float* nocapture writeonly %2) {
%4 = tail call { float, float } asm sideeffect "fsincos", "={st},={st(1)},0,~{dirflag},~{fpsr},~{flags}"(float %0)
%5 = extractvalue { float, float } %4, 0
%6 = extractvalue { float, float } %4, 1
store float %5, float* %2
store float %6, float* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ imprime_matrices();
int /*<<< orphan*/ imprime_matriz_resultado();
int /*<<< orphan*/ libera_espacio();
int /*<<< orphan*/ libera_los_matrices();
int /*<<< orphan*/ multiplica_matrices();
int main(void) {
  libera_los_matrices();
  imprime_matrices();
  multiplica_matrices();
  imprime_matriz_resultado();
  libera_espacio();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <libera_los_matrices@plt>
mov    $0x0,%al
call   1050 <imprime_matrices@plt>
mov    $0x0,%al
call   1070 <multiplica_matrices@plt>
mov    $0x0,%al
call   1040 <imprime_matriz_resultado@plt>
mov    $0x0,%al
call   1060 <libera_espacio@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <libera_los_matrices@plt>
xor    %eax,%eax
call   1050 <imprime_matrices@plt>
xor    %eax,%eax
call   1070 <multiplica_matrices@plt>
xor    %eax,%eax
call   1040 <imprime_matriz_resultado@plt>
xor    %eax,%eax
call   1060 <libera_espacio@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @libera_los_matrices()
%3 = call i32 (...) @imprime_matrices()
%4 = call i32 (...) @multiplica_matrices()
%5 = call i32 (...) @imprime_matriz_resultado()
%6 = call i32 (...) @libera_espacio()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @libera_los_matrices()
%2 = tail call i32 (...) @imprime_matrices()
%3 = tail call i32 (...) @multiplica_matrices()
%4 = tail call i32 (...) @imprime_matriz_resultado()
%5 = tail call i32 (...) @libera_espacio()
ret i32 0
}
void g_slist_nth_data() {}


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

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

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

LLVM IR (-O2):
define void @g_slist_nth_data() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ heap_sift_2(int, int, double *, double *);
void heap_build_2(int n, double x[], double y[]) {
  int i;
  for (i = n / 2; i >= 0; i--)
    heap_sift_2(i, n - 1, x, y);
}


x86 assembly (clang, -O0):
<heap_build_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jl     115f <heap_build_2+0x4f>
mov    -0x1c(%rbp),%edi
mov    -0x4(%rbp),%esi
sub    $0x1,%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1030 <heap_sift_2@plt>
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    1131 <heap_build_2+0x21>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<heap_build_2>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    $0xffffffff,%edi
jl     1144 <heap_build_2+0x34>
mov    %rdx,%r14
mov    %rsi,%r15
mov    %edi,%ebx
mov    %edi,%ebp
shr    $0x1f,%ebp
add    %edi,%ebp
sar    %ebp
add    $0xffffffff,%ebx
mov    %ebp,%edi
mov    %ebx,%esi
mov    %r15,%rdx
mov    %r14,%rcx
call   1030 <heap_sift_2@plt>
add    $0xffffffff,%ebp
jb     1130 <heap_build_2+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @heap_build_2(i32 %0, double* %1, double* %2) {
%4 = alloca i32
%5 = alloca double*
%6 = alloca double*
%7 = alloca i32
store i32 %0, i32* %4
store double* %1, double** %5
store double* %2, double** %6
%8 = load i32, i32* %4
%9 = sdiv i32 %8, 2
store i32 %9, i32* %7
br label %10
10: ; preds = %20, %3
%11 = load i32, i32* %7
%12 = icmp sge i32 %11, 0
br i1 %12, label %13, label %23
13: ; preds = %10
%14 = load i32, i32* %7
%15 = load i32, i32* %4
%16 = sub nsw i32 %15, 1
%17 = load double*, double** %5
%18 = load double*, double** %6
%19 = call i32 @heap_sift_2(i32 %14, i32 %16, double* %17, double* %18)
br label %20
20: ; preds = %13
%21 = load i32, i32* %7
%22 = add nsw i32 %21, -1
store i32 %22, i32* %7
br label %10
23: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @heap_build_2(i32 %0, double* %1, double* %2) {
%4 = icmp sgt i32 %0, -2
br i1 %4, label %5, label %13
5: ; preds = %3
%6 = sdiv i32 %0, 2
%7 = add nsw i32 %0, -1
br label %8
8: ; preds = %5, %8
%9 = phi i32 [ %6, %5 ], [ %11, %8 ]
%10 = tail call i32 @heap_sift_2(i32 %9, i32 %7, double* %1, double* %2)
%11 = add nsw i32 %9, -1
%12 = icmp eq i32 %9, 0
br i1 %12, label %13, label %8
13: ; preds = %8, %3
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint8_t Count1s(uint16_t Word) {
  return Count1s((uint8_t)Word) + Count1s((uint8_t)(Word >> 8));
}


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

x86 assembly (clang, -O2):
<Count1s>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1030 <Count1s@plt>
sar    $0x8,%ebx
jmp    1120 <Count1s+0x10>

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

LLVM IR (-O2):
define i32 @Count1s(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %5, %2 ]
%4 = tail call i32 @Count1s(i32 %3)
%5 = ashr i32 %3, 8
br label %2
}
/* Variables and functions */
int ap_get_single_string_command(int, int, char *, int);
int ap_get_session_name(int session, char *str) {
  return (ap_get_single_string_command(session, 0xcc0d, str, 256));
}


x86 assembly (clang, -O0):
<ap_get_session_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    $0xcc0d,%esi
mov    $0x100,%ecx
call   1030 <ap_get_single_string_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ap_get_session_name>:
mov    %rsi,%rdx
mov    $0xcc0d,%esi
mov    $0x100,%ecx
jmp    1030 <ap_get_single_string_command@plt>

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

LLVM IR (-O2):
define i32 @ap_get_session_name(i32 %0, i8* %1) {
%3 = tail call i32 @ap_get_single_string_command(i32 %0, i32 52237, i8* %1, i32 256)
ret i32 %3
}