xunge/DecIR huggingface dataset:
int base64_encode_len(int len) { return ((len + 2) / 3 * 4) + 1; }


x86 assembly (clang, -O0):
<base64_encode_len>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
shl    $0x2,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64_encode_len>:
add    $0x2,%edi
movslq %edi,%rax
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
lea    0x1(,%rax,4),%eax
ret

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

LLVM IR (-O2):
define i32 @base64_encode_len(i32 %0) {
%2 = add nsw i32 %0, 2
%3 = sdiv i32 %2, 3
%4 = shl nsw i32 %3, 2
%5 = or i32 %4, 1
ret i32 %5
}
int SDL_imageFilterMultNorASM(unsigned char *Src1, unsigned char *Src2,
                              unsigned char *Dest, int length) {
  return (0);
}


x86 assembly (clang, -O0):
<SDL_imageFilterMultNorASM>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @SDL_imageFilterMultNorASM(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
ret i32 0
}

LLVM IR (-O2):
define i32 @SDL_imageFilterMultNorASM(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i32 %3) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ japi_setpos(int, int, int);
void j_setpos(int arg0, int arg1, int arg2) { japi_setpos(arg0, arg1, arg2); }


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

x86 assembly (clang, -O2):
<j_setpos>:
jmp    1030 <japi_setpos@plt>

