xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
void pause(void) {
  printf("Press enter to continue...\n");
  getchar();
}


x86 assembly (clang, -O0):
<pause>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pause>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <getchar@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Press enter to continue...\0A\00"
define void @pause() {
%1 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @getchar()
ret void
}

LLVM IR (-O2):
@str = [27 x i8] c"Press enter to continue...\00"
define void @pause() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @getchar()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tzset();
void __attribute__((constructor)) easy_time_start_() { tzset(); }


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

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

LLVM IR (-O0):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @easy_time_start_, i8* null }]
define void @easy_time_start_() {
%1 = call i32 (...) @tzset()
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @easy_time_start_, i8* null }]
define void @easy_time_start_() {
%1 = tail call i32 (...) @tzset()
ret void
}
/* Variables and functions */
int LINES;
int /*<<< orphan*/ addstr(char *);
int /*<<< orphan*/ clear();
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ getch();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ move(int, int);
int /*<<< orphan*/ refresh();
main() {
  initscr();
  clear();
  move(10, 20);
  addstr("hello,world");
  move(LINES - 1, 0);
  refresh();
  getch();
  endwin();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <initscr@plt>
mov    $0x0,%al
call   1080 <clear@plt>
mov    $0xa,%edi
mov    $0x14,%esi
call   1090 <move@plt>
lea    0xe68(%rip),%rdi
call   1070 <addstr@plt>
mov    0x2e44(%rip),%rax
mov    (%rax),%edi
sub    $0x1,%edi
xor    %esi,%esi
call   1090 <move@plt>
mov    $0x0,%al
call   1040 <refresh@plt>
mov    $0x0,%al
call   1050 <getch@plt>
mov    $0x0,%al
call   1060 <endwin@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <initscr@plt>
xor    %eax,%eax
call   1080 <clear@plt>
mov    $0xa,%edi
mov    $0x14,%esi
call   1090 <move@plt>
lea    0xe6b(%rip),%rdi
call   1070 <addstr@plt>
mov    0x2e47(%rip),%rax
mov    (%rax),%edi
add    $0xffffffff,%edi
xor    %esi,%esi
call   1090 <move@plt>
xor    %eax,%eax
call   1040 <refresh@plt>
xor    %eax,%eax
call   1050 <getch@plt>
xor    %eax,%eax
call   1060 <endwin@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"hello,world\00"
@LINES = global i32 0
define i32 @main() {
%1 = call i32 (...) @initscr()
%2 = call i32 (...) @clear()
%3 = call i32 @move(i32 10, i32 20)
%4 = call i32 @addstr(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @LINES
%6 = sub nsw i32 %5, 1
%7 = call i32 @move(i32 %6, i32 0)
%8 = call i32 (...) @refresh()
%9 = call i32 (...) @getch()
%10 = call i32 (...) @endwin()
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"hello,world\00"
@LINES = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @clear()
%3 = tail call i32 @move(i32 10, i32 20)
%4 = tail call i32 @addstr(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @LINES
%6 = add nsw i32 %5, -1
%7 = tail call i32 @move(i32 %6, i32 0)
%8 = tail call i32 (...) @refresh()
%9 = tail call i32 (...) @getch()
%10 = tail call i32 (...) @endwin()
ret i32 0
}
int test_imm_BCuint16_reg(unsigned short val) {
  return ((val) & (0xBC << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_BCuint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xbc,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_BCuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 188
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
unsigned int getdist_(const char *dist_name,
                      const unsigned int dist_name_length) {
  return (unsigned int)0;
}


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

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

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

LLVM IR (-O2):
define i32 @getdist_(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
int libtasTestFunc1() { return 1; }


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

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

LLVM IR (-O0):
define i32 @libtasTestFunc1() {
ret i32 1
}

LLVM IR (-O2):
define i32 @libtasTestFunc1() {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t hci_event_packet_get_type(const uint8_t *event) { return event[0]; }


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

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

LLVM IR (-O0):
define i32 @hci_event_packet_get_type(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @hci_event_packet_get_type(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
void copia_con_apuntadores(void) {
  extern char linea[], linea_max[];
  char *plinea = linea;
  char *plinea_max = linea_max;
  while (*plinea) {
    *plinea_max = *plinea;
    plinea++;
    plinea_max++;
  }
  *plinea_max = '\0';
}


x86 assembly (clang, -O0):
<copia_con_apuntadores>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ee5(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0x2ec2(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1150 <copia_con_apuntadores+0x50>
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111a <copia_con_apuntadores+0x1a>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<copia_con_apuntadores>:
mov    0x2ee9(%rip),%rax
mov    (%rax),%dl
test   %dl,%dl
je     1135 <copia_con_apuntadores+0x35>
add    $0x1,%rax
mov    0x2ec0(%rip),%rcx
nopl   0x0(%rax,%rax,1)
mov    %dl,(%rcx)
add    $0x1,%rcx
movzbl (%rax),%edx
add    $0x1,%rax
test   %dl,%dl
jne    1120 <copia_con_apuntadores+0x20>
movb   $0x0,(%rcx)
ret
mov    0x2e9c(%rip),%rcx
movb   $0x0,(%rcx)
ret

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

LLVM IR (-O2):
@linea = external global [0 x i8]
@linea_max = external global [0 x i8]
define void @copia_con_apuntadores() {
%1 = load i8, i8* getelementptr inbounds ([0 x i8], [0 x i8]* @linea, i64 0, i64 0)
%2 = icmp eq i8 %1, 0
br i1 %2, label %11, label %3
3: ; preds = %0, %3
%4 = phi i8 [ %9, %3 ], [ %1, %0 ]
%5 = phi i8* [ %8, %3 ], [ getelementptr inbounds ([0 x i8], [0 x i8]* @linea_max, i64 0, i64 0), %0 ]
%6 = phi i8* [ %7, %3 ], [ getelementptr inbounds ([0 x i8], [0 x i8]* @linea, i64 0, i64 0), %0 ]
store i8 %4, i8* %5
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = getelementptr inbounds i8, i8* %5, i64 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %3
11: ; preds = %3, %0
%12 = phi i8* [ getelementptr inbounds ([0 x i8], [0 x i8]* @linea_max, i64 0, i64 0), %0 ], [ %8, %3 ]
store i8 0, i8* %12
ret void
}
float catmullrom_w1(float x) { return 1.0f + x * x * (-2.5f + 1.5f * x); }


x86 assembly (clang, -O0):
<catmullrom_w1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
movss  0xee4(%rip),%xmm2
mulss  %xmm2,%xmm1
movss  0xedc(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  0xec4(%rip),%xmm1
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<catmullrom_w1>:
movaps %xmm0,%xmm1
mulss  0xef5(%rip),%xmm0
addss  0xef1(%rip),%xmm0
mulss  %xmm1,%xmm1
mulss  %xmm1,%xmm0
addss  0xee5(%rip),%xmm0
ret

LLVM IR (-O0):
define float @catmullrom_w1(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fmul float %3, %4
%6 = load float, float* %2
%7 = call float @llvm.fmuladd.f32(float 1.500000e+00, float %6, float -2.500000e+00)
%8 = call float @llvm.fmuladd.f32(float %5, float %7, float 1.000000e+00)
ret float %8
}

LLVM IR (-O2):
define float @catmullrom_w1(float %0) {
%2 = fmul float %0, %0
%3 = tail call float @llvm.fmuladd.f32(float %0, float 1.500000e+00, float -2.500000e+00)
%4 = tail call float @llvm.fmuladd.f32(float %2, float %3, float 1.000000e+00)
ret float %4
}
/* Variables and functions */
scalar_t__ get_cpu_secs();
double TimeCPU(void) { return (double)get_cpu_secs(); }


x86 assembly (clang, -O0):
<TimeCPU>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <get_cpu_secs@plt>
cvtsi2sd %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimeCPU>:
push   %rax
xor    %eax,%eax
call   1030 <get_cpu_secs@plt>
cvtsi2sd %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @TimeCPU() {
%1 = call i64 (...) @get_cpu_secs()
%2 = sitofp i64 %1 to double
ret double %2
}

LLVM IR (-O2):
define double @TimeCPU() {
%1 = tail call i64 (...) @get_cpu_secs()
%2 = sitofp i64 %1 to double
ret double %2
}
float degToRad(float val) { return val * (3.14592f / 180.0f); }


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

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

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

LLVM IR (-O2):
define float @degToRad(float %0) {
%2 = fmul float %0, 0x3F91E59400000000
ret float %2
}
int fun774() { return 774; }


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

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

LLVM IR (-O0):
define i32 @fun774() {
ret i32 774
}

LLVM IR (-O2):
define i32 @fun774() {
ret i32 774
}
int main() {
  double arr[] = {3.0, 1.0};
  return (int)(arr[0] + arr[1]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0xeee(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeeb(%rip),%rax
mov    %rax,-0x18(%rbp)
movsd  -0x20(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.arr = [2 x double] [double 3.000000e+00, double 1.000000e+00]
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x double]
store i32 0, i32* %1
%3 = bitcast [2 x double]* %2 to i8*
%4 = getelementptr inbounds [2 x double], [2 x double]* %2, i64 0, i64 0
%5 = load double, double* %4
%6 = getelementptr inbounds [2 x double], [2 x double]* %2, i64 0, i64 1
%7 = load double, double* %6
%8 = fadd double %5, %7
%9 = fptosi double %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
ret i32 4
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ atomic_postadd_int32_t(int /*<<< orphan*/ *, int);
int32_t atomic_postinc_int32_t(int32_t *var) {
  return atomic_postadd_int32_t(var, 1);
}


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

x86 assembly (clang, -O2):
<atomic_postinc_int32_t>:
mov    $0x1,%esi
jmp    1030 <atomic_postadd_int32_t@plt>

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

LLVM IR (-O2):
define i32 @atomic_postinc_int32_t(i32* %0) {
%2 = tail call i32 @atomic_postadd_int32_t(i32* %0, i32 1)
ret i32 %2
}
void wcsutil_setAll(int ncoord, int nelem, double *first) {
  double v0, *vp;
  v0 = *first;
  for (vp = first + nelem; vp < first + ncoord * nelem; vp += nelem) {
    *vp = v0;
  }
}


x86 assembly (clang, -O0):
<wcsutil_setAll>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    -0x4(%rbp),%edx
imul   -0x8(%rbp),%edx
movslq %edx,%rdx
shl    $0x3,%rdx
add    %rdx,%rcx
cmp    %rcx,%rax
jae    1177 <wcsutil_setAll+0x77>
movsd  -0x18(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
jmp    112e <wcsutil_setAll+0x2e>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcsutil_setAll>:
imul   %esi,%edi
cmp    %esi,%edi
jle    112c <wcsutil_setAll+0x2c>
movsd  (%rdx),%xmm0
movslq %esi,%rax
movslq %edi,%rcx
lea    (%rdx,%rcx,8),%rcx
lea    (%rdx,%rax,8),%rdx
shl    $0x3,%rax
nopl   (%rax)
movsd  %xmm0,(%rdx)
add    %rax,%rdx
cmp    %rcx,%rdx
jb     1120 <wcsutil_setAll+0x20>
ret

LLVM IR (-O0):
define void @wcsutil_setAll(i32 %0, i32 %1, double* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca double*
%7 = alloca double
%8 = alloca double*
store i32 %0, i32* %4
store i32 %1, i32* %5
store double* %2, double** %6
%9 = load double*, double** %6
%10 = load double, double* %9
store double %10, double* %7
%11 = load double*, double** %6
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds double, double* %11, i64 %13
store double* %14, double** %8
br label %15
15: ; preds = %27, %3
%16 = load double*, double** %8
%17 = load double*, double** %6
%18 = load i32, i32* %4
%19 = load i32, i32* %5
%20 = mul nsw i32 %18, %19
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds double, double* %17, i64 %21
%23 = icmp ult double* %16, %22
br i1 %23, label %24, label %32
24: ; preds = %15
%25 = load double, double* %7
%26 = load double*, double** %8
store double %25, double* %26
br label %27
27: ; preds = %24
%28 = load i32, i32* %5
%29 = load double*, double** %8
%30 = sext i32 %28 to i64
%31 = getelementptr inbounds double, double* %29, i64 %30
store double* %31, double** %8
br label %15
32: ; preds = %15
ret void
}

LLVM IR (-O2):
define void @wcsutil_setAll(i32 %0, i32 %1, double* %2) {
%4 = load double, double* %2
%5 = sext i32 %1 to i64
%6 = mul nsw i32 %1, %0
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds double, double* %2, i64 %7
%9 = icmp sgt i32 %6, %1
br i1 %9, label %10, label %16
10: ; preds = %3
%11 = getelementptr inbounds double, double* %2, i64 %5
br label %12
12: ; preds = %10, %12
%13 = phi double* [ %14, %12 ], [ %11, %10 ]
store double %4, double* %13
%14 = getelementptr inbounds double, double* %13, i64 %5
%15 = icmp ult double* %14, %8
br i1 %15, label %12, label %16
16: ; preds = %12, %3
ret void
}
/* Variables and functions */
__attribute__((const)) bool is_power_of_2(unsigned long n) {
  return (n != 0 && ((n & (n - 1)) == 0));
}


x86 assembly (clang, -O0):
<is_power_of_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1131 <is_power_of_2+0x31>
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    $0x1,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_power_of_2>:
test   %rdi,%rdi
je     1112 <is_power_of_2+0x12>
lea    -0x1(%rdi),%rcx
xor    %eax,%eax
test   %rcx,%rdi
sete   %al
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @is_power_of_2(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i64 @llvm.ctpop.i64(i64 %0)
%5 = icmp ult i64 %4, 2
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int chmod(const char *path, mode_t mode) {
  (void)path;
  (void)mode;
  return -1;
}


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

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

LLVM IR (-O0):
define i32 @chmod(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
ret i32 -1
}

LLVM IR (-O2):
define i32 @chmod(i8* nocapture readnone %0, i32 %1) {
ret i32 -1
}
/* Variables and functions */
char const *jep106_table_manufacturer(unsigned int, unsigned int);
const char *jep106_manufacturer(unsigned int manufacturer) {
  return jep106_table_manufacturer(manufacturer >> 7, manufacturer & 0x7f);
}


x86 assembly (clang, -O0):
<jep106_manufacturer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
shr    $0x7,%edi
mov    -0x4(%rbp),%esi
and    $0x7f,%esi
call   1030 <jep106_table_manufacturer@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jep106_manufacturer>:
mov    %edi,%esi
shr    $0x7,%edi
and    $0x7f,%esi
jmp    1030 <jep106_table_manufacturer@plt>

LLVM IR (-O0):
define i8* @jep106_manufacturer(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 7
%5 = load i32, i32* %2
%6 = and i32 %5, 127
%7 = call i8* @jep106_table_manufacturer(i32 %4, i32 %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @jep106_manufacturer(i32 %0) {
%2 = lshr i32 %0, 7
%3 = and i32 %0, 127
%4 = tail call i8* @jep106_table_manufacturer(i32 %2, i32 %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ alarm(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void handler(int s) {
  printf("/");
  fflush(stdout);
  alarm(1);
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x1,%edi
call   1040 <alarm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
push   %rax
mov    $0x2f,%edi
call   1030 <putchar@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <alarm@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"/\00"
@stdout = global i32 0
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdout
%5 = call i32 @fflush(i32 %4)
%6 = call i32 @alarm(i32 1)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @handler(i32 %0) {
%2 = tail call i32 @putchar(i32 47)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
%5 = tail call i32 @alarm(i32 1)
ret void
}
/* Variables and functions */
char *corta_string(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char *s = "";
  s = corta_string(s);
  printf("%s\n", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xecd(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <corta_string@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedb(%rip),%rdi
call   1040 <corta_string@plt>
lea    0xecc(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i8* @corta_string(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %1)
ret i32 0
}
/* Variables and functions */
int converte(char, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *, int *);
int main() {
  char c;
  int shift;
  printf("Carater e shift: ");
  scanf("%c %d", &c, &shift);
  printf("%c\n", converte(c, shift));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xebe(%rip),%rdi
lea    -0x5(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x5(%rbp),%al
mov    -0xc(%rbp),%esi
movsbl %al,%edi
call   1030 <converte@plt>
mov    %eax,%esi
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xecc(%rip),%rdi
lea    0x3(%rsp),%rsi
lea    0x4(%rsp),%rdx
call   1050 <scanf@plt>
movsbl 0x3(%rsp),%edi
mov    0x4(%rsp),%esi
call   1030 <converte@plt>
lea    0xeae(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Carater e shift: \00"
@.str.1 = [6 x i8] c"%c %d\00"
@.str.2 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %2, i32* %3)
%6 = load i8, i8* %2
%7 = load i32, i32* %3
%8 = call i32 @converte(i8 signext %6, i32 %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"Carater e shift: \00"
@.str.1 = [6 x i8] c"%c %d\00"
@.str.2 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %1, i32* %2)
%6 = load i8, i8* %1
%7 = load i32, i32* %2
%8 = call i32 @converte(i8 signext %6, i32 %7)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret i32 0
}
void Lia_Handler(int singo) { return; }


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

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

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

LLVM IR (-O2):
define void @Lia_Handler(i32 %0) {
ret void
}
int test_imm_37uint8_reg(unsigned char val) {
  return ((val) & (0x37 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_37uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 55
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct utimeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ utimeval_less_than(struct utimeval *, struct utimeval *);
int utimeval_greater_or_equal(struct utimeval *first, struct utimeval *second) {
  return !utimeval_less_than(first, second);
}


x86 assembly (clang, -O0):
<utimeval_greater_or_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <utimeval_less_than@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utimeval_greater_or_equal>:
push   %rax
call   1030 <utimeval_less_than@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.utimeval = type { i32 }
define i32 @utimeval_greater_or_equal(%struct.utimeval* %0, %struct.utimeval* %1) {
%3 = alloca %struct.utimeval*
%4 = alloca %struct.utimeval*
store %struct.utimeval* %0, %struct.utimeval** %3
store %struct.utimeval* %1, %struct.utimeval** %4
%5 = load %struct.utimeval*, %struct.utimeval** %3
%6 = load %struct.utimeval*, %struct.utimeval** %4
%7 = call i32 @utimeval_less_than(%struct.utimeval* %5, %struct.utimeval* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
%struct.utimeval = type { i32 }
define i32 @utimeval_greater_or_equal(%struct.utimeval* %0, %struct.utimeval* %1) {
%3 = tail call i32 @utimeval_less_than(%struct.utimeval* %0, %struct.utimeval* %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int *func_ret_null();
int *func_do_something() { return func_ret_null(); }


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

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

LLVM IR (-O0):
define i32* @func_do_something() {
%1 = call i32* (...) @func_ret_null()
ret i32* %1
}

LLVM IR (-O2):
define i32* @func_do_something() {
%1 = tail call i32* (...) @func_ret_null()
ret i32* %1
}
int div_i(int a, int b) { return (a / b); }


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

x86 assembly (clang, -O2):
<div_i>:
mov    %edi,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @div_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 = sdiv i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @div_i(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
/* Variables and functions */
void *realloc(void *, size_t);
void *memory_resize(void *ptr, size_t size) { return realloc(ptr, size); }


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

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

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

LLVM IR (-O2):
define noalias i8* @memory_resize(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
ret i8* %3
}
int test_imm_06uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x06 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_06uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 6
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
double atomic_mass_phosphate(void) {
  double phosphate_mass = 0.0;
  phosphate_mass = 3 * 1.008 + 4 * 16.00 + 30.97;
  return phosphate_mass;
}


x86 assembly (clang, -O0):
<atomic_mass_phosphate>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xeec(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @atomic_mass_phosphate() {
%1 = alloca double
store double 0.000000e+00, double* %1
store double 0x40587F9DB22D0E56, double* %1
%2 = load double, double* %1
ret double %2
}

LLVM IR (-O2):
define double @atomic_mass_phosphate() {
ret double 0x40587F9DB22D0E56
}
void __attribute__((__no__)) bar(int x) { asm(""); }


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

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

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

LLVM IR (-O2):
define void @bar(i32 %0) {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void(Memento_blockInfo)(void *ptr) {}


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

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

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

LLVM IR (-O2):
define void @Memento_blockInfo(i8* nocapture %0) {
ret void
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, struct timezone *);
int get_microseconds_hand(void) {
  struct timeval tv;
  struct timezone tz;
  gettimeofday(&tv, &tz);
  return tv.tv_usec;
}


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

x86 assembly (clang, -O2):
<get_microseconds_hand>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1030 <gettimeofday@plt>
mov    0x8(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
%struct.timezone = type { i32 }
define i32 @get_microseconds_hand() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
%struct.timezone = type { i32 }
define i32 @get_microseconds_hand() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = bitcast %struct.timeval* %1 to i8*
%4 = bitcast %struct.timezone* %2 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%7 = load i32, i32* %6
ret i32 %7
}
int min_int(int a, int b) { return a > b ? b : a; }


x86 assembly (clang, -O0):
<min_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <min_int+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <min_int+0x27>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min_int>:
mov    %edi,%eax
cmp    %esi,%edi
cmovg  %esi,%eax
ret

LLVM IR (-O0):
define i32 @min_int(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 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %4
br label %12
10: ; preds = %2
%11 = load i32, i32* %3
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @min_int(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Type definitions */
struct property {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ property_set_value(struct property *, int /*<<< orphan*/);
int /*<<< orphan*/ value_new_string(char const *);
void property_set_string(struct property *prop, const char *s) {
  property_set_value(prop, value_new_string(s));
}


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

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

LLVM IR (-O0):
%struct.property = type { i32 }
define void @property_set_string(%struct.property* %0, i8* %1) {
%3 = alloca %struct.property*
%4 = alloca i8*
store %struct.property* %0, %struct.property** %3
store i8* %1, i8** %4
%5 = load %struct.property*, %struct.property** %3
%6 = load i8*, i8** %4
%7 = call i32 @value_new_string(i8* %6)
%8 = call i32 @property_set_value(%struct.property* %5, i32 %7)
ret void
}

LLVM IR (-O2):
%struct.property = type { i32 }
define void @property_set_string(%struct.property* %0, i8* %1) {
%3 = tail call i32 @value_new_string(i8* %1)
%4 = tail call i32 @property_set_value(%struct.property* %0, i32 %3)
ret void
}
void rop3_47_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~*D;
  stk2 = S | stk3;
  stk1 = T & stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_47_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_47_1_0>:
mov    (%rdi),%al
mov    %eax,%ecx
not    %cl
or     %sil,%cl
and    %dl,%cl
or     %sil,%cl
not    %cl
and    %sil,%al
or     %cl,%al
mov    %al,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_47_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, -1
%6 = or i8 %5, %1
%7 = and i8 %6, %2
%8 = or i8 %7, %1
%9 = xor i8 %8, -1
%10 = and i8 %4, %1
%11 = or i8 %10, %9
store i8 %11, i8* %0
ret void
}
__attribute__((no, constructor(200))) int foo() { return 123; }


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

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

LLVM IR (-O0):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 200, void ()* bitcast (i32 ()* @foo to void ()*), i8* null }]
define i32 @foo() {
ret i32 123
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 200, void ()* bitcast (i32 ()* @foo to void ()*), i8* null }]
define i32 @foo() {
ret i32 123
}
int ucard(array)
register unsigned *array;
{
  register int j = 0, n;
  for (n = 0; n < 64; n++)
    if ((array[n / (8 * sizeof(int))] & (1 << (n % (8 * sizeof(int))))))
      j++;
  return (j);
}


x86 assembly (clang, -O0):
<ucard>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x40,-0x10(%rbp)
jge    1167 <ucard+0x67>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
shr    $0x5,%rcx
mov    (%rax,%rcx,4),%eax
movslq -0x10(%rbp),%rcx
and    $0x1f,%rcx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1154 <ucard+0x54>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1159 <ucard+0x59>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <ucard+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ucard>:
xor    %r8d,%r8d
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r8d,%ecx
shr    $0x5,%ecx
mov    (%rdi,%rcx,4),%edx
mov    %r8d,%ecx
and    $0x1e,%cl
mov    %edx,%esi
shr    %cl,%esi
and    $0x1,%esi
add    %eax,%esi
or     $0x1,%cl
shr    %cl,%edx
and    $0x1,%edx
mov    %edx,%eax
add    %esi,%eax
add    $0x2,%r8d
cmp    $0x40,%r8d
jne    1110 <ucard+0x10>
ret

LLVM IR (-O0):
define i32 @ucard(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %26, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 64
br i1 %7, label %8, label %29
8: ; preds = %5
%9 = load i32*, i32** %2
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = udiv i64 %11, 32
%13 = getelementptr inbounds i32, i32* %9, i64 %12
%14 = load i32, i32* %13
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = urem i64 %16, 32
%18 = trunc i64 %17 to i32
%19 = shl i32 1, %18
%20 = and i32 %14, %19
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %25
22: ; preds = %8
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
store i32 %24, i32* %3
br label %25
25: ; preds = %22, %8
br label %26
26: ; preds = %25
%27 = load i32, i32* %4
%28 = add nsw i32 %27, 1
store i32 %28, i32* %4
br label %5
29: ; preds = %5
%30 = load i32, i32* %3
ret i32 %30
}

LLVM IR (-O2):
define i32 @ucard(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %22, %2 ]
%4 = phi i32 [ 0, %1 ], [ %21, %2 ]
%5 = lshr i32 %3, 5
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = load i32, i32* %7
%9 = and i32 %3, 30
%10 = lshr i32 %8, %9
%11 = and i32 %10, 1
%12 = add nuw nsw i32 %11, %4
%13 = lshr i32 %3, 5
%14 = zext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %0, i64 %14
%16 = load i32, i32* %15
%17 = and i32 %3, 30
%18 = or i32 %17, 1
%19 = lshr i32 %16, %18
%20 = and i32 %19, 1
%21 = add nuw nsw i32 %20, %12
%22 = add nuw nsw i32 %3, 2
%23 = icmp eq i32 %22, 64
br i1 %23, label %24, label %2
24: ; preds = %2
ret i32 %21
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
int aw_bdb_del(void *v_mydb, void *v_txn, char *keystr, int keylen) {
  fatal("BerkeleyDB support not compiled");
  return 0;
}


x86 assembly (clang, -O0):
<aw_bdb_del>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
lea    0xed2(%rip),%rdi
call   1030 <fatal@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [32 x i8] c"BerkeleyDB support not compiled\00"
define i32 @aw_bdb_del(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = call i32 @fatal(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"BerkeleyDB support not compiled\00"
define i32 @aw_bdb_del(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i32 %3) {
%5 = tail call i32 @fatal(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int get_term_width();
int /*<<< orphan*/ ics_printf(char *, int);
void update_ics_width() {
  static int old_width = 0;
  int new_width = get_term_width();
  if (old_width != new_width)
    ics_printf("set width %d\n", new_width);
  old_width = new_width;
}


x86 assembly (clang, -O0):
<update_ics_width>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <get_term_width@plt>
mov    %eax,-0x4(%rbp)
mov    0x2efc(%rip),%eax
cmp    -0x4(%rbp),%eax
je     1150 <update_ics_width+0x30>
mov    -0x4(%rbp),%esi
lea    0xeb5(%rip),%rdi
call   1040 <ics_printf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,0x2edb(%rip)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_ics_width>:
push   %rbx
xor    %eax,%eax
call   1030 <get_term_width@plt>
mov    %eax,%ebx
cmp    %eax,0x2f04(%rip)
je     1140 <update_ics_width+0x20>
lea    0xec7(%rip),%rdi
mov    %ebx,%esi
call   1040 <ics_printf@plt>
mov    %ebx,0x2eee(%rip)
pop    %rbx
ret

LLVM IR (-O0):
@update_ics_width.old_width = internal global i32 0
@.str = [14 x i8] c"set width %d\0A\00"
define void @update_ics_width() {
%1 = alloca i32
%2 = call i32 (...) @get_term_width()
store i32 %2, i32* %1
%3 = load i32, i32* @update_ics_width.old_width
%4 = load i32, i32* %1
%5 = icmp ne i32 %3, %4
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i32, i32* %1
%8 = call i32 @ics_printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %6, %0
%10 = load i32, i32* %1
store i32 %10, i32* @update_ics_width.old_width
ret void
}

LLVM IR (-O2):
@update_ics_width.old_width = internal unnamed_addr global i32 0
@.str = [14 x i8] c"set width %d\0A\00"
define void @update_ics_width() {
%1 = tail call i32 (...) @get_term_width()
%2 = load i32, i32* @update_ics_width.old_width
%3 = icmp eq i32 %2, %1
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @ics_printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %1)
br label %6
6: ; preds = %4, %0
store i32 %1, i32* @update_ics_width.old_width
ret void
}
void foo629() {}


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

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

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

LLVM IR (-O2):
define void @foo629() {
ret void
}
unsigned long long foo(unsigned long long x) { return 0x73500000735LL * x; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movabs $0x73500000735,%rax
imul   -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movabs $0x73500000735,%rax
imul   %rdi,%rax
ret

LLVM IR (-O0):
define i64 @foo(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul i64 7924214662965, %3
ret i64 %4
}

LLVM IR (-O2):
define i64 @foo(i64 %0) {
%2 = mul i64 %0, 7924214662965
ret i64 %2
}
void foo268() {}


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

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

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

LLVM IR (-O2):
define void @foo268() {
ret void
}
__attribute__((used)) int _isatty(int file) { return 1; }


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

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

LLVM IR (-O0):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 (i32)* @_isatty to i8*)], section "llvm.metadata"
define i32 @_isatty(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i32 1
}

LLVM IR (-O2):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 (i32)* @_isatty to i8*)], section "llvm.metadata"
define i32 @_isatty(i32 %0) {
ret i32 1
}