xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ cal_bits(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main(int argc, char *argv[]) {
  char bits[32] = {0};
  scanf("%s", bits);
  cal_bits(bits);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1030 <memset@plt>
lea    -0x30(%rbp),%rsi
lea    0xe9f(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x30(%rbp),%rdi
call   1040 <cal_bits@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
lea    0xec8(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1030 <cal_bits@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [32 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [32 x i8]* %6 to i8*
%8 = getelementptr inbounds [32 x i8], [32 x i8]* %6, i64 0, i64 0
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds [32 x i8], [32 x i8]* %6, i64 0, i64 0
%11 = call i32 @cal_bits(i8* %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [32 x i8]
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @cal_bits(i8* %4)
ret i32 0
}
/* Variables and functions */
char input();
void comment() {
  char c, c1;
loop:
  while ((c = input()) != '*' && c != 0)
    ;
  if ((c1 = input()) != '/' && c != 0) {
    goto loop;
  }
}


x86 assembly (clang, -O0):
<comment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
jmp    111d <comment+0xd>
mov    $0x0,%al
call   1030 <input@plt>
mov    %al,-0x1(%rbp)
movsbl %al,%ecx
xor    %eax,%eax
cmp    $0x2a,%ecx
mov    %al,-0x3(%rbp)
je     1145 <comment+0x35>
movsbl -0x1(%rbp),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
test   $0x1,%al
jne    1155 <comment+0x45>
jmp    115a <comment+0x4a>
jmp    111d <comment+0xd>
mov    $0x0,%al
call   1030 <input@plt>
mov    %al,-0x2(%rbp)
movsbl %al,%eax
cmp    $0x2f,%eax
je     1182 <comment+0x72>
movsbl -0x1(%rbp),%eax
cmp    $0x0,%eax
je     1182 <comment+0x72>
jmp    1118 <comment+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<comment>:
push   %rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <input@plt>
mov    %eax,%ebx
cmp    $0x2a,%al
je     1131 <comment+0x21>
test   %bl,%bl
jne    1120 <comment+0x10>
xor    %eax,%eax
call   1030 <input@plt>
cmp    $0x2f,%al
je     1140 <comment+0x30>
test   %bl,%bl
jne    1120 <comment+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @comment() {
%1 = alloca i8
%2 = alloca i8
br label %3
3: ; preds = %23, %0
br label %4
4: ; preds = %14, %3
%5 = call signext i8 (...) @input()
store i8 %5, i8* %1
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 42
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = load i8, i8* %1
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br label %12
12: ; preds = %8, %4
%13 = phi i1 [ false, %4 ], [ %11, %8 ]
br i1 %13, label %14, label %15
14: ; preds = %12
br label %4
15: ; preds = %12
%16 = call signext i8 (...) @input()
store i8 %16, i8* %2
%17 = sext i8 %16 to i32
%18 = icmp ne i32 %17, 47
br i1 %18, label %19, label %24
19: ; preds = %15
%20 = load i8, i8* %1
%21 = sext i8 %20 to i32
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %24
23: ; preds = %19
br label %3
24: ; preds = %19, %15
ret void
}

LLVM IR (-O2):
define void @comment() {
br label %1
1: ; preds = %3, %0
%2 = tail call signext i8 (...) @input()
switch i8 %2, label %3 [
i8 42, label %4
i8 0, label %4
]
3: ; preds = %1, %4
br label %1
4: ; preds = %1, %1
%5 = icmp ne i8 %2, 0
%6 = tail call signext i8 (...) @input()
%7 = icmp ne i8 %6, 47
%8 = select i1 %7, i1 %5, i1 false
br i1 %8, label %3, label %9
9: ; preds = %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LCD_PutChar(int);
int lcdPrintfFunc(void *outParm, int ch) {
  LCD_PutChar(ch);
  return 1;
}


x86 assembly (clang, -O0):
<lcdPrintfFunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <LCD_PutChar@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @lcdPrintfFunc(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @LCD_PutChar(i32 %1)
ret i32 1
}
/* Variables and functions */
int llib_str_cmp(char *, char *);
int vacmp(void *a, void *b) { return llib_str_cmp((char *)a, (char *)b); }


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

x86 assembly (clang, -O2):
<vacmp>:
jmp    1030 <llib_str_cmp@plt>

LLVM IR (-O0):
define i32 @vacmp(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 = load i8*, i8** %4
%7 = call i32 @llib_str_cmp(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @vacmp(i8* %0, i8* %1) {
%3 = tail call i32 @llib_str_cmp(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void imprimeVet(int tam, int *vetor) {
  int i;
  for (i = 0; i < tam; i++) {
    printf("%d,", vetor[i]);
  }
}


x86 assembly (clang, -O0):
<imprimeVet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1157 <imprimeVet+0x47>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <imprimeVet+0x16>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d,\00"
define void @imprimeVet(i32 %0, i32* nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %1, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
void PyInit_complement() {}


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

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

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

LLVM IR (-O2):
define void @PyInit_complement() {
ret void
}
unsigned char bitmap_readPixelValue(const unsigned char *pImageData,
                                    int scanLineSize, int row, int col) {
  int byteIndex;
  unsigned char cByteChunk;
  unsigned char cPixelMask;
  unsigned char cPixelValue;
  byteIndex = (scanLineSize * row) + (col / 8);
  cByteChunk = *(pImageData + byteIndex);
  cPixelMask = 0x80 >> (col % 8);
  cPixelValue = (cByteChunk & cPixelMask) == 0 ? 0x00 : 0x01;
  return cPixelValue;
}


x86 assembly (clang, -O0):
<bitmap_readPixelValue>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x19(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    $0x80,%eax
sar    %cl,%eax
mov    %al,-0x1a(%rbp)
movzbl -0x19(%rbp),%edx
movzbl -0x1a(%rbp),%eax
and    %eax,%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
mov    %al,-0x1b(%rbp)
movzbl -0x1b(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_readPixelValue>:
imul   %edx,%esi
lea    0x7(%rcx),%eax
test   %ecx,%ecx
cmovns %ecx,%eax
sar    $0x3,%eax
add    %esi,%eax
cltq
movzbl (%rdi,%rax,1),%eax
and    $0x7,%cl
shl    %cl,%eax
movzbl %al,%eax
shr    $0x7,%eax
ret

LLVM IR (-O0):
define zeroext i8 @bitmap_readPixelValue(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8
%11 = alloca i8
%12 = alloca i8
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%13 = load i32, i32* %6
%14 = load i32, i32* %7
%15 = mul nsw i32 %13, %14
%16 = load i32, i32* %8
%17 = sdiv i32 %16, 8
%18 = add nsw i32 %15, %17
store i32 %18, i32* %9
%19 = load i8*, i8** %5
%20 = load i32, i32* %9
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %19, i64 %21
%23 = load i8, i8* %22
store i8 %23, i8* %10
%24 = load i32, i32* %8
%25 = srem i32 %24, 8
%26 = ashr i32 128, %25
%27 = trunc i32 %26 to i8
store i8 %27, i8* %11
%28 = load i8, i8* %10
%29 = zext i8 %28 to i32
%30 = load i8, i8* %11
%31 = zext i8 %30 to i32
%32 = and i32 %29, %31
%33 = icmp eq i32 %32, 0
%34 = zext i1 %33 to i64
%35 = select i1 %33, i32 0, i32 1
%36 = trunc i32 %35 to i8
store i8 %36, i8* %12
%37 = load i8, i8* %12
ret i8 %37
}

LLVM IR (-O2):
define zeroext i8 @bitmap_readPixelValue(i8* nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = mul nsw i32 %2, %1
%6 = sdiv i32 %3, 8
%7 = add nsw i32 %6, %5
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = and i32 %3, 7
%12 = lshr i32 128, %11
%13 = zext i8 %10 to i32
%14 = and i32 %12, %13
%15 = icmp ne i32 %14, 0
%16 = zext i1 %15 to i8
ret i8 %16
}
int test_imm_88int64_lowword_mem(long long *val) {
  return ((*val) & (0x88 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_88int64_lowword_mem>:
testb  $0x88,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_88int64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 136
%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_88int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 136
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void DISCgpiopins_default(void) { return; }


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

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

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

LLVM IR (-O2):
define void @DISCgpiopins_default() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ basic_xattr_test(char *);
int main(int argc, char *argv[]) {
  basic_xattr_test("/mnt/");
  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)
lea    0xed3(%rip),%rdi
call   1030 <basic_xattr_test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"/mnt/\00"
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 @basic_xattr_test(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"/mnt/\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @basic_xattr_test(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void writeGpxFooter(FILE *OUT) { fprintf(OUT, "</gpx>"); }


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

x86 assembly (clang, -O2):
<writeGpxFooter>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x6,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"</gpx>\00"
define void @writeGpxFooter(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"</gpx>\00"
define void @writeGpxFooter(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 6, i64 1, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Reserved20_DriverIRQHandler();
__attribute__((weak, section(".after_vectors"))) void
Reserved20_IRQHandler(void) {
  Reserved20_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @Reserved20_IRQHandler() section ".after_vectors" {
%1 = call i32 (...) @Reserved20_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @Reserved20_IRQHandler() section ".after_vectors" {
%1 = tail call i32 (...) @Reserved20_DriverIRQHandler()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ BIO_METHOD;

/* Variables and functions */
int /*<<< orphan*/ BIO_meth_free(int /*<<< orphan*/ *);
void BIO_f_wrap_destroy(BIO_METHOD *method) { BIO_meth_free(method); }


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

x86 assembly (clang, -O2):
<BIO_f_wrap_destroy>:
jmp    1030 <BIO_meth_free@plt>

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

LLVM IR (-O2):
define void @BIO_f_wrap_destroy(i32* %0) {
%2 = tail call i32 @BIO_meth_free(i32* %0)
ret void
}
unsigned xrop3_105_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D ^ S;
  stk1 = T ^ stk2;
  stk1 = ~stk1;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_105_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_105_1_1>:
mov    %esi,%eax
or     %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
or     %esi,%eax
xor    $0xffffff00,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_105_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = zext i8 %1 to i32
%5 = or i8 %1, %0
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
%9 = or i32 %8, %4
%10 = xor i32 %9, -256
ret i32 %10
}
char *my_index(const char *str, int chr) {
  while (*str) {
    if (*str == chr)
      return (char *)str;
    str++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<my_index>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1146 <my_index+0x46>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    1135 <my_index+0x35>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114e <my_index+0x4e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110b <my_index+0xb>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_index>:
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <my_index+0x23>
mov    %rdi,%rax
nopl   0x0(%rax)
movsbl %cl,%ecx
cmp    %esi,%ecx
je     1125 <my_index+0x25>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <my_index+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @my_index(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %10
%6 = phi i8 [ %12, %10 ], [ %3, %2 ]
%7 = phi i8* [ %11, %10 ], [ %0, %2 ]
%8 = sext i8 %6 to i32
%9 = icmp eq i32 %8, %1
br i1 %9, label %14, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %10, %2
%15 = phi i8* [ null, %2 ], [ null, %10 ], [ %7, %5 ]
ret i8* %15
}
int foo() {
  volatile int x = 0xaac358bb;
  return x - 0x11c3db31;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movl   $0xaac358bb,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x11c3db31,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movl   $0xaac358bb,-0x4(%rsp)
aa
mov    $0xee3c24cf,%eax
add    -0x4(%rsp),%eax
ret

LLVM IR (-O0):
define i32 @foo() {
%1 = alloca i32
store volatile i32 -1430038341, i32* %1
%2 = load volatile i32, i32* %1
%3 = sub nsw i32 %2, 298048305
ret i32 %3
}

LLVM IR (-O2):
define i32 @foo() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 -1430038341, i32* %1
%3 = load volatile i32, i32* %1
%4 = add nsw i32 %3, -298048305
ret i32 %4
}
/* Variables and functions */
void record_allocation(void *p, size_t t) {}


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

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

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

LLVM IR (-O2):
define void @record_allocation(i8* nocapture %0, i64 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(int exit_code) {
  fprintf(stderr, "usage: revnetgroup -u|-h\n");
  fprintf(stderr, "       revnetgroup --version\n");
  exit(exit_code);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2eb3(%rip),%r14
mov    (%r14),%edi
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xed4(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"usage: revnetgroup -u|-h\0A\00"
@.str.1 = [30 x i8] c" revnetgroup --version\0A\00"
define void @usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* %2
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"usage: revnetgroup -u|-h\0A\00"
@.str.1 = [30 x i8] c" revnetgroup --version\0A\00"
define void @usage(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @exit(i32 %0)
unreachable
}
void ADC_IRQHandler(void) {
  while (1)
    ;
}


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

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

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

LLVM IR (-O2):
define void @ADC_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ perfTest();
int /*<<< orphan*/ test1();
int /*<<< orphan*/ test2();
int /*<<< orphan*/ test3();
int /*<<< orphan*/ test4();
int main(int argc, char *argv[]) {
  test1();
  test2();
  test3();
  test4();
  perfTest();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <test1@plt>
mov    $0x0,%al
call   1070 <test2@plt>
mov    $0x0,%al
call   1040 <test3@plt>
mov    $0x0,%al
call   1060 <test4@plt>
mov    $0x0,%al
call   1030 <perfTest@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <test1@plt>
xor    %eax,%eax
call   1070 <test2@plt>
xor    %eax,%eax
call   1040 <test3@plt>
xor    %eax,%eax
call   1060 <test4@plt>
xor    %eax,%eax
call   1030 <perfTest@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 (...) @test1()
%7 = call i32 (...) @test2()
%8 = call i32 (...) @test3()
%9 = call i32 (...) @test4()
%10 = call i32 (...) @perfTest()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test1()
%4 = tail call i32 (...) @test2()
%5 = tail call i32 (...) @test3()
%6 = tail call i32 (...) @test4()
%7 = tail call i32 (...) @perfTest()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ putcode(int /*<<< orphan*/, int /*<<< orphan*/);
none() { putcode(0, 0); }


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

x86 assembly (clang, -O2):
<none>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <putcode@plt>

LLVM IR (-O0):
define i32 @none() {
%1 = alloca i32
%2 = call i32 @putcode(i32 0, i32 0)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @none() {
%1 = tail call i32 @putcode(i32 0, i32 0)
ret i32 undef
}
/* Variables and functions */
char *strncpy(char *, char const *, size_t);
char *safe_strncpy(char *dst, const char *src, size_t size) {
  if (!size)
    return dst;
  dst[--size] = '\0';
  return strncpy(dst, src, size);
}


x86 assembly (clang, -O0):
<safe_strncpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    113c <safe_strncpy+0x2c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1169 <safe_strncpy+0x59>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %rcx,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x20(%rbp)
movb   $0x0,-0x1(%rax,%rcx,1)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <strncpy@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_strncpy>:
push   %rbx
mov    %rdi,%rbx
test   %rdx,%rdx
je     112a <safe_strncpy+0x1a>
movb   $0x0,-0x1(%rbx,%rdx,1)
add    $0xffffffffffffffff,%rdx
mov    %rbx,%rdi
call   1030 <strncpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @safe_strncpy(i8* returned %0, i8* nocapture %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %9, label %5
5: ; preds = %3
%6 = add i64 %2, -1
%7 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 0, i8* %7
%8 = tail call i8* @strncpy(i8* dereferenceable(1) %0, i8* %1, i64 %6)
br label %9
9: ; preds = %3, %5
ret i8* %0
}
/* Variables and functions */
char *strdup(int /*<<< orphan*/);
int /*<<< orphan*/ string_escape_full(char *, char *);
char *appaserver_escape_street_address(char *street_address) {
  char escape_street_address[1024];
  return strdup(string_escape_full(escape_street_address, street_address));
}


x86 assembly (clang, -O0):
<appaserver_escape_street_address>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <string_escape_full@plt>
mov    %eax,%edi
call   1040 <strdup@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<appaserver_escape_street_address>:
sub    $0x408,%rsp
mov    %rdi,%rsi
mov    %rsp,%rdi
call   1030 <string_escape_full@plt>
mov    %eax,%edi
call   1040 <strdup@plt>
add    $0x408,%rsp
ret

LLVM IR (-O0):
define i8* @appaserver_escape_street_address(i8* %0) {
%2 = alloca i8*
%3 = alloca [1024 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @string_escape_full(i8* %4, i8* %5)
%7 = call i8* @strdup(i32 %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @appaserver_escape_street_address(i8* %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = call i32 @string_escape_full(i8* %3, i8* %0)
%5 = call i8* @strdup(i32 %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(unsigned long);
int /*<<< orphan*/ stderr;
void *xmalloc(unsigned long size) {
  void *ptr;
  ptr = malloc(size);
  if (ptr == NULL) {
    fprintf(stderr, "ERROR: out of memory!\n");
    exit(1);
  }
  return ptr;
}


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

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

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"ERROR: out of memory!\0A\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %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 ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i8* %2
}
int min(unsigned int a, unsigned int b) { return (((a) < (b)) ? (a) : (b)); }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    1121 <min+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <min+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Type definitions */
struct scsiDevice {
  int dummy;
};
struct device {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ freeDevice(struct device *);
void scsiFreeDevice(struct scsiDevice *dev) {
  freeDevice((struct device *)dev);
}


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

x86 assembly (clang, -O2):
<scsiFreeDevice>:
jmp    1030 <freeDevice@plt>

LLVM IR (-O0):
%struct.scsiDevice = type { i32 }
%struct.device = type { i32 }
define void @scsiFreeDevice(%struct.scsiDevice* %0) {
%2 = alloca %struct.scsiDevice*
store %struct.scsiDevice* %0, %struct.scsiDevice** %2
%3 = load %struct.scsiDevice*, %struct.scsiDevice** %2
%4 = bitcast %struct.scsiDevice* %3 to %struct.device*
%5 = call i32 @freeDevice(%struct.device* %4)
ret void
}

LLVM IR (-O2):
%struct.scsiDevice = type { i32 }
%struct.device = type { i32 }
define void @scsiFreeDevice(%struct.scsiDevice* %0) {
%2 = bitcast %struct.scsiDevice* %0 to %struct.device*
%3 = tail call i32 @freeDevice(%struct.device* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long);
int /*<<< orphan*/ second(int);
extern void first(unsigned long arg) {
  printf("first: 0x%x\n", arg);
  second(0xdeadc0de);
}


x86 assembly (clang, -O0):
<first>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0xdeadc0de,%edi
call   1040 <second@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<first>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xdeadc0de,%edi
pop    %rax
jmp    1040 <second@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"first: 0x%x\0A\00"
define void @first(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i64 %3)
%5 = call i32 @second(i32 -559038242)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"first: 0x%x\0A\00"
define void @first(i64 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i64 %0)
%3 = tail call i32 @second(i32 -559038242)
ret void
}
void test1() {
  int i = 0;
#pragma clang __debug captured
  {
    static float inner = 3.0;
    (void)inner;
    i++;
  }
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
call   1130 <__captured_stmt>
add    $0x10,%rsp
pop    %rbp
ret
cs nopw 0x0(%rax,%rax,1)

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

LLVM IR (-O0):
%struct.anon = type { i32* }
@test1.inner = internal global float 3.000000e+00
define void @test1() {
%1 = alloca i32
%2 = alloca %struct.anon
store i32 0, i32* %1
%3 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 0
store i32* %1, i32** %3
ret void
}
define internal void @__captured_stmt(%struct.anon* %0) {
%2 = alloca %struct.anon*
store %struct.anon* %0, %struct.anon** %2
%3 = load %struct.anon*, %struct.anon** %2
%4 = load float, float* @test1.inner
%5 = getelementptr inbounds %struct.anon, %struct.anon* %3, i32 0, i32 0
%6 = load i32*, i32** %5
%7 = load i32, i32* %6
%8 = add nsw i32 %7, 1
store i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @test1() {
ret void
}
void tegra_bpmp_trace_printk(void) {}


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

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

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

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


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    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <lnname@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1030 <lnname@plt>
mov    $0x1,%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 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @lnname(i8* %8)
ret i32 1
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @lnname(i8* %4)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ alarm(int);
int /*<<< orphan*/ printf(char *);
int main() {
  int go = 1;
  alarm(4);
  while (go) {
    printf("sip");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    $0x4,%edi
call   1040 <alarm@plt>
cmpl   $0x0,-0x8(%rbp)
je     115b <main+0x3b>
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
jmp    1140 <main+0x20>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x4,%edi
call   1040 <alarm@plt>
lea    0xece(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1030 <printf@plt>
jmp    1140 <main+0x20>

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

LLVM IR (-O2):
@.str = [4 x i8] c"sip\00"
define i32 @main() {
%1 = tail call i32 @alarm(i32 4)
br label %2
2: ; preds = %2, %0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %2
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMR58_set(void) { return U_WMRCORENONE_set("U_WMR58"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR58\00"
define i8* @U_WMR58_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR58\00"
define i8* @U_WMR58_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
void cnfLock(void) {}


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

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

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

LLVM IR (-O2):
define void @cnfLock() {
ret void
}
/* Variables and functions */
int lmc_does_file_exist(char *);
int /*<<< orphan*/ lmc_file_path_for_namespace(char *, char const *);
int lmc_does_namespace_exist(const char *ns) {
  char fn[1024];
  lmc_file_path_for_namespace((char *)&fn, ns);
  return lmc_does_file_exist(fn);
}


x86 assembly (clang, -O0):
<lmc_does_namespace_exist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <lmc_file_path_for_namespace@plt>
lea    -0x410(%rbp),%rdi
call   1030 <lmc_does_file_exist@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lmc_does_namespace_exist>:
push   %rbx
sub    $0x400,%rsp
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <lmc_file_path_for_namespace@plt>
mov    %rbx,%rdi
call   1030 <lmc_does_file_exist@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @lmc_does_namespace_exist(i8* %0) {
%2 = alloca i8*
%3 = alloca [1024 x i8]
store i8* %0, i8** %2
%4 = bitcast [1024 x i8]* %3 to i8*
%5 = load i8*, i8** %2
%6 = call i32 @lmc_file_path_for_namespace(i8* %4, i8* %5)
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%8 = call i32 @lmc_does_file_exist(i8* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @lmc_does_namespace_exist(i8* %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = call i32 @lmc_file_path_for_namespace(i8* %3, i8* %0)
%5 = call i32 @lmc_does_file_exist(i8* %3)
ret i32 %5
}
int test_imm_72int8_mem(signed char *val) {
  return ((*val) & (0x72 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_72int8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0x72,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_72int8_mem>:
testb  $0x72,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_72int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 114
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ lcdhal_deselect();
void lcd_stopStream(void) { lcdhal_deselect(); }


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

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

LLVM IR (-O0):
define void @lcd_stopStream() {
%1 = call i32 (...) @lcdhal_deselect()
ret void
}

LLVM IR (-O2):
define void @lcd_stopStream() {
%1 = tail call i32 (...) @lcdhal_deselect()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Init();
void _M2_RTExceptions_init(__attribute__((unused)) int argc,
                           __attribute__((unused)) char *argv[]) {
  Init();
}


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

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

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

LLVM IR (-O2):
define void @_M2_RTExceptions_init(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @Init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XListHosts() {
  printf("XListHosts called\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<XListHosts>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"XListHosts called\0A\00"
define i32 @XListHosts() {
%1 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [18 x i8] c"XListHosts called\00"
define i32 @XListHosts() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int dictlite_identityComparison(void *key1, void *key2) { return key1 - key2; }


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

x86 assembly (clang, -O2):
<dictlite_identityComparison>:
mov    %rdi,%rax
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @dictlite_identityComparison(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 = load i8*, i8** %4
%7 = ptrtoint i8* %5 to i64
%8 = ptrtoint i8* %6 to i64
%9 = sub i64 %7, %8
%10 = trunc i64 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @dictlite_identityComparison(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = ptrtoint i8* %1 to i64
%5 = sub i64 %3, %4
%6 = trunc i64 %5 to i32
ret i32 %6
}
int test_imm_F0int8_reg(signed char val) {
  return ((val) & (0xF0 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_F0int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xf0,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_F0int8_reg>:
cmp    $0x10,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_F0int8_reg(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, 240
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_F0int8_reg(i8 signext %0) {
%2 = icmp ult i8 %0, 16
%3 = select i1 %2, i32 -40, i32 -20
ret i32 %3
}