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

/* Variables and functions */
int /*<<< orphan*/ abort();
void leave(int n, siginfo_t *info, void *x) { abort(); }


x86 assembly (clang, -O0):
<leave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<leave>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @leave(i32 %0, i32* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i8*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i8* %2, i8** %6
%7 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @leave(i32 %0, i32* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ replace_spaces(char *);
int main(int argc, char **argv) {
  assert(argc == 2);
  char *str = argv[1];
  printf("Original string: %s\n", str);
  replace_spaces(str);
  printf("Replaced spaces: %s\n", str);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
xor    %eax,%eax
cmp    $0x2,%edi
sete   %al
mov    %eax,%edi
call   1040 <assert@plt>
mov    0x8(%rbx),%rbx
lea    0xeb2(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1050 <replace_spaces@plt>
lea    0xeb0(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Original string: %s\0A\00"
@.str.1 = [21 x i8] c"Replaced spaces: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 2
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
store i8* %13, i8** %6
%14 = load i8*, i8** %6
%15 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = load i8*, i8** %6
%17 = call i32 @replace_spaces(i8* %16)
%18 = load i8*, i8** %6
%19 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %18)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Original string: %s\0A\00"
@.str.1 = [21 x i8] c"Replaced spaces: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = tail call i32 @replace_spaces(i8* %7)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret i32 0
}
void delay(unsigned len) {
  while (len--)
    ;
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1120 <delay+0x20>
jmp    1107 <delay+0x7>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @delay(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* %2
%5 = add i32 %4, -1
store i32 %5, i32* %2
%6 = icmp ne i32 %4, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @delay(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ log_init(char *);
void amf_si_init(void) { log_init("AMF"); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"AMF\00"
define void @amf_si_init() {
%1 = call i32 @log_init(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"AMF\00"
define void @amf_si_init() {
%1 = tail call i32 @log_init(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
double strtod(char const *, char **);
double parse_double(char const *s) {
  char *end;
  double r = strtod(s, &end);
  if (*end) {
    fprintf(stderr, "Non floating point characters: %s\n", s);
    exit(2);
  }
  return r;
}


x86 assembly (clang, -O0):
<parse_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <strtod@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     117e <parse_double+0x4e>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe91(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_double>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rsi
call   1030 <strtod@plt>
mov    0x8(%rsp),%rax
cmpb   $0x0,(%rax)
jne    1152 <parse_double+0x22>
add    $0x10,%rsp
pop    %rbx
ret
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
lea    0xe9e(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"Non floating point characters: %s\0A\00"
define double @parse_double(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca double
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call double @strtod(i8* %5, i8** %3)
store double %6, double* %4
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %1
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %2
%13 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = call i32 @exit(i32 2)
unreachable
15: ; preds = %1
%16 = load double, double* %4
ret double %16
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"Non floating point characters: %s\0A\00"
define double @parse_double(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call double @strtod(i8* %0, i8** %2)
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %0)
%11 = tail call i32 @exit(i32 2)
unreachable
12: ; preds = %1
ret double %4
}
void HariMain(void) {
  while (1)
    ;
}


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

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

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

LLVM IR (-O2):
define void @HariMain() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
char *newDbSerializeHelperStr(int, char *, char *, int);
int /*<<< orphan*/ sprintf(char *, char *, int);
char *newDbSerializeHelperInt(int MAXBUF, char *buf, int num,
                              int proceedComma) {
  char intbuf[20];
  sprintf(intbuf, "%d", num);
  return newDbSerializeHelperStr(MAXBUF, buf, intbuf, proceedComma);
}


x86 assembly (clang, -O0):
<newDbSerializeHelperInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xebd(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    -0x30(%rbp),%rdx
mov    -0x18(%rbp),%ecx
call   1030 <newDbSerializeHelperStr@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<newDbSerializeHelperInt>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %ecx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xec7(%rip),%rsi
mov    %rsp,%r15
mov    %r15,%rdi
call   1040 <sprintf@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14d,%ecx
call   1030 <newDbSerializeHelperStr@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i8* @newDbSerializeHelperInt(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca [20 x i8]
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = getelementptr inbounds [20 x i8], [20 x i8]* %9, i64 0, i64 0
%11 = load i32, i32* %7
%12 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i32, i32* %5
%14 = load i8*, i8** %6
%15 = getelementptr inbounds [20 x i8], [20 x i8]* %9, i64 0, i64 0
%16 = load i32, i32* %8
%17 = call i8* @newDbSerializeHelperStr(i32 %13, i8* %14, i8* %15, i32 %16)
ret i8* %17
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i8* @newDbSerializeHelperInt(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca [20 x i8]
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%7 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %2)
%8 = call i8* @newDbSerializeHelperStr(i32 %0, i8* %1, i8* %6, i32 %3)
ret i8* %8
}
/* Variables and functions */
void stub1(short, int);
void testClosureSIrV(void (*closure)(short, int), short a1, int a2) {
  if (closure != NULL)
    (*closure)(a1, a2);
}


x86 assembly (clang, -O0):
<testClosureSIrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %edx,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1131 <testClosureSIrV+0x31>
mov    -0x8(%rbp),%rax
mov    -0xa(%rbp),%cx
mov    -0x10(%rbp),%esi
movswl %cx,%edi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureSIrV>:
test   %rdi,%rdi
je     110f <testClosureSIrV+0xf>
mov    %rdi,%rax
movswl %si,%edi
mov    %edx,%esi
jmp    *%rax
ret

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

LLVM IR (-O2):
define void @testClosureSIrV(void (i16, i32)* %0, i16 signext %1, i32 %2) {
%4 = icmp eq void (i16, i32)* %0, null
br i1 %4, label %6, label %5
5: ; preds = %3
tail call void %0(i16 signext %1, i32 %2)
br label %6
6: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gendir(char *);
int /*<<< orphan*/ strlen(char *);
char *genn0(char *sf) {
  char *ptr;
  gendir(sf);
  ptr += strlen(sf);
  ptr[0] = 'n';
  ptr[1] = '0';
  ptr[2] = '\0';
}


x86 assembly (clang, -O0):
<genn0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <gendir@plt>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movb   $0x6e,(%rax)
mov    -0x18(%rbp),%rax
movb   $0x30,0x1(%rax)
mov    -0x18(%rbp),%rax
movb   $0x0,0x2(%rax)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genn0>:
push   %rbx
mov    %rdi,%rbx
call   1040 <gendir@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>

LLVM IR (-O0):
define i8* @genn0(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @gendir(i8* %5)
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = load i8*, i8** %4
%10 = sext i32 %8 to i64
%11 = getelementptr inbounds i8, i8* %9, i64 %10
store i8* %11, i8** %4
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 0
store i8 110, i8* %13
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 48, i8* %15
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i64 2
store i8 0, i8* %17
%18 = load i8*, i8** %2
ret i8* %18
}

LLVM IR (-O2):
define noalias i8* @genn0(i8* %0) {
%2 = tail call i32 @gendir(i8* %0)
%3 = tail call i32 @strlen(i8* %0)
unreachable
}
int se32(int i) {
  return ((i & 0xFF000000) >> 24) | ((i & 0xFF0000) >> 8) |
         ((i & 0xFF00) << 8) | ((i & 0xFF) << 24);
}


x86 assembly (clang, -O0):
<se32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff000000,%eax
shr    $0x18,%eax
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @se32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -16777216
%5 = lshr i32 %4, 24
%6 = load i32, i32* %2
%7 = and i32 %6, 16711680
%8 = ashr i32 %7, 8
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = and i32 %10, 65280
%12 = shl i32 %11, 8
%13 = or i32 %9, %12
%14 = load i32, i32* %2
%15 = and i32 %14, 255
%16 = shl i32 %15, 24
%17 = or i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @se32(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int uint64_t;
typedef scalar_t__ rax;

/* Variables and functions */
int /*<<< orphan*/ cpuid(int, int *, int *, int *, int *);
bool cpuid_therm_interrupt_powerlimit() {
  uint64_t rax, rbx, rcx, rdx;
  int leaf = 6;
  cpuid(leaf, &rax, &rbx, &rcx, &rdx);
  if ((((uint64_t)(rax) &
        ((((uint64_t)1 << (((4)) - ((4)) + 1)) - 1) << ((4)))) >>
       (4)) == 1) {
    return true;
  } else {
    return false;
  }
}


x86 assembly (clang, -O0):
<cpuid_therm_interrupt_powerlimit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x6,-0x18(%rbp)
mov    -0x18(%rbp),%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
call   1030 <cpuid@plt>
mov    -0x8(%rbp),%eax
and    $0x10,%eax
sar    $0x4,%eax
cmp    $0x1,%eax
jne    1155 <cpuid_therm_interrupt_powerlimit+0x45>
movl   $0x1,-0x4(%rbp)
jmp    115c <cpuid_therm_interrupt_powerlimit+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid_therm_interrupt_powerlimit>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rsi
lea    0x14(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0xc(%rsp),%r8
mov    $0x6,%edi
call   1030 <cpuid@plt>
mov    0x8(%rsp),%eax
shr    $0x4,%eax
and    $0x1,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @cpuid_therm_interrupt_powerlimit() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 6, i32* %6
%7 = load i32, i32* %6
%8 = call i32 @cpuid(i32 %7, i32* %2, i32* %3, i32* %4, i32* %5)
%9 = load i32, i32* %2
%10 = and i32 %9, 16
%11 = ashr i32 %10, 4
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %14
13: ; preds = %0
store i32 1, i32* %1
br label %15
14: ; preds = %0
store i32 0, i32* %1
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
define i32 @cpuid_therm_interrupt_powerlimit() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = call i32 @cpuid(i32 6, i32* %1, i32* %2, i32* %3, i32* %4)
%10 = load i32, i32* %1
%11 = lshr i32 %10, 4
%12 = and i32 %11, 1
ret i32 %12
}
/* Type definitions */
struct Volume {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ adfGetFreeBlocks(struct Volume *, int, long *);
long adfGet1FreeBlock(struct Volume *vol) {
  long block[1];
  if (!adfGetFreeBlocks(vol, 1, block))
    return (-1);
  else
    return (block[0]);
}


x86 assembly (clang, -O0):
<adfGet1FreeBlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rdx
mov    $0x1,%esi
call   1030 <adfGetFreeBlocks@plt>
cmp    $0x0,%eax
jne    1144 <adfGet1FreeBlock+0x34>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    114c <adfGet1FreeBlock+0x3c>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<adfGet1FreeBlock>:
push   %rax
mov    %rsp,%rdx
mov    $0x1,%esi
call   1030 <adfGetFreeBlocks@plt>
cmp    $0x1,%eax
sbb    %rax,%rax
or     (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.Volume = type { i32 }
define i64 @adfGet1FreeBlock(%struct.Volume* %0) {
%2 = alloca i64
%3 = alloca %struct.Volume*
%4 = alloca [1 x i64]
store %struct.Volume* %0, %struct.Volume** %3
%5 = load %struct.Volume*, %struct.Volume** %3
%6 = getelementptr inbounds [1 x i64], [1 x i64]* %4, i64 0, i64 0
%7 = call i32 @adfGetFreeBlocks(%struct.Volume* %5, i32 1, i64* %6)
%8 = icmp ne i32 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %1
store i64 -1, i64* %2
br label %13
10: ; preds = %1
%11 = getelementptr inbounds [1 x i64], [1 x i64]* %4, i64 0, i64 0
%12 = load i64, i64* %11
store i64 %12, i64* %2
br label %13
13: ; preds = %10, %9
%14 = load i64, i64* %2
ret i64 %14
}

LLVM IR (-O2):
%struct.Volume = type { i32 }
define i64 @adfGet1FreeBlock(%struct.Volume* %0) {
%2 = alloca [1 x i64]
%3 = bitcast [1 x i64]* %2 to i8*
%4 = getelementptr inbounds [1 x i64], [1 x i64]* %2, i64 0, i64 0
%5 = call i32 @adfGetFreeBlocks(%struct.Volume* %0, i32 1, i64* %4)
%6 = icmp eq i32 %5, 0
%7 = load i64, i64* %4
%8 = select i1 %6, i64 -1, i64 %7
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ vc4_strncat(char **, char const *, int /*<<< orphan*/);
void vc4_strcat(char **dest, const char *src) {
  vc4_strncat(dest, src, strlen(src));
}


x86 assembly (clang, -O0):
<vc4_strcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <vc4_strncat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vc4_strcat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <vc4_strncat@plt>

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

LLVM IR (-O2):
define void @vc4_strcat(i8** %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @vc4_strncat(i8** %0, i8* %1, i32 %3)
ret void
}
/* Variables and functions */
unsigned char *dheke_client_process(unsigned char *, unsigned char *,
                                    unsigned char const *);
unsigned char *ke_dheke_client_process(unsigned char *key,
                                       unsigned char *context,
                                       const unsigned char *server_session) {
  return dheke_client_process(key, context, server_session);
}


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

x86 assembly (clang, -O2):
<ke_dheke_client_process>:
jmp    1030 <dheke_client_process@plt>

LLVM IR (-O0):
define i8* @ke_dheke_client_process(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i8* @dheke_client_process(i8* %7, i8* %8, i8* %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @ke_dheke_client_process(i8* %0, i8* %1, i8* %2) {
%4 = tail call i8* @dheke_client_process(i8* %0, i8* %1, i8* %2)
ret i8* %4
}
/* Type definitions */
struct _reent {
  int dummy;
};
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ EIO;
int /*<<< orphan*/ errno;
__attribute__((warning("call to default lseek_r"))) off_t
_undef_lseek_r(struct _reent *r, int fd, off_t offset, int whence) {
  errno = EIO;
  return (off_t)-1;
}


x86 assembly (clang, -O0):
<_undef_lseek_r>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    0x2ec8(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb7(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_undef_lseek_r>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct._reent = type { i32 }
@EIO = global i32 0
@errno = global i32 0
define i32 @_undef_lseek_r(%struct._reent* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca %struct._reent*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store %struct._reent* %0, %struct._reent** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* @EIO
store i32 %9, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct._reent = type { i32 }
@EIO = global i32 0
@errno = global i32 0
define i32 @_undef_lseek_r(%struct._reent* nocapture readnone %0, i32 %1, i32 %2, i32 %3) {
%5 = load i32, i32* @EIO
store i32 %5, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int quit(void) {
  do {
    printf("[ TOOL ] ");
    printf("exit...\n");
  } while (0);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<quit>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <quit+0x9>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<quit>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"[ TOOL ] \00"
@.str.1 = [9 x i8] c"exit...\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @quit() {
br label %1
1: ; preds = %0
%2 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %4
4: ; preds = %1
%5 = load i32, i32* @EXIT_SUCCESS
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@.str = [10 x i8] c"[ TOOL ] \00"
@EXIT_SUCCESS = global i32 0
@str = [8 x i8] c"exit...\00"
define i32 @quit() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
double noise(mu, sigma)
double mu, sigma;
{
  double randomnormaldeviate();
  return ((randomnormaldeviate() * sigma) + mu);
}


x86 assembly (clang, -O0):
<noise>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    $0x0,%al
call   1030 <randomnormaldeviate@plt>
movsd  -0x10(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<noise>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
xor    %eax,%eax
call   1030 <randomnormaldeviate@plt>
mulsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @noise(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = call double (...) @randomnormaldeviate()
%6 = load double, double* %4
%7 = load double, double* %3
%8 = call double @llvm.fmuladd.f64(double %5, double %6, double %7)
ret double %8
}

LLVM IR (-O2):
define double @noise(double %0, double %1) {
%3 = tail call double (...) @randomnormaldeviate()
%4 = tail call double @llvm.fmuladd.f64(double %3, double %1, double %0)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void keyPrint(void *k) {
  char *key = (char *)k;
  printf("%s", key);
}


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

x86 assembly (clang, -O2):
<keyPrint>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @keyPrint(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void g_file_read_link() {}


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

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

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

LLVM IR (-O2):
define void @g_file_read_link() {
ret void
}
/* Variables and functions */
int re_match(char const *, char *);
int validate_hex16(const char *str) {
  if (!str)
    return 0;
  return re_match(str, "^[0-9a-fA-F]{4}$");
}


x86 assembly (clang, -O0):
<validate_hex16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <validate_hex16+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1146 <validate_hex16+0x36>
mov    -0x10(%rbp),%rdi
lea    0xec2(%rip),%rsi
call   1030 <re_match@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<validate_hex16>:
test   %rdi,%rdi
je     1121 <validate_hex16+0x11>
lea    0xee4(%rip),%rsi
jmp    1030 <re_match@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [17 x i8] c"^[0-9a-fA-F]{4}$\00"
define i32 @validate_hex16(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp ne i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %1
store i32 0, i32* %2
br label %10
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i32 @re_match(i8* %8, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
store i32 %9, i32* %2
br label %10
10: ; preds = %7, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@.str = [17 x i8] c"^[0-9a-fA-F]{4}$\00"
define i32 @validate_hex16(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @re_match(i8* %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
void ff_hevc_put_hevc_epel_hv32_8_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_epel_hv32_8_avx2() {
ret void
}
/* Type definitions */
typedef int uint64_t;
struct pcg_state_128 {
  int dummy;
};

/* Variables and functions */
int pcg_mcg_128_xsl_rr_64_random_r(struct pcg_state_128 *);
uint64_t pcg_mcg_128_xsl_rr_64_boundedrand_r(struct pcg_state_128 *rng,
                                             uint64_t bound) {
  uint64_t threshold = -bound % bound;
  for (;;) {
    uint64_t r = pcg_mcg_128_xsl_rr_64_random_r(rng);
    if (r >= threshold)
      return r % bound;
  }
}


x86 assembly (clang, -O0):
<pcg_mcg_128_xsl_rr_64_boundedrand_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
sub    -0xc(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pcg_mcg_128_xsl_rr_64_random_r@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1152 <pcg_mcg_128_xsl_rr_64_boundedrand_r+0x42>
mov    -0x14(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
add    $0x20,%rsp
pop    %rbp
ret
jmp    112b <pcg_mcg_128_xsl_rr_64_boundedrand_r+0x1b>

x86 assembly (clang, -O2):
<pcg_mcg_128_xsl_rr_64_boundedrand_r>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <pcg_mcg_128_xsl_rr_64_random_r@plt>
test   %eax,%eax
js     1120 <pcg_mcg_128_xsl_rr_64_boundedrand_r+0x10>
cltd
idiv   %ebp
mov    %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.pcg_state_128 = type { i32 }
define i32 @pcg_mcg_128_xsl_rr_64_boundedrand_r(%struct.pcg_state_128* %0, i32 %1) {
%3 = alloca %struct.pcg_state_128*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store %struct.pcg_state_128* %0, %struct.pcg_state_128** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = sub nsw i32 0, %7
%9 = load i32, i32* %4
%10 = srem i32 %8, %9
store i32 %10, i32* %5
br label %11
11: ; preds = %21, %2
%12 = load %struct.pcg_state_128*, %struct.pcg_state_128** %3
%13 = call i32 @pcg_mcg_128_xsl_rr_64_random_r(%struct.pcg_state_128* %12)
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = load i32, i32* %5
%16 = icmp sge i32 %14, %15
br i1 %16, label %17, label %21
17: ; preds = %11
%18 = load i32, i32* %6
%19 = load i32, i32* %4
%20 = srem i32 %18, %19
ret i32 %20
21: ; preds = %11
br label %11
}

LLVM IR (-O2):
%struct.pcg_state_128 = type { i32 }
define i32 @pcg_mcg_128_xsl_rr_64_boundedrand_r(%struct.pcg_state_128* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @pcg_mcg_128_xsl_rr_64_random_r(%struct.pcg_state_128* %0)
%5 = icmp sgt i32 %4, -1
br i1 %5, label %6, label %3
6: ; preds = %3
%7 = srem i32 %4, %1
ret i32 %7
}
int test_imm_94int32_mem(int *val) {
  return ((*val) & (0x94 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_94int32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 148
%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_94int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 148
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
scalar_t__ find_define(char const *);
scalar_t__ find_symbol(char const *);
uint32_t is_defined(const char *name) {
  return (find_symbol(name) || find_define(name));
}


x86 assembly (clang, -O0):
<is_defined>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <find_symbol@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    115a <is_defined+0x3a>
mov    -0x8(%rbp),%rdi
call   1040 <find_define@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_defined>:
push   %rbx
mov    %rdi,%rbx
call   1030 <find_symbol@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1138 <is_defined+0x18>
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <find_define@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_defined(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @find_symbol(i8* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i64 @find_define(i8* %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_defined(i8* %0) {
%2 = tail call i64 @find_symbol(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @find_define(i8* %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
void prepare_to_copy(struct task_struct *tsk) {}


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @prepare_to_copy(%struct.task_struct* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ eeprom_write_block(int /*<<< orphan*/ *, void *, int);
int /*<<< orphan*/ memset(int /*<<< orphan*/ *, int, int);
void eeprom_driver_erase(void) {
  uint8_t buf[32];
  memset(buf, 0x00, 32);
  for (uint32_t addr = 0; addr < 8192; addr += 32) {
    eeprom_write_block(buf, (void *)(uintptr_t)addr, 32);
  }
}


x86 assembly (clang, -O0):
<eeprom_driver_erase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
lea    -0x80(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1040 <memset@plt>
movl   $0x0,-0x84(%rbp)
cmpl   $0x2000,-0x84(%rbp)
jge    117e <eeprom_driver_erase+0x5e>
lea    -0x80(%rbp),%rdi
movslq -0x84(%rbp),%rsi
mov    $0x20,%edx
call   1030 <eeprom_write_block@plt>
mov    -0x84(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x84(%rbp)
jmp    1145 <eeprom_driver_erase+0x25>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eeprom_driver_erase>:
push   %r14
push   %rbx
sub    $0x88,%rsp
mov    %rsp,%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1040 <memset@plt>
mov    $0xffffffffffffffe0,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x20,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x20,%edx
call   1030 <eeprom_write_block@plt>
cmp    $0x1fe0,%rbx
jb     1150 <eeprom_driver_erase+0x30>
add    $0x88,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @eeprom_driver_erase() {
%1 = alloca [32 x i32]
%2 = alloca i32
%3 = getelementptr inbounds [32 x i32], [32 x i32]* %1, i64 0, i64 0
%4 = call i32 @memset(i32* %3, i32 0, i32 32)
store i32 0, i32* %2
br label %5
5: ; preds = %14, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 8192
br i1 %7, label %8, label %17
8: ; preds = %5
%9 = getelementptr inbounds [32 x i32], [32 x i32]* %1, i64 0, i64 0
%10 = load i32, i32* %2
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i8*
%13 = call i32 @eeprom_write_block(i32* %9, i8* %12, i32 32)
br label %14
14: ; preds = %8
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 32
store i32 %16, i32* %2
br label %5
17: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @eeprom_driver_erase() {
%1 = alloca [32 x i32]
%2 = bitcast [32 x i32]* %1 to i8*
%3 = getelementptr inbounds [32 x i32], [32 x i32]* %1, i64 0, i64 0
%4 = call i32 @memset(i32* %3, i32 0, i32 32)
br label %6
5: ; preds = %6
ret void
6: ; preds = %0, %6
%7 = phi i64 [ 0, %0 ], [ %10, %6 ]
%8 = inttoptr i64 %7 to i8*
%9 = call i32 @eeprom_write_block(i32* %3, i8* %8, i32 32)
%10 = add nuw nsw i64 %7, 32
%11 = icmp ult i64 %7, 8160
br i1 %11, label %6, label %5
}
/* Type definitions */
struct timeval {
  double tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
double shmem_time() {
  struct timeval tv;
  gettimeofday(&tv, 0);
  return (tv.tv_sec);
}


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

x86 assembly (clang, -O2):
<shmem_time>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.timeval = type { double }
define double @shmem_time() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load double, double* %3
ret double %4
}

LLVM IR (-O2):
%struct.timeval = type { double }
define double @shmem_time() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char, char, char, char, char, char);
main() { printf("%c\n", '-', '-', '-', '-', '/', '/', '/'); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
mov    $0x2d,%r8d
mov    $0x2f,%r9d
mov    %r8d,%esi
mov    %r8d,%edx
mov    %r8d,%ecx
movl   $0x2f,(%rsp)
movl   $0x2f,0x8(%rsp)
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x2d,%esi
mov    $0x2d,%edx
mov    $0x2d,%ecx
mov    $0x2d,%r8d
mov    $0x2f,%r9d
push   $0x2f
push   $0x2f
call   1030 <printf@plt>
add    $0x10,%rsp
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext 45, i8 signext 45, i8 signext 45, i8 signext 45, i8 signext 47, i8 signext 47, i8 signext 47)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, size_t, char *, int, int, int);
void _versionGetString(char *buffer, size_t bufLen, uint32_t verNumber) {
  snprintf(buffer, bufLen, "%d.%d.%d", ((verNumber >> 16) & 0xF),
           ((verNumber >> 8) & 0xF), (verNumber & 0xF));
}


x86 assembly (clang, -O0):
<_versionGetString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%ecx
sar    $0x10,%ecx
and    $0xf,%ecx
mov    -0x14(%rbp),%r8d
sar    $0x8,%r8d
and    $0xf,%r8d
mov    -0x14(%rbp),%r9d
and    $0xf,%r9d
lea    0xeb1(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_versionGetString>:
mov    %edx,%r9d
mov    %edx,%ecx
shr    $0x10,%ecx
and    $0xf,%ecx
mov    %edx,%r8d
shr    $0x8,%r8d
and    $0xf,%r8d
and    $0xf,%r9d
lea    0xecf(%rip),%rdx
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"%d.%d.%d\00"
define void @_versionGetString(i8* %0, i64 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = load i32, i32* %6
%10 = ashr i32 %9, 16
%11 = and i32 %10, 15
%12 = load i32, i32* %6
%13 = ashr i32 %12, 8
%14 = and i32 %13, 15
%15 = load i32, i32* %6
%16 = and i32 %15, 15
%17 = call i32 @snprintf(i8* %7, i64 %8, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %14, i32 %16)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"%d.%d.%d\00"
define void @_versionGetString(i8* %0, i64 %1, i32 %2) {
%4 = lshr i32 %2, 16
%5 = and i32 %4, 15
%6 = lshr i32 %2, 8
%7 = and i32 %6, 15
%8 = and i32 %2, 15
%9 = tail call i32 @snprintf(i8* %0, i64 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %7, i32 %8)
ret void
}
int base64_decode_value(char value_in) {
  static const char decoding[] = {
      62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1,
      -1, -1, -2, -1, -1, -1, 0,  1,  2,  3,  4,  5,  6,  7,  8,  9,
      10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
      -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
      36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51};
  static const char decoding_size = sizeof(decoding);
  value_in -= 43;
  if (value_in < 0 || value_in >= decoding_size)
    return -1;
  return decoding[(int)value_in];
}


x86 assembly (clang, -O0):
<base64_decode_value>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
sub    $0x2b,%eax
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x0,%eax
jl     112e <base64_decode_value+0x2e>
movsbl -0x5(%rbp),%eax
cmp    $0x50,%eax
jl     113a <base64_decode_value+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    114f <base64_decode_value+0x4f>
movsbl -0x5(%rbp),%eax
movslq %eax,%rcx
lea    0xeb8(%rip),%rax
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64_decode_value>:
add    $0xd5,%dil
mov    $0xffffffff,%eax
cmp    $0x4f,%dil
ja     111e <base64_decode_value+0x1e>
movzbl %dil,%eax
lea    0xee6(%rip),%rcx
movsbl (%rax,%rcx,1),%eax
ret

LLVM IR (-O0):
@base64_decode_value.decoding = internal constant [80 x i8] c">\FF\FF\FF?456789:;<=\FF\FF\FF\FE\FF\FF\FF\00\01\02\03\04\05\06\07\08\09\0A\0B\0C\0D\0E\0F\10\11\12\13\14\15\16\17\18\19\FF\FF\FF\FF\FF\FF\1A\1B\1C\1D\1E\1F !\22#$%&'()*+,-./0123"
@base64_decode_value.decoding_size = internal constant i8 80
define i32 @base64_decode_value(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = sub nsw i32 %5, 43
%7 = trunc i32 %6 to i8
store i8 %7, i8* %3
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp slt i32 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %1
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp sge i32 %13, 80
br i1 %14, label %15, label %16
15: ; preds = %11, %1
store i32 -1, i32* %2
br label %23
16: ; preds = %11
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [80 x i8], [80 x i8]* @base64_decode_value.decoding, i64 0, i64 %19
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
store i32 %22, i32* %2
br label %23
23: ; preds = %16, %15
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
@base64_decode_value.decoding = internal unnamed_addr constant [80 x i8] c">\FF\FF\FF?456789:;<=\FF\FF\FF\FE\FF\FF\FF\00\01\02\03\04\05\06\07\08\09\0A\0B\0C\0D\0E\0F\10\11\12\13\14\15\16\17\18\19\FF\FF\FF\FF\FF\FF\1A\1B\1C\1D\1E\1F !\22#$%&'()*+,-./0123"
define i32 @base64_decode_value(i8 signext %0) {
%2 = add i8 %0, -43
%3 = icmp ugt i8 %2, 79
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = zext i8 %2 to i64
%6 = getelementptr inbounds [80 x i8], [80 x i8]* @base64_decode_value.decoding, i64 0, i64 %5
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
br label %9
9: ; preds = %1, %4
%10 = phi i32 [ %8, %4 ], [ -1, %1 ]
ret i32 %10
}
double *fct_1(double *a, double *b, double *c, double *d, double *e, double *f,
              double *g, double *h) {
  (void)a;
  (void)b;
  (void)c;
  (void)d;
  (void)e;
  (void)f;
  (void)g;
  (void)h;
  return b;
}


x86 assembly (clang, -O0):
<fct_1>:
push   %rbp
mov    %rsp,%rbp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fct_1>:
mov    %rsi,%rax
ret

LLVM IR (-O0):
define double* @fct_1(double* %0, double* %1, double* %2, double* %3, double* %4, double* %5, double* %6, double* %7) {
%9 = alloca double*
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
%13 = alloca double*
%14 = alloca double*
%15 = alloca double*
%16 = alloca double*
store double* %0, double** %9
store double* %1, double** %10
store double* %2, double** %11
store double* %3, double** %12
store double* %4, double** %13
store double* %5, double** %14
store double* %6, double** %15
store double* %7, double** %16
%17 = load double*, double** %9
%18 = load double*, double** %10
%19 = load double*, double** %11
%20 = load double*, double** %12
%21 = load double*, double** %13
%22 = load double*, double** %14
%23 = load double*, double** %15
%24 = load double*, double** %16
%25 = load double*, double** %10
ret double* %25
}

LLVM IR (-O2):
define double* @fct_1(double* nocapture readnone %0, double* readnone returned %1, double* nocapture readnone %2, double* nocapture readnone %3, double* nocapture readnone %4, double* nocapture readnone %5, double* nocapture readnone %6, double* nocapture readnone %7) {
ret double* %1
}
int get_src_code_from_opcode(int instruction) {
  return (instruction & 0b00000111);
}


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

x86 assembly (clang, -O2):
<get_src_code_from_opcode>:
mov    %edi,%eax
and    $0x7,%eax
ret

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

LLVM IR (-O2):
define i32 @get_src_code_from_opcode(i32 %0) {
%2 = and i32 %0, 7
ret i32 %2
}
unsigned int test_15(int x) { return ~(x >> 31) >> 31; }


x86 assembly (clang, -O0):
<test_15>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
xor    $0xffffffff,%eax
sar    $0x1f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_15>:
mov    %edi,%eax
sar    $0x1f,%eax
not    %eax
ret

LLVM IR (-O0):
define i32 @test_15(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 31
%5 = xor i32 %4, -1
%6 = ashr i32 %5, 31
ret i32 %6
}

LLVM IR (-O2):
define i32 @test_15(i32 %0) {
%2 = ashr i32 %0, 31
%3 = xor i32 %2, -1
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int seek(int fd, off_t offset, int whence) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @seek(i32 %0, i32 %1, i32 %2) {
ret i32 0
}