xunge/DecIR huggingface dataset:
int main(int arc, const char *argv[]) { return 0; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
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
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ ungetc(char, int /*<<< orphan*/ *);
void lang_skipWhitespace(FILE *lang_in) {
  char exit;
  exit = 0;
  char c;
  c = fgetc(lang_in);
  while (c == ' ' || c == '\t') {
    c = fgetc(lang_in);
  }
  ungetc(c, lang_in);
}


x86 assembly (clang, -O0):
<lang_skipWhitespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %al,-0xa(%rbp)
movsbl -0xa(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0xb(%rbp)
je     115b <lang_skipWhitespace+0x3b>
movsbl -0xa(%rbp),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%al
test   $0x1,%al
jne    116b <lang_skipWhitespace+0x4b>
jmp    117c <lang_skipWhitespace+0x5c>
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %al,-0xa(%rbp)
jmp    113c <lang_skipWhitespace+0x1c>
mov    -0xa(%rbp),%al
mov    -0x8(%rbp),%rsi
movsbl %al,%edi
call   1040 <ungetc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lang_skipWhitespace>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <fgetc@plt>
cmp    $0x9,%al
je     1130 <lang_skipWhitespace+0x10>
cmp    $0x20,%al
je     1130 <lang_skipWhitespace+0x10>
movsbl %al,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <ungetc@plt>

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

LLVM IR (-O2):
define void @lang_skipWhitespace(i32* nocapture %0) {
br label %2
2: ; preds = %4, %1
%3 = tail call signext i8 @fgetc(i32* %0)
switch i8 %3, label %5 [
i8 32, label %4
i8 9, label %4
]
4: ; preds = %2, %2
br label %2
5: ; preds = %2
%6 = tail call i32 @ungetc(i8 signext %3, i32* %0)
ret void
}
char pgm_read_byte_near(const char *s) { return s[0]; }


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

x86 assembly (clang, -O2):
<pgm_read_byte_near>:
mov    (%rdi),%al
ret

LLVM IR (-O0):
define signext i8 @pgm_read_byte_near(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
ret i8 %5
}

LLVM IR (-O2):
define signext i8 @pgm_read_byte_near(i8* nocapture %0) {
%2 = load i8, i8* %0
ret i8 %2
}
void InitFrameCap(void) {}


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

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

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

LLVM IR (-O2):
define void @InitFrameCap() {
ret void
}
/* Type definitions */
typedef int uint_fast32_t;

/* Variables and functions */
__attribute__((unused)) uint_fast32_t cop_ld_ube32(const void *buf) {
  const unsigned char *b = buf;
  return ((uint_fast32_t)b[3] << 0) | ((uint_fast32_t)b[2] << 8) |
         ((uint_fast32_t)b[1] << 16) | ((uint_fast32_t)b[0] << 24);
}


x86 assembly (clang, -O0):
<cop_ld_ube32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl 0x3(%rax),%eax
shl    $0x0,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @cop_ld_ube32(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 = getelementptr inbounds i8, i8* %5, i64 3
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = shl i32 %8, 0
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 2
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = shl i32 %13, 8
%15 = or i32 %9, %14
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 1
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = shl i32 %19, 16
%21 = or i32 %15, %20
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i64 0
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = shl i32 %25, 24
%27 = or i32 %21, %26
ret i32 %27
}

LLVM IR (-O2):
define i32 @cop_ld_ube32(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 8
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 1
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 16
%14 = or i32 %9, %13
%15 = load i8, i8* %0
%16 = zext i8 %15 to i32
%17 = shl nuw i32 %16, 24
%18 = or i32 %14, %17
ret i32 %18
}
/* Variables and functions */
int kprobe_trace_selftest_target(int a1, int a2, int a3, int a4, int a5,
                                 int a6) {
  return a1 + a2 + a3 + a4 + a5 + a6;
}


x86 assembly (clang, -O0):
<kprobe_trace_selftest_target>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kprobe_trace_selftest_target>:
lea    (%rdi,%rsi,1),%eax
add    %edx,%eax
add    %ecx,%eax
add    %r8d,%eax
add    %r9d,%eax
ret

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

LLVM IR (-O2):
define i32 @kprobe_trace_selftest_target(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = add nsw i32 %1, %0
%8 = add nsw i32 %7, %2
%9 = add nsw i32 %8, %3
%10 = add nsw i32 %9, %4
%11 = add nsw i32 %10, %5
ret i32 %11
}
char hex(int ch) {
  if ((ch &= 0x000f) < 10)
    ch += '0';
  else
    ch += 'A' - 10;
  return ((char)ch);
}


x86 assembly (clang, -O0):
<hex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
mov    %eax,-0x4(%rbp)
cmp    $0xa,%eax
jge    1127 <hex+0x27>
mov    -0x4(%rbp),%eax
add    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    1130 <hex+0x30>
mov    -0x4(%rbp),%eax
add    $0x37,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex>:
and    $0xf,%edi
lea    0x37(%rdi),%eax
lea    0x30(%rdi),%ecx
cmp    $0xa,%edi
movzbl %cl,%ecx
movzbl %al,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @hex(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 15
store i32 %4, i32* %2
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 48
store i32 %8, i32* %2
br label %12
9: ; preds = %1
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 55
store i32 %11, i32* %2
br label %12
12: ; preds = %9, %6
%13 = load i32, i32* %2
%14 = trunc i32 %13 to i8
ret i8 %14
}

LLVM IR (-O2):
define signext i8 @hex(i32 %0) {
%2 = and i32 %0, 15
%3 = icmp ult i32 %2, 10
%4 = or i32 %2, 48
%5 = add nuw nsw i32 %2, 55
%6 = select i1 %3, i32 %4, i32 %5
%7 = trunc i32 %6 to i8
ret i8 %7
}
void foo_1_1_1_2_1_1_2_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_1_2_1_1_2_2_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int create_client(int, char *);
int /*<<< orphan*/ create_client_loop(int);
int main(int argc, char **argv) {
  int cfd;
  char hostis[] = "127.0.0.1";
  int port = 11124;
  cfd = create_client(port, hostis);
  create_client_loop(cfd);
  close(cfd);
  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)
mov    0xeb3(%rip),%rax
mov    %rax,-0x1e(%rbp)
mov    0xeb0(%rip),%ax
mov    %ax,-0x16(%rbp)
movl   $0x2b74,-0x24(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x1e(%rbp),%rsi
call   1050 <create_client@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <create_client_loop@plt>
mov    -0x14(%rbp),%edi
call   1030 <close@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x2e302e302e373231,%rax
2e 30 2e
mov    %rax,(%rsp)
movw   $0x31,0x8(%rsp)
mov    %rsp,%rsi
mov    $0x2b74,%edi
call   1050 <create_client@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1040 <create_client_loop@plt>
mov    %ebx,%edi
call   1030 <close@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.hostis = [10 x i8] c"127.0.0.1\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [10 x i8]
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = bitcast [10 x i8]* %7 to i8*
store i32 11124, i32* %8
%10 = load i32, i32* %8
%11 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
%12 = call i32 @create_client(i32 %10, i8* %11)
store i32 %12, i32* %6
%13 = load i32, i32* %6
%14 = call i32 @create_client_loop(i32 %13)
%15 = load i32, i32* %6
%16 = call i32 @close(i32 %15)
ret i32 0
}

LLVM IR (-O2):
@__const.main.hostis = [10 x i8] c"127.0.0.1\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [10 x i8]
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = call i32 @create_client(i32 11124, i8* %4)
%6 = call i32 @create_client_loop(i32 %5)
%7 = call i32 @close(i32 %5)
ret i32 0
}
int fun186() { return 186; }


x86 assembly (clang, -O0):
<fun186>:
push   %rbp
mov    %rsp,%rbp
mov    $0xba,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun186>:
mov    $0xba,%eax
ret

LLVM IR (-O0):
define i32 @fun186() {
ret i32 186
}

LLVM IR (-O2):
define i32 @fun186() {
ret i32 186
}
/* Type definitions */
struct timespec {
  double tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_BOOTTIME;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
double millis_since_boot() {
  struct timespec t;
  clock_gettime(CLOCK_BOOTTIME, &t);
  return t.tv_sec * 1000.0 + t.tv_nsec * 1e-6;
}


x86 assembly (clang, -O0):
<millis_since_boot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xecc(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xeb8(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<millis_since_boot>:
sub    $0x18,%rsp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
cvtsi2sdl 0x10(%rsp),%xmm1
mulsd  0xecb(%rip),%xmm1
movsd  0x8(%rsp),%xmm0
mulsd  0xec5(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { double, i32 }
@CLOCK_BOOTTIME = global i32 0
define double @millis_since_boot() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_BOOTTIME
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = sitofp i32 %7 to double
%9 = fmul double %8, 0x3EB0C6F7A0B5ED8D
%10 = call double @llvm.fmuladd.f64(double %5, double 1.000000e+03, double %9)
ret double %10
}

LLVM IR (-O2):
%struct.timespec = type { double, i32 }
@CLOCK_BOOTTIME = global i32 0
define double @millis_since_boot() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_BOOTTIME
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load double, double* %5
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sitofp i32 %8 to double
%10 = fmul double %9, 0x3EB0C6F7A0B5ED8D
%11 = call double @llvm.fmuladd.f64(double %6, double 1.000000e+03, double %10)
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
void nine() {
  float *p;
  *p = 12.5;
  printf("The value of p is: %f\n", *p);
}


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

x86 assembly (clang, -O2):
LLVM IR (-O0):
@.str = [23 x i8] c"The value of p is: %f\0A\00"
define void @nine() {
%1 = alloca float*
%2 = load float*, float** %1
store float 1.250000e+01, float* %2
%3 = load float*, float** %1
%4 = load float, float* %3
%5 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), float %4)
ret void
}

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ logMessage(int, char *);
int enablePorts(int errorLevel, unsigned short int base,
                unsigned short int count) {
  logMessage(errorLevel, "I/O ports not supported.");
  return 0;
}


x86 assembly (clang, -O0):
<enablePorts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dx,%ax
mov    %si,%cx
mov    %edi,-0x4(%rbp)
mov    %cx,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    0xecd(%rip),%rsi
call   1030 <logMessage@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [25 x i8] c"I/O ports not supported.\00"
define i32 @enablePorts(i32 %0, i16 zeroext %1, i16 zeroext %2) {
%4 = alloca i32
%5 = alloca i16
%6 = alloca i16
store i32 %0, i32* %4
store i16 %1, i16* %5
store i16 %2, i16* %6
%7 = load i32, i32* %4
%8 = call i32 @logMessage(i32 %7, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"I/O ports not supported.\00"
define i32 @enablePorts(i32 %0, i16 zeroext %1, i16 zeroext %2) {
%4 = tail call i32 @logMessage(i32 %0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct epoll_event {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() { printf("%d\n", sizeof(struct epoll_event)); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ recreate_cfg_objects();
int /*<<< orphan*/ setup();
int main(void) {
  recreate_cfg_objects();
  setup();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @recreate_cfg_objects()
%2 = tail call i32 (...) @setup()
ret i32 0
}
int rn_refines(m_arg, n_arg) void *m_arg, *n_arg;
{ return 0; }


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

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

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

LLVM IR (-O2):
define i32 @rn_refines(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *realloc(void *, unsigned int);
int /*<<< orphan*/ stderr;
void *MemRealloc(void *old, unsigned int size) {
  void *p;
  p = realloc(old, size);
  if (!p) {
    fprintf(stderr, "***** Out of memory! *****\n");
    return NULL;
  }
  return p;
}


x86 assembly (clang, -O0):
<MemRealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <realloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    116c <MemRealloc+0x4c>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
lea    0xea6(%rip),%rsi
call   1030 <fprintf@plt>
movq   $0x0,-0x8(%rbp)
jmp    1174 <MemRealloc+0x54>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MemRealloc>:
push   %rbx
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <MemRealloc+0x23>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
lea    0xec2(%rip),%rsi
call   1030 <fprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"***** Out of memory! *****\0A\00"
define i8* @MemRealloc(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = call i8* @realloc(i8* %7, i32 %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp ne i8* %10, null
br i1 %11, label %15, label %12
12: ; preds = %2
%13 = load i32, i32* @stderr
%14 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
store i8* null, i8** %3
br label %17
15: ; preds = %2
%16 = load i8*, i8** %6
store i8* %16, i8** %3
br label %17
17: ; preds = %15, %12
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"***** Out of memory! *****\0A\00"
define i8* @MemRealloc(i8* %0, i32 %1) {
%3 = tail call i8* @realloc(i8* %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %5
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int main() {
  printf("%f\n", 57.4573);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee2(%rip),%rdi
movsd  0xed2(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double 5.745730e+01)
ret i32 0
}

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

/* Variables and functions */
uint32_t rotl_32c(short dummy, uint32_t x) { return (x << 16) | (x >> 16); }


x86 assembly (clang, -O0):
<rotl_32c>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x10,%eax
mov    -0x8(%rbp),%ecx
sar    $0x10,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotl_32c>:
mov    %esi,%eax
shl    $0x10,%eax
sar    $0x10,%esi
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @rotl_32c(i16 signext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 %5, 16
%7 = load i32, i32* %4
%8 = ashr i32 %7, 16
%9 = or i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @rotl_32c(i16 signext %0, i32 %1) {
%3 = shl i32 %1, 16
%4 = ashr i32 %1, 16
%5 = or i32 %3, %4
ret i32 %5
}
/* Variables and functions */
double doublemod(double, double);
double edisrnd(double *r) {
  double value;
  *r = doublemod(*r, 655536.0);
  *r = doublemod((*r) * 2053.0 + 13849.0, 65536.0);
  value = *r / 65536.0;
  return (value);
}


x86 assembly (clang, -O0):
<edisrnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xeec(%rip),%xmm1
call   1030 <doublemod@plt>
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xebf(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xebb(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xe9f(%rip),%xmm1
call   1030 <doublemod@plt>
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xe82(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<edisrnd>:
push   %rbx
mov    %rdi,%rbx
movsd  (%rdi),%xmm0
movsd  0xee0(%rip),%xmm1
call   1030 <doublemod@plt>
movsd  %xmm0,(%rbx)
mulsd  0xed7(%rip),%xmm0
addsd  0xed7(%rip),%xmm0
movsd  0xed7(%rip),%xmm1
call   1030 <doublemod@plt>
movsd  %xmm0,(%rbx)
mulsd  0xece(%rip),%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @edisrnd(double* %0) {
%2 = alloca double*
%3 = alloca double
store double* %0, double** %2
%4 = load double*, double** %2
%5 = load double, double* %4
%6 = call double @doublemod(double %5, double 6.555360e+05)
%7 = load double*, double** %2
store double %6, double* %7
%8 = load double*, double** %2
%9 = load double, double* %8
%10 = call double @llvm.fmuladd.f64(double %9, double 2.053000e+03, double 1.384900e+04)
%11 = call double @doublemod(double %10, double 6.553600e+04)
%12 = load double*, double** %2
store double %11, double* %12
%13 = load double*, double** %2
%14 = load double, double* %13
%15 = fdiv double %14, 6.553600e+04
store double %15, double* %3
%16 = load double, double* %3
ret double %16
}

LLVM IR (-O2):
define double @edisrnd(double* nocapture %0) {
%2 = load double, double* %0
%3 = tail call double @doublemod(double %2, double 6.555360e+05)
store double %3, double* %0
%4 = tail call double @llvm.fmuladd.f64(double %3, double 2.053000e+03, double 1.384900e+04)
%5 = tail call double @doublemod(double %4, double 6.553600e+04)
store double %5, double* %0
%6 = fmul double %5, 0x3EF0000000000000
ret double %6
}
/* Variables and functions */
double __ieee754_gamma_r(double, int *);
double gamma_r(double x, int *signgamp) {
  return __ieee754_gamma_r(x, signgamp);
}


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

x86 assembly (clang, -O2):
<gamma_r>:
jmp    1030 <__ieee754_gamma_r@plt>

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

LLVM IR (-O2):
define double @gamma_r(double %0, i32* %1) {
%3 = tail call double @__ieee754_gamma_r(double %0, i32* %1)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ ERR_get_error();
int /*<<< orphan*/ err(int, char *, int /*<<< orphan*/);
void bn_checkp(const void *p) {
  if (p == NULL)
    err(1, "allocation failure %lx", ERR_get_error());
}


x86 assembly (clang, -O0):
<bn_checkp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1151 <bn_checkp+0x31>
mov    $0x0,%al
call   1040 <ERR_get_error@plt>
mov    %eax,%edx
mov    $0x1,%edi
lea    0xeb4(%rip),%rsi
call   1030 <err@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bn_checkp>:
test   %rdi,%rdi
je     1126 <bn_checkp+0x6>
ret
push   %rax
xor    %eax,%eax
call   1040 <ERR_get_error@plt>
lea    0xecb(%rip),%rsi
mov    $0x1,%edi
mov    %eax,%edx
pop    %rax
jmp    1030 <err@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"allocation failure %lx\00"
define void @bn_checkp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = call i32 (...) @ERR_get_error()
%7 = call i32 @err(i32 1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"allocation failure %lx\00"
define void @bn_checkp(i8* readnone %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 (...) @ERR_get_error()
%5 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %6
6: ; preds = %3, %1
ret void
}
/* Variables and functions */
char *tokenParser(char *, char *, int, char *);
char *swissParser(char *header) {
  return tokenParser(header, " \t", 1, "swissParser");
}


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

x86 assembly (clang, -O2):
<swissParser>:
lea    0xee9(%rip),%rsi
lea    0xee5(%rip),%rcx
mov    $0x1,%edx
jmp    1030 <tokenParser@plt>

LLVM IR (-O0):
@.str = [3 x i8] c" \09\00"
@.str.1 = [12 x i8] c"swissParser\00"
define i8* @swissParser(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @tokenParser(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
@.str = [3 x i8] c" \09\00"
@.str.1 = [12 x i8] c"swissParser\00"
define i8* @swissParser(i8* %0) {
%2 = tail call i8* @tokenParser(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret i8* %2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int exponent;
};
union ieee754_float {
  float f;
  TYPE_1__ ieee;
};

/* Variables and functions */
float NAN;
float frexpf_fast(float x, int *e) {
  union ieee754_float u;
  u.f = x;
  int exp = u.ieee.exponent;
  if (exp == 0xff)
    return NAN;
  *e = exp - 126;
  u.ieee.exponent = 126;
  return u.f;
}


x86 assembly (clang, -O0):
<frexpf_fast>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0xff,-0x1c(%rbp)
jne    113f <frexpf_fast+0x3f>
mov    0x2ec7(%rip),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115c <frexpf_fast+0x5c>
mov    -0x1c(%rbp),%ecx
sub    $0x7e,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x7e,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<frexpf_fast>:
movd   %xmm0,%eax
cmp    $0xff,%eax
jne    1117 <frexpf_fast+0x17>
mov    0x2ee6(%rip),%rax
movss  (%rax),%xmm0
ret
add    $0xffffff82,%eax
mov    %eax,(%rdi)
movss  0xedc(%rip),%xmm0
ret

LLVM IR (-O0):
%union.ieee754_float = type { float }
%struct.TYPE_2__ = type { i32 }
@NAN = global float 0.000000e+00
define float @frexpf_fast(float %0, i32* %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca i32*
%6 = alloca %union.ieee754_float
%7 = alloca i32
store float %0, float* %4
store i32* %1, i32** %5
%8 = load float, float* %4
%9 = bitcast %union.ieee754_float* %6 to float*
store float %8, float* %9
%10 = bitcast %union.ieee754_float* %6 to %struct.TYPE_2__*
%11 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %10, i32 0, i32 0
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32, i32* %7
%14 = icmp eq i32 %13, 255
br i1 %14, label %15, label %17
15: ; preds = %2
%16 = load float, float* @NAN
store float %16, float* %3
br label %25
17: ; preds = %2
%18 = load i32, i32* %7
%19 = sub nsw i32 %18, 126
%20 = load i32*, i32** %5
store i32 %19, i32* %20
%21 = bitcast %union.ieee754_float* %6 to %struct.TYPE_2__*
%22 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %21, i32 0, i32 0
store i32 126, i32* %22
%23 = bitcast %union.ieee754_float* %6 to float*
%24 = load float, float* %23
store float %24, float* %3
br label %25
25: ; preds = %17, %15
%26 = load float, float* %3
ret float %26
}

LLVM IR (-O2):
@NAN = global float 0.000000e+00
define float @frexpf_fast(float %0, i32* nocapture writeonly %1) {
%3 = bitcast float %0 to i32
%4 = icmp eq i32 %3, 255
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = load float, float* @NAN
br label %9
7: ; preds = %2
%8 = add nsw i32 %3, -126
store i32 %8, i32* %1
br label %9
9: ; preds = %7, %5
%10 = phi float [ %6, %5 ], [ 0x370F800000000000, %7 ]
ret float %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void curl_easy_cleanup(void *curl) { printf("Fake cleanup\n"); }


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"Fake cleanup\00"
define void @curl_easy_cleanup(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ CallBack1(int, void *);
int /*<<< orphan*/ CheckRunningInMainThread(char *);
int XOPSilentCommand(const char *cmdPtr) {
  if (!CheckRunningInMainThread("XOPSilentCommand"))
    return 978;
  return (int)CallBack1(70, (void *)cmdPtr);
}


x86 assembly (clang, -O0):
<XOPSilentCommand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xecd(%rip),%rdi
call   1040 <CheckRunningInMainThread@plt>
cmp    $0x0,%eax
jne    114d <XOPSilentCommand+0x2d>
movl   $0x3d2,-0x4(%rbp)
jmp    115e <XOPSilentCommand+0x3e>
mov    -0x10(%rbp),%rsi
mov    $0x46,%edi
call   1030 <CallBack1@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XOPSilentCommand>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1040 <CheckRunningInMainThread@plt>
test   %eax,%eax
je     1143 <XOPSilentCommand+0x23>
mov    $0x46,%edi
mov    %rbx,%rsi
call   1030 <CallBack1@plt>
pop    %rbx
ret
mov    $0x3d2,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"XOPSilentCommand\00"
define i32 @XOPSilentCommand(i8* %0) {
%2 = tail call i32 @CheckRunningInMainThread(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i64 @CallBack1(i32 70, i8* %0)
%6 = trunc i64 %5 to i32
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %6, %4 ], [ 978, %1 ]
ret i32 %8
}
void init_matrix_repr_short(char *repr, unsigned length) {
  repr[length - 1] = '\0';
}


x86 assembly (clang, -O0):
<init_matrix_repr_short>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
mov    %ecx,%ecx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_matrix_repr_short>:
add    $0xffffffff,%esi
movb   $0x0,(%rdi,%rsi,1)
ret

LLVM IR (-O0):
define void @init_matrix_repr_short(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = sub i32 %6, 1
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
store i8 0, i8* %9
ret void
}

LLVM IR (-O2):
define void @init_matrix_repr_short(i8* nocapture writeonly %0, i32 %1) {
%3 = add i32 %1, -1
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 0, i8* %5
ret void
}
/* Type definitions */
struct feed_buf {
  int dummy;
};

/* Variables and functions */
char feed_esc_write_n1(struct feed_buf *const, unsigned int const, char);
char feed_esc_write_cuu(struct feed_buf *const p_buf,
                        unsigned int const i_count) {
  return feed_esc_write_n1(p_buf, i_count, 'A');
}


x86 assembly (clang, -O0):
<feed_esc_write_cuu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x41,%edx
call   1030 <feed_esc_write_n1@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<feed_esc_write_cuu>:
mov    $0x41,%edx
jmp    1030 <feed_esc_write_n1@plt>

LLVM IR (-O0):
%struct.feed_buf = type { i32 }
define signext i8 @feed_esc_write_cuu(%struct.feed_buf* %0, i32 %1) {
%3 = alloca %struct.feed_buf*
%4 = alloca i32
store %struct.feed_buf* %0, %struct.feed_buf** %3
store i32 %1, i32* %4
%5 = load %struct.feed_buf*, %struct.feed_buf** %3
%6 = load i32, i32* %4
%7 = call signext i8 @feed_esc_write_n1(%struct.feed_buf* %5, i32 %6, i8 signext 65)
ret i8 %7
}

LLVM IR (-O2):
%struct.feed_buf = type { i32 }
define signext i8 @feed_esc_write_cuu(%struct.feed_buf* %0, i32 %1) {
%3 = tail call signext i8 @feed_esc_write_n1(%struct.feed_buf* %0, i32 %1, i8 signext 65)
ret i8 %3
}
void sd_zbc_release_disk(struct scsi_disk *sdkp) {}


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

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

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

LLVM IR (-O2):
%struct.scsi_disk = type opaque
define void @sd_zbc_release_disk(%struct.scsi_disk* nocapture %0) {
ret void
}
int OSC_WritePadding(char *dest, int i) {
  dest[i] = '\0';
  i++;
  for (; (i % 4) != 0; i++) {
    dest[i] = '\0';
  }
  return i;
}


x86 assembly (clang, -O0):
<OSC_WritePadding>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     114e <OSC_WritePadding+0x4e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1120 <OSC_WritePadding+0x20>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<OSC_WritePadding>:
push   %rbx
movslq %esi,%rax
movb   $0x0,(%rdi,%rax,1)
add    $0x1,%eax
test   $0x3,%al
je     115a <OSC_WritePadding+0x4a>
movslq %eax,%rbx
add    %rbx,%rdi
mov    $0x2,%edx
sub    %esi,%edx
and    $0x3,%edx
add    $0x1,%edx
xor    %esi,%esi
call   1030 <memset@plt>
lea    0x1(%rbx),%rax
test   $0x3,%al
je     115a <OSC_WritePadding+0x4a>
lea    0x2(%rbx),%rax
test   $0x3,%al
je     115a <OSC_WritePadding+0x4a>
lea    0x3(%rbx),%rax
add    $0x4,%rbx
test   $0x3,%al
cmove  %rax,%rbx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @OSC_WritePadding(i8* nocapture writeonly %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
store i8 0, i8* %4
%5 = add i32 %1, 1
%6 = and i32 %5, 3
%7 = icmp eq i32 %6, 0
br i1 %7, label %31, label %8
8: ; preds = %2
%9 = sext i32 %5 to i64
%10 = getelementptr i8, i8* %0, i64 %9
%11 = sub i32 2, %1
%12 = and i32 %11, 3
%13 = add nuw nsw i32 %12, 1
%14 = zext i32 %13 to i64
%15 = add nsw i64 %9, 1
%16 = and i64 %15, 3
%17 = icmp eq i64 %16, 0
br i1 %17, label %28, label %18
18: ; preds = %8
%19 = add nsw i64 %9, 2
%20 = and i64 %19, 3
%21 = icmp eq i64 %20, 0
br i1 %21, label %28, label %22
22: ; preds = %18
%23 = add nsw i64 %9, 3
%24 = and i64 %23, 3
%25 = icmp eq i64 %24, 0
%26 = add nsw i64 %9, 4
%27 = select i1 %25, i64 %23, i64 %26
br label %28
28: ; preds = %22, %18, %8
%29 = phi i64 [ %15, %8 ], [ %19, %18 ], [ %27, %22 ]
%30 = trunc i64 %29 to i32
br label %31
31: ; preds = %28, %2
%32 = phi i32 [ %5, %2 ], [ %30, %28 ]
ret i32 %32
}
int get16bit(unsigned char *p) { return (p[0] << 8) | p[1]; }


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

x86 assembly (clang, -O2):
<get16bit>:
movzwl (%rdi),%eax
shl    $0x10,%eax
bswap  %eax
ret

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

LLVM IR (-O2):
define i32 @get16bit(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = or i32 %4, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("\thello, world\n"); }


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"\09hello, world\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct svc_req {
  int dummy;
};

/* Variables and functions */
int l2tp_user_list_1_svc(void *, struct svc_req *);
int _l2tp_user_list_1(void *argp, void *result, struct svc_req *rqstp) {
  return (l2tp_user_list_1_svc(result, rqstp));
}


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

x86 assembly (clang, -O2):
<_l2tp_user_list_1>:
mov    %rsi,%rdi
mov    %rdx,%rsi
jmp    1030 <l2tp_user_list_1_svc@plt>

LLVM IR (-O0):
%struct.svc_req = type { i32 }
define i32 @_l2tp_user_list_1(i8* %0, i8* %1, %struct.svc_req* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca %struct.svc_req*
store i8* %0, i8** %4
store i8* %1, i8** %5
store %struct.svc_req* %2, %struct.svc_req** %6
%7 = load i8*, i8** %5
%8 = load %struct.svc_req*, %struct.svc_req** %6
%9 = call i32 @l2tp_user_list_1_svc(i8* %7, %struct.svc_req* %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.svc_req = type { i32 }
define i32 @_l2tp_user_list_1(i8* nocapture readnone %0, i8* %1, %struct.svc_req* %2) {
%4 = tail call i32 @l2tp_user_list_1_svc(i8* %1, %struct.svc_req* %2)
ret i32 %4
}
unsigned long get_dword(unsigned char *p) {
  unsigned long t;
  t = p[3];
  t = ((t << 8) | p[2]);
  t = ((t << 8) | p[1]);
  t = ((t << 8) | p[0]);
  return t;
}


x86 assembly (clang, -O0):
<get_dword>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x8,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
or     %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x8,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
or     %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x8,%rax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
or     %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_dword>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i64 @get_dword(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = zext i8 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = load i8, i8* %5
%7 = zext i8 %6 to i64
%8 = shl nuw nsw i64 %4, 16
%9 = shl nuw nsw i64 %7, 8
%10 = or i64 %9, %8
%11 = getelementptr inbounds i8, i8* %0, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i64
%14 = or i64 %10, %13
%15 = shl nuw nsw i64 %14, 8
%16 = load i8, i8* %0
%17 = zext i8 %16 to i64
%18 = or i64 %15, %17
ret i64 %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void shmem_int_max_to_all(int *target, int *source, int nreduce,
                                 int PE_start, int logPE_stride, int PE_size,
                                 int *pWrk, long *pSync) {
  printf("\nOpenSHMEM Analyzer\n");
}


x86 assembly (clang, -O0):
<shmem_int_max_to_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"\0AOpenSHMEM Analyzer\0A\00"
define void @shmem_int_max_to_all(i32* %0, i32* %1, i32 %2, i32 %3, i32 %4, i32 %5, i32* %6, i64* %7) {
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32*
%16 = alloca i64*
store i32* %0, i32** %9
store i32* %1, i32** %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store i32* %6, i32** %15
store i64* %7, i64** %16
%17 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define void @shmem_int_max_to_all(i32* nocapture readnone %0, i32* nocapture readnone %1, i32 %2, i32 %3, i32 %4, i32 %5, i32* nocapture readnone %6, i64* nocapture readnone %7) {
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
int test_imm_6Bint32_mem(int *val) {
  return ((*val) & (0x6B << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_6Bint32_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, 107
%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_6Bint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 107
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}