LLVM IR (-O0):
define void @j_setpos(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
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @japi_setpos(i32 %7, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @j_setpos(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @japi_setpos(i32 %0, i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "\nUsage: dma_thread [-h | -a <alignment> [ -w <workers>]\n"
                  "\nWith no arguments, generate test files and exit.\n"
                  "-h Display this help and exit.\n"
                  "-a align read buffer to offset <alignment>.\n"
                  "-w number of worker threads, 2 (default) to 256,\n"
                  "   defaults to number of cores.\n\n"
                  "Run first with no arguments to generate files.\n"
                  "Then run with -a <alignment> = 512  or 0. \n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [354 x i8] c"\0AUsage: dma_thread [-h | -a <alignment> [ -w <workers>]\0A\0AWith no arguments, generate test files and exit.\0A-h Display this help and exit.\0A-a align read buffer to offset <alignment>.\0A-w number of worker threads, 2 (default) to 256,\0A defaults to number of cores.\0A\0ARun first with no arguments to generate files.\0AThen run with -a <alignment> = 512 or 0. \0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([354 x i8], [354 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [354 x i8] c"\0AUsage: dma_thread [-h | -a <alignment> [ -w <workers>]\0A\0AWith no arguments, generate test files and exit.\0A-h Display this help and exit.\0A-a align read buffer to offset <alignment>.\0A-w number of worker threads, 2 (default) to 256,\0A defaults to number of cores.\0A\0ARun first with no arguments to generate files.\0AThen run with -a <alignment> = 512 or 0. \0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([354 x i8], [354 x i8]* @.str, i64 0, i64 0))
ret void
}
double ehnlc_fabs(double x) { return x >= 0.0 ? x : -x; }


x86 assembly (clang, -O0):
<ehnlc_fabs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     112a <ehnlc_fabs+0x2a>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    114b <ehnlc_fabs+0x4b>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ehnlc_fabs>:
movapd 0xef8(%rip),%xmm1
xorpd  %xmm0,%xmm1
xorpd  %xmm2,%xmm2
cmplesd %xmm0,%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @ehnlc_fabs(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oge double %3, 0.000000e+00
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load double, double* %2
br label %10
7: ; preds = %1
%8 = load double, double* %2
%9 = fneg double %8
br label %10
10: ; preds = %7, %5
%11 = phi double [ %6, %5 ], [ %9, %7 ]
ret double %11
}

LLVM IR (-O2):
define double @ehnlc_fabs(double %0) {
%2 = fcmp oge double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %0, double %3
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ __ISB();
unsigned int __get_SCTLR();
int /*<<< orphan*/ __set_SCTLR(unsigned int);
void L1C_DisableBTAC(void) {
  __set_SCTLR(__get_SCTLR() & ~(1U << 11U));
  __ISB();
}


x86 assembly (clang, -O0):
<L1C_DisableBTAC>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <__get_SCTLR@plt>
mov    %eax,%edi
and    $0xfffff7ff,%edi
call   1050 <__set_SCTLR@plt>
mov    $0x0,%al
call   1030 <__ISB@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<L1C_DisableBTAC>:
push   %rax
xor    %eax,%eax
call   1040 <__get_SCTLR@plt>
and    $0xfffff7ff,%eax
mov    %eax,%edi
call   1050 <__set_SCTLR@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <__ISB@plt>

LLVM IR (-O0):
define void @L1C_DisableBTAC() {
%1 = call i32 (...) @__get_SCTLR()
%2 = and i32 %1, -2049
%3 = call i32 @__set_SCTLR(i32 %2)
%4 = call i32 (...) @__ISB()
ret void
}

LLVM IR (-O2):
define void @L1C_DisableBTAC() {
%1 = tail call i32 (...) @__get_SCTLR()
%2 = and i32 %1, -2049
%3 = tail call i32 @__set_SCTLR(i32 %2)
%4 = tail call i32 (...) @__ISB()
ret void
}
/* Variables and functions */
void infinite_loop(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<infinite_loop>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <infinite_loop+0x9>
jmp    1109 <infinite_loop+0x9>

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

LLVM IR (-O0):
define void @infinite_loop() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @infinite_loop() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ remove_end_characters(char *, char *, char);
char *remove_quotes(char *d, char *s) {
  char buffer[1024];
  remove_end_characters(buffer, s, '\'');
  remove_end_characters(d, buffer, '\"');
  return d;
}


x86 assembly (clang, -O0):
<remove_quotes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x27,%edx
call   1030 <remove_end_characters@plt>
mov    -0x8(%rbp),%rdi
lea    -0x410(%rbp),%rsi
mov    $0x22,%edx
call   1030 <remove_end_characters@plt>
mov    -0x8(%rbp),%rax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_quotes>:
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x27,%edx
call   1030 <remove_end_characters@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x22,%edx
call   1030 <remove_end_characters@plt>
mov    %rbx,%rax
add    $0x408,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @remove_quotes(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [1024 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %4
%8 = call i32 @remove_end_characters(i8* %6, i8* %7, i8 signext 39)
%9 = load i8*, i8** %3
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%11 = call i32 @remove_end_characters(i8* %9, i8* %10, i8 signext 34)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define i8* @remove_quotes(i8* returned %0, i8* %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = call i32 @remove_end_characters(i8* %4, i8* %1, i8 signext 39)
%6 = call i32 @remove_end_characters(i8* %0, i8* %4, i8 signext 34)
ret i8* %0
}
int da_hasitem(int *cur, int *max, void ***array, void *item) {
  int idx;
  for (idx = 0; idx < *cur; idx++) {
    if ((*array)[idx] == item) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<da_hasitem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jge    1162 <da_hasitem+0x62>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
cmp    -0x28(%rbp),%rax
jne    114f <da_hasitem+0x4f>
movl   $0x1,-0x4(%rbp)
jmp    1169 <da_hasitem+0x69>
jmp    1154 <da_hasitem+0x54>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    111b <da_hasitem+0x1b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<da_hasitem>:
mov    (%rdi),%eax
test   %eax,%eax
jle    111f <da_hasitem+0x1f>
mov    (%rdx),%rdx
xor    %esi,%esi
nopl   0x0(%rax,%rax,1)
cmp    %rcx,(%rdx,%rsi,8)
je     1122 <da_hasitem+0x22>
add    $0x1,%rsi
cmp    %rsi,%rax
jne    1110 <da_hasitem+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @da_hasitem(i32* nocapture %0, i32* nocapture readnone %1, i8*** nocapture %2, i8* readnone %3) {
%5 = load i32, i32* %0
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %18
7: ; preds = %4
%8 = load i8**, i8*** %2
%9 = zext i32 %5 to i64
br label %12
10: ; preds = %12
%11 = icmp eq i64 %17, %9
br i1 %11, label %18, label %12
12: ; preds = %7, %10
%13 = phi i64 [ 0, %7 ], [ %17, %10 ]
%14 = getelementptr inbounds i8*, i8** %8, i64 %13
%15 = load i8*, i8** %14
%16 = icmp eq i8* %15, %3
%17 = add nuw nsw i64 %13, 1
br i1 %16, label %18, label %10
18: ; preds = %12, %10, %4
%19 = phi i32 [ 0, %4 ], [ 0, %10 ], [ 1, %12 ]
ret i32 %19
}
char to_hex(char code) {
  static char hex[] = "0123456789abcdef";
  return hex[code & 15];
}


x86 assembly (clang, -O0):
<to_hex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
and    $0xf,%eax
movslq %eax,%rcx
lea    0x2f15(%rip),%rax
movsbl (%rax,%rcx,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_hex>:
and    $0xf,%edi
lea    0xef6(%rip),%rax
mov    (%rdi,%rax,1),%al
ret

LLVM IR (-O0):
@to_hex.hex = internal global [17 x i8] c"0123456789abcdef\00"
define signext i8 @to_hex(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 15
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [17 x i8], [17 x i8]* @to_hex.hex, i64 0, i64 %6
%8 = load i8, i8* %7
ret i8 %8
}

LLVM IR (-O2):
@to_hex.hex = internal unnamed_addr constant [17 x i8] c"0123456789abcdef\00"
define signext i8 @to_hex(i8 signext %0) {
%2 = and i8 %0, 15
%3 = zext i8 %2 to i64
%4 = getelementptr inbounds [17 x i8], [17 x i8]* @to_hex.hex, i64 0, i64 %3
%5 = load i8, i8* %4
ret i8 %5
}
void _tr_init(void) {}


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

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

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

LLVM IR (-O2):
define void @_tr_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x7f() {
  Assert_real((isbdigit(127) == 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",
              640, ("isbdigit should be 0 for 0x7f"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0x7f>:
push   %rax
mov    $0x7f,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x280,%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 0x7f\00"
define void @t_isbdigit_0x7f() {
%1 = call i64 @isbdigit(i32 127)
%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 640, 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 0x7f\00"
define void @t_isbdigit_0x7f() {
%1 = tail call i64 @isbdigit(i32 127)
%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 640, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int delete_redirect_and_filter_rules(unsigned short, int);
int _upnp_delete_redir(unsigned short eport, int proto) {
  int r;
  r = delete_redirect_and_filter_rules(eport, proto);
  return r;
}


x86 assembly (clang, -O0):
<_upnp_delete_redir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x2(%rbp),%ax
mov    -0x8(%rbp),%esi
movzwl %ax,%edi
call   1030 <delete_redirect_and_filter_rules@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_upnp_delete_redir>:
jmp    1030 <delete_redirect_and_filter_rules@plt>

LLVM IR (-O0):
define i32 @_upnp_delete_redir(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
%5 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%6 = load i16, i16* %3
%7 = load i32, i32* %4
%8 = call i32 @delete_redirect_and_filter_rules(i16 zeroext %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @_upnp_delete_redir(i16 zeroext %0, i32 %1) {
%3 = tail call i32 @delete_redirect_and_filter_rules(i16 zeroext %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ CP15DCacheDisable();
int /*<<< orphan*/ CP15ICacheDisable();
void cache_disable(void) {
  CP15DCacheDisable();
  CP15ICacheDisable();
}


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

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

LLVM IR (-O0):
define void @cache_disable() {
%1 = call i32 (...) @CP15DCacheDisable()
%2 = call i32 (...) @CP15ICacheDisable()
ret void
}

LLVM IR (-O2):
define void @cache_disable() {
%1 = tail call i32 (...) @CP15DCacheDisable()
%2 = tail call i32 (...) @CP15ICacheDisable()
ret void
}
void ii2Nop(void) { return; }


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

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

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

LLVM IR (-O2):
define void @ii2Nop() {
ret void
}
_Bool ctor(const void *key, void *placement) {
  *(int *)placement = (int)key;
  return 1;
}


x86 assembly (clang, -O0):
<ctor>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x1,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctor>:
mov    %edi,(%rsi)
mov    $0x1,%al
ret

LLVM IR (-O0):
define zeroext i1 @ctor(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 = ptrtoint i8* %5 to i32
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to i32*
store i32 %6, i32* %8
ret i1 true
}

LLVM IR (-O2):
define zeroext i1 @ctor(i8* %0, i8* nocapture writeonly %1) {
%3 = ptrtoint i8* %0 to i64
%4 = trunc i64 %3 to i32
%5 = bitcast i8* %1 to i32*
store i32 %4, i32* %5
ret i1 true
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void swap(int a, int b) {
  int tmp;
  tmp = a;
  a = b;
  b = tmp;
  printf("values after swap:  m = %d and n = %d \n\n", a, b);
}


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

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

LLVM IR (-O0):
@.str = [41 x i8] c"values after swap: m = %d and n = %d \0A\0A\00"
define void @swap(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
store i32 %6, i32* %5
%7 = load i32, i32* %4
store i32 %7, i32* %3
%8 = load i32, i32* %5
store i32 %8, i32* %4
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"values after swap: m = %d and n = %d \0A\0A\00"
define void @swap(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int *p;
  int havoc;
  int a;
  p = &a;
  a = 0;
  *p = 1;
  assert(a == 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
cmpl   $0x0,-0x18(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32* %4, i32** %2
store i32 0, i32* %4
%5 = load i32*, i32** %2
store i32 1, i32* %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 0)
ret i32 0
}
/* Variables and functions */
int sqrt(double);
int isPrime(int number) {
  int i = 2;
  int result = 1;
  for (; i <= sqrt((double)number); i++) {
    if (number % i == 0) {
      result = 0;
    }
  }
  return result;
}


x86 assembly (clang, -O0):
<isPrime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
call   1030 <sqrt@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jg     1170 <isPrime+0x60>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
jne    115d <isPrime+0x4d>
movl   $0x0,-0xc(%rbp)
jmp    1162 <isPrime+0x52>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <isPrime+0x19>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPrime>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edi,%r14d
cvtsi2sd %edi,%xmm0
movsd  %xmm0,0x8(%rsp)
call   1030 <sqrt@plt>
mov    $0x1,%ebp
cmp    $0x2,%eax
jl     115d <isPrime+0x4d>
mov    $0x1,%ebx
mov    $0x1,%ebp
xchg   %ax,%ax
add    $0x1,%ebx
mov    %r14d,%eax
cltd
idiv   %ebx
test   %edx,%edx
cmove  %edx,%ebp
movsd  0x8(%rsp),%xmm0
call   1030 <sqrt@plt>
cmp    %eax,%ebx
jl     1140 <isPrime+0x30>
mov    %ebp,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @isPrime(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 2, i32* %3
store i32 1, i32* %4
br label %5
5: ; preds = %18, %1
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = sitofp i32 %7 to double
%9 = call i32 @sqrt(double %8)
%10 = icmp sle i32 %6, %9
br i1 %10, label %11, label %21
11: ; preds = %5
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = srem i32 %12, %13
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %11
store i32 0, i32* %4
br label %17
17: ; preds = %16, %11
br label %18
18: ; preds = %17
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %5
21: ; preds = %5
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
define i32 @isPrime(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = tail call i32 @sqrt(double %2)
%4 = icmp slt i32 %3, 2
br i1 %4, label %14, label %5
5: ; preds = %1, %5
%6 = phi i32 [ %10, %5 ], [ 1, %1 ]
%7 = phi i32 [ %11, %5 ], [ 2, %1 ]
%8 = srem i32 %0, %7
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i32 0, i32 %6
%11 = add nuw nsw i32 %7, 1
%12 = tail call i32 @sqrt(double %2)
%13 = icmp slt i32 %7, %12
br i1 %13, label %5, label %14
14: ; preds = %5, %1
%15 = phi i32 [ 1, %1 ], [ %10, %5 ]
ret i32 %15
}
/* Variables and functions */
char *memcpy(char *, char const *, size_t);
char *xmalloc(size_t);
__attribute__((__warn_unused_result__)) __attribute__((__malloc__))
__attribute__((__returns_nonnull__)) __attribute__((__nonnull__)) char *
xstrcut(const char *str, size_t size) {
  char *s = xmalloc(size + 1);
  s[size] = '\0';
  return memcpy(s, str, size);
}


x86 assembly (clang, -O0):
<xstrcut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1030 <xmalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrcut>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0x1(%rsi),%rdi
call   1030 <xmalloc@plt>
movb   $0x0,(%rax,%rbx,1)
mov    %rax,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <memcpy@plt>

LLVM IR (-O0):
define noalias i8* @xstrcut(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = add i64 %6, 1
%8 = call i8* @xmalloc(i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = load i64, i64* %4
%11 = getelementptr inbounds i8, i8* %9, i64 %10
store i8 0, i8* %11
%12 = load i8*, i8** %5
%13 = load i8*, i8** %3
%14 = load i64, i64* %4
%15 = call i8* @memcpy(i8* %12, i8* %13, i64 %14)
ret i8* %15
}

LLVM IR (-O2):
define noalias i8* @xstrcut(i8* nocapture %0, i64 %1) {
%3 = add i64 %1, 1
%4 = tail call i8* @xmalloc(i64 %3)
%5 = getelementptr inbounds i8, i8* %4, i64 %1
store i8 0, i8* %5
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %4, i8* align 1 %0, i64 %1, i1 false)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ output_line(char *);
gen_complement() {
  output_line("addiu\t$t1, $zero, -1");
  output_line("xor\t$v0, $t1");
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"addiu\09$t1, $zero, -1\00"
@.str.1 = [13 x i8] c"xor\09$v0, $t1\00"
define i32 @gen_complement() {
%1 = alloca i32
%2 = call i32 @output_line(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @output_line(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [21 x i8] c"addiu\09$t1, $zero, -1\00"
@.str.1 = [13 x i8] c"xor\09$v0, $t1\00"
define i32 @gen_complement() {
%1 = tail call i32 @output_line(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @output_line(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret i32 undef
}
int MPI_Comm_f2c(int comm) { return comm; }


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

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

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

LLVM IR (-O2):
define i32 @MPI_Comm_f2c(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
unsigned long findPythagTriplets();
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Locating Pythagorean Triplets\n");
  unsigned long product = findPythagTriplets();
  return product;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <findPythagTriplets@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <findPythagTriplets@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Locating Pythagorean Triplets\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%8 = call i64 (...) @findPythagTriplets()
store i64 %8, i64* %6
%9 = load i64, i64* %6
%10 = trunc i64 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
@str = [30 x i8] c"Locating Pythagorean Triplets\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%4 = tail call i64 (...) @findPythagTriplets()
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Variables and functions */
int recv_fds(int, int *, int, int /*<<< orphan*/ *);
int recv_fd(int sock) {
  int fd, ret;
  ret = recv_fds(sock, &fd, 1, NULL);
  if (ret)
    return -1;
  return fd;
}


x86 assembly (clang, -O0):
<recv_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0xc(%rbp),%rsi
mov    $0x1,%edx
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <recv_fds@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1149 <recv_fd+0x39>
movl   $0xffffffff,-0x4(%rbp)
jmp    114f <recv_fd+0x3f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recv_fd>:
push   %rax
lea    0x4(%rsp),%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1030 <recv_fds@plt>
neg    %eax
sbb    %eax,%eax
or     0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @recv_fd(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @recv_fds(i32 %0, i32* %2, i32 1, i32* null)
%5 = icmp eq i32 %4, 0
%6 = load i32, i32* %2
%7 = select i1 %5, i32 %6, i32 -1
ret i32 %7
}
int test_imm_48uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x48 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_48uint64_highword_reg>:
movabs $0x4800000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_48uint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 72
%6 = icmp ne i64 %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_48uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 309237645312
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ gpio_backlight_lower(int);
int /*<<< orphan*/ gpio_backlight_upper(int);
int /*<<< orphan*/ gpio_init();
int /*<<< orphan*/ usleep(int);
int main() {
  gpio_init();
  for (;;) {
    gpio_backlight_upper(1);
    usleep(500000);
    gpio_backlight_upper(0);
    gpio_backlight_lower(1);
    usleep(500000);
    gpio_backlight_lower(0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <gpio_init@plt>
mov    $0x1,%edi
call   1040 <gpio_backlight_upper@plt>
mov    $0x7a120,%edi
call   1060 <usleep@plt>
xor    %edi,%edi
call   1040 <gpio_backlight_upper@plt>
mov    $0x1,%edi
call   1030 <gpio_backlight_lower@plt>
mov    $0x7a120,%edi
call   1060 <usleep@plt>
xor    %edi,%edi
call   1030 <gpio_backlight_lower@plt>
jmp    1156 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <gpio_init@plt>
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1040 <gpio_backlight_upper@plt>
mov    $0x7a120,%edi
call   1060 <usleep@plt>
xor    %edi,%edi
call   1040 <gpio_backlight_upper@plt>
mov    $0x1,%edi
call   1030 <gpio_backlight_lower@plt>
mov    $0x7a120,%edi
call   1060 <usleep@plt>
xor    %edi,%edi
call   1030 <gpio_backlight_lower@plt>
jmp    1150 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @gpio_init()
br label %3
3: ; preds = %3, %0
%4 = call i32 @gpio_backlight_upper(i32 1)
%5 = call i32 @usleep(i32 500000)
%6 = call i32 @gpio_backlight_upper(i32 0)
%7 = call i32 @gpio_backlight_lower(i32 1)
%8 = call i32 @usleep(i32 500000)
%9 = call i32 @gpio_backlight_lower(i32 0)
br label %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @gpio_init()
br label %2
2: ; preds = %2, %0
%3 = tail call i32 @gpio_backlight_upper(i32 1)
%4 = tail call i32 @usleep(i32 500000)
%5 = tail call i32 @gpio_backlight_upper(i32 0)
%6 = tail call i32 @gpio_backlight_lower(i32 1)
%7 = tail call i32 @usleep(i32 500000)
%8 = tail call i32 @gpio_backlight_lower(i32 0)
br label %2
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_andnot_si64(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 test54(__m64 a, __m64 b) { return _mm_andnot_si64(a, b); }


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

x86 assembly (clang, -O2):
<test54>:
jmp    1030 <_mm_andnot_si64@plt>

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

LLVM IR (-O2):
define i32 @test54(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_andnot_si64(i32 %0, i32 %1)
ret i32 %3
}
long UARTCharGet(unsigned long ulBase) {
  ;
  while (!((*((volatile unsigned long *)(ulBase + 0x00000000))) & 0x00000020)) {
  }
  return ((*((volatile unsigned long *)(ulBase + 0x00000004))));
}


x86 assembly (clang, -O0):
<UARTCharGet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
and    $0x20,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1129 <UARTCharGet+0x29>
jmp    112e <UARTCharGet+0x2e>
jmp    1108 <UARTCharGet+0x8>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTCharGet>:
testq  $0x20,(%rdi)
je     1100 <UARTCharGet>
mov    0x4(%rdi),%rax
ret

LLVM IR (-O0):
define i64 @UARTCharGet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
br label %3
3: ; preds = %11, %1
%4 = load i64, i64* %2
%5 = add i64 %4, 0
%6 = inttoptr i64 %5 to i64*
%7 = load volatile i64, i64* %6
%8 = and i64 %7, 32
%9 = icmp ne i64 %8, 0
%10 = xor i1 %9, true
br i1 %10, label %11, label %12
11: ; preds = %3
br label %3
12: ; preds = %3
%13 = load i64, i64* %2
%14 = add i64 %13, 4
%15 = inttoptr i64 %14 to i64*
%16 = load volatile i64, i64* %15
ret i64 %16
}

LLVM IR (-O2):
define i64 @UARTCharGet(i64 %0) {
%2 = inttoptr i64 %0 to i64*
br label %3
3: ; preds = %3, %1
%4 = load volatile i64, i64* %2
%5 = and i64 %4, 32
%6 = icmp eq i64 %5, 0
br i1 %6, label %3, label %7
7: ; preds = %3
%8 = add i64 %0, 4
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ init_GPIO(int, int /*<<< orphan*/);
int /*<<< orphan*/ set_GPIO(int, int);
int /*<<< orphan*/ sleep(int);
int main(int argc, char **argv) {
  init_GPIO(21, 0);
  set_GPIO(21, 1);
  sleep(5);
  set_GPIO(21, 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x15,%edi
xor    %esi,%esi
call   1050 <init_GPIO@plt>
mov    $0x15,%edi
mov    $0x1,%esi
call   1030 <set_GPIO@plt>
mov    $0x5,%edi
call   1040 <sleep@plt>
mov    $0x15,%edi
xor    %esi,%esi
call   1030 <set_GPIO@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x15,%edi
xor    %esi,%esi
call   1050 <init_GPIO@plt>
mov    $0x15,%edi
mov    $0x1,%esi
call   1030 <set_GPIO@plt>
mov    $0x5,%edi
call   1040 <sleep@plt>
mov    $0x15,%edi
xor    %esi,%esi
call   1030 <set_GPIO@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @init_GPIO(i32 21, i32 0)
%7 = call i32 @set_GPIO(i32 21, i32 1)
%8 = call i32 @sleep(i32 5)
%9 = call i32 @set_GPIO(i32 21, i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @init_GPIO(i32 21, i32 0)
%4 = tail call i32 @set_GPIO(i32 21, i32 1)
%5 = tail call i32 @sleep(i32 5)
%6 = tail call i32 @set_GPIO(i32 21, i32 0)
ret i32 0
}
void SSMR3PutGCPhys64(void) {}


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

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

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

LLVM IR (-O2):
define void @SSMR3PutGCPhys64() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, char *, char *, int);
scalar_t__ system(char *);
void output_bad_records(char *bad_parse_file, char *bad_time_file,
                        char *bad_insert_file) {
  char sys_string[1024];
  sprintf(sys_string,
          "cat %s %s %s					|"
          "queue_top_bottom_lines.e %d			|"
          "html_table.e '^^Bad Records' '' ''		 ",
          bad_parse_file, bad_time_file, bad_insert_file, 80);
  if (system(sys_string)) {
  };
}


x86 assembly (clang, -O0):
<output_bad_records>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x420(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0xeaf(%rip),%rsi
mov    $0x50,%r9d
call   1040 <sprintf@plt>
lea    -0x420(%rbp),%rdi
call   1030 <system@plt>
cmp    $0x0,%rax
je     1177 <output_bad_records+0x57>
jmp    1177 <output_bad_records+0x57>
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_bad_records>:
push   %rbx
sub    $0x400,%rsp
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xec8(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x50,%r9d
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [87 x i8] c"cat %s %s %s\09\09\09\09\09|queue_top_bottom_lines.e %d\09\09\09|html_table.e '^^Bad Records' '' ''\09\09 \00"
define void @output_bad_records(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [1024 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%9 = load i8*, i8** %4
%10 = load i8*, i8** %5
%11 = load i8*, i8** %6
%12 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10, i8* %11, i32 80)
%13 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%14 = call i64 @system(i8* %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %3
br label %17
17: ; preds = %16, %3
ret void
}

LLVM IR (-O2):
@.str = [87 x i8] c"cat %s %s %s\09\09\09\09\09|queue_top_bottom_lines.e %d\09\09\09|html_table.e '^^Bad Records' '' ''\09\09 \00"
define void @output_bad_records(i8* %0, i8* %1, i8* %2) {
%4 = alloca [1024 x i8]
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%6 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([87 x i8], [87 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %2, i32 80)
%7 = call i64 @system(i8* %5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_CIPHER;

/* Variables and functions */
int EVP_CIPHER_key_length(int /*<<< orphan*/ const *);
int tnt_EVP_CIPHER_key_length(const EVP_CIPHER *cipher) {
  return EVP_CIPHER_key_length(cipher);
}


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

x86 assembly (clang, -O2):
<tnt_EVP_CIPHER_key_length>:
jmp    1030 <EVP_CIPHER_key_length@plt>

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

LLVM IR (-O2):
define i32 @tnt_EVP_CIPHER_key_length(i32* %0) {
%2 = tail call i32 @EVP_CIPHER_key_length(i32* %0)
ret i32 %2
}
void DIST_POINT_free(void) {}


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

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

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

LLVM IR (-O2):
define void @DIST_POINT_free() {
ret void
}
int lock(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @lock() {
ret i32 0
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_uid;
};
struct passwd {
  char *pw_name;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
struct passwd *getpwuid(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
char *getuser(struct stat stats) {
  struct passwd *usr = getpwuid(stats.st_uid);
  if (usr == NULL) {
    fprintf(stderr, "could not get user of file\n");
    exit(1);
  }
  return usr->pw_name;
}


x86 assembly (clang, -O0):
<getuser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <getpwuid@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1171 <getuser+0x41>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
lea    0xe9e(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getuser>:
push   %rax
call   1030 <getpwuid@plt>
test   %rax,%rax
je     1140 <getuser+0x10>
mov    (%rax),%rax
pop    %rcx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
%struct.passwd = type { i8* }
@stderr = global i32 0
@.str = [28 x i8] c"could not get user of file\0A\00"
define i8* @getuser(i32 %0) {
%2 = alloca %struct.stat
%3 = alloca %struct.passwd*
%4 = getelementptr inbounds %struct.stat, %struct.stat* %2, i32 0, i32 0
store i32 %0, i32* %4
%5 = getelementptr inbounds %struct.stat, %struct.stat* %2, i32 0, i32 0
%6 = load i32, i32* %5
%7 = call %struct.passwd* @getpwuid(i32 %6)
store %struct.passwd* %7, %struct.passwd** %3
%8 = load %struct.passwd*, %struct.passwd** %3
%9 = icmp eq %struct.passwd* %8, null
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %1
%15 = load %struct.passwd*, %struct.passwd** %3
%16 = getelementptr inbounds %struct.passwd, %struct.passwd* %15, i32 0, i32 0
%17 = load i8*, i8** %16
ret i8* %17
}

LLVM IR (-O2):
%struct.passwd = type { i8* }
@stderr = global i32 0
@.str = [28 x i8] c"could not get user of file\0A\00"
define i8* @getuser(i32 %0) {
%2 = tail call %struct.passwd* @getpwuid(i32 %0)
%3 = icmp eq %struct.passwd* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
%9 = getelementptr inbounds %struct.passwd, %struct.passwd* %2, i64 0, i32 0
%10 = load i8*, i8** %9
ret i8* %10
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
struct __uportsys_sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int __uportsys_accept(int, struct __uportsys_sockaddr *, int /*<<< orphan*/ *,
                      int /*<<< orphan*/ *);
int /*<<< orphan*/ errno;
int accept(int sd, struct sockaddr *addr, socklen_t *addr_len) {
  return __uportsys_accept(sd, (struct __uportsys_sockaddr *)addr, addr_len,
                           &errno);
}


x86 assembly (clang, -O0):
<accept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    0x2eab(%rip),%rcx
call   1030 <__uportsys_accept@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<accept>:
mov    0x2ec9(%rip),%rcx
jmp    1030 <__uportsys_accept@plt>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
%struct.__uportsys_sockaddr = type { i32 }
@errno = global i32 0
define i32 @accept(i32 %0, %struct.sockaddr* %1, i32* %2) {
%4 = alloca i32
%5 = alloca %struct.sockaddr*
%6 = alloca i32*
store i32 %0, i32* %4
store %struct.sockaddr* %1, %struct.sockaddr** %5
store i32* %2, i32** %6
%7 = load i32, i32* %4
%8 = load %struct.sockaddr*, %struct.sockaddr** %5
%9 = bitcast %struct.sockaddr* %8 to %struct.__uportsys_sockaddr*
%10 = load i32*, i32** %6
%11 = call i32 @__uportsys_accept(i32 %7, %struct.__uportsys_sockaddr* %9, i32* %10, i32* @errno)
ret i32 %11
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
%struct.__uportsys_sockaddr = type { i32 }
@errno = global i32 0
define i32 @accept(i32 %0, %struct.sockaddr* %1, i32* %2) {
%4 = bitcast %struct.sockaddr* %1 to %struct.__uportsys_sockaddr*
%5 = tail call i32 @__uportsys_accept(i32 %0, %struct.__uportsys_sockaddr* %4, i32* %2, i32* @errno)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void my_handler(int s) {
  printf("*** Caught signal\n");
  exit(0);
}


x86 assembly (clang, -O0):
<my_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<my_handler>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"*** Caught signal\0A\00"
define void @my_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [18 x i8] c"*** Caught signal\00"
define void @my_handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}