xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t hash(uint64_t t, uint64_t attempt) { return (t + attempt) % (8193); }


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    $0x2001,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
add    %esi,%edi
movslq %edi,%rax
imul   $0x3ffe001,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x27,%rcx
add    %edx,%ecx
mov    %ecx,%edx
shl    $0xd,%edx
add    %ecx,%edx
sub    %edx,%eax
ret

LLVM IR (-O0):
define i32 @hash(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 = add nsw i32 %5, %6
%8 = srem i32 %7, 8193
ret i32 %8
}

LLVM IR (-O2):
define i32 @hash(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = srem i32 %3, 8193
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ f1(int);
void __attribute__((__always___)) f2(int a) { f1(a); }


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

x86 assembly (clang, -O2):
<f2>:
jmp    1030 <f1@plt>

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

LLVM IR (-O2):
define void @f2(i32 %0) {
%2 = tail call i32 @f1(i32 %0)
ret void
}
/* Type definitions */
typedef int time_t;

/* Variables and functions */
int /*<<< orphan*/ tt;
long s_time() {
  time_t time(), tt;
  return time(&tt) * 1000;
}


x86 assembly (clang, -O0):
<s_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
mov    $0x0,%al
call   1030 <time@plt>
imul   $0x3e8,%eax,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_time>:
push   %rax
lea    0x4(%rsp),%rdi
xor    %eax,%eax
call   1030 <time@plt>
imul   $0x3e8,%eax,%eax
cltq
pop    %rcx
ret

LLVM IR (-O0):
@tt = global i32 0
define i64 @s_time() {
%1 = alloca i32
%2 = call i32 (i32*, ...) bitcast (i32 (...)* @time to i32 (i32*, ...)*)(i32* %1)
%3 = mul nsw i32 %2, 1000
%4 = sext i32 %3 to i64
ret i64 %4
}

LLVM IR (-O2):
@tt = global i32 0
define i64 @s_time() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 (i32*, ...) bitcast (i32 (...)* @time to i32 (i32*, ...)*)(i32* %1)
%4 = mul nsw i32 %3, 1000
%5 = sext i32 %4 to i64
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char *);
void podstawa(int szerokosc) {
  int i;
  for (i = 0; i < szerokosc; i++)
    putchar("*");
  putchar("\n");
}


