xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void help() {
  printf("log2mem example progam\n\n");
  printf("Options\n");
  printf("  "
         "--memmapfile"
         " - memory mapped file to create. If not provided, will use default "
         "name.\n");
  printf("  "
         "--help"
         " - display help\n");
  exit(0);
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
call   1030 <printf@plt>
lea    0xf2b(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<help>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee4(%rip),%rdi
call   1030 <puts@plt>
lea    0xee0(%rip),%rdi
call   1030 <puts@plt>
lea    0xf2b(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"log2mem example progam\0A\0A\00"
@.str.1 = [9 x i8] c"Options\0A\00"
@.str.2 = [88 x i8] c" --memmapfile - memory mapped file to create. If not provided, will use default name.\0A\00"
@.str.3 = [25 x i8] c" --help - display help\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [24 x i8] c"log2mem example progam\0A\00"
@str.4 = [8 x i8] c"Options\00"
@str.5 = [87 x i8] c" --memmapfile - memory mapped file to create. If not provided, will use default name.\00"
@str.6 = [24 x i8] c" --help - display help\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([87 x i8], [87 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.6, i64 0, i64 0))
%5 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ null_deref(int *);
void test2(int *p) { null_deref(p); }


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

x86 assembly (clang, -O2):
<test2>:
jmp    1030 <null_deref@plt>

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

LLVM IR (-O2):
define void @test2(i32* %0) {
%2 = tail call i32 @null_deref(i32* %0)
ret void
}
void tegra_drm_fb_exit(struct drm_device *drm) {}


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

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

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

LLVM IR (-O2):
%struct.drm_device = type opaque
define void @tegra_drm_fb_exit(%struct.drm_device* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct netent {
  int dummy;
};

/* Variables and functions */
struct netent *getnetbyaddr(uint32_t net, int type) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.netent = type { i32 }
define %struct.netent* @getnetbyaddr(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret %struct.netent* null
}

LLVM IR (-O2):
%struct.netent = type { i32 }
define noalias %struct.netent* @getnetbyaddr(i32 %0, i32 %1) {
ret %struct.netent* null
}
void smp_call_online_cpu(void (*func)(void *), void *data) { func(data); }


x86 assembly (clang, -O0):
<smp_call_online_cpu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smp_call_online_cpu>:
mov    %rdi,%rax
mov    %rsi,%rdi
jmp    *%rax

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

LLVM IR (-O2):
define void @smp_call_online_cpu(void (i8*)* nocapture %0, i8* %1) {
tail call void %0(i8* %1)
ret void
}
int main(void) {
  enum { ec1, ec2 } ee1, ee2;
  struct s {
    int i;
    double d;
  } se1, se2, se3;
  struct STRUCT {
    int i;
  };
  struct STRUCT *sp, se;
  int const long i, *func(
                        struct { int z; }, long long);
}


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

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

LLVM IR (-O0):
%struct.s = type { i32, double }
%struct.STRUCT = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.s
%4 = alloca %struct.s
%5 = alloca %struct.s
%6 = alloca %struct.STRUCT*
%7 = alloca %struct.STRUCT
%8 = alloca i64
ret i32 0
}

LLVM IR (-O2):
%struct.s = type { i32, double }
%struct.STRUCT = type { i32 }
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ nullf(char *);
int /*<<< orphan*/ output_byte(int);
void emit_cdq() {
  nullf("cdq\n");
  output_byte(0x99);
}


x86 assembly (clang, -O0):
<emit_cdq>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <nullf@plt>
mov    $0x99,%edi
call   1040 <output_byte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_cdq>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <nullf@plt>
mov    $0x99,%edi
pop    %rax
jmp    1040 <output_byte@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"cdq\0A\00"
define void @emit_cdq() {
%1 = call i32 @nullf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @output_byte(i32 153)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"cdq\0A\00"
define void @emit_cdq() {
%1 = tail call i32 @nullf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @output_byte(i32 153)
ret void
}
unsigned xrop3_64_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~D;
  stk2 = S & stk3;
  stk1 = T & stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_64_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @xrop3_64_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %5
%24 = xor i32 %23, -1
store i32 %24, i32* %10
%25 = load i32, i32* %6
%26 = load i32, i32* %10
%27 = and i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %7
%29 = load i32, i32* %9
%30 = and i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
%32 = load i32, i32* %6
%33 = xor i32 %32, -1
%34 = and i32 %31, %33
%35 = load i32, i32* %5
%36 = load i32, i32* %6
%37 = and i32 %35, %36
%38 = or i32 %34, %37
ret i32 %38
}

LLVM IR (-O2):
define i32 @xrop3_64_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
ret i32 %3
}
float RoughnessToDAlpha(float roughness) { return roughness * roughness; }


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

x86 assembly (clang, -O2):
<RoughnessToDAlpha>:
mulss  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define float @RoughnessToDAlpha(float %0) {
%2 = fmul float %0, %0
ret float %2
}
unsigned xrop3_246_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D ^ S;
  stk1 = T | stk2;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_246_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_246_0_1>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
mov    %eax,%edx
xor    $0xff,%edx
mov    %ecx,%edi
or     %edx,%edi
and    %eax,%edi
not    %ecx
and    %edx,%ecx
not    %eax
and    %esi,%eax
or     %ecx,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_246_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %6
%24 = xor i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %7
%26 = load i32, i32* %9
%27 = or i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = load i32, i32* %6
%30 = and i32 %28, %29
%31 = load i32, i32* %8
%32 = load i32, i32* %7
%33 = xor i32 %32, -1
%34 = and i32 %31, %33
%35 = or i32 %30, %34
%36 = load i32, i32* %7
%37 = load i32, i32* %6
%38 = xor i32 %37, -1
%39 = and i32 %36, %38
%40 = load i32, i32* %5
%41 = and i32 %39, %40
%42 = or i32 %35, %41
ret i32 %42
}

LLVM IR (-O2):
define i32 @xrop3_246_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %4, 255
%8 = or i32 %6, %7
%9 = and i32 %8, %4
%10 = xor i32 %6, -1
%11 = and i32 %7, %10
%12 = xor i32 %4, -1
%13 = and i32 %12, %5
%14 = or i32 %11, %13
%15 = or i32 %14, %9
ret i32 %15
}
void MPI_Isend() {}


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

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

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

