xunge/DecIR huggingface dataset:
float sacube(float a) { return (a * a * a * 6); }


x86 assembly (clang, -O0):
<sacube>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  0xee0(%rip),%xmm1
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sacube>:
movaps %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm1,%xmm0
mulss  0xeed(%rip),%xmm0
ret

LLVM IR (-O0):
define float @sacube(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fmul float %3, %4
%6 = load float, float* %2
%7 = fmul float %5, %6
%8 = fmul float %7, 6.000000e+00
ret float %8
}

LLVM IR (-O2):
define float @sacube(float %0) {
%2 = fmul float %0, %0
%3 = fmul float %2, %0
%4 = fmul float %3, 6.000000e+00
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ GL_FILL;
int /*<<< orphan*/ GL_FRONT_AND_BACK;
int /*<<< orphan*/ GL_LINE;
int /*<<< orphan*/ glPolygonMode(int /*<<< orphan*/, int /*<<< orphan*/);
void wire(void) {
  static int wire_mode;
  if (wire_mode ^= 1)
    glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
  else
    glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
}


x86 assembly (clang, -O0):
<wire>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f12(%rip),%eax
xor    $0x1,%eax
mov    %eax,0x2f09(%rip)
cmp    $0x0,%eax
je     1148 <wire+0x38>
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    0x2ea4(%rip),%rax
mov    (%rax),%esi
call   1030 <glPolygonMode@plt>
jmp    115f <wire+0x4f>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
mov    0x2e78(%rip),%rax
mov    (%rax),%esi
call   1030 <glPolygonMode@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wire>:
xorl   $0x1,0x2f15(%rip)
mov    0x2eca(%rip),%rax
mov    (%rax),%edi
jne    1130 <wire+0x20>
mov    0x2ea7(%rip),%rax
mov    (%rax),%esi
jmp    1030 <glPolygonMode@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <glPolygonMode@plt>

LLVM IR (-O0):
@wire.wire_mode = internal global i32 0
@GL_FRONT_AND_BACK = global i32 0
@GL_LINE = global i32 0
@GL_FILL = global i32 0
define void @wire() {
%1 = load i32, i32* @wire.wire_mode
%2 = xor i32 %1, 1
store i32 %2, i32* @wire.wire_mode
%3 = icmp ne i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = load i32, i32* @GL_FRONT_AND_BACK
%6 = load i32, i32* @GL_LINE
%7 = call i32 @glPolygonMode(i32 %5, i32 %6)
br label %12
8: ; preds = %0
%9 = load i32, i32* @GL_FRONT_AND_BACK
%10 = load i32, i32* @GL_FILL
%11 = call i32 @glPolygonMode(i32 %9, i32 %10)
br label %12
12: ; preds = %8, %4
ret void
}

LLVM IR (-O2):
@wire.wire_mode = internal unnamed_addr global i32 0
@GL_FRONT_AND_BACK = global i32 0
@GL_LINE = global i32 0
@GL_FILL = global i32 0
define void @wire() {
%1 = load i32, i32* @wire.wire_mode
%2 = xor i32 %1, 1
store i32 %2, i32* @wire.wire_mode
%3 = icmp eq i32 %2, 0
%4 = load i32, i32* @GL_FRONT_AND_BACK
%5 = load i32, i32* @GL_FILL
%6 = load i32, i32* @GL_LINE
%7 = select i1 %3, i32 %5, i32 %6
%8 = tail call i32 @glPolygonMode(i32 %4, i32 %7)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
void __attribute__((weak))
usr_mlme_associate_ind(uint64_t DeviceAddress, uint8_t CapabilityInformation) {
  DeviceAddress = DeviceAddress;
  CapabilityInformation = CapabilityInformation;
}


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

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

LLVM IR (-O0):
define weak void @usr_mlme_associate_ind(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
store i32 %5, i32* %3
%6 = load i32, i32* %4
store i32 %6, i32* %4
ret void
}

LLVM IR (-O2):
define weak void @usr_mlme_associate_ind(i32 %0, i32 %1) {
ret void
}
__attribute__((no, noclone)) signed __int128 t113_3sub(signed __int128 y) {
  signed __int128 r;
  if (__builtin_sub_overflow((signed __int128)(1), y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t113_3sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rax
xor    %ecx,%ecx
mov    $0x1,%edx
sub    %rsi,%rdx
sbb    %rax,%rcx
seto   %al
mov    %rdx,-0x40(%rbp)
mov    %rcx,-0x38(%rbp)
test   $0x1,%al
jne    115d <t113_3sub+0x4d>
jmp    1164 <t113_3sub+0x54>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t113_3sub>:
push   %r14
push   %rbx
push   %rax
xor    %r14d,%r14d
mov    $0x1,%ebx
sub    %rdi,%rbx
sbb    %rsi,%r14
jno    112b <t113_3sub+0x1b>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %rbx,%rax
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t113_3sub(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = bitcast i128* %4 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = load i128, i128* %4
store i128 %10, i128* %5
%11 = load i128, i128* %5
%12 = call { i128, i1 } @llvm.ssub.with.overflow.i128(i128 1, i128 %11)
%13 = extractvalue { i128, i1 } %12, 1
%14 = extractvalue { i128, i1 } %12, 0
store i128 %14, i128* %6
br i1 %13, label %15, label %17
15: ; preds = %2
%16 = call i32 (...) @bar()
br label %17
17: ; preds = %15, %2
%18 = load i128, i128* %6
store i128 %18, i128* %3
%19 = bitcast i128* %3 to { i64, i64 }*
%20 = load { i64, i64 }, { i64, i64 }* %19
ret { i64, i64 } %20
}

LLVM IR (-O2):
define { i64, i64 } @t113_3sub(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = tail call { i128, i1 } @llvm.ssub.with.overflow.i128(i128 1, i128 %6)
%8 = extractvalue { i128, i1 } %7, 1
%9 = extractvalue { i128, i1 } %7, 0
br i1 %8, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (...) @bar()
br label %12
12: ; preds = %10, %2
%13 = trunc i128 %9 to i64
%14 = lshr i128 %9, 64
%15 = trunc i128 %14 to i64
%16 = insertvalue { i64, i64 } poison, i64 %13, 0
%17 = insertvalue { i64, i64 } %16, i64 %15, 1
ret { i64, i64 } %17
}
long extract_sh6(insn, invalid)
unsigned long insn;
int *invalid;
{ return ((insn >> 11) & 0x1f) | ((insn << 4) & 0x20); }


x86 assembly (clang, -O0):
<extract_sh6>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
shr    $0xb,%rax
and    $0x1f,%rax
mov    -0x8(%rbp),%rcx
shl    $0x4,%rcx
and    $0x20,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_sh6>:
mov    %edi,%eax
shr    $0xb,%eax
and    $0x1f,%eax
shl    $0x4,%edi
and    $0x20,%edi
or     %rdi,%rax
ret

LLVM IR (-O0):
define i64 @extract_sh6(i64 %0, i32* %1) {
%3 = alloca i64
%4 = alloca i32*
store i64 %0, i64* %3
store i32* %1, i32** %4
%5 = load i64, i64* %3
%6 = lshr i64 %5, 11
%7 = and i64 %6, 31
%8 = load i64, i64* %3
%9 = shl i64 %8, 4
%10 = and i64 %9, 32
%11 = or i64 %7, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @extract_sh6(i64 %0, i32* nocapture readnone %1) {
%3 = lshr i64 %0, 11
%4 = and i64 %3, 31
%5 = shl i64 %0, 4
%6 = and i64 %5, 32
%7 = or i64 %4, %6
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
scalar_t__ write(int /*<<< orphan*/, char *, int);
void term_state_save() { (void)(write(STDOUT_FILENO, "\x1b[?1049h", 8) + 1); }


x86 assembly (clang, -O0):
<term_state_save>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
mov    $0x8,%edx
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<term_state_save>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
mov    $0x8,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
@.str = [9 x i8] c"\1B[?1049h\00"
define void @term_state_save() {
%1 = load i32, i32* @STDOUT_FILENO
%2 = call i64 @write(i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 8)
%3 = add nsw i64 %2, 1
ret void
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
@.str = [9 x i8] c"\1B[?1049h\00"
define void @term_state_save() {
%1 = load i32, i32* @STDOUT_FILENO
%2 = tail call i64 @write(i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
double flip(double input) {
  assert(sizeof(double) == 8);
  unsigned char *bytes = (unsigned char *)&input;
  int c;
  unsigned char temp;
  for (c = 0; c < 4; c++) {
    temp = bytes[c];
    bytes[c] = bytes[7 - c];
    bytes[7 - c] = temp;
  }
  return input;
}


x86 assembly (clang, -O0):
<flip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x1,%edi
call   1030 <assert@plt>
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    118e <flip+0x7e>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x15(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x7,%ecx
sub    -0x14(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x15(%rbp),%dl
mov    -0x10(%rbp),%rax
mov    $0x7,%ecx
sub    -0x14(%rbp),%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1136 <flip+0x26>
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flip>:
push   %rax
movsd  %xmm0,(%rsp)
mov    $0x1,%edi
call   1030 <assert@plt>
movq   (%rsp),%xmm0
movq   %xmm0,%rax
bswap  %rax
movq   %rax,%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
define double @flip(double %0) {
%2 = tail call i32 @assert(i32 1)
%3 = bitcast double %0 to i64
%4 = call i64 @llvm.bswap.i64(i64 %3)
%5 = bitcast i64 %4 to double
ret double %5
}
int StaticLibrary1Function(char c) { return (int)c; }


x86 assembly (clang, -O0):
<StaticLibrary1Function>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @StaticLibrary1Function(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @StaticLibrary1Function(i8 signext %0) {
%2 = sext i8 %0 to i32
ret i32 %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void ADCSequenceDMADisable(uint32_t ui32Base, uint32_t ui32SequenceNum) {
  ASSERT((ui32Base == 0x40038000) || (ui32Base == 0x40039000));
  ASSERT(ui32SequenceNum < 4);
  (*((volatile uint32_t *)(ui32Base + 0x00000000))) &=
      ~(0x100 << ui32SequenceNum);
}


x86 assembly (clang, -O0):
<ADCSequenceDMADisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x1,%al
cmpl   $0x40038000,-0x4(%rbp)
mov    %al,-0x9(%rbp)
je     113d <ADCSequenceDMADisable+0x2d>
cmpl   $0x40039000,-0x4(%rbp)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
cmpl   $0x4,-0x8(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x8(%rbp),%ecx
mov    $0x100,%edx
shl    %cl,%edx
xor    $0xffffffff,%edx
mov    -0x4(%rbp),%eax
add    $0x0,%eax
cltq
mov    (%rax),%ecx
and    %edx,%ecx
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCSequenceDMADisable>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %edi,%eax
and    $0xffffefff,%eax
xor    %edi,%edi
cmp    $0x40038000,%eax
sete   %dil
call   1030 <ASSERT@plt>
xor    %edi,%edi
cmp    $0x4,%ebx
setl   %dil
call   1030 <ASSERT@plt>
mov    $0x100,%eax
mov    %ebx,%ecx
shl    %cl,%eax
not    %eax
movslq %ebp,%rcx
and    %eax,(%rcx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @ADCSequenceDMADisable(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 1073971200
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 1073975296
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ true, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @ASSERT(i32 %12)
%14 = load i32, i32* %4
%15 = icmp slt i32 %14, 4
%16 = zext i1 %15 to i32
%17 = call i32 @ASSERT(i32 %16)
%18 = load i32, i32* %4
%19 = shl i32 256, %18
%20 = xor i32 %19, -1
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 0
%23 = sext i32 %22 to i64
%24 = inttoptr i64 %23 to i32*
%25 = load volatile i32, i32* %24
%26 = and i32 %25, %20
store volatile i32 %26, i32* %24
ret void
}

LLVM IR (-O2):
define void @ADCSequenceDMADisable(i32 %0, i32 %1) {
%3 = and i32 %0, -4097
%4 = icmp eq i32 %3, 1073971200
%5 = zext i1 %4 to i32
%6 = tail call i32 @ASSERT(i32 %5)
%7 = icmp slt i32 %1, 4
%8 = zext i1 %7 to i32
%9 = tail call i32 @ASSERT(i32 %8)
%10 = shl i32 256, %1
%11 = xor i32 %10, -1
%12 = sext i32 %0 to i64
%13 = inttoptr i64 %12 to i32*
%14 = load volatile i32, i32* %13
%15 = and i32 %14, %11
store volatile i32 %15, i32* %13
ret void
}
void set_bit_rl(unsigned char *c, int i) { *c |= 1 << i; }


x86 assembly (clang, -O0):
<set_bit_rl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
or     %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bit_rl>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     %al,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_bit_rl(i8* nocapture %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = load i8, i8* %0
%5 = trunc i32 %3 to i8
%6 = or i8 %4, %5
store i8 %6, i8* %0
ret void
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcat(char *, char const *);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
const char *concatenate(const char *a, const char *b) {
  char *result = malloc(strlen(a) + strlen(b) + 1);
  strcpy(result, a);
  strcat(result, b);
  return result;
}


x86 assembly (clang, -O0):
<concatenate>:
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,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
add    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<concatenate>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
call   1040 <strlen@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1040 <strlen@plt>
lea    (%r15,%rax,1),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r12,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <strcat@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @concatenate(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* %8)
%10 = add nsw i64 %7, %9
%11 = add nsw i64 %10, 1
%12 = call i8* @malloc(i64 %11)
store i8* %12, i8** %5
%13 = load i8*, i8** %5
%14 = load i8*, i8** %3
%15 = call i32 @strcpy(i8* %13, i8* %14)
%16 = load i8*, i8** %5
%17 = load i8*, i8** %4
%18 = call i32 @strcat(i8* %16, i8* %17)
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
define i8* @concatenate(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add i64 %3, 1
%6 = add i64 %5, %4
%7 = tail call i8* @malloc(i64 %6)
%8 = tail call i32 @strcpy(i8* %7, i8* %0)
%9 = tail call i32 @strcat(i8* %7, i8* %1)
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  char c = '+';
  int a = 10;
  int b = 20;
  switch (c) {
  case '+': {
    int sum = a + b;
    printf("sum is%d\n", sum);
    break;
  }
  case '-': {
    int minus = a - b;
    printf("minus is%d\n", minus);
    break;
  }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x2b,-0x5(%rbp)
movl   $0xa,-0xc(%rbp)
movl   $0x14,-0x10(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0x1c(%rbp)
sub    $0x2b,%eax
je     1157 <main+0x47>
jmp    1146 <main+0x36>
mov    -0x1c(%rbp),%eax
sub    $0x2d,%eax
je     1174 <main+0x64>
jmp    118c <main+0x7c>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
jmp    118c <main+0x7c>
mov    -0xc(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xe83(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"sum is%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 30)
ret i32 0
}
int pgis_getopt_long(argc, argv, options, long_options, opt_index)
int argc;
char *const *argv;
const char *options;
const struct option *long_options;
int *opt_index;
{
  return _pgis_getopt_internal(argc, argv, options, long_options, opt_index, 0);
}


x86 assembly (clang, -O0):
<pgis_getopt_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
xor    %r9d,%r9d
mov    $0x0,%al
call   1030 <_pgis_getopt_internal@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pgis_getopt_long>:
xor    %r9d,%r9d
xor    %eax,%eax
jmp    1030 <_pgis_getopt_internal@plt>

LLVM IR (-O0):
%struct.option = type opaque
define i32 @pgis_getopt_long(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8*
%9 = alloca %struct.option*
%10 = alloca i32*
store i32 %0, i32* %6
store i8** %1, i8*** %7
store i8* %2, i8** %8
store %struct.option* %3, %struct.option** %9
store i32* %4, i32** %10
%11 = load i32, i32* %6
%12 = load i8**, i8*** %7
%13 = load i8*, i8** %8
%14 = load %struct.option*, %struct.option** %9
%15 = load i32*, i32** %10
%16 = call i32 (i32, i8**, i8*, %struct.option*, i32*, i32, ...) bitcast (i32 (...)* @_pgis_getopt_internal to i32 (i32, i8**, i8*, %struct.option*, i32*, i32, ...)*)(i32 %11, i8** %12, i8* %13, %struct.option* %14, i32* %15, i32 0)
ret i32 %16
}

LLVM IR (-O2):
%struct.option = type opaque
define i32 @pgis_getopt_long(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4) {
%6 = tail call i32 (i32, i8**, i8*, %struct.option*, i32*, i32, ...) bitcast (i32 (...)* @_pgis_getopt_internal to i32 (i32, i8**, i8*, %struct.option*, i32*, i32, ...)*)(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4, i32 0)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ e_lda();
int /*<<< orphan*/ e_zp();
void e_lda_zp() {
  e_zp();
  e_lda();
}


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

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

LLVM IR (-O0):
define void @e_lda_zp() {
%1 = call i32 (...) @e_zp()
%2 = call i32 (...) @e_lda()
ret void
}

LLVM IR (-O2):
define void @e_lda_zp() {
%1 = tail call i32 (...) @e_zp()
%2 = tail call i32 (...) @e_lda()
ret void
}
void setU1(unsigned char *p, unsigned char u) { *p = u; }


x86 assembly (clang, -O0):
<setU1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setU1>:
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @setU1(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = load i8*, i8** %3
store i8 %5, i8* %6
ret void
}

LLVM IR (-O2):
define void @setU1(i8* nocapture writeonly %0, i8 zeroext %1) {
store i8 %1, i8* %0
ret void
}
/* Variables and functions */
int atoi(char *);
int read_hex(char *);
unsigned read_num(char *num) {
  if (num[0] == '0' && (num[1] == 'x' || num[1] == 'X'))
    return read_hex(num);
  return atoi(num);
}


x86 assembly (clang, -O0):
<read_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jne    116f <read_num+0x4f>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x78,%eax
je     115e <read_num+0x3e>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x58,%eax
jne    116f <read_num+0x4f>
mov    -0x10(%rbp),%rdi
call   1030 <read_hex@plt>
mov    %eax,-0x4(%rbp)
jmp    117b <read_num+0x5b>
mov    -0x10(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_num>:
cmpb   $0x30,(%rdi)
jne    1133 <read_num+0x13>
mov    0x1(%rdi),%al
or     $0x20,%al
cmp    $0x78,%al
jne    1133 <read_num+0x13>
jmp    1030 <read_hex@plt>
jmp    1040 <atoi@plt>

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

LLVM IR (-O2):
define i32 @read_num(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 48
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
switch i8 %6, label %9 [
i8 120, label %7
i8 88, label %7
]
7: ; preds = %4, %4
%8 = tail call i32 @read_hex(i8* %0)
br label %11
9: ; preds = %4, %1
%10 = tail call i32 @atoi(i8* %0)
br label %11
11: ; preds = %9, %7
%12 = phi i32 [ %8, %7 ], [ %10, %9 ]
ret i32 %12
}
void J444ToABGR() {}


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

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

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

LLVM IR (-O2):
define void @J444ToABGR() {
ret void
}
/* Variables and functions */
int f3_cmp(long double, long double);
int __lttf2(long double a, long double b) { return f3_cmp(a, b); }


x86 assembly (clang, -O0):
<__lttf2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <f3_cmp@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__lttf2>:
jmp    1030 <f3_cmp@plt>

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

LLVM IR (-O2):
define i32 @__lttf2(x86_fp80 %0, x86_fp80 %1) {
%3 = tail call i32 @f3_cmp(x86_fp80 %0, x86_fp80 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ getRoot_f(int /*<<< orphan*/, int);
int /*<<< orphan*/ getRoot_g(int, int);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main() {
  printf("root of f(x) is %lf\n\n", getRoot_f(0, 100));
  printf("root of g(x) is %lf\n\n", getRoot_g(-2, 1000));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
mov    $0x64,%esi
call   1050 <getRoot_f@plt>
mov    %eax,%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
mov    $0xfffffffe,%edi
mov    $0x3e8,%esi
call   1040 <getRoot_g@plt>
mov    %eax,%esi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
mov    $0x64,%esi
call   1050 <getRoot_f@plt>
lea    0xebc(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0xfffffffe,%edi
mov    $0x3e8,%esi
call   1040 <getRoot_g@plt>
lea    0xeb5(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"root of f(x) is %lf\0A\0A\00"
@.str.1 = [22 x i8] c"root of g(x) is %lf\0A\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @getRoot_f(i32 0, i32 100)
%3 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 @getRoot_g(i32 -2, i32 1000)
%5 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"root of f(x) is %lf\0A\0A\00"
@.str.1 = [22 x i8] c"root of g(x) is %lf\0A\0A\00"
define i32 @main() {
%1 = tail call i32 @getRoot_f(i32 0, i32 100)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @getRoot_g(i32 -2, i32 1000)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ memmove(char **, char **, int);
void remove_from_string_array(char **array, size_t len, int pos) {
  free(array[pos]);
  memmove(array + pos, array + pos + 1, sizeof(char *) * ((len - 1) - pos));
}


x86 assembly (clang, -O0):
<remove_from_string_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
add    $0x8,%rsi
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
movslq -0x14(%rbp),%rcx
sub    %rcx,%rax
shl    $0x3,%rax
mov    %eax,%edx
call   1040 <memmove@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_from_string_array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r12
mov    %rdi,%r14
movslq %edx,%rbx
lea    (%rdi,%rbx,8),%r15
mov    (%rdi,%rbx,8),%rdi
call   1030 <free@plt>
lea    (%r14,%rbx,8),%rsi
add    $0x8,%rsi
not    %ebx
add    %ebx,%r12d
shl    $0x3,%r12d
mov    %r15,%rdi
mov    %r12d,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <memmove@plt>

LLVM IR (-O0):
define void @remove_from_string_array(i8** %0, i64 %1, i32 %2) {
%4 = alloca i8**
%5 = alloca i64
%6 = alloca i32
store i8** %0, i8*** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i8**, i8*** %4
%8 = load i32, i32* %6
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8*, i8** %7, i64 %9
%11 = load i8*, i8** %10
%12 = call i32 @free(i8* %11)
%13 = load i8**, i8*** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8*, i8** %13, i64 %15
%17 = load i8**, i8*** %4
%18 = load i32, i32* %6
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8*, i8** %17, i64 %19
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i64, i64* %5
%23 = sub i64 %22, 1
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = sub i64 %23, %25
%27 = mul i64 8, %26
%28 = trunc i64 %27 to i32
%29 = call i32 @memmove(i8** %16, i8** %21, i32 %28)
ret void
}

LLVM IR (-O2):
define void @remove_from_string_array(i8** %0, i64 %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds i8*, i8** %0, i64 %4
%6 = load i8*, i8** %5
%7 = tail call i32 @free(i8* %6)
%8 = getelementptr inbounds i8*, i8** %5, i64 1
%9 = xor i64 %4, -1
%10 = add i64 %9, %1
%11 = trunc i64 %10 to i32
%12 = shl i32 %11, 3
%13 = tail call i32 @memmove(i8** %5, i8** %8, i32 %12)
ret void
}
int lm_get_lockspaces_sanlock(struct list_head *ls_rejoin) { return -1; }


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

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

LLVM IR (-O0):
%struct.list_head = type opaque
define i32 @lm_get_lockspaces_sanlock(%struct.list_head* %0) {
%2 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %2
ret i32 -1
}

LLVM IR (-O2):
%struct.list_head = type opaque
define i32 @lm_get_lockspaces_sanlock(%struct.list_head* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
void *Mem_Alloc(int);
scalar_t__ Mem_Init(int);
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main() {
  assert(Mem_Init(4096) == 0);
  void *ptr = Mem_Alloc(8);
  assert(ptr != NULL);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1000,%edi
call   1030 <Mem_Init@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x8,%edi
call   1050 <Mem_Alloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1000,%edi
call   1030 <Mem_Init@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
mov    $0x8,%edi
call   1050 <Mem_Alloc@plt>
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1040 <assert@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i64 @Mem_Init(i32 4096)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = call i8* @Mem_Alloc(i32 8)
store i8* %7, i8** %2
%8 = load i8*, i8** %2
%9 = icmp ne i8* %8, null
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @Mem_Init(i32 4096)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i8* @Mem_Alloc(i32 8)
%6 = icmp ne i8* %5, null
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
typedef int /*<<< orphan*/ ASN1_GENERALIZEDTIME;

/* Variables and functions */
int /*<<< orphan*/ *ASN1_GENERALIZEDTIME_adj(int /*<<< orphan*/ *,
                                             int /*<<< orphan*/,
                                             int /*<<< orphan*/,
                                             int /*<<< orphan*/);
ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s,
                                               time_t t) {
  return ASN1_GENERALIZEDTIME_adj(s, t, 0, 0);
}


x86 assembly (clang, -O0):
<ASN1_GENERALIZEDTIME_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <ASN1_GENERALIZEDTIME_adj@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ASN1_GENERALIZEDTIME_set>:
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <ASN1_GENERALIZEDTIME_adj@plt>

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

LLVM IR (-O2):
define i32* @ASN1_GENERALIZEDTIME_set(i32* %0, i32 %1) {
%3 = tail call i32* @ASN1_GENERALIZEDTIME_adj(i32* %0, i32 %1, i32 0, i32 0)
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
scalar_t__ strcmp(char *, char *);
int strlen(char *);
void dev_file_name(char *str) {
  int len = strlen(str);
  if (len <= 4 || strcmp(".dev", str + len - 4))
    strcat(str, ".dev");
}


x86 assembly (clang, -O0):
<dev_file_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jle    1177 <dev_file_name+0x47>
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
add    %rax,%rsi
add    $0xfffffffffffffffc,%rsi
lea    0xe98(%rip),%rdi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     1187 <dev_file_name+0x57>
mov    -0x8(%rbp),%rdi
lea    0xe7e(%rip),%rsi
call   1050 <strcat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dev_file_name>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cmp    $0x5,%eax
jl     1159 <dev_file_name+0x29>
mov    %eax,%eax
lea    (%rbx,%rax,1),%rsi
add    $0xfffffffffffffffc,%rsi
lea    0xeb1(%rip),%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1169 <dev_file_name+0x39>
lea    0xea0(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <strcat@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c".dev\00"
define void @dev_file_name(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp slt i32 %2, 5
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = zext i32 %2 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = getelementptr inbounds i8, i8* %6, i64 -4
%8 = tail call i64 @strcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %4, %1
%11 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %4
ret void
}
/* Variables and functions */
int PAPI_num_counters();
void papif_num_counters__(int *numevents) { *numevents = PAPI_num_counters(); }


x86 assembly (clang, -O0):
<papif_num_counters__>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <PAPI_num_counters@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_num_counters__>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <PAPI_num_counters@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @papif_num_counters__(i32* nocapture writeonly %0) {
%2 = tail call i32 (...) @PAPI_num_counters()
store i32 %2, i32* %0
ret void
}
void initialisiere_char_array(char *array, int laenge, char initialwert) {
  for (int i = 0; i < laenge; i++)
    array[i] = initialwert;
}


x86 assembly (clang, -O0):
<initialisiere_char_array>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113f <initialisiere_char_array+0x3f>
mov    -0xd(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <initialisiere_char_array+0x17>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialisiere_char_array>:
test   %esi,%esi
jle    1126 <initialisiere_char_array+0x16>
push   %rax
mov    %esi,%eax
movzbl %dl,%esi
mov    %rax,%rdx
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @initialisiere_char_array(i8* nocapture writeonly %0, i32 %1, i8 signext %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %3
ret void
}
int test_imm_A7int8_reg(signed char val) {
  return ((val) & (-0xA7 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_A7int8_reg>:
test   $0xffffff59,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_A7int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -167
%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_A7int8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -167
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ read_word_data(int /*<<< orphan*/, int);
uint16_t get_bus_polarity(uint8_t address) {
  return read_word_data(address, 0x02);
}


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

x86 assembly (clang, -O2):
<get_bus_polarity>:
mov    $0x2,%esi
jmp    1030 <read_word_data@plt>

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

LLVM IR (-O2):
define i32 @get_bus_polarity(i32 %0) {
%2 = tail call i32 @read_word_data(i32 %0, i32 2)
ret i32 %2
}
/* Variables and functions */
char *convert(char *, int);
int /*<<< orphan*/ printf(char *, char *);
void zigZagConversionMain(void) {
  printf("%s\n", convert("abcdefghijklmnopqrstuvwxyz", 25));
}


x86 assembly (clang, -O0):
<zigZagConversionMain>:
push   %rbp
mov    %rsp,%rbp
lea    0xed9(%rip),%rdi
mov    $0x19,%esi
call   1030 <convert@plt>
mov    %rax,%rsi
lea    0xec1(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<zigZagConversionMain>:
push   %rax
lea    0xedc(%rip),%rdi
mov    $0x19,%esi
call   1030 <convert@plt>
lea    0xec7(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [27 x i8] c"abcdefghijklmnopqrstuvwxyz\00"
define void @zigZagConversionMain() {
%1 = call i8* @convert(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 25)
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [27 x i8] c"abcdefghijklmnopqrstuvwxyz\00"
define void @zigZagConversionMain() {
%1 = tail call i8* @convert(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 25)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
double getCylindricalX(int index) {
  if (index == 0) {
    return -0.5;
  }
  return ((float)index / 31) - 0.5;
}


x86 assembly (clang, -O0):
<getCylindricalX>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1123 <getCylindricalX+0x23>
movsd  0xeef(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1149 <getCylindricalX+0x49>
cvtsi2ssl -0xc(%rbp),%xmm0
movss  0xee0(%rip),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xec0(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCylindricalX>:
test   %edi,%edi
je     111d <getCylindricalX+0x1d>
cvtsi2ss %edi,%xmm0
divss  0xef8(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xee4(%rip),%xmm0
ret
movsd  0xedb(%rip),%xmm0
ret

LLVM IR (-O0):
define double @getCylindricalX(i32 %0) {
%2 = alloca double
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store double -5.000000e-01, double* %2
br label %13
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sitofp i32 %8 to float
%10 = fdiv float %9, 3.100000e+01
%11 = fpext float %10 to double
%12 = fsub double %11, 5.000000e-01
store double %12, double* %2
br label %13
13: ; preds = %7, %6
%14 = load double, double* %2
ret double %14
}

LLVM IR (-O2):
define double @getCylindricalX(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = sitofp i32 %0 to float
%5 = fdiv float %4, 3.100000e+01
%6 = fpext float %5 to double
%7 = fadd double %6, -5.000000e-01
br label %8
8: ; preds = %1, %3
%9 = phi double [ %7, %3 ], [ -5.000000e-01, %1 ]
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ notImplementedI5();
void PrtSetPgFmtI5() { notImplementedI5(); }


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

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

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

LLVM IR (-O2):
define void @PrtSetPgFmtI5() {
%1 = tail call i32 (...) @notImplementedI5()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_indent(int indent) {
  int i;
  for (i = 0; i < indent; i++)
    fprintf(stderr, "  ");
}


x86 assembly (clang, -O0):
<print_indent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1151 <print_indent+0x41>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
lea    0xec2(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <print_indent+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_indent>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
jle    1140 <print_indent+0x30>
mov    %edi,%ebx
mov    0x2ebe(%rip),%r15
lea    0xed7(%rip),%r14
nopl   0x0(%rax)
mov    (%r15),%edi
mov    %r14,%rsi
call   1030 <fprintf@plt>
add    $0xffffffff,%ebx
jne    1130 <print_indent+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c" \00"
define void @print_indent(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%7 = add nuw nsw i32 %4, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %9, label %3
9: ; preds = %3, %1
ret void
}