xunge/DecIR huggingface dataset:
void split_ip(unsigned int addr, unsigned char *ip) {
  ip[3] = (addr & 0x000000ff);
  ip[2] = (addr & 0x0000ff00) >> 8;
  ip[1] = (addr & 0x00ff0000) >> 16;
  ip[0] = (addr & 0xff000000) >> 24;
}


x86 assembly (clang, -O0):
<split_ip>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x4(%rbp),%eax
and    $0xff00,%eax
shr    $0x8,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x4(%rbp),%eax
and    $0xff0000,%eax
shr    $0x10,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x4(%rbp),%eax
and    $0xff000000,%eax
shr    $0x18,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @split_ip(i32 %0, i8* nocapture writeonly %1) {
%3 = trunc i32 %0 to i8
%4 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %3, i8* %4
%5 = lshr i32 %0, 8
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %6, i8* %7
%8 = lshr i32 %0, 16
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %9, i8* %10
%11 = lshr i32 %0, 24
%12 = trunc i32 %11 to i8
store i8 %12, i8* %1
ret void
}
void add(x) float x;
{
  static float y = 0.0;
  extern float z;
  y += 2;
  z = x + y;
}


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  0xeeb(%rip),%xmm0
addss  0x2f07(%rip),%xmm0
movss  %xmm0,0x2eff(%rip)
movss  -0x4(%rbp),%xmm0
addss  0x2ef2(%rip),%xmm0
mov    0x2ea7(%rip),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
cvtsd2ss %xmm0,%xmm0
movss  0x2f18(%rip),%xmm1
addss  0xeec(%rip),%xmm1
movss  %xmm1,0x2f08(%rip)
addss  %xmm0,%xmm1
mov    0x2eb9(%rip),%rax
movss  %xmm1,(%rax)
ret

LLVM IR (-O0):
@add.y = internal global float 0.000000e+00
@z = external global float
define void @add(double %0) {
%2 = alloca float
%3 = fptrunc double %0 to float
store float %3, float* %2
%4 = load float, float* @add.y
%5 = fadd float %4, 2.000000e+00
store float %5, float* @add.y
%6 = load float, float* %2
%7 = load float, float* @add.y
%8 = fadd float %6, %7
store float %8, float* @z
ret void
}

