xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int);
char *int2str(void *pval1) {
  int v1 = (uintptr_t)pval1;
  static char buf[10];
  snprintf(buf, sizeof(buf), "%d", v1);
  return buf;
}


x86 assembly (clang, -O0):
<int2str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
lea    0x2efc(%rip),%rdi
mov    $0xa,%esi
lea    0xec7(%rip),%rdx
call   1030 <snprintf@plt>
lea    0x2ee4(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int2str>:
push   %rbx
mov    %rdi,%rcx
lea    0x2f0e(%rip),%rbx
lea    0xede(%rip),%rdx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@int2str.buf = internal global [10 x i8] zeroinitializer
@.str = [3 x i8] c"%d\00"
define i8* @int2str(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i64
%6 = trunc i64 %5 to i32
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @snprintf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @int2str.buf, i64 0, i64 0), i32 10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @int2str.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@int2str.buf = internal global [10 x i8] zeroinitializer
@.str = [3 x i8] c"%d\00"
define i8* @int2str(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 @snprintf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @int2str.buf, i64 0, i64 0), i32 10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @int2str.buf, i64 0, i64 0)
}
void avformat_version() {}


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

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

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

LLVM IR (-O2):
define void @avformat_version() {
ret void
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ select(int /*<<< orphan*/, int /*<<< orphan*/ *,
                          int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                          struct timeval *);
void sleep_ms(int ms) {
  struct timeval tv;
  tv.tv_sec = ms / 1000;
  tv.tv_usec = (ms % 1000) * 1000;
  select(0, NULL, NULL, NULL, &tv);
}


x86 assembly (clang, -O0):
<sleep_ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
imul   $0x3e8,%edx,%eax
mov    %eax,-0xc(%rbp)
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x10(%rbp),%r8
mov    %rcx,%rsi
mov    %rcx,%rdx
call   1030 <select@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleep_ms>:
push   %rax
movslq %edi,%rax
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
mov    %ecx,(%rsp)
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
imul   $0x3e8,%eax,%eax
mov    %eax,0x4(%rsp)
mov    %rsp,%r8
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <select@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define void @sleep_ms(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timeval
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sdiv i32 %4, 1000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
store i32 %5, i32* %6
%7 = load i32, i32* %2
%8 = srem i32 %7, 1000
%9 = mul nsw i32 %8, 1000
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
store i32 %9, i32* %10
%11 = call i32 @select(i32 0, i32* null, i32* null, i32* null, %struct.timeval* %3)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define void @sleep_ms(i32 %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = sdiv i32 %0, 1000
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
store i32 %4, i32* %5
%6 = srem i32 %0, 1000
%7 = mul nsw i32 %6, 1000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
store i32 %7, i32* %8
%9 = call i32 @select(i32 0, i32* null, i32* null, i32* null, %struct.timeval* %2)
ret void
}
void sys_findfile_ex() { ; }


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

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

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

LLVM IR (-O2):
define void @sys_findfile_ex() {
ret void
}
/* Variables and functions */
int nonagon(int);
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num;
  scanf("%d", &num);
  printf("The Nonagonal Number at position %d is: %d", num, nonagon(num));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee9(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <nonagon@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xeec(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%ebx
mov    %ebx,%edi
call   1040 <nonagon@plt>
lea    0xea8(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [43 x i8] c"The Nonagonal Number at position %d is: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%3 = load i32, i32* %1
%4 = load i32, i32* %1
%5 = call i32 @nonagon(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i32 %3, i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [43 x i8] c"The Nonagonal Number at position %d is: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @nonagon(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i32 %4, i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ kkill();
void sys_exit(int code) { kkill(); }


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

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

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

LLVM IR (-O2):
define void @sys_exit(i32 %0) {
%2 = tail call i32 (...) @kkill()
ret void
}
void init_pf_circ_fold(int length) {}


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

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

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

LLVM IR (-O2):
define void @init_pf_circ_fold(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ chSysLock();
int /*<<< orphan*/ port_get_irq_status();
scalar_t__ port_irq_enabled(int /*<<< orphan*/);
void chSysUnconditionalLock(void) {
  if (port_irq_enabled(port_get_irq_status())) {
    chSysLock();
  }
}


x86 assembly (clang, -O0):
<chSysUnconditionalLock>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <port_get_irq_status@plt>
mov    %eax,%edi
call   1050 <port_irq_enabled@plt>
cmp    $0x0,%rax
je     1153 <chSysUnconditionalLock+0x23>
mov    $0x0,%al
call   1040 <chSysLock@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<chSysUnconditionalLock>:
push   %rax
xor    %eax,%eax
call   1030 <port_get_irq_status@plt>
mov    %eax,%edi
call   1050 <port_irq_enabled@plt>
test   %rax,%rax
je     114c <chSysUnconditionalLock+0x1c>
xor    %eax,%eax
pop    %rcx
jmp    1040 <chSysLock@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @chSysUnconditionalLock() {
%1 = call i32 (...) @port_get_irq_status()
%2 = call i64 @port_irq_enabled(i32 %1)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @chSysLock()
br label %6
6: ; preds = %4, %0
ret void
}

LLVM IR (-O2):
define void @chSysUnconditionalLock() {
%1 = tail call i32 (...) @port_get_irq_status()
%2 = tail call i64 @port_irq_enabled(i32 %1)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 (...) @chSysLock()
br label %6
6: ; preds = %4, %0
ret void
}
char sum1(char i) { return i++; }


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

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

LLVM IR (-O0):
define signext i8 @sum1(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = add i8 %3, 1
store i8 %4, i8* %2
ret i8 %3
}

LLVM IR (-O2):
define signext i8 @sum1(i8 returned signext %0) {
ret i8 %0
}
/* Variables and functions */
int /*<<< orphan*/ f1();
int main() {
  f1();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f1()
ret i32 0
}
/* Type definitions */
struct ibv_device {
  int dummy;
};
struct ibv_context {
  int dummy;
};

/* Variables and functions */
struct ibv_context *ibv_open_device(struct ibv_device *);
struct ibv_context *mlx4_glue_open_device(struct ibv_device *device) {
  return ibv_open_device(device);
}


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

x86 assembly (clang, -O2):
<mlx4_glue_open_device>:
jmp    1030 <ibv_open_device@plt>

LLVM IR (-O0):
%struct.ibv_context = type { i32 }
%struct.ibv_device = type { i32 }
define %struct.ibv_context* @mlx4_glue_open_device(%struct.ibv_device* %0) {
%2 = alloca %struct.ibv_device*
store %struct.ibv_device* %0, %struct.ibv_device** %2
%3 = load %struct.ibv_device*, %struct.ibv_device** %2
%4 = call %struct.ibv_context* @ibv_open_device(%struct.ibv_device* %3)
ret %struct.ibv_context* %4
}

LLVM IR (-O2):
%struct.ibv_context = type { i32 }
%struct.ibv_device = type { i32 }
define %struct.ibv_context* @mlx4_glue_open_device(%struct.ibv_device* %0) {
%2 = tail call %struct.ibv_context* @ibv_open_device(%struct.ibv_device* %0)
ret %struct.ibv_context* %2
}
signed short int signedshortint_ignoring_signedshort(signed short int x,
                                                     signed short y) {
  return x;
}


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

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

LLVM IR (-O0):
define signext i16 @signedshortint_ignoring_signedshort(i16 signext %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 signext i16 @signedshortint_ignoring_signedshort(i16 returned signext %0, i16 signext %1) {
ret i16 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 1;
  printf("%d", a);
  return 0;
}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @XtAddSignal() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_batch_context_create() {
  fprintf(stderr, "Should never reach here");
  abort();
}


x86 assembly (clang, -O0):
<grpcsharp_batch_context_create>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<grpcsharp_batch_context_create>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_batch_context_create() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_batch_context_create() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ checkTainted(char **);
int /*<<< orphan*/ checkUntainted(char **);
void test(char *def) {
  checkTainted(&def);
  checkUntainted(&def);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <checkTainted@plt>
lea    -0x8(%rbp),%rdi
call   1030 <checkUntainted@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,0x8(%rsp)
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <checkTainted@plt>
mov    %rbx,%rdi
call   1030 <checkUntainted@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @test(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @checkTainted(i8** %2)
%4 = call i32 @checkUntainted(i8** %2)
ret void
}

LLVM IR (-O2):
define void @test(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @checkTainted(i8** %2)
%4 = call i32 @checkUntainted(i8** %2)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t HibernateIsActive(void) {
  return ((*((volatile unsigned long *)(0x400FC010))) & 0x00000040 ? 1 : 0);
}


x86 assembly (clang, -O0):
<HibernateIsActive>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fc010,%eax
mov    (%rax),%rdx
and    $0x40,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateIsActive>:
mov    0x400fc010,%rax
40
shr    $0x6,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @HibernateIsActive() {
%1 = load volatile i64, i64* inttoptr (i64 1074774032 to i64*)
%2 = and i64 %1, 64
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 1, i32 0
ret i32 %5
}

LLVM IR (-O2):
define i32 @HibernateIsActive() {
%1 = load volatile i64, i64* inttoptr (i64 1074774032 to i64*)
%2 = trunc i64 %1 to i32
%3 = lshr i32 %2, 6
%4 = and i32 %3, 1
ret i32 %4
}
/* Variables and functions */
int do_write_enable(int);
int flash_write_enable(int fd) { return do_write_enable(fd); }


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

x86 assembly (clang, -O2):
<flash_write_enable>:
jmp    1030 <do_write_enable@plt>

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

LLVM IR (-O2):
define i32 @flash_write_enable(i32 %0) {
%2 = tail call i32 @do_write_enable(i32 %0)
ret i32 %2
}
int HelpItem53(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem53() {
ret i32 0
}
int compare(a, b)
char **a, **b;
{ return (wordcomp(*a, *b)); }


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

x86 assembly (clang, -O2):
<compare>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
xor    %eax,%eax
jmp    1030 <wordcomp@plt>

LLVM IR (-O0):
define i32 @compare(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** %5
%7 = load i8**, i8*** %4
%8 = load i8*, i8** %7
%9 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @wordcomp to i32 (i8*, i8*, ...)*)(i8* %6, i8* %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @compare(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
%5 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @wordcomp to i32 (i8*, i8*, ...)*)(i8* %3, i8* %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
long double __ieee754_log2l(long double x) {
  fputs("__ieee754_log2l not implemented\n", stderr);
  __set_errno(ENOSYS);
  return 0.0;
}


x86 assembly (clang, -O0):
<__ieee754_log2l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    0x2ea3(%rip),%rax
mov    (%rax),%esi
lea    0xec2(%rip),%rdi
call   1040 <fputs@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
fldz
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ieee754_log2l>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1040 <fputs@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
fldz
pop    %rax
ret

LLVM IR (-O0):
@.str = [33 x i8] c"__ieee754_log2l not implemented\0A\00"
@stderr = global i32 0
@ENOSYS = global i32 0
define x86_fp80 @__ieee754_log2l(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fputs(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @ENOSYS
%6 = call i32 @__set_errno(i32 %5)
ret x86_fp80 0xK00000000000000000000
}

LLVM IR (-O2):
@.str = [33 x i8] c"__ieee754_log2l not implemented\0A\00"
@stderr = global i32 0
@ENOSYS = global i32 0
define x86_fp80 @__ieee754_log2l(x86_fp80 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fputs(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @ENOSYS
%5 = tail call i32 @__set_errno(i32 %4)
ret x86_fp80 0xK00000000000000000000
}
void csv_disp_sum(struct list *lst, double stot, double utot, double ftot,
                  double ifitot, double ifatot) {}


x86 assembly (clang, -O0):
<csv_disp_sum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  %xmm4,-0x30(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.list = type opaque
define void @csv_disp_sum(%struct.list* %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca %struct.list*
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store %struct.list* %0, %struct.list** %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
ret void
}

LLVM IR (-O2):
%struct.list = type opaque
define void @csv_disp_sum(%struct.list* nocapture %0, double %1, double %2, double %3, double %4, double %5) {
ret void
}
/* Variables and functions */
int RAND_MAX;
int rand();
int random_level(int max_level) {
  int level = 1;
  while (rand() < RAND_MAX / 2 && level < max_level) {
    level++;
  }
  return level;
}


x86 assembly (clang, -O0):
<random_level>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,%ecx
mov    0x2eb6(%rip),%rax
mov    (%rax),%eax
mov    $0x2,%esi
cltd
idiv   %esi
mov    %eax,%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x9(%rbp)
jge    1157 <random_level+0x47>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
setl   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1167 <random_level+0x57>
jmp    1175 <random_level+0x65>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <random_level+0x12>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_level>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
mov    0x2ecb(%rip),%r14
xor    %ebp,%ebp
nop
add    $0x1,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
mov    (%r14),%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
add    %ecx,%edx
sar    %edx
cmp    %edx,%eax
jge    113e <random_level+0x2e>
cmp    %ebx,%ebp
jl     1120 <random_level+0x10>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@RAND_MAX = global i32 0
define i32 @random_level(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
br label %4
4: ; preds = %15, %1
%5 = call i32 (...) @rand()
%6 = load i32, i32* @RAND_MAX
%7 = sdiv i32 %6, 2
%8 = icmp slt i32 %5, %7
br i1 %8, label %9, label %13
9: ; preds = %4
%10 = load i32, i32* %3
%11 = load i32, i32* %2
%12 = icmp slt i32 %10, %11
br label %13
13: ; preds = %9, %4
%14 = phi i1 [ false, %4 ], [ %12, %9 ]
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %4
18: ; preds = %13
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@RAND_MAX = global i32 0
define i32 @random_level(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 1, %1 ], [ %10, %2 ]
%4 = tail call i32 (...) @rand()
%5 = load i32, i32* @RAND_MAX
%6 = sdiv i32 %5, 2
%7 = icmp slt i32 %4, %6
%8 = icmp slt i32 %3, %0
%9 = select i1 %7, i1 %8, i1 false
%10 = add nuw nsw i32 %3, 1
br i1 %9, label %2, label %11
11: ; preds = %2
ret i32 %3
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ fork();
int /*<<< orphan*/ setsid();
int /*<<< orphan*/ umask(int /*<<< orphan*/);
void run_as_daemon(void) {
  pid_t pid;
  umask(0);
  pid = fork();
  if (pid != 0)
    exit(0);
  setsid();
}


x86 assembly (clang, -O0):
<run_as_daemon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1040 <umask@plt>
mov    $0x0,%al
call   1060 <fork@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     116c <run_as_daemon+0x2c>
xor    %edi,%edi
call   1050 <exit@plt>
mov    $0x0,%al
call   1030 <setsid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_as_daemon>:
push   %rax
xor    %edi,%edi
call   1040 <umask@plt>
xor    %eax,%eax
call   1060 <fork@plt>
test   %rax,%rax
jne    115c <run_as_daemon+0x1c>
xor    %eax,%eax
pop    %rcx
jmp    1030 <setsid@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define void @run_as_daemon() {
%1 = alloca i64
%2 = call i32 @umask(i32 0)
%3 = call i64 (...) @fork()
store i64 %3, i64* %1
%4 = load i64, i64* %1
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @exit(i32 0)
unreachable
8: ; preds = %0
%9 = call i32 (...) @setsid()
ret void
}

LLVM IR (-O2):
define void @run_as_daemon() {
%1 = tail call i32 @umask(i32 0)
%2 = tail call i64 (...) @fork()
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @exit(i32 0)
unreachable
6: ; preds = %0
%7 = tail call i32 (...) @setsid()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  int count;
  count = 2;
  count = 8;
  int x = count;
  printf("count is %d and x is %d\n", count, x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2,-0x4(%rbp)
movl   $0x8,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [25 x i8] c"count is %d and x is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 2, i32* %1
store i32 8, i32* %1
%3 = load i32, i32* %1
store i32 %3, i32* %2
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"count is %d and x is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 8, i32 8)
ret i32 0
}
/* Type definitions */
struct hdr_histogram {
  int dummy;
};
typedef scalar_t__ int64_t;

/* Variables and functions */
scalar_t__ lowest_equivalent_value(struct hdr_histogram *, scalar_t__);
int size_of_equivalent_value_range(struct hdr_histogram *, scalar_t__);
int64_t median_equivalent_value(struct hdr_histogram *h, int64_t value) {
  return lowest_equivalent_value(h, value) +
         (size_of_equivalent_value_range(h, value) >> 1);
}


x86 assembly (clang, -O0):
<median_equivalent_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <lowest_equivalent_value@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <size_of_equivalent_value_range@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
sar    $0x1,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<median_equivalent_value>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <lowest_equivalent_value@plt>
mov    %rax,%r15
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <size_of_equivalent_value_range@plt>
sar    %eax
cltq
add    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.hdr_histogram = type { i32 }
define i64 @median_equivalent_value(%struct.hdr_histogram* %0, i64 %1) {
%3 = alloca %struct.hdr_histogram*
%4 = alloca i64
store %struct.hdr_histogram* %0, %struct.hdr_histogram** %3
store i64 %1, i64* %4
%5 = load %struct.hdr_histogram*, %struct.hdr_histogram** %3
%6 = load i64, i64* %4
%7 = call i64 @lowest_equivalent_value(%struct.hdr_histogram* %5, i64 %6)
%8 = load %struct.hdr_histogram*, %struct.hdr_histogram** %3
%9 = load i64, i64* %4
%10 = call i32 @size_of_equivalent_value_range(%struct.hdr_histogram* %8, i64 %9)
%11 = ashr i32 %10, 1
%12 = sext i32 %11 to i64
%13 = add nsw i64 %7, %12
ret i64 %13
}

LLVM IR (-O2):
%struct.hdr_histogram = type { i32 }
define i64 @median_equivalent_value(%struct.hdr_histogram* %0, i64 %1) {
%3 = tail call i64 @lowest_equivalent_value(%struct.hdr_histogram* %0, i64 %1)
%4 = tail call i32 @size_of_equivalent_value_range(%struct.hdr_histogram* %0, i64 %1)
%5 = ashr i32 %4, 1
%6 = sext i32 %5 to i64
%7 = add nsw i64 %3, %6
ret i64 %7
}
gcd(int x, int y) {
  if (x == y) {
    return x;
  } else if (x < y) {
    return gcd(x, y - x);
  } else {
    return gcd(x - y, y);
  }
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1135 <gcd+0x25>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1168 <gcd+0x58>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1157 <gcd+0x47>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    -0x8(%rbp),%esi
call   1030 <gcd@plt>
mov    %eax,-0x4(%rbp)
jmp    1168 <gcd+0x58>
mov    -0x8(%rbp),%edi
sub    -0xc(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <gcd@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
cmp    %esi,%edi
jne    1107 <gcd+0x7>
mov    %edi,%eax
ret
mov    %esi,%eax
mov    %eax,%ecx
nopl   0x0(%rax,%rax,1)
sub    %edi,%ecx
jle    1120 <gcd+0x20>
mov    %ecx,%eax
cmp    %ecx,%edi
jne    1110 <gcd+0x10>
jmp    1104 <gcd+0x4>
nopl   0x0(%rax)
sub    %eax,%edi
cmp    %edi,%eax
jne    1109 <gcd+0x9>
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
br i1 %3, label %16, label %4
4: ; preds = %2, %13
%5 = phi i32 [ %8, %13 ], [ %1, %2 ]
%6 = phi i32 [ %14, %13 ], [ %0, %2 ]
br label %7
7: ; preds = %4, %10
%8 = phi i32 [ %5, %4 ], [ %11, %10 ]
%9 = icmp sgt i32 %8, %6
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = sub nsw i32 %8, %6
%12 = icmp eq i32 %6, %11
br i1 %12, label %16, label %7
13: ; preds = %7
%14 = sub nsw i32 %6, %8
%15 = icmp eq i32 %14, %8
br i1 %15, label %16, label %4
16: ; preds = %13, %10, %2
%17 = phi i32 [ %0, %2 ], [ %6, %10 ], [ %8, %13 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ string_free_erase(char *);
void string_free_erasep(char **p) {
  if (*p)
    string_free_erase(*p);
}


x86 assembly (clang, -O0):
<string_free_erasep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1136 <string_free_erasep+0x26>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <string_free_erase@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_free_erasep>:
mov    (%rdi),%rdi
test   %rdi,%rdi
je     111d <string_free_erasep+0xd>
jmp    1030 <string_free_erase@plt>
ret

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

LLVM IR (-O2):
define void @string_free_erasep(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @string_free_erase(i8* %2)
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void bar(unsigned short x) {
  unsigned char y = -1;
  if (x == y)
    abort();
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movb   $0xff,-0x3(%rbp)
movzwl -0x2(%rbp),%eax
movzbl -0x3(%rbp),%ecx
cmp    %ecx,%eax
jne    113a <bar+0x2a>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
cmp    $0xff,%edi
je     1119 <bar+0x9>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @bar(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
store i8 -1, i8* %3
%4 = load i16, i16* %2
%5 = zext i16 %4 to i32
%6 = load i8, i8* %3
%7 = zext i8 %6 to i32
%8 = icmp eq i32 %5, %7
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @bar(i16 zeroext %0) {
%2 = icmp eq i16 %0, 255
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memmove(char *, char *, int);
void str_remove(const char *base, char *src, size_t n) {
  memmove(src, src + n, 512 - (size_t)(src - base) - n);
}


x86 assembly (clang, -O0):
<str_remove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
sub    %rax,%rcx
mov    $0x200,%eax
sub    %rcx,%rax
sub    -0x18(%rbp),%rax
mov    %eax,%edx
call   1030 <memmove@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_remove>:
mov    %rsi,%rax
add    %rdx,%rsi
sub    %esi,%edi
lea    0x200(%rdi),%edx
mov    %rax,%rdi
jmp    1030 <memmove@plt>

LLVM IR (-O0):
define void @str_remove(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %5
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = getelementptr inbounds i8, i8* %8, i64 %9
%11 = load i8*, i8** %5
%12 = load i8*, i8** %4
%13 = ptrtoint i8* %11 to i64
%14 = ptrtoint i8* %12 to i64
%15 = sub i64 %13, %14
%16 = sub i64 512, %15
%17 = load i64, i64* %6
%18 = sub i64 %16, %17
%19 = trunc i64 %18 to i32
%20 = call i32 @memmove(i8* %7, i8* %10, i32 %19)
ret void
}

LLVM IR (-O2):
define void @str_remove(i8* %0, i8* %1, i64 %2) {
%4 = getelementptr inbounds i8, i8* %1, i64 %2
%5 = ptrtoint i8* %1 to i64
%6 = ptrtoint i8* %0 to i64
%7 = add i64 %6, 512
%8 = add i64 %5, %2
%9 = sub i64 %7, %8
%10 = trunc i64 %9 to i32
%11 = tail call i32 @memmove(i8* %1, i8* %4, i32 %10)
ret void
}
/* Variables and functions */
bool birch_character_is_digit(char c) { return c >= '1' && c <= '9'; }


x86 assembly (clang, -O0):
<birch_character_is_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x31,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <birch_character_is_digit+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<birch_character_is_digit>:
add    $0xcf,%dil
xor    %eax,%eax
cmp    $0x9,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @birch_character_is_digit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 49
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @birch_character_is_digit(i8 signext %0) {
%2 = add i8 %0, -49
%3 = icmp ult i8 %2, 9
%4 = zext i1 %3 to i32
ret i32 %4
}
int pxpy6() {
  int x;
  int y;
  x = 0;
  y = 1;
  x = x && y;
  return 42;
}


x86 assembly (clang, -O0):
<pxpy6>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x9(%rbp)
je     112b <pxpy6+0x2b>
cmpl   $0x0,-0x8(%rbp)
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    $0x2a,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @pxpy6() {
ret i32 42
}
void X509V3_EXT_REQ_add_conf(void) {}


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

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

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

LLVM IR (-O2):
define void @X509V3_EXT_REQ_add_conf() {
ret void
}
__attribute__((no, noclone)) unsigned __int128 t123_5mul(signed __int128 x) {
  unsigned __int128 r;
  if (__builtin_mul_overflow(x, (signed __int128)(0), &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t123_5mul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
xor    %eax,%eax
movq   $0x0,-0x38(%rbp)
movq   $0x0,-0x40(%rbp)
test   $0x1,%al
jne    114f <t123_5mul+0x3f>
jmp    1156 <t123_5mul+0x46>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x40,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define { i64, i64 } @t123_5mul(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = bitcast i128* %4 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = load i128, i128* %4
store i128 %10, i128* %5
%11 = load i128, i128* %5
%12 = sext i128 %11 to i129
%13 = call { i129, i1 } @llvm.smul.with.overflow.i129(i129 %12, i129 0)
%14 = extractvalue { i129, i1 } %13, 1
%15 = extractvalue { i129, i1 } %13, 0
%16 = trunc i129 %15 to i128
%17 = zext i128 %16 to i129
%18 = icmp ne i129 %15, %17
%19 = or i1 %14, %18
store i128 %16, i128* %6
br i1 %19, label %20, label %22
20: ; preds = %2
%21 = call i32 (...) @bar()
br label %22
22: ; preds = %20, %2
%23 = load i128, i128* %6
store i128 %23, i128* %3
%24 = bitcast i128* %3 to { i64, i64 }*
%25 = load { i64, i64 }, { i64, i64 }* %24
ret { i64, i64 } %25
}

LLVM IR (-O2):
define { i64, i64 } @t123_5mul(i64 %0, i64 %1) {
ret { i64, i64 } zeroinitializer
}
/* Type definitions */
struct create_args_info {
  int dummy;
};

/* Variables and functions */
int create_cmdline_parser2(int, char **, struct create_args_info *,
                           int /*<<< orphan*/, int, int);
int create_cmdline_parser(int argc, char **argv,
                          struct create_args_info *args_info) {
  return create_cmdline_parser2(argc, argv, args_info, 0, 1, 1);
}


x86 assembly (clang, -O0):
<create_cmdline_parser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
mov    $0x1,%r9d
mov    %r9d,%r8d
call   1030 <create_cmdline_parser2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_cmdline_parser>:
xor    %ecx,%ecx
mov    $0x1,%r8d
mov    $0x1,%r9d
jmp    1030 <create_cmdline_parser2@plt>

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

LLVM IR (-O2):
%struct.create_args_info = type { i32 }
define i32 @create_cmdline_parser(i32 %0, i8** %1, %struct.create_args_info* %2) {
%4 = tail call i32 @create_cmdline_parser2(i32 %0, i8** %1, %struct.create_args_info* %2, i32 0, i32 1, i32 1)
ret i32 %4
}
void __nptl_deallocate_tsd() {}


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

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

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

LLVM IR (-O2):
define void @__nptl_deallocate_tsd() {
ret void
}
int main() {
  int array1[4] = {1, 2, 4, 5};
  int array2[] = {1, 2, 4, 5};
  int days[7] = {[6] = 6};
  int multiArr1[][4] = {{4}, {4}};
  int multiArr2[3][4];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xef1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xeee(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed8(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed5(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xed2(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xecf(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xecd(%rip),%eax
mov    %eax,-0x28(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    0xec5(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xec2(%rip),%rax
mov    %rax,-0x48(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.array1 = [4 x i32] [i32 1, i32 2, i32 4, i32 5]
@__const.main.array2 = [4 x i32] [i32 1, i32 2, i32 4, i32 5]
@__const.main.days = [7 x i32] [i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 6]
@__const.main.multiArr1 = [2 x [4 x i32]] [[4 x i32] [i32 4, i32 0, i32 0, i32 0], [4 x i32] [i32 4, i32 0, i32 0, i32 0]]
define i32 @main() {
%1 = alloca [4 x i32]
%2 = alloca [4 x i32]
%3 = alloca [7 x i32]
%4 = alloca [2 x [4 x i32]]
%5 = alloca [3 x [4 x i32]]
%6 = bitcast [4 x i32]* %1 to i8*
%7 = bitcast [4 x i32]* %2 to i8*
%8 = bitcast [7 x i32]* %3 to i8*
%9 = bitcast [2 x [4 x i32]]* %4 to i8*
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
scalar_t__ realloc(void *, unsigned int);
void *yy_flex_realloc(void *ptr, unsigned int size) {
  return (void *)realloc(ptr, size);
}


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

x86 assembly (clang, -O2):
<yy_flex_realloc>:
jmp    1030 <realloc@plt>

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

LLVM IR (-O2):
define i8* @yy_flex_realloc(i8* %0, i32 %1) {
%3 = tail call i64 @realloc(i8* %0, i32 %1)
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int, char *);
int /*<<< orphan*/ stderr;
void SmugTest_assert(int expression, char *assertion, char *file, int line) {
  if (0 == expression) {
    fprintf(stderr, "[%s:%d] - Assertion failed: %s\n", file, line, assertion);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<SmugTest_assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
xor    %eax,%eax
cmp    -0x4(%rbp),%eax
jne    116b <SmugTest_assert+0x4b>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%r8
lea    0xea4(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SmugTest_assert>:
test   %edi,%edi
je     1125 <SmugTest_assert+0x5>
ret
push   %rax
mov    %rsi,%r8
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xec7(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"[%s:%d] - Assertion failed: %s\0A\00"
define void @SmugTest_assert(i32 %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = icmp eq i32 0, %9
br i1 %10, label %11, label %18
11: ; preds = %4
%12 = load i32, i32* @stderr
%13 = load i8*, i8** %7
%14 = load i32, i32* %8
%15 = load i8*, i8** %6
%16 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %13, i32 %14, i8* %15)
%17 = call i32 @exit(i32 1)
unreachable
18: ; preds = %4
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"[%s:%d] - Assertion failed: %s\0A\00"
define void @SmugTest_assert(i32 %0, i8* %1, i8* %2, i32 %3) {
%5 = icmp eq i32 %0, 0
br i1 %5, label %6, label %10
6: ; preds = %4
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %3, i8* %1)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ display_cursor(int);
void cursoroff(void) { display_cursor(false); }


x86 assembly (clang, -O0):
<cursoroff>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <display_cursor@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @cursoroff() {
%1 = call i32 @display_cursor(i32 0)
ret void
}

LLVM IR (-O2):
define void @cursoroff() {
%1 = tail call i32 @display_cursor(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pars_arg_eol_do(int);
void pars_arg_newline(void) { pars_arg_eol_do(false); }


x86 assembly (clang, -O0):
<pars_arg_newline>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <pars_arg_eol_do@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @pars_arg_newline() {
%1 = call i32 @pars_arg_eol_do(i32 0)
ret void
}

LLVM IR (-O2):
define void @pars_arg_newline() {
%1 = tail call i32 @pars_arg_eol_do(i32 0)
ret void
}