xunge/DecIR huggingface dataset:
/* Type definitions */
struct sigaction {
  int /*<<< orphan*/ sa_handler;
};

/* Variables and functions */
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ SIG_DFL;
int /*<<< orphan*/ sigaction(int /*<<< orphan*/, struct sigaction *,
                             int /*<<< orphan*/ *);
bool restore_signals() {
  struct sigaction sigint_handler;
  sigint_handler.sa_handler = SIG_DFL;
  sigaction(SIGINT, &sigint_handler, NULL);
  return true;
}


x86 assembly (clang, -O0):
<restore_signals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigaction@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<restore_signals>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rsp)
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
xor    %edx,%edx
call   1030 <sigaction@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.sigaction = type { i32 }
@SIG_DFL = global i32 0
@SIGINT = global i32 0
define i32 @restore_signals() {
%1 = alloca %struct.sigaction
%2 = load i32, i32* @SIG_DFL
%3 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i32 0, i32 0
store i32 %2, i32* %3
%4 = load i32, i32* @SIGINT
%5 = call i32 @sigaction(i32 %4, %struct.sigaction* %1, i32* null)
ret i32 1
}

LLVM IR (-O2):
%struct.sigaction = type { i32 }
@SIG_DFL = global i32 0
@SIGINT = global i32 0
define i32 @restore_signals() {
%1 = alloca %struct.sigaction
%2 = bitcast %struct.sigaction* %1 to i8*
%3 = load i32, i32* @SIG_DFL
%4 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i64 0, i32 0
store i32 %3, i32* %4
%5 = load i32, i32* @SIGINT
%6 = call i32 @sigaction(i32 %5, %struct.sigaction* %1, i32* null)
ret i32 1
}
/* Variables and functions */
float lgammaf(float);
float futrts_lgamma32(float x) { return lgammaf(x); }


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

x86 assembly (clang, -O2):
<futrts_lgamma32>:
jmp    1030 <lgammaf@plt>

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

LLVM IR (-O2):
define float @futrts_lgamma32(float %0) {
%2 = tail call float @lgammaf(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char *, int);
void ACUTE_assert_print(int line, unsigned char *exception) {
  printf("%s at line %d\n", exception, line);
}


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

x86 assembly (clang, -O2):
<ACUTE_assert_print>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"%s at line %d\0A\00"
define void @ACUTE_assert_print(i32 %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %0)
ret void
}
/* Variables and functions */
void VIDDummyVdp2DrawEnd(void) {}


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

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

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

LLVM IR (-O2):
define void @VIDDummyVdp2DrawEnd() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ fork();
int /*<<< orphan*/ sleep(int);
void *foo1(void *a) {
  pid_t p = fork();
  sleep(1);
  return 0;
}