x86 assembly (clang, -O0):
<podstawa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <podstawa+0x38>
lea    0xecb(%rip),%rdi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <podstawa+0x12>
lea    0xeb3(%rip),%rdi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<podstawa>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    113d <podstawa+0x2d>
mov    %edi,%ebx
lea    0xedf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1130 <podstawa+0x20>
lea    0xebe(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"*\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @podstawa(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @putchar(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
%9 = tail call i32 @putchar(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(unsigned char *);
unsigned int logic_byte_invert(unsigned char a, unsigned char *p_result) {
  assert(p_result);
  unsigned int err_code = 0;
  if (!p_result) {
    err_code = 2;
    goto end;
  }
  *p_result = (-1 * a);
end:
  return err_code;
}


x86 assembly (clang, -O0):
<logic_byte_invert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <assert@plt>
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1149 <logic_byte_invert+0x39>
movl   $0x2,-0x14(%rbp)
jmp    115b <logic_byte_invert+0x4b>
movzbl -0x1(%rbp),%eax
imul   $0xffffffff,%eax,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logic_byte_invert>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1030 <assert@plt>
test   %rbx,%rbx
je     112f <logic_byte_invert+0x1f>
neg    %bpl
mov    %bpl,(%rbx)
xor    %eax,%eax
jmp    1134 <logic_byte_invert+0x24>
mov    $0x2,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @logic_byte_invert(i8 zeroext %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8*
%5 = alloca i32
store i8 %0, i8* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @assert(i8* %6)
store i32 0, i32* %5
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br i1 %9, label %11, label %10
10: ; preds = %2
store i32 2, i32* %5
br label %17
11: ; preds = %2
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = mul nsw i32 -1, %13
%15 = trunc i32 %14 to i8
%16 = load i8*, i8** %4
store i8 %15, i8* %16
br label %17
17: ; preds = %11, %10
%18 = load i32, i32* %5
ret i32 %18
}

LLVM IR (-O2):
define i32 @logic_byte_invert(i8 zeroext %0, i8* %1) {
%3 = tail call i32 @assert(i8* %1)
%4 = icmp eq i8* %1, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = sub i8 0, %0
store i8 %6, i8* %1
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ 0, %5 ], [ 2, %2 ]
ret i32 %8
}
int iso_721(c)
char *c;
{ return ((c[0] & 0xff) | ((c[1] & 0xff) << 8)); }


x86 assembly (clang, -O0):
<iso_721>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
and    $0xff,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iso_721>:
movzwl (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @iso_721(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
ret i32 %8
}
unsigned int ByteSwap(unsigned int x) {
  char tmp;
  char *cp;
  cp = (char *)&x;
  tmp = cp[3];
  cp[3] = cp[0];
  cp[0] = tmp;
  tmp = cp[2];
  cp[2] = cp[1];
  cp[1] = tmp;
  return x;
}


x86 assembly (clang, -O0):
<ByteSwap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x3(%rax),%al
mov    %al,-0x5(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x5(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    0x2(%rax),%al
mov    %al,-0x5(%rbp)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x5(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ByteSwap(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ flushline(int);
void print(void) { flushline(true); }


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

x86 assembly (clang, -O2):
<print>:
mov    $0x1,%edi
jmp    1030 <flushline@plt>

LLVM IR (-O0):
define void @print() {
%1 = call i32 @flushline(i32 1)
ret void
}

LLVM IR (-O2):
define void @print() {
%1 = tail call i32 @flushline(i32 1)
ret void
}
int test_imm_BDint64_lowword_reg(long long val) {
  return ((val) & (0xBD << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_BDint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 189
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct perl_mstats {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ bomb(char *);
extern int Perl_get_mstats(struct perl_mstats *buf, int buflen, int level) {
  bomb("Perl_get_mstats");
}


x86 assembly (clang, -O0):
<Perl_get_mstats>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
lea    0xed7(%rip),%rdi
call   1030 <bomb@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.perl_mstats = type { i32 }
@.str = [16 x i8] c"Perl_get_mstats\00"
define i32 @Perl_get_mstats(%struct.perl_mstats* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.perl_mstats*
%6 = alloca i32
%7 = alloca i32
store %struct.perl_mstats* %0, %struct.perl_mstats** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = call i32 @bomb(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
%struct.perl_mstats = type { i32 }
@.str = [16 x i8] c"Perl_get_mstats\00"
define i32 @Perl_get_mstats(%struct.perl_mstats* nocapture readnone %0, i32 %1, i32 %2) {
%4 = tail call i32 @bomb(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t xscom_mangle_addr(uint64_t addr) {
  uint64_t tmp;
  tmp = (addr & 0xf000000000000000) >> 4;
  addr &= 0x00ffffffffffffff;
  addr |= tmp;
  return addr << 3;
}


x86 assembly (clang, -O0):
<xscom_mangle_addr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
movabs $0xf000000000000000,%rcx
and    %rcx,%rax
shr    $0x4,%rax
mov    %eax,-0x8(%rbp)
movslq -0x4(%rbp),%rax
movabs $0xffffffffffffff,%rcx
and    %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xscom_mangle_addr>:
lea    0x0(,%rdi,8),%eax
ret

LLVM IR (-O0):
define i32 @xscom_mangle_addr(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = and i64 %5, -1152921504606846976
%7 = lshr i64 %6, 4
%8 = trunc i64 %7 to i32
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = and i64 %10, 72057594037927935
%12 = trunc i64 %11 to i32
store i32 %12, i32* %2
%13 = load i32, i32* %3
%14 = load i32, i32* %2
%15 = or i32 %14, %13
store i32 %15, i32* %2
%16 = load i32, i32* %2
%17 = shl i32 %16, 3
ret i32 %17
}

LLVM IR (-O2):
define i32 @xscom_mangle_addr(i32 %0) {
%2 = shl i32 %0, 3
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ postMessage(int /*<<< orphan*/, int /*<<< orphan*/,
                               int /*<<< orphan*/);
void terminate(void) { postMessage(0, 0, 0); }


x86 assembly (clang, -O0):
<terminate>:
push   %rbp
mov    %rsp,%rbp
xor    %edx,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1030 <postMessage@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<terminate>:
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <postMessage@plt>

LLVM IR (-O0):
define void @terminate() {
%1 = call i32 @postMessage(i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @terminate() {
%1 = tail call i32 @postMessage(i32 0, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sumOfNumberInString(char *);
int main(void) {
  char str[10] = "12345";
  printf("%d", sumOfNumberInString(str));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0xe(%rbp)
mov    0xec7(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    -0xe(%rbp),%rdi
call   1040 <sumOfNumberInString@plt>
mov    %eax,%esi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x3534333231,%rax
mov    %rax,0x8(%rsp)
movw   $0x0,0x10(%rsp)
lea    0x8(%rsp),%rdi
call   1040 <sumOfNumberInString@plt>
lea    0xebf(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.str = [10 x i8] c"12345\00\00\00\00\00"
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @sumOfNumberInString(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
void Interp1(unsigned char *pc, int c1, int c2) {
  *((int *)pc) = (c1 * 3 + c2) >> 2;
}


x86 assembly (clang, -O0):
<Interp1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
imul   $0x3,-0xc(%rbp),%ecx
add    -0x10(%rbp),%ecx
sar    $0x2,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Interp1>:
lea    (%rsi,%rsi,2),%eax
add    %edx,%eax
sar    $0x2,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @Interp1(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = mul nsw i32 %7, 3
%9 = load i32, i32* %6
%10 = add nsw i32 %8, %9
%11 = ashr i32 %10, 2
%12 = load i8*, i8** %4
%13 = bitcast i8* %12 to i32*
store i32 %11, i32* %13
ret void
}

LLVM IR (-O2):
define void @Interp1(i8* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %1, 3
%5 = add nsw i32 %4, %2
%6 = ashr i32 %5, 2
%7 = bitcast i8* %0 to i32*
store i32 %6, i32* %7
ret void
}
int getScancode(int keycode) { return keycode - 8; }


x86 assembly (clang, -O0):
<getScancode>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x8,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getScancode>:
lea    -0x8(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @getScancode(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 8
ret i32 %4
}

LLVM IR (-O2):
define i32 @getScancode(i32 %0) {
%2 = add nsw i32 %0, -8
ret i32 %2
}
float conversion(int cels) {
  float fahr = 9.0 / 5.0 * cels + 32;
  return (fahr);
}


x86 assembly (clang, -O0):
<conversion>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xeec(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xee8(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<conversion>:
cvtsi2sd %edi,%xmm0
mulsd  0xef4(%rip),%xmm0
addsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @conversion(i32 %0) {
%2 = alloca i32
%3 = alloca float
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sitofp i32 %4 to double
%6 = call double @llvm.fmuladd.f64(double 1.800000e+00, double %5, double 3.200000e+01)
%7 = fptrunc double %6 to float
store float %7, float* %3
%8 = load float, float* %3
ret float %8
}

LLVM IR (-O2):
define float @conversion(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = tail call double @llvm.fmuladd.f64(double %2, double 1.800000e+00, double 3.200000e+01)
%4 = fptrunc double %3 to float
ret float %4
}
void ubi_dbg_dump_vid_hdr(const struct ubi_vid_hdr *vid_hdr) { return; }


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

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

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

LLVM IR (-O2):
%struct.ubi_vid_hdr = type opaque
define void @ubi_dbg_dump_vid_hdr(%struct.ubi_vid_hdr* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fail_prog(char *, unsigned long);
void *malloc(size_t);
void *emalloc(size_t size) {
  void *mem;
  if ((mem = malloc(size)) == 0)
    fail_prog("Could not allocate %lu bytes of memory", (unsigned long)size);
  return mem;
}


x86 assembly (clang, -O0):
<emalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1153 <emalloc+0x33>
mov    -0x8(%rbp),%rsi
lea    0xeb2(%rip),%rdi
call   1040 <fail_prog@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <emalloc+0x23>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
call   1040 <fail_prog@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [39 x i8] c"Could not allocate %lu bytes of memory\00"
define i8* @emalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i64, i64* %2
%9 = call i32 @fail_prog(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i64 %8)
br label %10
10: ; preds = %7, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [39 x i8] c"Could not allocate %lu bytes of memory\00"
define noalias i8* @emalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @fail_prog(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ _con_out(char);
int /*<<< orphan*/ pari(short);
void paripi(short r) {
  pari(r);
  _con_out((char)'+');
}


x86 assembly (clang, -O0):
<paripi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edi
call   1040 <pari@plt>
mov    $0x2b,%edi
call   1030 <_con_out@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<paripi>:
push   %rax
call   1040 <pari@plt>
mov    $0x2b,%edi
pop    %rax
jmp    1030 <_con_out@plt>

LLVM IR (-O0):
define void @paripi(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call i32 @pari(i16 signext %3)
%5 = call i32 @_con_out(i8 signext 43)
ret void
}

LLVM IR (-O2):
define void @paripi(i16 signext %0) {
%2 = tail call i32 @pari(i16 signext %0)
%3 = tail call i32 @_con_out(i8 signext 43)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Bag_new(int);
int /*<<< orphan*/ run_test(int /*<<< orphan*/);
int main(void) {
  if (!run_test(Bag_new(false)))
    return -1;
  if (!run_test(Bag_new(true)))
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1030 <Bag_new@plt>
mov    %eax,%edi
call   1040 <run_test@plt>
cmp    $0x0,%eax
jne    1152 <main+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    117f <main+0x5f>
mov    $0x1,%edi
call   1030 <Bag_new@plt>
mov    %eax,%edi
call   1040 <run_test@plt>
cmp    $0x0,%eax
jne    1178 <main+0x58>
movl   $0xffffffff,-0x4(%rbp)
jmp    117f <main+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <Bag_new@plt>
mov    %eax,%edi
call   1040 <run_test@plt>
test   %eax,%eax
je     114b <main+0x2b>
mov    $0x1,%edi
call   1030 <Bag_new@plt>
mov    %eax,%edi
call   1040 <run_test@plt>
cmp    $0x1,%eax
sbb    %eax,%eax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @Bag_new(i32 0)
%2 = tail call i32 @run_test(i32 %1)
%3 = icmp eq i32 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %0
%5 = tail call i32 @Bag_new(i32 1)
%6 = tail call i32 @run_test(i32 %5)
%7 = icmp eq i32 %6, 0
%8 = sext i1 %7 to i32
br label %9
9: ; preds = %4, %0
%10 = phi i32 [ -1, %0 ], [ %8, %4 ]
ret i32 %10
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *Make_new_Strcpy(char *str) {
  char *newstr = (char *)malloc(strlen(str) + 1);
  strcpy(newstr, str);
  return newstr;
}


x86 assembly (clang, -O0):
<Make_new_Strcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Make_new_Strcpy>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @Make_new_Strcpy(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = load i8*, i8** %2
%11 = call i32 @strcpy(i8* %9, i8* %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define i8* @Make_new_Strcpy(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strcpy(i8* %5, i8* %0)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ closeListeningSockets(int);
int prepareForShutdown(int flags) {
  closeListeningSockets(1);
  return 0;
}


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

x86 assembly (clang, -O2):
<prepareForShutdown>:
push   %rax
mov    $0x1,%edi
call   1030 <closeListeningSockets@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @prepareForShutdown(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @closeListeningSockets(i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @prepareForShutdown(i32 %0) {
%2 = tail call i32 @closeListeningSockets(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ MFRC522_Clear_Bit(int, int);
void MFRC522_AntennaOff() { MFRC522_Clear_Bit(0x14, 0x03); }


x86 assembly (clang, -O0):
<MFRC522_AntennaOff>:
push   %rbp
mov    %rsp,%rbp
mov    $0x14,%edi
mov    $0x3,%esi
call   1030 <MFRC522_Clear_Bit@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @MFRC522_AntennaOff() {
%1 = call i32 @MFRC522_Clear_Bit(i32 20, i32 3)
ret void
}

LLVM IR (-O2):
define void @MFRC522_AntennaOff() {
%1 = tail call i32 @MFRC522_Clear_Bit(i32 20, i32 3)
ret void
}
/* Variables and functions */
char *get_continent_name_and_code(char const *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
void geoip_set_continent(const char *continent, char *loc) {
  if (continent)
    sprintf(loc, "%s", get_continent_name_and_code(continent));
  else
    sprintf(loc, "%s", "Continent Unknown");
}


x86 assembly (clang, -O0):
<geoip_set_continent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1164 <geoip_set_continent+0x44>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <get_continent_name_and_code@plt>
mov    -0x18(%rbp),%rdi
mov    %rax,%rdx
lea    0xea6(%rip),%rsi
call   1040 <sprintf@plt>
jmp    117b <geoip_set_continent+0x5b>
mov    -0x10(%rbp),%rdi
lea    0xe91(%rip),%rsi
lea    0xe8d(%rip),%rdx
call   1040 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<geoip_set_continent>:
push   %rbx
mov    %rsi,%rbx
test   %rdi,%rdi
je     113a <geoip_set_continent+0x1a>
call   1040 <get_continent_name_and_code@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>
movups 0xebf(%rip),%xmm0
movups %xmm0,(%rbx)
movw   $0x6e,0x10(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
@.str.1 = [18 x i8] c"Continent Unknown\00"
define void @geoip_set_continent(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i8* @get_continent_name_and_code(i8* %0)
%6 = tail call i8* @strcpy(i8* dereferenceable(1) %1, i8* dereferenceable(1) %5)
br label %8
7: ; preds = %2
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(18) %1, i8* align 1 dereferenceable(18) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i64 18, i1 false)
br label %8
8: ; preds = %7, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DymosimError(char *);
int /*<<< orphan*/ sprintf(char *, char *, char const *, char const *, double,
                           double);
double powerr(const char *xexpr, double x, const char *yexpr, double y) {
  char buf[1000];
  sprintf(buf, "\nModel error - power: (%.400s) ^ (%.400s) = (%g) ^ (%g)\n",
          xexpr, yexpr, x, y);
  DymosimError(buf);
  return 1.0;
}


x86 assembly (clang, -O0):
<powerr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x18(%rbp),%rcx
movsd  -0x10(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
lea    0xeab(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x410(%rbp),%rdi
call   1030 <DymosimError@plt>
movsd  0xe8a(%rip),%xmm0
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<powerr>:
push   %rbx
sub    $0x3f0,%rsp
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xed3(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <DymosimError@plt>
movsd  0xeb0(%rip),%xmm0
add    $0x3f0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [57 x i8] c"\0AModel error - power: (%.400s) ^ (%.400s) = (%g) ^ (%g)\0A\00"
define double @powerr(i8* %0, double %1, i8* %2, double %3) {
%5 = alloca i8*
%6 = alloca double
%7 = alloca i8*
%8 = alloca double
%9 = alloca [1000 x i8]
store i8* %0, i8** %5
store double %1, double* %6
store i8* %2, i8** %7
store double %3, double* %8
%10 = getelementptr inbounds [1000 x i8], [1000 x i8]* %9, i64 0, i64 0
%11 = load i8*, i8** %5
%12 = load i8*, i8** %7
%13 = load double, double* %6
%14 = load double, double* %8
%15 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i8* %11, i8* %12, double %13, double %14)
%16 = getelementptr inbounds [1000 x i8], [1000 x i8]* %9, i64 0, i64 0
%17 = call i32 @DymosimError(i8* %16)
ret double 1.000000e+00
}

LLVM IR (-O2):
@.str = [57 x i8] c"\0AModel error - power: (%.400s) ^ (%.400s) = (%g) ^ (%g)\0A\00"
define double @powerr(i8* %0, double %1, i8* %2, double %3) {
%5 = alloca [1000 x i8]
%6 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%7 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %2, double %1, double %3)
%8 = call i32 @DymosimError(i8* %6)
ret double 1.000000e+00
}
/* Type definitions */
typedef int /*<<< orphan*/ mpz_t;

/* Variables and functions */
int /*<<< orphan*/ mpz_sgn(int /*<<< orphan*/);
int mpz_is0(mpz_t z) { return !mpz_sgn(z); }


x86 assembly (clang, -O0):
<mpz_is0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <mpz_sgn@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpz_is0>:
push   %rax
call   1030 <mpz_sgn@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mpz_is0(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @mpz_sgn(i32 %3)
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @mpz_is0(i32 %0) {
%2 = tail call i32 @mpz_sgn(i32 %0)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ LCD_Write_Byte(int, int /*<<< orphan*/);
int /*<<< orphan*/ chr_to_cyr(unsigned char);
void LCD_Write_Char(unsigned char c) { LCD_Write_Byte(0x01, chr_to_cyr(c)); }


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

x86 assembly (clang, -O2):
<LCD_Write_Char>:
push   %rax
call   1040 <chr_to_cyr@plt>
mov    $0x1,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <LCD_Write_Byte@plt>

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

LLVM IR (-O2):
define void @LCD_Write_Char(i8 zeroext %0) {
%2 = tail call i32 @chr_to_cyr(i8 zeroext %0)
%3 = tail call i32 @LCD_Write_Byte(i32 1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void keyboard(unsigned char key, int x, int y) {
  switch (key) {
  case 27:
    exit(0);
  }
}


x86 assembly (clang, -O0):
<keyboard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x1(%rbp),%al
sub    $0x1b,%al
jne    113b <keyboard+0x2b>
jmp    1134 <keyboard+0x24>
xor    %edi,%edi
call   1030 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keyboard>:
cmp    $0x1b,%dil
je     1117 <keyboard+0x7>
ret
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @keyboard(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
switch i32 %8, label %11 [
i32 27, label %9
]
9: ; preds = %3
%10 = call i32 @exit(i32 0)
unreachable
11: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @keyboard(i8 zeroext %0, i32 %1, i32 %2) {
%4 = icmp eq i8 %0, 27
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %3
ret void
}
void border_sw_ext_corner_special_sand_long_vert(unsigned char *pic,
                                                 unsigned char *mirr) {
  *pic = 0x2F;
  *mirr = 0x01;
}


x86 assembly (clang, -O0):
<border_sw_ext_corner_special_sand_long_vert>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x2f,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<border_sw_ext_corner_special_sand_long_vert>:
movb   $0x2f,(%rdi)
movb   $0x1,(%rsi)
ret

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

LLVM IR (-O2):
define void @border_sw_ext_corner_special_sand_long_vert(i8* nocapture writeonly %0, i8* nocapture writeonly %1) {
store i8 47, i8* %0
store i8 1, i8* %1
ret void
}
int cosmos_dlclose_vm(void *dlh) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @cosmos_dlclose_vm(i8* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
int le_to_u32(int /*<<< orphan*/ const *);
int32_t le_to_i32(const uint8_t *buf) {
  uint32_t v = le_to_u32(buf);
  return v < 0x80000000U ? v : -((int32_t)(0xffffffffU - v)) - 1;
}


x86 assembly (clang, -O0):
<le_to_i32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <le_to_u32@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x80000000,-0xc(%rbp)
jae    1140 <le_to_i32+0x30>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1152 <le_to_i32+0x42>
mov    $0xffffffff,%ecx
sub    -0xc(%rbp),%ecx
xor    %eax,%eax
sub    %ecx,%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<le_to_i32>:
jmp    1030 <le_to_u32@plt>

LLVM IR (-O0):
define i32 @le_to_i32(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @le_to_u32(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ult i32 %6, -2147483648
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i32, i32* %3
br label %15
10: ; preds = %1
%11 = load i32, i32* %3
%12 = sub i32 -1, %11
%13 = sub nsw i32 0, %12
%14 = sub nsw i32 %13, 1
br label %15
15: ; preds = %10, %8
%16 = phi i32 [ %9, %8 ], [ %14, %10 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @le_to_i32(i32* %0) {
%2 = tail call i32 @le_to_u32(i32* %0)
ret i32 %2
}
/* Variables and functions */
int unlink(char const *);
int lace_compat_file_rm(const char *filepath) { return unlink(filepath); }


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

x86 assembly (clang, -O2):
<lace_compat_file_rm>:
jmp    1030 <unlink@plt>

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

LLVM IR (-O2):
define i32 @lace_compat_file_rm(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
ret i32 %2
}
void ath9k_cmn_debug_recv(struct dentry *debugfs_phy,
                          struct ath_rx_stats *rxstats) {}


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

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

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

LLVM IR (-O2):
%struct.dentry = type opaque
%struct.ath_rx_stats = type opaque
define void @ath9k_cmn_debug_recv(%struct.dentry* nocapture %0, %struct.ath_rx_stats* nocapture %1) {
ret void
}
/* Variables and functions */
char writeUART(int, unsigned char *);
char fan_get_rpm(void) { return writeUART(2, (unsigned char *)"\x080\x038"); }


x86 assembly (clang, -O0):
<fan_get_rpm>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
lea    0xee0(%rip),%rsi
call   1030 <writeUART@plt>
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fan_get_rpm>:
lea    0xee9(%rip),%rsi
mov    $0x2,%edi
jmp    1030 <writeUART@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"\808\00"
define signext i8 @fan_get_rpm() {
%1 = call signext i8 @writeUART(i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i8 %1
}

LLVM IR (-O2):
@.str = [3 x i8] c"\808\00"
define signext i8 @fan_get_rpm() {
%1 = tail call signext i8 @writeUART(i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i8 %1
}
/* Variables and functions */
int PnameRef();
PlogicNameRef() {
  int b = -1;
  ;
  b = PnameRef();
  return (b);
}


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

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

LLVM IR (-O0):
define i32 @PlogicNameRef() {
%1 = alloca i32
store i32 -1, i32* %1
%2 = call i32 (...) @PnameRef()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @PlogicNameRef() {
%1 = tail call i32 (...) @PnameRef()
ret i32 %1
}
void RasterDisable(unsigned int baseAddr) {
  (*((volatile unsigned int *)(baseAddr + (0x28)))) &= ~(0x00000001u);
}


x86 assembly (clang, -O0):
<RasterDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x28,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xfffffffe,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RasterDisable>:
add    $0x28,%edi
andl   $0xfffffffe,(%rdi)
ret

LLVM IR (-O0):
define void @RasterDisable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 40
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, -2
store volatile i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @RasterDisable(i32 %0) {
%2 = add i32 %0, 40
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = and i32 %5, -2
store volatile i32 %6, i32* %4
ret void
}
void SXNET_new(void) {}


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

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

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

LLVM IR (-O2):
define void @SXNET_new() {
ret void
}
/* Type definitions */
struct rbtree {
  int dummy;
};
struct rbnode {
  int dummy;
};

/* Variables and functions */
struct rbnode *_rb_get_minmax(struct rbtree *, int /*<<< orphan*/);
struct rbnode *rb_get_min(struct rbtree *tree) {
  return _rb_get_minmax(tree, 0);
}


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

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

LLVM IR (-O0):
%struct.rbnode = type { i32 }
%struct.rbtree = type { i32 }
define %struct.rbnode* @rb_get_min(%struct.rbtree* %0) {
%2 = alloca %struct.rbtree*
store %struct.rbtree* %0, %struct.rbtree** %2
%3 = load %struct.rbtree*, %struct.rbtree** %2
%4 = call %struct.rbnode* @_rb_get_minmax(%struct.rbtree* %3, i32 0)
ret %struct.rbnode* %4
}

LLVM IR (-O2):
%struct.rbnode = type { i32 }
%struct.rbtree = type { i32 }
define %struct.rbnode* @rb_get_min(%struct.rbtree* %0) {
%2 = tail call %struct.rbnode* @_rb_get_minmax(%struct.rbtree* %0, i32 0)
ret %struct.rbnode* %2
}
/* Variables and functions */
int /*<<< orphan*/ test(int **);
int main(int argc, const char *argv[]) {
  int arr[10][6];
  test(arr);
  int arr2[9][7];
  test(arr);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xf0,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <test@plt>
mov    %rbx,%rdi
call   1030 <test@plt>
xor    %eax,%eax
add    $0xf0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [10 x [6 x i32]]
%7 = alloca [9 x [7 x i32]]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = getelementptr inbounds [10 x [6 x i32]], [10 x [6 x i32]]* %6, i64 0, i64 0
%9 = bitcast [6 x i32]* %8 to i32**
%10 = call i32 @test(i32** %9)
%11 = getelementptr inbounds [10 x [6 x i32]], [10 x [6 x i32]]* %6, i64 0, i64 0
%12 = bitcast [6 x i32]* %11 to i32**
%13 = call i32 @test(i32** %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [10 x [6 x i32]]
%4 = bitcast [10 x [6 x i32]]* %3 to i8*
%5 = bitcast [10 x [6 x i32]]* %3 to i32**
%6 = call i32 @test(i32** %5)
%7 = call i32 @test(i32** %5)
ret i32 0
}
void outportl(unsigned int __val, unsigned short __port) {
  __asm__ volatile("outl %0,%1" : : "a"(__val), "dN"(__port));
}


x86 assembly (clang, -O0):
<outportl>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x6(%rbp),%dx
out    %eax,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outportl>:
mov    %esi,%edx
mov    %edi,%eax
out    %eax,(%dx)
ret

LLVM IR (-O0):
define void @outportl(i32 %0, i16 zeroext %1) {
%3 = alloca i32
%4 = alloca i16
store i32 %0, i32* %3
store i16 %1, i16* %4
%5 = load i32, i32* %3
%6 = load i16, i16* %4
ret void
}

LLVM IR (-O2):
define void @outportl(i32 %0, i16 zeroext %1) {
tail call void asm sideeffect "outl $0,$1", "{ax},{dx}N,~{dirflag},~{fpsr},~{flags}"(i32 %0, i16 %1)
ret void
}