LLVM IR (-O2):
define void @MPI_Isend() {
ret void
}
void oem_pm8921_bms_change_table(void) {}


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

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

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

LLVM IR (-O2):
define void @oem_pm8921_bms_change_table() {
ret void
}
/* Variables and functions */
int japi_isparent(int, int);
int j_isparent(int arg0, int arg1) { return (japi_isparent(arg0, arg1)); }


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

x86 assembly (clang, -O2):
<j_isparent>:
jmp    1030 <japi_isparent@plt>

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

LLVM IR (-O2):
define i32 @j_isparent(i32 %0, i32 %1) {
%3 = tail call i32 @japi_isparent(i32 %0, i32 %1)
ret i32 %3
}
int HelpItem126(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem126() {
ret i32 0
}
OP(fd, e4) {
  illegal_1();
  op_e4();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_e4@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_e4()
ret i32 undef
}
void XtDatabase() {}


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

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

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

LLVM IR (-O2):
define void @XtDatabase() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ upcrt_clear_all_puts();
extern void upcrt_sync_allnb(void) { upcrt_clear_all_puts(); }


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

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

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

LLVM IR (-O2):
define void @upcrt_sync_allnb() {
%1 = tail call i32 (...) @upcrt_clear_all_puts()
ret void
}
void vqes_openlog(const char *ident, int logstat, int logfac, int fd[],
                  int num_fds) {
  return;
}


x86 assembly (clang, -O0):
<vqes_openlog>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @vqes_openlog(i8* nocapture %0, i32 %1, i32 %2, i32* nocapture %3, i32 %4) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rsc68_set_music(int /*<<< orphan*/);
int /*<<< orphan*/ rsc68_set_remote_music(int /*<<< orphan*/);
int /*<<< orphan*/ rsc68_set_share(int /*<<< orphan*/);
int /*<<< orphan*/ rsc68_set_user(int /*<<< orphan*/);
void file68_shutdown(void) {
  rsc68_set_user(0);
  rsc68_set_share(0);
  rsc68_set_music(0);
  rsc68_set_remote_music(0);
}


x86 assembly (clang, -O0):
<file68_shutdown>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1060 <rsc68_set_user@plt>
xor    %edi,%edi
call   1040 <rsc68_set_share@plt>
xor    %edi,%edi
call   1050 <rsc68_set_music@plt>
xor    %edi,%edi
call   1030 <rsc68_set_remote_music@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<file68_shutdown>:
push   %rax
xor    %edi,%edi
call   1060 <rsc68_set_user@plt>
xor    %edi,%edi
call   1040 <rsc68_set_share@plt>
xor    %edi,%edi
call   1050 <rsc68_set_music@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <rsc68_set_remote_music@plt>

LLVM IR (-O0):
define void @file68_shutdown() {
%1 = call i32 @rsc68_set_user(i32 0)
%2 = call i32 @rsc68_set_share(i32 0)
%3 = call i32 @rsc68_set_music(i32 0)
%4 = call i32 @rsc68_set_remote_music(i32 0)
ret void
}

LLVM IR (-O2):
define void @file68_shutdown() {
%1 = tail call i32 @rsc68_set_user(i32 0)
%2 = tail call i32 @rsc68_set_share(i32 0)
%3 = tail call i32 @rsc68_set_music(i32 0)
%4 = tail call i32 @rsc68_set_remote_music(i32 0)
ret void
}
double get_clt() { return 110.0; }


x86 assembly (clang, -O0):
<get_clt>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_clt>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @get_clt() {
ret double 1.100000e+02
}

LLVM IR (-O2):
define double @get_clt() {
ret double 1.100000e+02
}
/* Variables and functions */
int /*<<< orphan*/ STDERR_FILENO;
int backtrace(void **, int);
int /*<<< orphan*/ backtrace_symbols_fd(void **, int, int /*<<< orphan*/);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void SIGSEGV_handler(int sig) {
  void *array[10];
  int size;
  size = backtrace(array, 10);
  fprintf(stderr, "Error: signal %d:\n", sig);
  backtrace_symbols_fd(array, size, STDERR_FILENO);
  exit(1);
}


x86 assembly (clang, -O0):
<SIGSEGV_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
mov    $0xa,%esi
call   1040 <backtrace@plt>
mov    %eax,-0x64(%rbp)
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xe91(%rip),%rsi
call   1050 <fprintf@plt>
lea    -0x60(%rbp),%rdi
mov    -0x64(%rbp),%esi
mov    0x2e56(%rip),%rax
mov    (%rax),%edx
call   1030 <backtrace_symbols_fd@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<SIGSEGV_handler>:
push   %rbp
push   %r14
push   %rbx
sub    $0x50,%rsp
mov    %edi,%ebx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0xa,%esi
call   1040 <backtrace@plt>
mov    %eax,%ebp
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
lea    0xe94(%rip),%rsi
mov    %ebx,%edx
call   1050 <fprintf@plt>
mov    0x2e5e(%rip),%rax
mov    (%rax),%edx
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <backtrace_symbols_fd@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"Error: signal %d:\0A\00"
@STDERR_FILENO = global i32 0
define void @SIGSEGV_handler(i32 %0) {
%2 = alloca i32
%3 = alloca [10 x i8*]
%4 = alloca i32
store i32 %0, i32* %2
%5 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 0
%6 = call i32 @backtrace(i8** %5, i32 10)
store i32 %6, i32* %4
%7 = load i32, i32* @stderr
%8 = load i32, i32* %2
%9 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 0
%11 = load i32, i32* %4
%12 = load i32, i32* @STDERR_FILENO
%13 = call i32 @backtrace_symbols_fd(i8** %10, i32 %11, i32 %12)
%14 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"Error: signal %d:\0A\00"
@STDERR_FILENO = global i32 0
define void @SIGSEGV_handler(i32 %0) {
%2 = alloca [10 x i8*]
%3 = bitcast [10 x i8*]* %2 to i8*
%4 = getelementptr inbounds [10 x i8*], [10 x i8*]* %2, i64 0, i64 0
%5 = call i32 @backtrace(i8** %4, i32 10)
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %0)
%8 = load i32, i32* @STDERR_FILENO
%9 = call i32 @backtrace_symbols_fd(i8** %4, i32 %5, i32 %8)
%10 = call i32 @exit(i32 1)
unreachable
}
void test4() {
  printf("\t*** %s ***\n", __func__);
  small_string_test("123 , 5  ,       92    , 0, 0\n"
                    "1, 12  34, 56, \"quote , \", 66\nok");
  printf("\t*** %s: done ***\n", __func__);
}


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xedb(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <small_string_test@plt>
lea    0xf04(%rip),%rdi
lea    0xeb8(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test4>:
push   %rbx
lea    0xed8(%rip),%rdi
lea    0xede(%rip),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed3(%rip),%rdi
xor    %eax,%eax
call   1030 <small_string_test@plt>
lea    0xf04(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"\09*** %s ***\0A\00"
@__func__.test4 = [6 x i8] c"test4\00"
@.str.1 = [63 x i8] c"123 , 5 , 92 , 0, 0\0A1, 12 34, 56, \22quote , \22, 66\0Aok\00"
@.str.2 = [19 x i8] c"\09*** %s: done ***\0A\00"
define void @test4() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.test4, i64 0, i64 0))
%2 = call i32 (i8*, ...) bitcast (i32 (...)* @small_string_test to i32 (i8*, ...)*)(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.test4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"\09*** %s ***\0A\00"
@__func__.test4 = [6 x i8] c"test4\00"
@.str.1 = [63 x i8] c"123 , 5 , 92 , 0, 0\0A1, 12 34, 56, \22quote , \22, 66\0Aok\00"
@.str.2 = [19 x i8] c"\09*** %s: done ***\0A\00"
define void @test4() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.test4, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @small_string_test to i32 (i8*, ...)*)(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.test4, i64 0, i64 0))
ret void
}
int f2() {
  int x[2] = {0};
  return x[1];
}


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

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