x86 assembly (clang, -O0):
<foo1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <fork@plt>
mov    %eax,-0xc(%rbp)
mov    $0x1,%edi
call   1030 <sleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @foo1(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = call i32 (...) @fork()
store i32 %4, i32* %3
%5 = call i32 @sleep(i32 1)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @foo1(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @fork()
%3 = tail call i32 @sleep(i32 1)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x0e() {
  Assert_real((isbdigit(14) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              75, ("isbdigit should be 0 for 0x0e"));
}


x86 assembly (clang, -O0):
<t_isbdigit_0x0e>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe,%edi
call   1040 <isbdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x4b,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isbdigit_0x0e>:
push   %rax
mov    $0xe,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x4b,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x0e\00"
define void @t_isbdigit_0x0e() {
%1 = call i64 @isbdigit(i32 14)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 75, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x0e\00"
define void @t_isbdigit_0x0e() {
%1 = tail call i64 @isbdigit(i32 14)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 75, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int bst_comp_int(void *data1, void *data2) {
  return *((int *)data1) - *((int *)data2);
}


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

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

LLVM IR (-O0):
define i32 @bst_comp_int(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @bst_comp_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
void finalize_dist_(const unsigned int *id) { return; }


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

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

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

LLVM IR (-O2):
define void @finalize_dist_(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __get_order(unsigned long);
int /*<<< orphan*/ free_pages(unsigned long, int /*<<< orphan*/);
void dma_mem_free(unsigned long addr, unsigned long size) {
  free_pages(addr, __get_order(size));
}


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

x86 assembly (clang, -O2):
<dma_mem_free>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <__get_order@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <free_pages@plt>

LLVM IR (-O0):
define void @dma_mem_free(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = call i32 @__get_order(i64 %6)
%8 = call i32 @free_pages(i64 %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @dma_mem_free(i64 %0, i64 %1) {
%3 = tail call i32 @__get_order(i64 %1)
%4 = tail call i32 @free_pages(i64 %0, i32 %3)
ret void
}
int test_imm_78int8_mem(signed char *val) {
  return ((*val) & (-0x78 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_78int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -120
%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_78int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -120
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int foo(int bar) { return 42 + 1844; }


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

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

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
ret i32 1886
}
/* Variables and functions */
int abs(int);
int fMax1(int a, int b) { return ((a + b) + abs(a - b)) / 2; }


x86 assembly (clang, -O0):
<fMax1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
sub    -0x8(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fMax1>:
lea    (%rsi,%rdi,1),%eax
sub    %esi,%edi
mov    %edi,%ecx
neg    %ecx
cmovs  %edi,%ecx
add    %eax,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
ret

LLVM IR (-O0):
define i32 @fMax1(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 = add nsw i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 %8, %9
%11 = call i32 @abs(i32 %10)
%12 = add nsw i32 %7, %11
%13 = sdiv i32 %12, 2
ret i32 %13
}

LLVM IR (-O2):
define i32 @fMax1(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = sub nsw i32 %0, %1
%5 = tail call i32 @llvm.abs.i32(i32 %4, i1 true)
%6 = add nsw i32 %3, %5
%7 = sdiv i32 %6, 2
ret i32 %7
}
int security_quota_on(struct file *file) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.file = type opaque
define i32 @security_quota_on(%struct.file* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Msp430GpioC__11__GeneralIO__clr();
void OneWireMasterC__Pin__clr(void) { Msp430GpioC__11__GeneralIO__clr(); }


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

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

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

LLVM IR (-O2):
define void @OneWireMasterC__Pin__clr() {
%1 = tail call i32 (...) @Msp430GpioC__11__GeneralIO__clr()
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
char *strrchr(char *, char);
int str_as_status(char *buff) {
  int status = 1;
  char *s = strrchr(buff, ' ') + 1;
  if (strcmp(s, "YES"))
    status = 0;
  return status;
}


x86 assembly (clang, -O0):
<str_as_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x20,%esi
call   1030 <strrchr@plt>
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xeac(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     116a <str_as_status+0x4a>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_as_status>:
push   %rax
mov    $0x20,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rdi
lea    0xeca(%rip),%rsi
call   1040 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"YES\00"
define i32 @str_as_status(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 32)
%3 = getelementptr inbounds i8, i8* %2, i64 1
%4 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
void glGetUniformIndices(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glGetUniformIndices() {
ret void
}
void d2i_DIST_POINT(void) {}


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

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

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

LLVM IR (-O2):
define void @d2i_DIST_POINT() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ pthread_exit(void *);
int /*<<< orphan*/ sleep(int);
void *thr_fn2(void *arg) {
  printf("thread 2 will sleep %d ms\n", (8));
  sleep((8));
  printf("thread 2 wake up \n");
  printf("thread 2 exiting\n");
  pthread_exit((void *)2);
}


x86 assembly (clang, -O0):
<thr_fn2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xebd(%rip),%rdi
mov    $0x8,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x8,%edi
call   1050 <sleep@plt>
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thr_fn2>:
push   %rax
lea    0xeb8(%rip),%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x8,%edi
call   1060 <sleep@plt>
lea    0xeb6(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%edi
pop    %rax
jmp    1050 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"thread 2 will sleep %d ms\0A\00"
@.str.1 = [19 x i8] c"thread 2 wake up \0A\00"
@.str.2 = [18 x i8] c"thread 2 exiting\0A\00"
define i8* @thr_fn2(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 8)
%5 = call i32 @sleep(i32 8)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @pthread_exit(i8* inttoptr (i64 2 to i8*))
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [27 x i8] c"thread 2 will sleep %d ms\0A\00"
@str = [18 x i8] c"thread 2 wake up \00"
@str.3 = [17 x i8] c"thread 2 exiting\00"
define noalias i8* @thr_fn2(i8* nocapture readnone %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 8)
%3 = tail call i32 @sleep(i32 8)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.3, i64 0, i64 0))
%6 = tail call i32 @pthread_exit(i8* inttoptr (i64 2 to i8*))
ret i8* undef
}
int bazMapPtr(struct map *m) { return 500; }


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

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

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

LLVM IR (-O2):
%struct.map = type opaque
define i32 @bazMapPtr(%struct.map* nocapture readnone %0) {
ret i32 500
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;
typedef int /*<<< orphan*/ dev_t;

/* Variables and functions */
int _xmknod(int version, const char *path, mode_t mode, dev_t dev) {
  return (0);
}


x86 assembly (clang, -O0):
<_xmknod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @_xmknod(i32 %0, i8* nocapture readnone %1, i32 %2, i32 %3) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pretty_print_dst();
int display_coff_symbols() {
  pretty_print_dst();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @display_coff_symbols() {
%1 = call i32 (...) @pretty_print_dst()
ret i32 0
}

LLVM IR (-O2):
define i32 @display_coff_symbols() {
%1 = tail call i32 (...) @pretty_print_dst()
ret i32 0
}
/* Type definitions */
struct timeval {
  unsigned long tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
unsigned long seconds_elapsed(void *arg) {
  struct timeval t1, *t0 = arg;
  unsigned long seconds;
  gettimeofday(&t1, 0);
  seconds = t1.tv_sec - t0->tv_sec;
  if (seconds < 1)
    seconds = 1;
  return seconds;
}


x86 assembly (clang, -O0):
<seconds_elapsed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    (%rcx),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x1,-0x20(%rbp)
jae    1151 <seconds_elapsed+0x41>
movq   $0x1,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seconds_elapsed>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    0x8(%rsp),%rcx
sub    (%rbx),%rcx
mov    $0x1,%eax
cmovne %rcx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i64 }
define i64 @seconds_elapsed(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.timeval
%4 = alloca %struct.timeval*
%5 = alloca i64
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = bitcast i8* %6 to %struct.timeval*
store %struct.timeval* %7, %struct.timeval** %4
%8 = call i32 @gettimeofday(%struct.timeval* %3, i32 0)
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%10 = load i64, i64* %9
%11 = load %struct.timeval*, %struct.timeval** %4
%12 = getelementptr inbounds %struct.timeval, %struct.timeval* %11, i32 0, i32 0
%13 = load i64, i64* %12
%14 = sub i64 %10, %13
store i64 %14, i64* %5
%15 = load i64, i64* %5
%16 = icmp ult i64 %15, 1
br i1 %16, label %17, label %18
17: ; preds = %1
store i64 1, i64* %5
br label %18
18: ; preds = %17, %1
%19 = load i64, i64* %5
ret i64 %19
}

LLVM IR (-O2):
%struct.timeval = type { i64 }
define i64 @seconds_elapsed(i8* nocapture %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = call i32 @gettimeofday(%struct.timeval* %2, i32 0)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
%6 = load i64, i64* %5
%7 = bitcast i8* %0 to i64*
%8 = load i64, i64* %7
%9 = sub i64 %6, %8
%10 = icmp eq i64 %9, 0
%11 = select i1 %10, i64 1, i64 %9
ret i64 %11
}
unsigned short int unsignedshortint_ignoring_shortint(unsigned short int x,
                                                      short int y) {
  return x;
}


x86 assembly (clang, -O0):
<unsignedshortint_ignoring_shortint>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i16 @unsignedshortint_ignoring_shortint(i16 zeroext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
ret i16 %5
}

LLVM IR (-O2):
define zeroext i16 @unsignedshortint_ignoring_shortint(i16 returned zeroext %0, i16 signext %1) {
ret i16 %0
}
int collatz(long n) {
  int c = 0;
  while (n > 1) {
    if (n % 2 == 0)
      n /= 2;
    else
      n = 3 * n + 1;
    ++c;
  }
  return c;
}


x86 assembly (clang, -O0):
<collatz>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x1,-0x8(%rbp)
jle    1164 <collatz+0x64>
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
jne    1149 <collatz+0x49>
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
jmp    1156 <collatz+0x56>
imul   $0x3,-0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <collatz+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<collatz>:
xor    %eax,%eax
cmp    $0x2,%rdi
jl     112c <collatz+0x2c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
mov    %rdi,%rcx
shr    %rcx
test   $0x1,%dil
lea    0x1(%rdi,%rdi,2),%rdi
cmove  %rcx,%rdi
add    $0x1,%eax
cmp    $0x1,%rdi
jg     1110 <collatz+0x10>
ret

LLVM IR (-O0):
define i32 @collatz(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
store i32 0, i32* %3
br label %4
4: ; preds = %18, %1
%5 = load i64, i64* %2
%6 = icmp sgt i64 %5, 1
br i1 %6, label %7, label %21
7: ; preds = %4
%8 = load i64, i64* %2
%9 = srem i64 %8, 2
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i64, i64* %2
%13 = sdiv i64 %12, 2
store i64 %13, i64* %2
br label %18
14: ; preds = %7
%15 = load i64, i64* %2
%16 = mul nsw i64 3, %15
%17 = add nsw i64 %16, 1
store i64 %17, i64* %2
br label %18
18: ; preds = %14, %11
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %4
21: ; preds = %4
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @collatz(i64 %0) {
%2 = icmp sgt i64 %0, 1
br i1 %2, label %3, label %14
3: ; preds = %1, %3
%4 = phi i32 [ %12, %3 ], [ 0, %1 ]
%5 = phi i64 [ %11, %3 ], [ %0, %1 ]
%6 = and i64 %5, 1
%7 = icmp eq i64 %6, 0
%8 = lshr i64 %5, 1
%9 = mul nsw i64 %5, 3
%10 = add nsw i64 %9, 1
%11 = select i1 %7, i64 %8, i64 %10
%12 = add nuw nsw i32 %4, 1
%13 = icmp sgt i64 %11, 1
br i1 %13, label %3, label %14
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %12, %3 ]
ret i32 %15
}
void display_openhpsdr_parm_info(void) {}


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

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

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

LLVM IR (-O2):
define void @display_openhpsdr_parm_info() {
ret void
}
int hexchar(unsigned val) { return "0123456789abcdef"[val & 0xf]; }


x86 assembly (clang, -O0):
<hexchar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
mov    %eax,%eax
mov    %eax,%ecx
lea    0xee8(%rip),%rax
movsbl (%rax,%rcx,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexchar>:
and    $0xf,%edi
lea    0xef6(%rip),%rax
movsbl (%rdi,%rax,1),%eax
ret

LLVM IR (-O0):
@.str = [17 x i8] c"0123456789abcdef\00"
define i32 @hexchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 15
%5 = zext i32 %4 to i64
%6 = getelementptr inbounds [17 x i8], [17 x i8]* @.str, i64 0, i64 %5
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
@.str = [17 x i8] c"0123456789abcdef\00"
define i32 @hexchar(i32 %0) {
%2 = and i32 %0, 15
%3 = zext i32 %2 to i64
%4 = getelementptr inbounds [17 x i8], [17 x i8]* @.str, i64 0, i64 %3
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
ret i32 %6
}
void ARGBToNV21() {}


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

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

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

LLVM IR (-O2):
define void @ARGBToNV21() {
ret void
}
void cbor_null_null_callback(void *_ctx) {}


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

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

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

LLVM IR (-O2):
define void @cbor_null_null_callback(i8* nocapture %0) {
ret void
}
int nn_xrep_ispeer(int socktype) { return socktype == (3 * 16 + 0) ? 1 : 0; }


x86 assembly (clang, -O0):
<nn_xrep_ispeer>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x30,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nn_xrep_ispeer>:
xor    %eax,%eax
cmp    $0x30,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @nn_xrep_ispeer(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 48
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 1, i32 0
ret i32 %6
}

LLVM IR (-O2):
define i32 @nn_xrep_ispeer(i32 %0) {
%2 = icmp eq i32 %0, 48
%3 = zext i1 %2 to i32
ret i32 %3
}
int test_imm_74int32_reg(int val) { return ((val) & (0x74 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_74int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x74,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_74int32_reg>:
test   $0x74,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_74int32_reg(i32 %0) {
%2 = and i32 %0, 116
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void c_usage() {
  printf("client --server-ip <ip address of server> --server-port <port of the "
         "server>\n");
  exit(1);
}


x86 assembly (clang, -O0):
<c_usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<c_usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [78 x i8] c"client --server-ip <ip address of server> --server-port <port of the server>\0A\00"
define void @c_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [77 x i8] c"client --server-ip <ip address of server> --server-port <port of the server>\00"
define void @c_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct termios {
  int /*<<< orphan*/ c_ospeed;
};
typedef int /*<<< orphan*/ speed_t;

/* Variables and functions */
speed_t cfgetospeed(const struct termios *tp) { return tp->c_ospeed; }


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

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

LLVM IR (-O0):
%struct.termios = type { i32 }
define i32 @cfgetospeed(%struct.termios* %0) {
%2 = alloca %struct.termios*
store %struct.termios* %0, %struct.termios** %2
%3 = load %struct.termios*, %struct.termios** %2
%4 = getelementptr inbounds %struct.termios, %struct.termios* %3, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.termios = type { i32 }
define i32 @cfgetospeed(%struct.termios* nocapture %0) {
%2 = getelementptr inbounds %struct.termios, %struct.termios* %0, i64 0, i32 0
%3 = load i32, i32* %2
ret i32 %3
}
int os_delete(const char *filename, int *rc) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @os_delete(i8* nocapture readnone %0, i32* nocapture readnone %1) {
ret i32 -1
}
void test61_PrintImpl_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test61_PrintImpl_targetInit__I() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int /*<<< orphan*/ execvp(char *, void *);
int /*<<< orphan*/ printf(char *, char *);
int mexec(void *arg) {
  printf("Starting %s\n", *(char **)arg);
  execvp(*(char **)arg, arg);
  _exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<mexec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    0xeb6(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x8(%rbp),%rsi
call   1050 <execvp@plt>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<mexec>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rsi
lea    0xec2(%rip),%rdi
call   1040 <printf@plt>
mov    (%rbx),%rdi
mov    %rbx,%rsi
call   1050 <execvp@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Starting %s\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @mexec(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i8**
%5 = load i8*, i8** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %2
%8 = bitcast i8* %7 to i8**
%9 = load i8*, i8** %8
%10 = load i8*, i8** %2
%11 = call i32 @execvp(i8* %9, i8* %10)
%12 = load i32, i32* @EXIT_FAILURE
%13 = call i32 @_exit(i32 %12)
unreachable
}

LLVM IR (-O2):
@.str = [13 x i8] c"Starting %s\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @mexec(i8* %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = tail call i32 @execvp(i8* %5, i8* %0)
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @_exit(i32 %7)
unreachable
}
/* Variables and functions */
void *malloc(int);
extern void *primAllocMemory(int size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<primAllocMemory>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @primAllocMemory(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
ret i8* %2
}
/* Type definitions */
typedef int num;

/* Variables and functions */
int /*<<< orphan*/ heap_max_balance(int *, int, int);
void build_max_heap(int array[], int num) {
  int i;
  for (i = (((num)-1) >> 1); i >= 0; i--) {
    heap_max_balance(array, i, num);
  }
}


x86 assembly (clang, -O0):
<build_max_heap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
sar    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1152 <build_max_heap+0x42>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <heap_max_balance@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    112b <build_max_heap+0x1b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_max_heap>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    1141 <build_max_heap+0x31>
mov    %esi,%ebx
mov    %rdi,%r14
lea    -0x1(%rbx),%ebp
shr    %ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <heap_max_balance@plt>
add    $0xffffffff,%ebp
jb     1130 <build_max_heap+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @build_max_heap(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = sub nsw i32 %6, 1
%8 = ashr i32 %7, 1
store i32 %8, i32* %5
br label %9
9: ; preds = %17, %2
%10 = load i32, i32* %5
%11 = icmp sge i32 %10, 0
br i1 %11, label %12, label %20
12: ; preds = %9
%13 = load i32*, i32** %3
%14 = load i32, i32* %5
%15 = load i32, i32* %4
%16 = call i32 @heap_max_balance(i32* %13, i32 %14, i32 %15)
br label %17
17: ; preds = %12
%18 = load i32, i32* %5
%19 = add nsw i32 %18, -1
store i32 %19, i32* %5
br label %9
20: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @build_max_heap(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = add nsw i32 %1, -1
%6 = lshr i32 %5, 1
br label %7
7: ; preds = %4, %7
%8 = phi i32 [ %10, %7 ], [ %6, %4 ]
%9 = tail call i32 @heap_max_balance(i32* %0, i32 %8, i32 %1)
%10 = add nsw i32 %8, -1
%11 = icmp eq i32 %8, 0
br i1 %11, label %12, label %7
12: ; preds = %7, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ arena_free(int);
int /*<<< orphan*/ free(void *);
void arena_release(int *arena) {
  if (0 != *arena) {
    arena_free(*arena);
    free((void *)*arena);
    *arena = 0;
  }
}


x86 assembly (clang, -O0):
<arena_release>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmp    (%rcx),%eax
je     115b <arena_release+0x3b>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1040 <arena_free@plt>
mov    -0x8(%rbp),%rax
movslq (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arena_release>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
test   %edi,%edi
je     113d <arena_release+0x1d>
call   1040 <arena_free@plt>
movslq (%rbx),%rdi
call   1030 <free@plt>
movl   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @arena_release(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = icmp ne i32 0, %4
br i1 %5, label %6, label %16
6: ; preds = %1
%7 = load i32*, i32** %2
%8 = load i32, i32* %7
%9 = call i32 @arena_free(i32 %8)
%10 = load i32*, i32** %2
%11 = load i32, i32* %10
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i8*
%14 = call i32 @free(i8* %13)
%15 = load i32*, i32** %2
store i32 0, i32* %15
br label %16
16: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
define void @arena_release(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = tail call i32 @arena_free(i32 %2)
%6 = load i32, i32* %0
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i8*
%9 = tail call i32 @free(i8* %8)
store i32 0, i32* %0
br label %10
10: ; preds = %4, %1
ret void
}
/* Variables and functions */
double floor(double);
double intdiv(double a, double b) { return floor(a / b); }


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

x86 assembly (clang, -O2):
<intdiv>:
divsd  %xmm1,%xmm0
jmp    1030 <floor@plt>

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

LLVM IR (-O2):
define double @intdiv(double %0, double %1) {
%3 = fdiv double %0, %1
%4 = tail call double @llvm.floor.f64(double %3)
ret double %4
}
main() { char x = 65536; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
scalar_t__ malloc(int);
extern long *make_ptr() {
  long *ptr = (long *)malloc(sizeof(long));
  *ptr = 32;
  return ptr;
}


x86 assembly (clang, -O0):
<make_ptr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x20,(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_ptr>:
push   %rax
mov    $0x8,%edi
call   1030 <malloc@plt>
movq   $0x20,(%rax)
pop    %rcx
ret

LLVM IR (-O0):
define i64* @make_ptr() {
%1 = alloca i64*
%2 = call i64 @malloc(i32 8)
%3 = inttoptr i64 %2 to i64*
store i64* %3, i64** %1
%4 = load i64*, i64** %1
store i64 32, i64* %4
%5 = load i64*, i64** %1
ret i64* %5
}

LLVM IR (-O2):
define i64* @make_ptr() {
%1 = tail call i64 @malloc(i32 8)
%2 = inttoptr i64 %1 to i64*
store i64 32, i64* %2
ret i64* %2
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
void input_N(int *N_array) { scanf("%d", N_array); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @input_N(i32* %0) {
%2 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %0)
ret void
}
char rotate_char(char c, int amount) { return 'a' + (c - 'a' + amount) % 26; }


x86 assembly (clang, -O0):
<rotate_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x61,%eax
add    -0x8(%rbp),%eax
mov    $0x1a,%ecx
cltd
idiv   %ecx
add    $0x61,%edx
mov    %dl,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotate_char>:
lea    (%rdi,%rsi,1),%eax
add    $0xffffff9f,%eax
cltq
imul   $0x4ec4ec4f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x23,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%edx
lea    (%rdx,%rdx,4),%edx
add    %ecx,%edx
sub    %edx,%eax
add    $0x61,%al
ret

LLVM IR (-O0):
define signext i8 @rotate_char(i8 signext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %6, 97
%8 = load i32, i32* %4
%9 = add nsw i32 %7, %8
%10 = srem i32 %9, 26
%11 = add nsw i32 97, %10
%12 = trunc i32 %11 to i8
ret i8 %12
}

LLVM IR (-O2):
define signext i8 @rotate_char(i8 signext %0, i32 %1) {
%3 = sext i8 %0 to i32
%4 = add nsw i32 %3, -97
%5 = add nsw i32 %4, %1
%6 = srem i32 %5, 26
%7 = trunc i32 %6 to i8
%8 = add nsw i8 %7, 97
ret i8 %8
}
/* Variables and functions */
char *strcpy(char *restrict dest, const char *restrict src) {
  size_t i = 0;
  while (src[i] != '\0') {
    dest[i] = src[i];
    ++i;
  }
  dest[i] = '\0';
  return dest;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1150 <strcpy+0x50>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <strcpy+0x14>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%dl
xor    %ecx,%ecx
test   %dl,%dl
je     1120 <strcpy+0x20>
nopl   0x0(%rax,%rax,1)
mov    %dl,(%rax,%rcx,1)
movzbl 0x1(%rsi,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
movb   $0x0,(%rax,%rcx,1)
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* noalias returned writeonly %0, i8* noalias nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i64 [ %9, %5 ], [ 0, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %6, i8* %8
%9 = add i64 %7, 1
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i64 [ 0, %2 ], [ %9, %5 ]
%15 = getelementptr inbounds i8, i8* %0, i64 %14
store i8 0, i8* %15
ret i8* %0
}
int Q_isupper(int c) {
  if (c >= 'A' && c <= 'Z') {
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<Q_isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jl     1127 <Q_isupper+0x27>
cmpl   $0x5a,-0x8(%rbp)
jg     1127 <Q_isupper+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <Q_isupper+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_isupper>:
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @Q_isupper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 90
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @Q_isupper(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
int pm_trace_is_enabled(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pm_trace_is_enabled() {
ret i32 0
}