LLVM IR (-O2):
@add.y = internal unnamed_addr global float 0.000000e+00
@z = external global float
define void @add(double %0) {
%2 = fptrunc double %0 to float
%3 = load float, float* @add.y
%4 = fadd float %3, 2.000000e+00
store float %4, float* @add.y
%5 = fadd float %4, %2
store float %5, float* @z
ret void
}
/* Variables and functions */
int decode(int, char **);
int main(int argc, char *argv[]) { return decode(argc, argv); }


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <decode@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @decode(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ pwm_deinit();
void PWM_stop(int pin) { pwm_deinit(); }


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

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

LLVM IR (-O0):
define void @PWM_stop(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @pwm_deinit()
ret void
}

LLVM IR (-O2):
define void @PWM_stop(i32 %0) {
%2 = tail call i32 (...) @pwm_deinit()
ret void
}
/* Type definitions */
struct winsize {
  scalar_t__ ws_col;
};

/* Variables and functions */
int /*<<< orphan*/ STDERR_FILENO;
int /*<<< orphan*/ TIOCGWINSZ;
int ioctl(int /*<<< orphan*/, int /*<<< orphan*/, struct winsize *);
int get_terminal_width(void) {
  struct winsize ws;
  if (ioctl(STDERR_FILENO, TIOCGWINSZ, &ws) == -1 || ws.ws_col == 0) {
    return 75;
  } else {
    return (ws.ws_col - 1);
  }
}


x86 assembly (clang, -O0):
<get_terminal_width>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
lea    -0x10(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0xffffffff,%eax
je     1147 <get_terminal_width+0x37>
cmpq   $0x0,-0x10(%rbp)
jne    1153 <get_terminal_width+0x43>
movl   $0x4b,-0x4(%rbp)
jmp    115e <get_terminal_width+0x4e>
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_terminal_width>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
call   1030 <ioctl@plt>
mov    (%rsp),%rdx
lea    -0x1(%rdx),%ecx
test   %rdx,%rdx
mov    $0x4b,%edx
cmove  %edx,%ecx
cmp    $0xffffffff,%eax
cmove  %edx,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.winsize = type { i64 }
@STDERR_FILENO = global i32 0
@TIOCGWINSZ = global i32 0
define i32 @get_terminal_width() {
%1 = alloca i32
%2 = alloca %struct.winsize
%3 = load i32, i32* @STDERR_FILENO
%4 = load i32, i32* @TIOCGWINSZ
%5 = call i32 @ioctl(i32 %3, i32 %4, %struct.winsize* %2)
%6 = icmp eq i32 %5, -1
br i1 %6, label %11, label %7
7: ; preds = %0
%8 = getelementptr inbounds %struct.winsize, %struct.winsize* %2, i32 0, i32 0
%9 = load i64, i64* %8
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %7, %0
store i32 75, i32* %1
br label %17
12: ; preds = %7
%13 = getelementptr inbounds %struct.winsize, %struct.winsize* %2, i32 0, i32 0
%14 = load i64, i64* %13
%15 = sub nsw i64 %14, 1
%16 = trunc i64 %15 to i32
store i32 %16, i32* %1
br label %17
17: ; preds = %12, %11
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
%struct.winsize = type { i64 }
@STDERR_FILENO = global i32 0
@TIOCGWINSZ = global i32 0
define i32 @get_terminal_width() {
%1 = alloca %struct.winsize
%2 = bitcast %struct.winsize* %1 to i8*
%3 = load i32, i32* @STDERR_FILENO
%4 = load i32, i32* @TIOCGWINSZ
%5 = call i32 @ioctl(i32 %3, i32 %4, %struct.winsize* %1)
%6 = icmp eq i32 %5, -1
%7 = getelementptr inbounds %struct.winsize, %struct.winsize* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = icmp eq i64 %8, 0
%10 = select i1 %6, i1 true, i1 %9
%11 = trunc i64 %8 to i32
%12 = add i32 %11, -1
%13 = select i1 %10, i32 75, i32 %12
ret i32 %13
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void prim_memset_zero(void *target, uint32_t size) {
  uint8_t *byte_ptr = target;
  for (int counter = 0; counter < size; ++counter) {
    byte_ptr[counter] = 0x0;
  }
}


x86 assembly (clang, -O0):
<prim_memset_zero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1143 <prim_memset_zero+0x43>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111a <prim_memset_zero+0x1a>
pop    %rbp
ret

x86 assembly (clang, -O2):
<prim_memset_zero>:
test   %esi,%esi
jle    1126 <prim_memset_zero+0x16>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @prim_memset_zero(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = zext i32 %1 to i64
%6 = shl nuw nsw i64 %5, 2
br label %7
7: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rand();
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
int main(void) {
  srand((unsigned)time(NULL));
  printf("%d \n", rand());
  printf("%d \n", rand());
  printf("%d \n", rand());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x0,%al
call   1060 <rand@plt>
mov    %eax,%esi
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1060 <rand@plt>
mov    %eax,%esi
lea    0xe7c(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1060 <rand@plt>
mov    %eax,%esi
lea    0xe67(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
xor    %eax,%eax
call   1060 <rand@plt>
lea    0xea3(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1060 <rand@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1060 <rand@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d \0A\00"
define i32 @main() {
%1 = tail call i64 @time(i32* null)
%2 = trunc i64 %1 to i32
%3 = tail call i32 @srand(i32 %2)
%4 = tail call i32 (...) @rand()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = tail call i32 (...) @rand()
%7 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = tail call i32 (...) @rand()
%9 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ outb(char, int);
void commandRegister1(char var) { outb(var, 0x0260); }


x86 assembly (clang, -O0):
<commandRegister1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x260,%esi
movsbl -0x1(%rbp),%edi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<commandRegister1>:
mov    $0x260,%esi
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @commandRegister1(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @outb(i8 signext %3, i32 608)
ret void
}

LLVM IR (-O2):
define void @commandRegister1(i8 signext %0) {
%2 = tail call i32 @outb(i8 signext %0, i32 608)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printIntArray(int *array, size_t num) {
  for (size_t i = 0; i < num; i++)
    printf("%d ", array[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<printIntArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1160 <printIntArray+0x50>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <printIntArray+0x18>
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printIntArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1157 <printIntArray+0x37>
mov    %rsi,%r12
mov    %rdi,%r14
lea    0xec6(%rip),%r15
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r14,%rbx,4),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printIntArray+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printIntArray(i32* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %6, %2
%5 = tail call i32 @putchar(i32 10)
ret void
6: ; preds = %2, %6
%7 = phi i64 [ %11, %6 ], [ 0, %2 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw i64 %7, 1
%12 = icmp eq i64 %11, %1
br i1 %12, label %4, label %6
}
int fn7(int i) {
  static const char g[10] = "abcdefghij";
  return g[i];
}


x86 assembly (clang, -O0):
<fn7>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rcx
lea    0xeee(%rip),%rax
movsbl (%rax,%rcx,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn7>:
movslq %edi,%rax
lea    0xef6(%rip),%rcx
movsbl (%rax,%rcx,1),%eax
ret

LLVM IR (-O0):
@fn7.g = internal constant [10 x i8] c"abcdefghij"
define i32 @fn7(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [10 x i8], [10 x i8]* @fn7.g, i64 0, i64 %4
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@fn7.g = internal unnamed_addr constant [10 x i8] c"abcdefghij"
define i32 @fn7(i32 %0) {
%2 = sext i32 %0 to i64
%3 = getelementptr inbounds [10 x i8], [10 x i8]* @fn7.g, i64 0, i64 %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
ret i32 %5
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ window_group;
};
typedef TYPE_1__ XWMHints;

/* Variables and functions */
unsigned long get_XWMHints_window_group(void *_p) {
  return (unsigned long)((XWMHints *)_p)->window_group;
}


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

x86 assembly (clang, -O2):
<get_XWMHints_window_group>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XWMHints_window_group(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XWMHints_window_group(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
float fabs(float const);
float fDistance(const float value1, const float value2) {
  return fabs(value1 - value2);
}


x86 assembly (clang, -O0):
<fDistance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
call   1030 <fabs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fDistance>:
subss  %xmm1,%xmm0
andps  0xef5(%rip),%xmm0
ret

LLVM IR (-O0):
define float @fDistance(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fsub float %5, %6
%8 = call float @fabs(float %7)
ret float %8
}

LLVM IR (-O2):
define float @fDistance(float %0, float %1) {
%3 = fsub float %0, %1
%4 = tail call float @llvm.fabs.f32(float %3)
ret float %4
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ *display;
};
typedef TYPE_1__ XButtonPressedEvent;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
void set_XButtonPressedEvent_display(void *_p, void *_v) {
  ((XButtonPressedEvent *)_p)->display = (Display *)_v;
}


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

x86 assembly (clang, -O2):
<set_XButtonPressedEvent_display>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32* }
define void @set_XButtonPressedEvent_display(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to i32*
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to %struct.TYPE_2__*
%9 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %8, i32 0, i32 0
store i32* %6, i32** %9
ret void
}

LLVM IR (-O2):
define void @set_XButtonPressedEvent_display(i8* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
store i8* %1, i8** %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MagStateHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void MagStateUpdated() { UAVObjUpdated(MagStateHandle()); }


x86 assembly (clang, -O0):
<MagStateUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <MagStateHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<MagStateUpdated>:
push   %rax
xor    %eax,%eax
call   1030 <MagStateHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @MagStateUpdated() {
%1 = call i32 (...) @MagStateHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @MagStateUpdated() {
%1 = tail call i32 (...) @MagStateHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
void RTStrCacheRetain(void) {}


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

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

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

LLVM IR (-O2):
define void @RTStrCacheRetain() {
ret void
}
int main() {
  int (*p2)(int *, int (*f)(int *));
  int (*p3[5])(int *);
  int (*(*p4)[5])(int *);
  int(*(*p5)(int *))[5];
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32 (i32*, i32 (i32*)*)*
%2 = alloca [5 x i32 (i32*)*]
%3 = alloca [5 x i32 (i32*)*]*
%4 = alloca [5 x i32]* (i32*)*
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
unsigned int __get_cpsr();
int /*<<< orphan*/ __set_cpsr(unsigned int);
unsigned FIQ_enable(void) {
  unsigned _cpsr_val;
  _cpsr_val = __get_cpsr();
  __set_cpsr(_cpsr_val & ~0x00000040);
  return _cpsr_val;
}


x86 assembly (clang, -O0):
<FIQ_enable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <__get_cpsr@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
and    $0xffffffbf,%edi
call   1030 <__set_cpsr@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FIQ_enable>:
push   %rbx
xor    %eax,%eax
call   1040 <__get_cpsr@plt>
mov    %eax,%ebx
mov    %eax,%edi
and    $0xffffffbf,%edi
call   1030 <__set_cpsr@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @FIQ_enable() {
%1 = alloca i32
%2 = call i32 (...) @__get_cpsr()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = and i32 %3, -65
%5 = call i32 @__set_cpsr(i32 %4)
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
define i32 @FIQ_enable() {
%1 = tail call i32 (...) @__get_cpsr()
%2 = and i32 %1, -65
%3 = tail call i32 @__set_cpsr(i32 %2)
ret i32 %1
}
int mbo_load_local(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @mbo_load_local() {
ret i32 0
}
int main() {
  float a[10];
  float b[20][30];
  float c[40];
  float d[50][5];
  float e[100];
  int n;
  scanf("%i", &n);
  scanf("%s", a[0]);
  a[9] = a[0];
  printf("%s\n", b[9][9]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xfc0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec7(%rip),%rdi
lea    -0xfb4(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movss  -0x30(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeac(%rip),%rdi
mov    $0x1,%al
call   1040 <scanf@plt>
movss  -0x30(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x534(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
lea    0xe8b(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xfc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xec8(%rip),%rdi
mov    $0x1,%al
call   1040 <scanf@plt>
lea    0xebd(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%i\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x float]
%3 = alloca [20 x [30 x float]]
%4 = alloca [40 x float]
%5 = alloca [50 x [5 x float]]
%6 = alloca [100 x float]
%7 = alloca i32
store i32 0, i32* %1
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %7)
%9 = getelementptr inbounds [10 x float], [10 x float]* %2, i64 0, i64 0
%10 = load float, float* %9
%11 = fpext float %10 to double
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double %11)
%13 = getelementptr inbounds [10 x float], [10 x float]* %2, i64 0, i64 0
%14 = load float, float* %13
%15 = getelementptr inbounds [10 x float], [10 x float]* %2, i64 0, i64 9
store float %14, float* %15
%16 = getelementptr inbounds [20 x [30 x float]], [20 x [30 x float]]* %3, i64 0, i64 9
%17 = getelementptr inbounds [30 x float], [30 x float]* %16, i64 0, i64 9
%18 = load float, float* %17
%19 = fpext float %18 to double
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %19)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double undef)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double undef)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ triexit(int);
void internalerror() {
  printf("  Please report this bug to jrs@cs.berkeley.edu\n");
  printf("  Include the message above, your input data set, and the exact\n");
  printf("    command line you used to run Triangle.\n");
  triexit(1);
}


x86 assembly (clang, -O0):
<internalerror>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
lea    0xefa(%rip),%rdi
call   1040 <printf@plt>
lea    0xf2f(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1030 <triexit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<internalerror>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xefc(%rip),%rdi
call   1030 <puts@plt>
lea    0xf30(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <triexit@plt>

LLVM IR (-O0):
@.str = [49 x i8] c" Please report this bug to jrs@cs.berkeley.edu\0A\00"
@.str.1 = [65 x i8] c" Include the message above, your input data set, and the exact\0A\00"
@.str.2 = [44 x i8] c" command line you used to run Triangle.\0A\00"
define void @internalerror() {
%1 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @triexit(i32 1)
ret void
}

LLVM IR (-O2):
@str = [48 x i8] c" Please report this bug to jrs@cs.berkeley.edu\00"
@str.3 = [64 x i8] c" Include the message above, your input data set, and the exact\00"
@str.4 = [43 x i8] c" command line you used to run Triangle.\00"
define void @internalerror() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.4, i64 0, i64 0))
%4 = tail call i32 @triexit(i32 1)
ret void
}
int f2(int p1) { return p1; }


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

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

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

LLVM IR (-O2):
define i32 @f2(i32 returned %0) {
ret i32 %0
}
void wait_for_light(int light_port_) {}


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

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

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

LLVM IR (-O2):
define void @wait_for_light(i32 %0) {
ret void
}
/* Type definitions */
struct timeval {
  int /*<<< orphan*/ tv_usec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int __test(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int rt_test_switch_end(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return __test(102, tv.tv_sec, tv.tv_usec);
}


x86 assembly (clang, -O0):
<rt_test_switch_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    $0x66,%edi
call   1040 <__test@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rt_test_switch_end>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    (%rsp),%edx
mov    0x4(%rsp),%esi
mov    $0x66,%edi
pop    %rax
jmp    1040 <__test@plt>

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @rt_test_switch_end() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%6 = load i32, i32* %5
%7 = call i32 @__test(i32 102, i32 %4, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @rt_test_switch_end() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i32, i32* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%7 = load i32, i32* %6
%8 = tail call i32 @__test(i32 102, i32 %5, i32 %7)
ret i32 %8
}
float __glsl_clamp(float x, float minVal, float maxVal) {
  return x < minVal ? minVal : x > maxVal ? maxVal : x;
}


x86 assembly (clang, -O0):
<__glsl_clamp>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1135 <__glsl_clamp+0x35>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    1167 <__glsl_clamp+0x67>
movss  -0x4(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1153 <__glsl_clamp+0x53>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    115d <__glsl_clamp+0x5d>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<__glsl_clamp>:
minss  %xmm0,%xmm2
cmpltss %xmm1,%xmm0
movaps %xmm0,%xmm3
andnps %xmm2,%xmm3
andps  %xmm1,%xmm0
orps   %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @__glsl_clamp(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = fcmp olt float %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load float, float* %5
br label %22
12: ; preds = %3
%13 = load float, float* %4
%14 = load float, float* %6
%15 = fcmp ogt float %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load float, float* %6
br label %20
18: ; preds = %12
%19 = load float, float* %4
br label %20
20: ; preds = %18, %16
%21 = phi float [ %17, %16 ], [ %19, %18 ]
br label %22
22: ; preds = %20, %10
%23 = phi float [ %11, %10 ], [ %21, %20 ]
ret float %23
}

LLVM IR (-O2):
define float @__glsl_clamp(float %0, float %1, float %2) {
%4 = fcmp olt float %0, %1
%5 = fcmp ogt float %0, %2
%6 = select i1 %5, float %2, float %0
%7 = select i1 %4, float %1, float %6
ret float %7
}
/* Variables and functions */
int __get_array_size(char const *);
int __infer_nondet_int();
int access(const char *path, int mode) {
  int size;
  int success;
  size = __get_array_size(path);
  success = __infer_nondet_int();
  return (success > 0) ? 0 : -1;
}


x86 assembly (clang, -O0):
<access>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <__get_array_size@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_int@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edx
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmovg  %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<access>:
push   %rax
call   1040 <__get_array_size@plt>
xor    %eax,%eax
call   1030 <__infer_nondet_int@plt>
xor    %ecx,%ecx
test   %eax,%eax
setle  %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @access(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %3
%8 = call i32 @__get_array_size(i8* %7)
store i32 %8, i32* %5
%9 = call i32 (...) @__infer_nondet_int()
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp sgt i32 %10, 0
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 0, i32 -1
ret i32 %13
}

LLVM IR (-O2):
define i32 @access(i8* %0, i32 %1) {
%3 = tail call i32 @__get_array_size(i8* %0)
%4 = tail call i32 (...) @__infer_nondet_int()
%5 = icmp slt i32 %4, 1
%6 = sext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void shmem_get32(void *dest, const void *src, size_t len, int pe) {
  printf("\nOpenSHMEM Analyzer\n");
}


x86 assembly (clang, -O0):
<shmem_get32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"\0AOpenSHMEM Analyzer\0A\00"
define void @shmem_get32(i8* %0, i8* %1, i64 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%9 = 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_get32(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2, i32 %3) {
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int dojpa();
int main(void) {
  int i;
  i = dojpa();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @dojpa()
ret i32 0
}
int compare_int(void *a, void *b) {
  if (*(int *)a > *(int *)b)
    return 1;
  else if (*(int *)a == *(int *)b)
    return 0;
  else
    return -1;
}


x86 assembly (clang, -O0):
<compare_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jle    112a <compare_int+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    114f <compare_int+0x4f>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jne    1148 <compare_int+0x48>
movl   $0x0,-0x4(%rbp)
jmp    114f <compare_int+0x4f>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_int>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
xor    %edx,%edx
cmp    %ecx,%eax
setne  %dl
neg    %edx
cmp    %ecx,%eax
mov    $0x1,%eax
cmovle %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @compare_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp sgt i32 %4, %6
%8 = icmp ne i32 %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
int openturns_library_ok() { return 1; }


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

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

LLVM IR (-O0):
define i32 @openturns_library_ok() {
ret i32 1
}

LLVM IR (-O2):
define i32 @openturns_library_ok() {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ terminal_error(char *);
void terminal_fileopen_error(FILE *fp, char *name) {
  if (fclose(fp) == -1)
    terminal_error("fclose");
  terminal_error(name);
}


x86 assembly (clang, -O0):
<terminal_fileopen_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
cmp    $0xffffffff,%eax
jne    114e <terminal_fileopen_error+0x2e>
lea    0xeb7(%rip),%rdi
call   1040 <terminal_error@plt>
mov    -0x10(%rbp),%rdi
call   1040 <terminal_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<terminal_fileopen_error>:
push   %rbx
mov    %rsi,%rbx
call   1030 <fclose@plt>
cmp    $0xffffffff,%eax
jne    113a <terminal_fileopen_error+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <terminal_error@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <terminal_error@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"fclose\00"
define void @terminal_fileopen_error(i32* nocapture %0, i8* %1) {
%3 = tail call i32 @fclose(i32* %0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @terminal_error(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
%8 = tail call i32 @terminal_error(i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ minprintf(char *, int, double, char *);
int main() {
  minprintf("int: %d, double: %f, string: %s\n", 1, 0.123, "Hello");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
lea    0xf0a(%rip),%rdx
movsd  0xed9(%rip),%xmm0
mov    $0x1,%esi
call   1030 <minprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"int: %d, double: %f, string: %s\0A\00"
@.str.1 = [6 x i8] c"Hello\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @minprintf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 1, double 1.230000e-01, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"int: %d, double: %f, string: %s\0A\00"
@.str.1 = [6 x i8] c"Hello\00"
define i32 @main() {
%1 = tail call i32 @minprintf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 1, double 1.230000e-01, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_mutex_lock(int /*<<< orphan*/ *);
void EndRegion(pthread_mutex_t mutex) { pthread_mutex_lock(&mutex); }


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

x86 assembly (clang, -O2):
<EndRegion>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <pthread_mutex_lock@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @EndRegion(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @pthread_mutex_lock(i32* %2)
ret void
}
void RC4_set_key(void) {}


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

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

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

LLVM IR (-O2):
define void @RC4_set_key() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(void) { puts("main"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <puts@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 = [5 x i8] c"main\00"
define i32 @main() {
%1 = call i32 @puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"main\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void RTTimeProgramStartNanoTS(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTimeProgramStartNanoTS() {
ret void
}
/* Variables and functions */
char *strcpy(char *, char const *);
size_t strlen(char *);
char *strcat(char *dest, const char *src) {
  const size_t startingPoint = strlen(dest);
  return strcpy(&dest[startingPoint], src);
}


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

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

LLVM IR (-O0):
define i8* @strcat(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
store i64 %7, i64* %5
%8 = load i8*, i8** %3
%9 = load i64, i64* %5
%10 = getelementptr inbounds i8, i8* %8, i64 %9
%11 = load i8*, i8** %4
%12 = call i8* @strcpy(i8* %10, i8* %11)
ret i8* %12
}

LLVM IR (-O2):
define i8* @strcat(i8* %0, i8* nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = tail call i8* @strcpy(i8* dereferenceable(1) %4, i8* dereferenceable(1) %1)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
void divert(int flag, FILE *fp) {
  fprintf(fp, "divert(%d)dnl\n", flag ? -1 : 0);
}


x86 assembly (clang, -O0):
<divert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%ecx
xor    %edx,%edx
mov    $0xffffffff,%eax
cmp    $0x0,%ecx
cmovne %eax,%edx
lea    0xec6(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<divert>:
mov    %rsi,%rax
neg    %edi
sbb    %edx,%edx
lea    0xee2(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"divert(%d)dnl\0A\00"
define void @divert(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -1, i32 0
%10 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"divert(%d)dnl\0A\00"
define void @divert(i32 %0, i32* nocapture %1) {
%3 = icmp ne i32 %0, 0
%4 = sext i1 %3 to i32
%5 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void one(void) { puts("You entered 1."); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"You entered 1.\00"
define void @one() {
%1 = call i32 @puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"You entered 1.\00"
define void @one() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}