xunge/DecIR huggingface dataset:
void free_2d_double(double **ptr) {
  free(ptr[0]);
  free(ptr);
}


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

x86 assembly (clang, -O2):
<free_2d_double>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_2d_double(double** %0) {
%2 = alloca double**
store double** %0, double*** %2
%3 = load double**, double*** %2
%4 = getelementptr inbounds double*, double** %3, i64 0
%5 = load double*, double** %4
%6 = bitcast double* %5 to i8*
%7 = load double**, double*** %2
%8 = bitcast double** %7 to i8*
ret void
}

LLVM IR (-O2):
define void @free_2d_double(double** nocapture %0) {
%2 = bitcast double** %0 to i8**
%3 = load i8*, i8** %2
tail call void @free(i8* %3)
%4 = bitcast double** %0 to i8*
tail call void @free(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main(void) { printf("I LOVE YOU ,deal World!"); }


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"I LOVE YOU ,deal World!\00"
define void @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"I LOVE YOU ,deal World!\00"
define void @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}
int read_SInt32Number(char *p) {
  int rv;
  rv = 16777216 * (int)((signed char *)p)[0] +
       65536 * (int)((unsigned char *)p)[1] +
       256 * (int)((unsigned char *)p)[2] + (int)((unsigned char *)p)[3];
  return rv;
}


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

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

LLVM IR (-O0):
define i32 @read_SInt32Number(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = mul nsw i32 16777216, %7
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = mul nsw i32 65536, %12
%14 = add nsw i32 %8, %13
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 2
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = mul nsw i32 256, %18
%20 = add nsw i32 %14, %19
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i64 3
%23 = load i8, i8* %22
%24 = zext i8 %23 to i32
%25 = add nsw i32 %20, %24
store i32 %25, i32* %3
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @read_SInt32Number(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = shl nsw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ Act_Done();
int /*<<< orphan*/ Me();
int /*<<< orphan*/ SendItem(int /*<<< orphan*/, char *);
void Act_Ok(void) {
  SendItem(Me(), "Ok.\n");
  Act_Done();
}


x86 assembly (clang, -O0):
<Act_Ok>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <Me@plt>
mov    %eax,%edi
lea    0xebc(%rip),%rsi
call   1030 <SendItem@plt>
mov    $0x0,%al
call   1040 <Act_Done@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Act_Ok>:
push   %rax
xor    %eax,%eax
call   1050 <Me@plt>
lea    0xec1(%rip),%rsi
mov    %eax,%edi
call   1030 <SendItem@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <Act_Done@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"Ok.\0A\00"
define void @Act_Ok() {
%1 = call i32 (...) @Me()
%2 = call i32 @SendItem(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @Act_Done()
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"Ok.\0A\00"
define void @Act_Ok() {
%1 = tail call i32 (...) @Me()
%2 = tail call i32 @SendItem(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @Act_Done()
ret void
}
void _Block_assign_default(void *value, void **destptr) { *destptr = value; }


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

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

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

LLVM IR (-O2):
define void @_Block_assign_default(i8* %0, i8** nocapture writeonly %1) {
store i8* %0, i8** %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getuid();
int /*<<< orphan*/ print_num(int /*<<< orphan*/);
int main(int argc, const char *argv[]) {
  print_num(getuid());
  return (0);
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getuid()
%4 = tail call i32 @print_num(i32 %3)
ret i32 0
}
int func(int a, int b) { return a - b - 1; }


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

x86 assembly (clang, -O2):
<func>:
not    %esi
lea    (%rsi,%rdi,1),%eax
ret

LLVM IR (-O0):
define i32 @func(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 = sub nsw i32 %5, %6
%8 = sub nsw i32 %7, 1
ret i32 %8
}

LLVM IR (-O2):
define i32 @func(i32 %0, i32 %1) {
%3 = xor i32 %1, -1
%4 = add i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ deviceIf_useBuffer();
double time_until();
void use_buffer(void) {
  double t;
  deviceIf_useBuffer();
  t = time_until();
}


x86 assembly (clang, -O0):
<use_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <deviceIf_useBuffer@plt>
mov    $0x0,%al
call   1030 <time_until@plt>
movsd  %xmm0,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @use_buffer() {
%1 = alloca double
%2 = call i32 (...) @deviceIf_useBuffer()
%3 = call double (...) @time_until()
store double %3, double* %1
ret void
}

LLVM IR (-O2):
define void @use_buffer() {
%1 = tail call i32 (...) @deviceIf_useBuffer()
%2 = tail call double (...) @time_until()
ret void
}
double c1(float x, unsigned short y, int z) { return z ? x + x : y; }


x86 assembly (clang, -O0):
<c1>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
movss  %xmm0,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1131 <c1+0x31>
movss  -0x4(%rbp),%xmm0
addss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    113e <c1+0x3e>
movzwl -0x6(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<c1>:
test   %esi,%esi
je     110d <c1+0xd>
addss  %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
ret
xorps  %xmm0,%xmm0
cvtsi2ss %edi,%xmm0
cvtss2sd %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @c1(float %0, i16 zeroext %1, i32 %2) {
%4 = alloca float
%5 = alloca i16
%6 = alloca i32
store float %0, float* %4
store i16 %1, i16* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = load float, float* %4
%11 = load float, float* %4
%12 = fadd float %10, %11
br label %17
13: ; preds = %3
%14 = load i16, i16* %5
%15 = zext i16 %14 to i32
%16 = sitofp i32 %15 to float
br label %17
17: ; preds = %13, %9
%18 = phi float [ %12, %9 ], [ %16, %13 ]
%19 = fpext float %18 to double
ret double %19
}

LLVM IR (-O2):
define double @c1(float %0, i16 zeroext %1, i32 %2) {
%4 = icmp eq i32 %2, 0
%5 = fadd float %0, %0
%6 = uitofp i16 %1 to float
%7 = select i1 %4, float %6, float %5
%8 = fpext float %7 to double
ret double %8
}
int fn2(unsigned char a) { return ((int)a) | ((int)~a); }


x86 assembly (clang, -O0):
<fn2>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x1(%rbp),%ecx
xor    $0xffffffff,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fn2(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = xor i32 %6, -1
%8 = or i32 %4, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @fn2(i8 zeroext %0) {
ret i32 -1
}
void acpi_gpiochip_request_interrupts(struct gpio_chip *chip) {}


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

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

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

LLVM IR (-O2):
%struct.gpio_chip = type opaque
define void @acpi_gpiochip_request_interrupts(%struct.gpio_chip* nocapture %0) {
ret void
}
int test_imm_93uint16_mem(unsigned short *val) {
  return ((*val) & (-0x93 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_93uint16_mem>:
movzwl (%rdi),%eax
test   $0xff6d,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_93uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -147
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ dbg_close();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void perror_exit(char *text) {
  dbg_close();
  perror(text);
  exit(1);
}


x86 assembly (clang, -O0):
<perror_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <dbg_close@plt>
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<perror_exit>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <dbg_close@plt>
mov    %rbx,%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @perror_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @dbg_close()
%4 = load i8*, i8** %2
%5 = call i32 @perror(i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @perror_exit(i8* nocapture %0) {
%2 = tail call i32 (...) @dbg_close()
%3 = tail call i32 @perror(i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
void testErrorInArgument(int *p) {
  int i = ((p ? 0 : *p));
  (void)i;
}


x86 assembly (clang, -O0):
<testErrorInArgument>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     111d <testErrorInArgument+0x1d>
xor    %eax,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <testErrorInArgument+0x26>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @testErrorInArgument(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int strlen(char *);
int write(int, char *, int);
void toFVM(int inP[], char outstr[]) {
  int len = strlen(outstr);
  int cnt = write(inP[1], outstr, len);
  if (-1 == cnt) {
    perror("write to pipe");
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<toFVM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
mov    %eax,-0x18(%rbp)
mov    $0xffffffff,%eax
cmp    -0x18(%rbp),%eax
jne    1196 <toFVM+0x56>
lea    0xe79(%rip),%rdi
call   1050 <perror@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toFVM>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    0x4(%r14),%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
cmp    $0xffffffff,%eax
je     116d <toFVM+0x2d>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xe8c(%rip),%rdi
call   1050 <perror@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

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

LLVM IR (-O2):
@.str = [14 x i8] c"write to pipe\00"
define void @toFVM(i32* nocapture %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = tail call i32 @write(i32 %5, i8* %1, i32 %3)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @exit(i32 -1)
unreachable
11: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void main() {
  printf("%s: "
         "hello world\n",
         "MAIN");
  ;
  printf("%s: "
         "This is an error message!\n",
         "MAIN");
  ;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rdi
lea    0xef2(%rip),%rbx
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"%s: hello world\0A\00"
@.str.1 = [5 x i8] c"MAIN\00"
@.str.2 = [31 x i8] c"%s: This is an error message!\0A\00"
define void @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"%s: hello world\0A\00"
@.str.1 = [5 x i8] c"MAIN\00"
@.str.2 = [31 x i8] c"%s: This is an error message!\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void report_proximity_data(struct ssp_data *data, struct sensor_value *prox) {
  return;
}


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

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

LLVM IR (-O0):
%struct.ssp_data = type opaque
%struct.sensor_value = type opaque
define void @report_proximity_data(%struct.ssp_data* %0, %struct.sensor_value* %1) {
%3 = alloca %struct.ssp_data*
%4 = alloca %struct.sensor_value*
store %struct.ssp_data* %0, %struct.ssp_data** %3
store %struct.sensor_value* %1, %struct.sensor_value** %4
ret void
}

LLVM IR (-O2):
%struct.ssp_data = type opaque
%struct.sensor_value = type opaque
define void @report_proximity_data(%struct.ssp_data* nocapture %0, %struct.sensor_value* nocapture %1) {
ret void
}
/* Variables and functions */
double ceil(double);
double floor(double);
double llz_roundf(double x) { return (x > 0) ? floor(x + 0.5) : ceil(x - 0.5); }


x86 assembly (clang, -O0):
<llz_roundf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    115b <llz_roundf+0x3b>
movsd  0xeb9(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
call   1040 <floor@plt>
movsd  %xmm0,-0x10(%rbp)
jmp    1176 <llz_roundf+0x56>
movsd  -0x8(%rbp),%xmm0
movsd  0xe98(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <ceil@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<llz_roundf>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1137 <llz_roundf+0x17>
addsd  0xed6(%rip),%xmm0
jmp    1040 <floor@plt>
addsd  0xec1(%rip),%xmm0
jmp    1030 <ceil@plt>

LLVM IR (-O0):
define double @llz_roundf(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ogt double %3, 0.000000e+00
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load double, double* %2
%7 = fadd double %6, 5.000000e-01
%8 = call double @llvm.floor.f64(double %7)
br label %13
9: ; preds = %1
%10 = load double, double* %2
%11 = fsub double %10, 5.000000e-01
%12 = call double @llvm.ceil.f64(double %11)
br label %13
13: ; preds = %9, %5
%14 = phi double [ %8, %5 ], [ %12, %9 ]
ret double %14
}

LLVM IR (-O2):
define double @llz_roundf(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = fadd double %0, 5.000000e-01
%5 = tail call double @llvm.floor.f64(double %4)
br label %9
6: ; preds = %1
%7 = fadd double %0, -5.000000e-01
%8 = tail call double @llvm.ceil.f64(double %7)
br label %9
9: ; preds = %6, %3
%10 = phi double [ %5, %3 ], [ %8, %6 ]
ret double %10
}
void NOTICEREF_new(void) {}


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

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

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

LLVM IR (-O2):
define void @NOTICEREF_new() {
ret void
}
void floatGenBufferOut(struct LSD_SceneNodeOutput const *output) {}


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

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

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

LLVM IR (-O2):
%struct.LSD_SceneNodeOutput = type opaque
define void @floatGenBufferOut(%struct.LSD_SceneNodeOutput* nocapture %0) {
ret void
}
int test_01(const short *x, int a, int b, int c) {
  if (x[a] == 92)
    return b;
  return c;
}


x86 assembly (clang, -O0):
<test_01>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movswl (%rax,%rcx,2),%eax
cmp    $0x5c,%eax
jne    1131 <test_01+0x31>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1137 <test_01+0x37>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_01>:
mov    %edx,%eax
movslq %esi,%rdx
cmpw   $0x5c,(%rdi,%rdx,2)
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_01(i16* nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i16, i16* %0, i64 %5
%7 = load i16, i16* %6
%8 = icmp eq i16 %7, 92
%9 = select i1 %8, i32 %2, i32 %3
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int DivideByZero() {
  unsigned int i;
  volatile unsigned int zero = 0;
  fprintf(stderr, "Going to divide by zero\n");
  i = 1 / zero;
  return i / i;
}


x86 assembly (clang, -O0):
<DivideByZero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
xor    %edx,%edx
div    %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x4(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DivideByZero>:
push   %rax
movl   $0x0,0x4(%rsp)
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
lea    0xed7(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x4(%rsp),%eax
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"Going to divide by zero\0A\00"
define i32 @DivideByZero() {
%1 = alloca i32
%2 = alloca i32
store volatile i32 0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%5 = load volatile i32, i32* %2
%6 = udiv i32 1, %5
store i32 %6, i32* %1
%7 = load i32, i32* %1
%8 = load i32, i32* %1
%9 = udiv i32 %7, %8
ret i32 %9
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"Going to divide by zero\0A\00"
define i32 @DivideByZero() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 0, i32* %1
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%5 = load volatile i32, i32* %1
ret i32 1
}
/* Variables and functions */
void pwc_dec1_init(int type, int release, void *buffer, void *table) {}


x86 assembly (clang, -O0):
<pwc_dec1_init>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @pwc_dec1_init(i32 %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
ret void
}

LLVM IR (-O2):
define void @pwc_dec1_init(i32 %0, i32 %1, i8* nocapture %2, i8* nocapture %3) {
ret void
}
void outnop2str(s) char *s;
{
  ;
  outstr(s);
  bumplc2();
  outnl();
}


x86 assembly (clang, -O0):
<outnop2str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <outstr@plt>
mov    $0x0,%al
call   1030 <bumplc2@plt>
mov    $0x0,%al
call   1050 <outnl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outnop2str>:
push   %rax
xor    %eax,%eax
call   1040 <outstr@plt>
xor    %eax,%eax
call   1030 <bumplc2@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <outnl@plt>

LLVM IR (-O0):
define void @outnop2str(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @outstr to i32 (i8*, ...)*)(i8* %3)
%5 = call i32 (...) @bumplc2()
%6 = call i32 (...) @outnl()
ret void
}

LLVM IR (-O2):
define void @outnop2str(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @outstr to i32 (i8*, ...)*)(i8* %0)
%3 = tail call i32 (...) @bumplc2()
%4 = tail call i32 (...) @outnl()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mgrSendMessageToSndModule(int, char *, int /*<<< orphan*/ *);
int mgrEffectChange(int code, void *arg1, void *arg2) {
  ;
  mgrSendMessageToSndModule((8005), "/effector/effect/toggle", NULL);
  return 0;
}


x86 assembly (clang, -O0):
<mgrEffectChange>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x1f45,%edi
lea    0xed1(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <mgrSendMessageToSndModule@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mgrEffectChange>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x1f45,%edi
xor    %edx,%edx
call   1030 <mgrSendMessageToSndModule@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"/effector/effect/toggle\00"
define i32 @mgrEffectChange(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = call i32 @mgrSendMessageToSndModule(i32 8005, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32* null)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"/effector/effect/toggle\00"
define i32 @mgrEffectChange(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 @mgrSendMessageToSndModule(i32 8005, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32* null)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ rush(int /*<<< orphan*/, int);
int main() {
  rush(0, 1);
  return (0);
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @rush(i32 0, i32 1)
ret i32 0
}
/* Variables and functions */
scalar_t__ read(int, char *, int);
int read_file(int fid, char *buff) {
  int len = 0;
  while (read(fid, &buff[len], 1)) {
    len++;
  }
  return len;
}


x86 assembly (clang, -O0):
<read_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rax
add    %rax,%rsi
mov    $0x1,%edx
call   1030 <read@plt>
cmp    $0x0,%rax
je     1156 <read_file+0x46>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <read_file+0x16>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_file>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%r14d
mov    $0xffffffff,%ebp
nop
mov    %r14d,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <read@plt>
add    $0x1,%ebp
add    $0x1,%rbx
test   %rax,%rax
jne    1120 <read_file+0x10>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @read_file(i32 %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %8, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = tail call i64 @read(i32 %0, i8* %5, i32 1)
%7 = icmp eq i64 %6, 0
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %4 to i32
ret i32 %10
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ above;
};
struct TYPE_4__ {
  TYPE_1__ xconfigure;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
unsigned long get_XEvent_xconfigure_above(void *_p) {
  return (unsigned long)((XEvent *)_p)->xconfigure.above;
}


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

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

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

LLVM IR (-O2):
define i64 @get_XEvent_xconfigure_above(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ memcpy(char *, char *, int);
char *filtercreate(void *arg, const char *const *key_array,
                   const size_t *key_length_array, int num_keys,
                   size_t *filter_length) {
  *filter_length = 4;
  char *result = malloc(4);
  memcpy(result, "fake", 4);
  return result;
}


x86 assembly (clang, -O0):
<filtercreate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movq   $0x4,(%rax)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
lea    0xea1(%rip),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x30(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filtercreate>:
push   %rbx
movq   $0x4,(%r8)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xec4(%rip),%rsi
mov    %rax,%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"fake\00"
define i8* @filtercreate(i8* nocapture readnone %0, i8** nocapture readnone %1, i64* nocapture readnone %2, i32 %3, i64* nocapture writeonly %4) {
store i64 4, i64* %4
%6 = tail call dereferenceable_or_null(4) i8* @malloc(i32 4)
%7 = tail call i32 @memcpy(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, ...);
void _mk_conf_str(unsigned char val, char *to, int size) {
  if ((val & 0x7f) == 0x7f) {
    snprintf(to, 5, "N/A");
    return;
  }
  snprintf(to, 5, "%d", val);
  return;
}


x86 assembly (clang, -O0):
<_mk_conf_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x7f,%eax
cmp    $0x7f,%eax
jne    1151 <_mk_conf_str+0x41>
mov    -0x10(%rbp),%rdi
mov    $0x5,%esi
lea    0xebb(%rip),%rdx
mov    $0x0,%al
call   1030 <snprintf@plt>
jmp    116c <_mk_conf_str+0x5c>
mov    -0x10(%rbp),%rdi
movzbl -0x1(%rbp),%ecx
mov    $0x5,%esi
lea    0xe9f(%rip),%rdx
mov    $0x0,%al
call   1030 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mk_conf_str>:
mov    %edi,%eax
not    %eax
test   $0x7f,%al
jne    112e <_mk_conf_str+0x1e>
lea    0xee1(%rip),%rdx
mov    %rsi,%rdi
mov    $0x5,%esi
xor    %eax,%eax
jmp    1030 <snprintf@plt>
mov    %edi,%ecx
lea    0xecd(%rip),%rdx
mov    %rsi,%rdi
mov    $0x5,%esi
xor    %eax,%eax
jmp    1030 <snprintf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"N/A\00"
@.str.1 = [3 x i8] c"%d\00"
define void @_mk_conf_str(i8 zeroext %0, i8* %1, i32 %2) {
%4 = zext i8 %0 to i32
%5 = and i32 %4, 127
%6 = icmp eq i32 %5, 127
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 (i8*, i32, i8*, ...) @snprintf(i8* %1, i32 5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %11
9: ; preds = %3
%10 = tail call i32 (i8*, i32, i8*, ...) @snprintf(i8* %1, i32 5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %4)
br label %11
11: ; preds = %9, %7
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int pthread_attr_setstack(pthread_attr_t *a, void *b, size_t c) { assert(0); }


x86 assembly (clang, -O0):
<pthread_attr_setstack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
xor    %edi,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_attr_setstack>:
xor    %edi,%edi
jmp    1030 <assert@plt>

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

LLVM IR (-O2):
define i32 @pthread_attr_setstack(i32* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
%4 = tail call i32 @assert(i32 0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ mkFlNm(char *, char *, char *);
int rename(char *, char *);
int reNm(char *oldFileName, char *newFileName, char *dirName) {
  char oldFullFile[1024];
  char newFullFile[1024];
  mkFlNm(oldFullFile, dirName, oldFileName);
  mkFlNm(newFullFile, dirName, newFileName);
  return rename(oldFullFile, newFullFile);
}


x86 assembly (clang, -O0):
<reNm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x820,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x420(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%rdx
call   1040 <mkFlNm@plt>
lea    -0x820(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <mkFlNm@plt>
lea    -0x420(%rbp),%rdi
lea    -0x820(%rbp),%rsi
call   1030 <rename@plt>
add    $0x820,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reNm>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x808,%rsp
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%rdx
lea    0x400(%rsp),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <mkFlNm@plt>
mov    %rsp,%r12
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <mkFlNm@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1030 <rename@plt>
add    $0x808,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @reNm(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [1024 x i8]
%8 = alloca [1024 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%10 = load i8*, i8** %6
%11 = load i8*, i8** %4
%12 = call i32 @mkFlNm(i8* %9, i8* %10, i8* %11)
%13 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%14 = load i8*, i8** %6
%15 = load i8*, i8** %5
%16 = call i32 @mkFlNm(i8* %13, i8* %14, i8* %15)
%17 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%18 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%19 = call i32 @rename(i8* %17, i8* %18)
ret i32 %19
}

LLVM IR (-O2):
define i32 @reNm(i8* %0, i8* %1, i8* %2) {
%4 = alloca [1024 x i8]
%5 = alloca [1024 x i8]
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%8 = call i32 @mkFlNm(i8* %6, i8* %2, i8* %0)
%9 = call i32 @mkFlNm(i8* %7, i8* %2, i8* %1)
%10 = call i32 @rename(i8* %6, i8* %7)
ret i32 %10
}
void ble_rsp_sm_set_oob_data(const void *nul) {}


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

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

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

LLVM IR (-O2):
define void @ble_rsp_sm_set_oob_data(i8* nocapture %0) {
ret void
}
int main() { int num; }


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
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
unsigned int indexFor(unsigned int tablelength, unsigned int hashvalue) {
  return (hashvalue & (tablelength - 1u));
}


x86 assembly (clang, -O0):
<indexFor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<indexFor>:
lea    -0x1(%rdi),%eax
and    %esi,%eax
ret

LLVM IR (-O0):
define i32 @indexFor(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 = sub i32 %6, 1
%8 = and i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @indexFor(i32 %0, i32 %1) {
%3 = add i32 %0, -1
%4 = and i32 %3, %1
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;
typedef int /*<<< orphan*/ _PATH_TTY;

/* Variables and functions */
scalar_t__ __ptsname_r(int, char *, int);
int revoke(char *);
int unlockpt(int fd) {
  char buf[sizeof(_PATH_TTY) + 2];
  if (__ptsname_r(fd, buf, sizeof(buf)))
    return -1;
  return revoke(buf);
}


x86 assembly (clang, -O0):
<unlockpt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0xe(%rbp),%rsi
mov    $0x6,%edx
call   1030 <__ptsname_r@plt>
cmp    $0x0,%rax
je     1152 <unlockpt+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    115e <unlockpt+0x3e>
lea    -0xe(%rbp),%rdi
call   1040 <revoke@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlockpt>:
push   %rax
lea    0x2(%rsp),%rsi
mov    $0x6,%edx
call   1030 <__ptsname_r@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
je     113f <unlockpt+0x1f>
pop    %rcx
ret
lea    0x2(%rsp),%rdi
call   1040 <revoke@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @unlockpt(i32 %0) {
%2 = alloca [6 x i8]
%3 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%4 = call i64 @__ptsname_r(i32 %0, i8* %3, i32 6)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @revoke(i8* %3)
br label %8
8: ; preds = %1, %6
%9 = phi i32 [ %7, %6 ], [ -1, %1 ]
ret i32 %9
}
/* Variables and functions */
int get_word();
int /*<<< orphan*/ put_char(char);
int /*<<< orphan*/ put_word(unsigned int);
unsigned target_read_word(unsigned addr) {
  put_char('r');
  put_word(addr);
  return get_word();
}


x86 assembly (clang, -O0):
<target_read_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x72,%edi
call   1030 <put_char@plt>
mov    -0x4(%rbp),%edi
call   1050 <put_word@plt>
mov    $0x0,%al
call   1040 <get_word@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<target_read_word>:
push   %rbx
mov    %edi,%ebx
mov    $0x72,%edi
call   1030 <put_char@plt>
mov    %ebx,%edi
call   1050 <put_word@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <get_word@plt>

LLVM IR (-O0):
define i32 @target_read_word(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @put_char(i8 signext 114)
%4 = load i32, i32* %2
%5 = call i32 @put_word(i32 %4)
%6 = call i32 (...) @get_word()
ret i32 %6
}

LLVM IR (-O2):
define i32 @target_read_word(i32 %0) {
%2 = tail call i32 @put_char(i8 signext 114)
%3 = tail call i32 @put_word(i32 %0)
%4 = tail call i32 (...) @get_word()
ret i32 %4
}
/* Type definitions */
typedef int evutil_socket_t;

/* Variables and functions */
short EV_TIMEOUT;
int /*<<< orphan*/ assert(int);
void timeout_handler(evutil_socket_t tid, short what, void *arg) {
  assert(-1 == tid);
  assert(what == EV_TIMEOUT);
}


x86 assembly (clang, -O0):
<timeout_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    %rdx,-0x10(%rbp)
mov    $0xffffffff,%eax
cmp    -0x4(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movswl -0x6(%rbp),%eax
mov    0x2e9a(%rip),%rcx
movswl (%rcx),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timeout_handler>:
push   %rbx
mov    %esi,%ebx
xor    %eax,%eax
cmp    $0xffffffff,%edi
sete   %al
mov    %eax,%edi
call   1030 <assert@plt>
mov    0x2eb7(%rip),%rax
xor    %edi,%edi
cmp    %bx,(%rax)
sete   %dil
pop    %rbx
jmp    1030 <assert@plt>

LLVM IR (-O0):
@EV_TIMEOUT = global i16 0
define void @timeout_handler(i32 %0, i16 signext %1, i8* %2) {
%4 = alloca i32
%5 = alloca i16
%6 = alloca i8*
store i32 %0, i32* %4
store i16 %1, i16* %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = icmp eq i32 -1, %7
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i16, i16* %5
%12 = sext i16 %11 to i32
%13 = load i16, i16* @EV_TIMEOUT
%14 = sext i16 %13 to i32
%15 = icmp eq i32 %12, %14
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
ret void
}

LLVM IR (-O2):
@EV_TIMEOUT = global i16 0
define void @timeout_handler(i32 %0, i16 signext %1, i8* nocapture readnone %2) {
%4 = icmp eq i32 %0, -1
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = load i16, i16* @EV_TIMEOUT
%8 = icmp eq i16 %7, %1
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
openpl() { printf("openpl()\n"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"openpl()\0A\00"
define i32 @openpl() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

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