LLVM IR (-O0):
define i32 @f2() {
%1 = alloca [2 x i32]
%2 = bitcast [2 x i32]* %1 to i8*
%3 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 1
%4 = load i32, i32* %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @f2() {
ret i32 0
}
void complete_cbr(int ctx) {}


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

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

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

LLVM IR (-O2):
define void @complete_cbr(i32 %0) {
ret void
}
double cub(double v) {
  return (v * v) * v;
  __builtin_unreachable();
}


x86 assembly (clang, -O0):
<cub>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cub>:
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @cub(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
%6 = load double, double* %2
%7 = fmul double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @cub(double %0) {
%2 = fmul double %0, %0
%3 = fmul double %2, %0
ret double %3
}
/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t btz_peek_i(int32_t *stack, uint32_t *stack_ptr) {
  return stack[(*stack_ptr) - 1];
}


x86 assembly (clang, -O0):
<btz_peek_i>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<btz_peek_i>:
movslq (%rsi),%rax
mov    -0x4(%rdi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @btz_peek_i(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 = load i32, i32* %6
%8 = sub nsw i32 %7, 1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %5, i64 %9
%11 = load i32, i32* %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @btz_peek_i(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = add nsw i32 %3, -1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
ret i32 %7
}
void tea_encode_byte(char *v, int *k, int p) {
  char y[] = "NpK!TeA";
  *v = *v ^ y[p] ^ (char)(k[p % 4] % 0xFF);
}


x86 assembly (clang, -O0):
<tea_encode_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0xeea(%rip),%rax
mov    %rax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movslq -0x14(%rbp),%rcx
movsbl -0x1c(%rbp,%rcx,1),%ecx
xor    %ecx,%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    -0x28(%rbp),%rax
movslq %edx,%rcx
mov    (%rax,%rcx,4),%eax
mov    $0xff,%ecx
cltd
idiv   %ecx
mov    -0x20(%rbp),%eax
mov    %dl,%cl
movsbl %cl,%ecx
xor    %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<tea_encode_byte>:
movslq %edx,%rcx
lea    0xef6(%rip),%rax
mov    (%rcx,%rax,1),%al
xor    (%rdi),%al
lea    0x3(%rcx),%edx
test   %ecx,%ecx
cmovns %ecx,%edx
and    $0xfffffffc,%edx
sub    %edx,%ecx
movslq %ecx,%rcx
movslq (%rsi,%rcx,4),%rcx
imul   $0xffffffff80808081,%rcx,%rdx
shr    $0x20,%rdx
add    %ecx,%edx
mov    %edx,%esi
shr    $0x1f,%esi
shr    $0x7,%edx
add    %esi,%edx
add    %ecx,%edx
xor    %al,%dl
mov    %dl,(%rdi)
ret

LLVM IR (-O0):
@__const.tea_encode_byte.y = [8 x i8] c"NpK!TeA\00"
define void @tea_encode_byte(i8* %0, i32* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca [8 x i8]
store i8* %0, i8** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%8 = bitcast [8 x i8]* %7 to i8*
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = load i32, i32* %6
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [8 x i8], [8 x i8]* %7, i64 0, i64 %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = xor i32 %11, %16
%18 = load i32*, i32** %5
%19 = load i32, i32* %6
%20 = srem i32 %19, 4
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %18, i64 %21
%23 = load i32, i32* %22
%24 = srem i32 %23, 255
%25 = trunc i32 %24 to i8
%26 = sext i8 %25 to i32
%27 = xor i32 %17, %26
%28 = trunc i32 %27 to i8
%29 = load i8*, i8** %4
store i8 %28, i8* %29
ret void
}

LLVM IR (-O2):
@__const.tea_encode_byte.y = [8 x i8] c"NpK!TeA\00"
define void @tea_encode_byte(i8* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = load i8, i8* %0
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [8 x i8], [8 x i8]* @__const.tea_encode_byte.y, i64 0, i64 %5
%7 = load i8, i8* %6
%8 = xor i8 %7, %4
%9 = srem i32 %2, 4
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %1, i64 %10
%12 = load i32, i32* %11
%13 = srem i32 %12, 255
%14 = trunc i32 %13 to i8
%15 = xor i8 %8, %14
store i8 %15, i8* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ bar;

/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, char *, int);
int my2(void *foo, char bar) {
  memcpy(foo, &bar, sizeof(bar));
  return 1;
}


x86 assembly (clang, -O0):
<my2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1030 <memcpy@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my2>:
push   %rax
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <memcpy@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @my2(i8* %0, i8 signext %1) {
%3 = alloca i8
store i8 %1, i8* %3
%4 = call i32 @memcpy(i8* %0, i8* %3, i32 1)
ret i32 1
}
unsigned long dsi_get_pll_hsdiv_dispc_rate(struct platform_device *dsidev) {
  WARN("%s: DSI not compiled in, returning rate as 0\n", __func__);
  return 0;
}


x86 assembly (clang, -O0):
<dsi_get_pll_hsdiv_dispc_rate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
lea    0xf04(%rip),%rsi
mov    $0x0,%al
call   1030 <WARN@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dsi_get_pll_hsdiv_dispc_rate>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xf0f(%rip),%rsi
xor    %eax,%eax
call   1030 <WARN@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.platform_device = type opaque
@.str = [46 x i8] c"%s: DSI not compiled in, returning rate as 0\0A\00"
@__func__.dsi_get_pll_hsdiv_dispc_rate = [29 x i8] c"dsi_get_pll_hsdiv_dispc_rate\00"
define i64 @dsi_get_pll_hsdiv_dispc_rate(%struct.platform_device* %0) {
%2 = alloca %struct.platform_device*
store %struct.platform_device* %0, %struct.platform_device** %2
%3 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @WARN to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @__func__.dsi_get_pll_hsdiv_dispc_rate, i64 0, i64 0))
ret i64 0
}

LLVM IR (-O2):
%struct.platform_device = type opaque
@.str = [46 x i8] c"%s: DSI not compiled in, returning rate as 0\0A\00"
@__func__.dsi_get_pll_hsdiv_dispc_rate = [29 x i8] c"dsi_get_pll_hsdiv_dispc_rate\00"
define i64 @dsi_get_pll_hsdiv_dispc_rate(%struct.platform_device* nocapture readnone %0) {
%2 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @WARN to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @__func__.dsi_get_pll_hsdiv_dispc_rate, i64 0, i64 0))
ret i64 0
}
/* Variables and functions */
double exp(double);
double g(double x) { return 0.5 * exp(0.5 * (1 - x * x)) * (1 + x * x); }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm0,%xmm1
movsd  0xeb6(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xeb2(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  0xe9e(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe7c(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
push   %rax
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
movsd  0xeda(%rip),%xmm0
subsd  %xmm1,%xmm0
mulsd  0xed6(%rip),%xmm0
call   1030 <exp@plt>
mulsd  0xec9(%rip),%xmm0
movsd  (%rsp),%xmm1
addsd  0xeb4(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @g(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fneg double %3
%6 = call double @llvm.fmuladd.f64(double %5, double %4, double 1.000000e+00)
%7 = fmul double 5.000000e-01, %6
%8 = call double @exp(double %7)
%9 = fmul double 5.000000e-01, %8
%10 = load double, double* %2
%11 = load double, double* %2
%12 = call double @llvm.fmuladd.f64(double %10, double %11, double 1.000000e+00)
%13 = fmul double %9, %12
ret double %13
}

LLVM IR (-O2):
define double @g(double %0) {
%2 = fneg double %0
%3 = tail call double @llvm.fmuladd.f64(double %2, double %0, double 1.000000e+00)
%4 = fmul double %3, 5.000000e-01
%5 = tail call double @exp(double %4)
%6 = fmul double %5, 5.000000e-01
%7 = tail call double @llvm.fmuladd.f64(double %0, double %0, double 1.000000e+00)
%8 = fmul double %7, %6
ret double %8
}
int next_power_of_two(int x) {
  int i;
  x--;
  for (i = 1; i < sizeof(int) * 8; i <<= 1)
    x = x | (x >> i);
  x++;
  return x;
}


x86 assembly (clang, -O0):
<next_power_of_two>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movslq -0x8(%rbp),%rax
cmp    $0x20,%rax
jae    1145 <next_power_of_two+0x45>
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1117 <next_power_of_two+0x17>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_power_of_two>:
lea    -0x1(%rdi),%eax
mov    %eax,%ecx
sar    %ecx
or     %eax,%ecx
mov    %ecx,%eax
sar    $0x2,%eax
or     %ecx,%eax
mov    %eax,%ecx
sar    $0x4,%ecx
or     %eax,%ecx
mov    %ecx,%edx
sar    $0x8,%edx
or     %ecx,%edx
mov    %edx,%eax
sar    $0x10,%eax
or     %edx,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @next_power_of_two(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %4, -1
store i32 %5, i32* %2
store i32 1, i32* %3
br label %6
6: ; preds = %16, %1
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = icmp ult i64 %8, 32
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = load i32, i32* %2
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = ashr i32 %12, %13
%15 = or i32 %11, %14
store i32 %15, i32* %2
br label %16
16: ; preds = %10
%17 = load i32, i32* %3
%18 = shl i32 %17, 1
store i32 %18, i32* %3
br label %6
19: ; preds = %6
%20 = load i32, i32* %2
%21 = add nsw i32 %20, 1
store i32 %21, i32* %2
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @next_power_of_two(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = ashr i32 %2, 1
%4 = or i32 %3, %2
%5 = ashr i32 %4, 2
%6 = or i32 %5, %4
%7 = ashr i32 %6, 4
%8 = or i32 %7, %6
%9 = ashr i32 %8, 8
%10 = or i32 %9, %8
%11 = ashr i32 %10, 16
%12 = or i32 %11, %10
%13 = add nsw i32 %12, 1
ret i32 %13
}
/* Variables and functions */
int toupper(int);
__attribute__((__weak__, __always___)) int softboundcets_toupper(int c) {
  return toupper(c);
}


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

x86 assembly (clang, -O2):
<softboundcets_toupper>:
jmp    1030 <toupper@plt>

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

LLVM IR (-O2):
define weak i32 @softboundcets_toupper(i32 %0) {
%2 = tail call i32 @toupper(i32 %0)
ret i32 %2
}
int subfunc(void) { return 42; }


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

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

LLVM IR (-O0):
define i32 @subfunc() {
ret i32 42
}

LLVM IR (-O2):
define i32 @subfunc() {
ret i32 42
}
int gcd_division(int a, int b) {
  while (b != 0) {
    int tmp = a;
    a = b;
    b = tmp % b;
  }
  return a;
}


x86 assembly (clang, -O0):
<gcd_division>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112f <gcd_division+0x2f>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x8(%rbp)
jmp    110a <gcd_division+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd_division>:
mov    %edi,%eax
test   %esi,%esi
je     111d <gcd_division+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd_division+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @gcd_division(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
br label %6
6: ; preds = %9, %2
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %6
%10 = load i32, i32* %3
store i32 %10, i32* %5
%11 = load i32, i32* %4
store i32 %11, i32* %3
%12 = load i32, i32* %5
%13 = load i32, i32* %4
%14 = srem i32 %12, %13
store i32 %14, i32* %4
br label %6
15: ; preds = %6
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @gcd_division(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %1, %2 ]
%7 = srem i32 %5, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %6, %4 ]
ret i32 %10
}
/* Variables and functions */
int TIOCM_DTR;
int get_mlines(int);
int put_mlines(int, int);
int clr_dtr(int fd) {
  int i;
  i = get_mlines(fd);
  i &= ~(TIOCM_DTR);
  i = put_mlines(fd, i);
  return (i);
}


x86 assembly (clang, -O0):
<clr_dtr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <get_mlines@plt>
mov    %eax,-0x8(%rbp)
mov    0x2eab(%rip),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <put_mlines@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clr_dtr>:
push   %rbx
mov    %edi,%ebx
call   1030 <get_mlines@plt>
mov    0x2eb9(%rip),%rcx
mov    (%rcx),%esi
not    %esi
and    %eax,%esi
mov    %ebx,%edi
pop    %rbx
jmp    1040 <put_mlines@plt>

LLVM IR (-O0):
@TIOCM_DTR = global i32 0
define i32 @clr_dtr(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @get_mlines(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* @TIOCM_DTR
%7 = xor i32 %6, -1
%8 = load i32, i32* %3
%9 = and i32 %8, %7
store i32 %9, i32* %3
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = call i32 @put_mlines(i32 %10, i32 %11)
store i32 %12, i32* %3
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@TIOCM_DTR = global i32 0
define i32 @clr_dtr(i32 %0) {
%2 = tail call i32 @get_mlines(i32 %0)
%3 = load i32, i32* @TIOCM_DTR
%4 = xor i32 %3, -1
%5 = and i32 %2, %4
%6 = tail call i32 @put_mlines(i32 %0, i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) { fprintf(stderr, "rlogin [-l username] hostname\n\n"); }


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"rlogin [-l username] hostname\0A\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"rlogin [-l username] hostname\0A\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void subtract(unsigned int a, unsigned int b) {
  unsigned int total = 0;
  if (a >= b) {
    total = a - b;
    printf("%d - %d = %d\n", a, b, total);
  } else
    printf("This calculator isn't capable of handling this expression.\n");
}


x86 assembly (clang, -O0):
<subtract>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jb     1156 <subtract+0x46>
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1164 <subtract+0x54>
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<subtract>:
mov    %esi,%edx
mov    %edi,%ecx
sub    %esi,%ecx
jae    1134 <subtract+0x14>
lea    0xedf(%rip),%rdi
jmp    1030 <puts@plt>
mov    %edi,%esi
lea    0xec3(%rip),%rdi
xor    %eax,%eax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"%d - %d = %d\0A\00"
@.str.1 = [60 x i8] c"This calculator isn't capable of handling this expression.\0A\00"
define void @subtract(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = icmp uge i32 %6, %7
br i1 %8, label %9, label %17
9: ; preds = %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = sub i32 %10, %11
store i32 %12, i32* %5
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %14, i32 %15)
br label %19
17: ; preds = %2
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.1, i64 0, i64 0))
br label %19
19: ; preds = %17, %9
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"%d - %d = %d\0A\00"
@str = [59 x i8] c"This calculator isn't capable of handling this expression.\00"
define void @subtract(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, %1
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = sub i32 %0, %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %5)
br label %9
7: ; preds = %2
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str, i64 0, i64 0))
br label %9
9: ; preds = %7, %4
ret void
}
void abort() {
  while (666)
    ;
}


x86 assembly (clang, -O0):
<abort>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <abort+0x9>
jmp    1109 <abort+0x9>

x86 assembly (clang, -O2):
<abort>:
jmp    1100 <abort>

LLVM IR (-O0):
define void @abort() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @abort() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ wFree(char *);
scalar_t__ wMalloc(int);
scalar_t__ wStackPopNumber();
int /*<<< orphan*/ wStackPushChar(char *, int /*<<< orphan*/);
void wBuiltinOct() {
  int i;
  char *buffer = (char *)wMalloc(16);
  i = (int)wStackPopNumber();
  sprintf(buffer, "%o", i);
  wStackPushChar(buffer, 0);
  wFree(buffer);
}


x86 assembly (clang, -O0):
<wBuiltinOct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x10,%edi
call   1040 <wMalloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <wStackPopNumber@plt>
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xe82(%rip),%rsi
call   1060 <sprintf@plt>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1070 <wStackPushChar@plt>
mov    -0x10(%rbp),%rdi
call   1050 <wFree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wBuiltinOct>:
push   %rbx
mov    $0x10,%edi
call   1040 <wMalloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <wStackPopNumber@plt>
lea    0xe94(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%edx
call   1060 <sprintf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1070 <wStackPushChar@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <wFree@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%o\00"
define void @wBuiltinOct() {
%1 = alloca i32
%2 = alloca i8*
%3 = call i64 @wMalloc(i32 16)
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %2
%5 = call i64 (...) @wStackPopNumber()
%6 = trunc i64 %5 to i32
store i32 %6, i32* %1
%7 = load i8*, i8** %2
%8 = load i32, i32* %1
%9 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i8*, i8** %2
%11 = call i32 @wStackPushChar(i8* %10, i32 0)
%12 = load i8*, i8** %2
%13 = call i32 @wFree(i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%o\00"
define void @wBuiltinOct() {
%1 = tail call i64 @wMalloc(i32 16)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i64 (...) @wStackPopNumber()
%4 = trunc i64 %3 to i32
%5 = tail call i32 @sprintf(i8* dereferenceable(1) %2, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = tail call i32 @wStackPushChar(i8* %2, i32 0)
%7 = tail call i32 @wFree(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ide_remove_handlers(int /*<<< orphan*/);
void ide_pri_disable(void) { ide_remove_handlers(0); }


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

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

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

LLVM IR (-O2):
define void @ide_pri_disable() {
%1 = tail call i32 @ide_remove_handlers(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(char *cmd) {
  printf("Usage: %s <GB of memory to allocate> <run duration (s)>\n", cmd);
}


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

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

LLVM IR (-O0):
@.str = [57 x i8] c"Usage: %s <GB of memory to allocate> <run duration (s)>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [57 x i8] c"Usage: %s <GB of memory to allocate> <run duration (s)>\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}