xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, double);
int /*<<< orphan*/ scanf(char *, int *, int *, double *);
int main() {
  int numero, horas;
  double salario_por_hora, salario;
  scanf("%d%d%lf", &numero, &horas, &salario_por_hora);
  salario = salario_por_hora * horas;
  printf("NUMBER = %d\nSALARY = R$ %.2lf\n", numero, salario);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x18(%rbp),%rcx
call   1040 <scanf@plt>
movsd  -0x18(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%esi
movsd  -0x20(%rbp),%xmm0
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
lea    0x10(%rsp),%rcx
call   1040 <scanf@plt>
cvtsi2sdl 0x8(%rsp),%xmm0
mulsd  0x10(%rsp),%xmm0
mov    0xc(%rsp),%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%d%d%lf\00"
@.str.1 = [31 x i8] c"NUMBER = %d\0ASALARY = R$ %.2lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = alloca double
store i32 0, i32* %1
%6 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, double* %4)
%7 = load double, double* %4
%8 = load i32, i32* %3
%9 = sitofp i32 %8 to double
%10 = fmul double %7, %9
store double %10, double* %5
%11 = load i32, i32* %2
%12 = load double, double* %5
%13 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %11, double %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%d%d%lf\00"
@.str.1 = [31 x i8] c"NUMBER = %d\0ASALARY = R$ %.2lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast double* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, double* %3)
%8 = load double, double* %3
%9 = load i32, i32* %2
%10 = sitofp i32 %9 to double
%11 = fmul double %8, %10
%12 = load i32, i32* %1
%13 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %12, double %11)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("hello world\n"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"hello world\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"hello world\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int fun983() { return 983; }


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

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

LLVM IR (-O0):
define i32 @fun983() {
ret i32 983
}

LLVM IR (-O2):
define i32 @fun983() {
ret i32 983
}
/* Variables and functions */
int /*<<< orphan*/ countSort(char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char arr[] = "opengenus";
  countSort(arr);
  printf("Sorted character array is %sn", arr);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x756e65676e65706f,%rax
65 6e 75
mov    %rax,(%rsp)
movw   $0x73,0x8(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <countSort@plt>
lea    0xebe(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.arr = [10 x i8] c"opengenus\00"
@.str = [30 x i8] c"Sorted character array is %sn\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
store i32 0, i32* %1
%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 @countSort(i8* %4)
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%7 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [10 x i8] c"opengenus\00"
@.str = [30 x i8] c"Sorted character array is %sn\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @countSort(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
short _LittleShort(short);
short LittleShort(short l) { return _LittleShort(l); }


x86 assembly (clang, -O0):
<LittleShort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edi
call   1030 <_LittleShort@plt>
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LittleShort>:
jmp    1030 <_LittleShort@plt>

LLVM IR (-O0):
define signext i16 @LittleShort(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call signext i16 @_LittleShort(i16 signext %3)
ret i16 %4
}

LLVM IR (-O2):
define signext i16 @LittleShort(i16 signext %0) {
%2 = tail call signext i16 @_LittleShort(i16 signext %0)
ret i16 %2
}
void draw2i_(x, y) int *x, *y;
{ draw((float)*x, (float)*y, 0.0); }


x86 assembly (clang, -O0):
<draw2i_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2ssl (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x10(%rbp),%rax
cvtsi2ssl (%rax),%xmm1
cvtss2sd %xmm1,%xmm1
xorps  %xmm2,%xmm2
mov    $0x3,%al
call   1030 <draw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw2i_>:
cvtsi2ssl (%rdi),%xmm0
cvtsi2ssl (%rsi),%xmm1
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
xorps  %xmm2,%xmm2
mov    $0x3,%al
jmp    1030 <draw@plt>

LLVM IR (-O0):
define void @draw2i_(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* %5
%7 = sitofp i32 %6 to float
%8 = fpext float %7 to double
%9 = load i32*, i32** %4
%10 = load i32, i32* %9
%11 = sitofp i32 %10 to float
%12 = fpext float %11 to double
%13 = call i32 (double, double, double, ...) bitcast (i32 (...)* @draw to i32 (double, double, double, ...)*)(double %8, double %12, double 0.000000e+00)
ret void
}

LLVM IR (-O2):
define void @draw2i_(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = sitofp i32 %3 to float
%5 = fpext float %4 to double
%6 = load i32, i32* %1
%7 = sitofp i32 %6 to float
%8 = fpext float %7 to double
%9 = tail call i32 (double, double, double, ...) bitcast (i32 (...)* @draw to i32 (double, double, double, ...)*)(double %5, double %8, double 0.000000e+00)
ret void
}
int test_imm_F1uint8_reg(unsigned char val) {
  return ((val) & (-0xF1 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_F1uint8_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, -241
%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_F1uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 15
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
__int128 t(void) { return (__int128)1 << 80; }


x86 assembly (clang, -O0):
<t>:
push   %rbp
mov    %rsp,%rbp
movq   $0x10000,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
pop    %rbp
ret

x86 assembly (clang, -O2):
<t>:
mov    $0x10000,%edx
xor    %eax,%eax
ret

LLVM IR (-O0):
define { i64, i64 } @t() {
%1 = alloca i128
store i128 1208925819614629174706176, i128* %1
%2 = bitcast i128* %1 to { i64, i64 }*
%3 = load { i64, i64 }, { i64, i64 }* %2
ret { i64, i64 } %3
}

LLVM IR (-O2):
define { i64, i64 } @t() {
ret { i64, i64 } { i64 0, i64 65536 }
}
/* Variables and functions */
int sscanf(char *, char *, int *);
scalar_t__ strstr(char *, char *);
bool parse_number(char *str, int *num) {
  return sscanf(str, strstr(str, "0x") ? "%x" : "%d", num);
}


x86 assembly (clang, -O0):
<parse_number>:
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    -0x8(%rbp),%rdi
lea    0xebd(%rip),%rsi
call   1040 <strstr@plt>
mov    -0x18(%rbp),%rdi
mov    %rax,%rcx
lea    0xeb0(%rip),%rsi
lea    0xea6(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rsi
mov    -0x10(%rbp),%rdx
call   1030 <sscanf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_number>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rsi
call   1040 <strstr@plt>
test   %rax,%rax
lea    0xec6(%rip),%rax
lea    0xebc(%rip),%rsi
cmove  %rax,%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <sscanf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"0x\00"
@.str.1 = [3 x i8] c"%x\00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @parse_number(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 i8*, i8** %3
%7 = call i64 @strstr(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%11 = load i32*, i32** %4
%12 = call i32 @sscanf(i8* %5, i8* %10, i32* %11)
ret i32 %12
}

LLVM IR (-O2):
@.str = [3 x i8] c"0x\00"
@.str.1 = [3 x i8] c"%x\00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @parse_number(i8* %0, i32* %1) {
%3 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
%6 = tail call i32 @sscanf(i8* %0, i8* %5, i32* %1)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int mls_type_set_char(unsigned char *buf, unsigned int *len, char src) {
  int size = 1;
  assert(1 <= *len);
  buf[0] = (unsigned char)(src & 0xff);
  *len -= size;
  return size;
}


x86 assembly (clang, -O0):
<mls_type_set_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x10(%rbp),%rcx
mov    $0x1,%eax
cmp    (%rcx),%eax
setbe  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movsbl -0x11(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%edx
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
sub    %edx,%ecx
mov    %ecx,(%rax)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mls_type_set_char>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
xor    %edi,%edi
cmpl   $0x0,(%rsi)
setne  %dil
call   1030 <assert@plt>
mov    %r14b,0x0(%rbp)
addl   $0xffffffff,(%rbx)
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @mls_type_set_char(i8* %0, i32* %1, i8 signext %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i8
%7 = alloca i32
store i8* %0, i8** %4
store i32* %1, i32** %5
store i8 %2, i8* %6
store i32 1, i32* %7
%8 = load i32*, i32** %5
%9 = load i32, i32* %8
%10 = icmp ule i32 1, %9
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i8, i8* %6
%14 = sext i8 %13 to i32
%15 = and i32 %14, 255
%16 = trunc i32 %15 to i8
%17 = load i8*, i8** %4
%18 = getelementptr inbounds i8, i8* %17, i64 0
store i8 %16, i8* %18
%19 = load i32, i32* %7
%20 = load i32*, i32** %5
%21 = load i32, i32* %20
%22 = sub i32 %21, %19
store i32 %22, i32* %20
%23 = load i32, i32* %7
ret i32 %23
}

LLVM IR (-O2):
define i32 @mls_type_set_char(i8* nocapture writeonly %0, i32* nocapture %1, i8 signext %2) {
%4 = load i32, i32* %1
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
store i8 %2, i8* %0
%8 = load i32, i32* %1
%9 = add i32 %8, -1
store i32 %9, i32* %1
ret i32 1
}
void *nopPtr3(void *a1, void *a2, void *a3) { return 0; }


x86 assembly (clang, -O0):
<nopPtr3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @nopPtr3(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @nopPtr3(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
ret i8* null
}
double RadToDeg(double rad) {
  return rad * (180.0 / 3.14159265358979323846264338327950288);
}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void mumble_contextactionmodify_callback(char *action, char *text,
                                         uint32_t m_context, uint32_t operation,
                                         void *user_data) {
  printf("contextactionmodify_callback\n");
}


x86 assembly (clang, -O0):
<mumble_contextactionmodify_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [30 x i8] c"contextactionmodify_callback\0A\00"
define void @mumble_contextactionmodify_callback(i8* %0, i8* %1, i32 %2, i32 %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [29 x i8] c"contextactionmodify_callback\00"
define void @mumble_contextactionmodify_callback(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i32 %3, i8* nocapture readnone %4) {
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[], char *envp[]) {
  int *s = 0x0;
  *s = 1;
  printf("Num: %d\n", argc);
  return 0;
}


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

x86 assembly (clang, -O2):
LLVM IR (-O0):
@.str = [9 x i8] c"Num: %d\0A\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca i32*
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
store i32* null, i32** %8
%9 = load i32*, i32** %8
store i32 1, i32* %9
%10 = load i32, i32* %5
%11 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
/* Variables and functions */
int f_1_d();
int f_1_c() { return f_1_d(); }


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

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

LLVM IR (-O0):
define i32 @f_1_c() {
%1 = call i32 (...) @f_1_d()
ret i32 %1
}

LLVM IR (-O2):
define i32 @f_1_c() {
%1 = tail call i32 (...) @f_1_d()
ret i32 %1
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ selection;
};
struct TYPE_4__ {
  TYPE_1__ xselectionrequest;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
unsigned long get_XEvent_xselectionrequest_selection(void *_p) {
  return (unsigned long)((XEvent *)_p)->xselectionrequest.selection;
}


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

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

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

LLVM IR (-O2):
define i64 @get_XEvent_xselectionrequest_selection(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int L_tmpnam;
int /*<<< orphan*/ *fopen(int /*<<< orphan*/, char *);
int /*<<< orphan*/ tmpnam(char *);
FILE *tmpfile(void) {
  char buffer[L_tmpnam];
  return fopen(tmpnam(buffer), "w+b");
}


x86 assembly (clang, -O0):
<tmpfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,%rsp
mov    %rax,-0x10(%rbp)
call   1040 <tmpnam@plt>
mov    %eax,%edi
lea    0xea2(%rip),%rsi
call   1030 <fopen@plt>
mov    -0x8(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tmpfile>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rdi
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rdi
mov    %rdi,%rsp
call   1040 <tmpnam@plt>
lea    0xeb6(%rip),%rsi
mov    %eax,%edi
call   1030 <fopen@plt>
mov    %rbp,%rsp
pop    %rbp
ret

LLVM IR (-O0):
@L_tmpnam = global i32 0
@.str = [4 x i8] c"w+b\00"
define i32* @tmpfile() {
%1 = alloca i8*
%2 = alloca i64
%3 = load i32, i32* @L_tmpnam
%4 = zext i32 %3 to i64
%5 = call i8* @llvm.stacksave()
store i8* %5, i8** %1
%6 = alloca i8, i64 %4
store i64 %4, i64* %2
%7 = call i32 @tmpnam(i8* %6)
%8 = call i32* @fopen(i32 %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%9 = load i8*, i8** %1
ret i32* %8
}

LLVM IR (-O2):
@L_tmpnam = global i32 0
@.str = [4 x i8] c"w+b\00"
define i32* @tmpfile() {
%1 = load i32, i32* @L_tmpnam
%2 = zext i32 %1 to i64
%3 = alloca i8, i64 %2
%4 = call i32 @tmpnam(i8* %3)
%5 = call i32* @fopen(i32 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32* %5
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *, char *);
void end_of_file() { fatal("Unexpected end of file", ""); }


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

x86 assembly (clang, -O2):
<end_of_file>:
lea    0xee9(%rip),%rdi
lea    0xef8(%rip),%rsi
jmp    1030 <fatal@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Unexpected end of file\00"
@.str.1 = [1 x i8] zeroinitializer
define void @end_of_file() {
%1 = call i32 @fatal(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"Unexpected end of file\00"
@.str.1 = [1 x i8] zeroinitializer
define void @end_of_file() {
%1 = tail call i32 @fatal(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errx(int, char *);
usage() { errx(1, "usage: [hexnum or internet name/address]"); }


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
lea    0xedc(%rip),%rsi
call   1030 <errx@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
jmp    1030 <errx@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"usage: [hexnum or internet name/address]\00"
define i32 @usage() {
%1 = alloca i32
%2 = call i32 @errx(i32 1, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [41 x i8] c"usage: [hexnum or internet name/address]\00"
define i32 @usage() {
%1 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int strlen(char const *);
void replaceString(char source[], const char s1[], const char s2[]) {
  int findString(const char source[], const char destination[]);
  void removeString(char source[], int start, int counts);
  void insertString(char source[], const char insertChars[], int start);
  int start;
  start = findString(source, s1);
  removeString(source, start, strlen(s1));
  insertString(source, s2, start);
  printf("%s", source);
}


x86 assembly (clang, -O0):
<replaceString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <findString@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%esi
mov    %eax,%edx
call   1070 <removeString@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1060 <insertString@plt>
mov    -0x8(%rbp),%rsi
lea    0xe4c(%rip),%rdi
call   1040 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<replaceString>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1050 <findString@plt>
mov    %eax,%ebp
mov    %r15,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %eax,%edx
call   1070 <removeString@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1060 <insertString@plt>
lea    0xe71(%rip),%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @replaceString(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = call i32 @findString(i8* %8, i8* %9)
store i32 %10, i32* %7
%11 = load i8*, i8** %4
%12 = load i32, i32* %7
%13 = load i8*, i8** %5
%14 = call i32 @strlen(i8* %13)
%15 = load i8*, i8** %4
%16 = load i8*, i8** %6
%17 = load i32, i32* %7
%18 = load i8*, i8** %4
%19 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %18)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @replaceString(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @findString(i8* %0, i8* %1)
%5 = tail call i32 @strlen(i8* %1)
tail call void @removeString(i8* %0, i32 %4, i32 %5)
tail call void @insertString(i8* %0, i8* %2, i32 %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ android_compiler_barrier();
void android_atomic_release_store(int32_t value, volatile int32_t *ptr) {
  android_compiler_barrier();
  *ptr = value;
}


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

x86 assembly (clang, -O2):
<android_atomic_release_store>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <android_compiler_barrier@plt>
mov    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @android_atomic_release_store(i32 %0, i32* %1) {
%3 = tail call i32 (...) @android_compiler_barrier()
store volatile i32 %0, i32* %1
ret void
}
int ispunct(int c) {
  return (c >= '!' && c <= '/') || (c >= ':' && c <= '@') ||
         (c >= '[' && c <= '`') || (c >= '{' && c <= '~');
}


x86 assembly (clang, -O0):
<ispunct>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x21,-0x4(%rbp)
jl     1120 <ispunct+0x20>
mov    $0x1,%al
cmpl   $0x2f,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1171 <ispunct+0x71>
cmpl   $0x3a,-0x4(%rbp)
jl     1139 <ispunct+0x39>
mov    $0x1,%al
cmpl   $0x40,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1171 <ispunct+0x71>
cmpl   $0x5b,-0x4(%rbp)
jl     1152 <ispunct+0x52>
mov    $0x1,%al
cmpl   $0x60,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1171 <ispunct+0x71>
xor    %eax,%eax
cmpl   $0x7b,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     116b <ispunct+0x6b>
cmpl   $0x7e,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ispunct>:
movd   %edi,%xmm0
pshufd $0x0,%xmm0,%xmm0
paddd  0xeef(%rip),%xmm0
pxor   0xef7(%rip),%xmm0
movdqa 0xeff(%rip),%xmm1
pcmpgtd %xmm0,%xmm1
movmskps %xmm1,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
ret

LLVM IR (-O0):
define i32 @ispunct(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 33
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 47
br i1 %7, label %28, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 58
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 64
br i1 %13, label %28, label %14
14: ; preds = %11, %8
%15 = load i32, i32* %2
%16 = icmp sge i32 %15, 91
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp sle i32 %18, 96
br i1 %19, label %28, label %20
20: ; preds = %17, %14
%21 = load i32, i32* %2
%22 = icmp sge i32 %21, 123
br i1 %22, label %23, label %26
23: ; preds = %20
%24 = load i32, i32* %2
%25 = icmp sle i32 %24, 126
br label %26
26: ; preds = %23, %20
%27 = phi i1 [ false, %20 ], [ %25, %23 ]
br label %28
28: ; preds = %26, %17, %11, %5
%29 = phi i1 [ true, %17 ], [ true, %11 ], [ true, %5 ], [ %27, %26 ]
%30 = zext i1 %29 to i32
ret i32 %30
}

LLVM IR (-O2):
define i32 @ispunct(i32 %0) {
%2 = insertelement <4 x i32> poison, i32 %0, i64 0
%3 = shufflevector <4 x i32> %2, <4 x i32> poison, <4 x i32> zeroinitializer
%4 = add <4 x i32> %3, <i32 -123, i32 -91, i32 -33, i32 -58>
%5 = icmp ult <4 x i32> %4, <i32 4, i32 6, i32 15, i32 7>
%6 = bitcast <4 x i1> %5 to i4
%7 = icmp ne i4 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}
int vde_chain_nm5_n_in(void) { return 4; }


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

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

LLVM IR (-O0):
define i32 @vde_chain_nm5_n_in() {
ret i32 4
}

LLVM IR (-O2):
define i32 @vde_chain_nm5_n_in() {
ret i32 4
}
unsigned long hash3(const char *str) {
  unsigned long hash = 0;
  int c;
  while ((c = *str++))
    hash = c + (hash << 6) + (hash << 16) - hash;
  return hash;
}


x86 assembly (clang, -O0):
<hash3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     1155 <hash3+0x55>
movslq -0x14(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x6,%rcx
add    %rcx,%rax
mov    -0x10(%rbp),%rcx
shl    $0x10,%rcx
add    %rcx,%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <hash3+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash3>:
mov    (%rdi),%cl
test   %cl,%cl
je     112a <hash3+0x2a>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbq %cl,%rcx
imul   $0x1003f,%rax,%rax
add    %rcx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash3+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @hash3(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 0, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = sext i8 %5 to i64
%10 = mul i64 %7, 65599
%11 = add i64 %10, %9
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 0, %1 ], [ %11, %4 ]
ret i64 %15
}
/* Variables and functions */
int mymeancmp(const void *v1, const void *v2) {
  intptr_t k1 = (intptr_t)v1;
  intptr_t k2 = (intptr_t)v2;
  if (k1 < k2)
    return -1;
  else if (k1 > k2)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<mymeancmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jge    1136 <mymeancmp+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1157 <mymeancmp+0x57>
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jle    1150 <mymeancmp+0x50>
movl   $0x1,-0x4(%rbp)
jmp    1157 <mymeancmp+0x57>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mymeancmp>:
xor    %ecx,%ecx
cmp    %rsi,%rdi
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @mymeancmp(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = ptrtoint i8* %8 to i64
store i64 %9, i64* %6
%10 = load i8*, i8** %5
%11 = ptrtoint i8* %10 to i64
store i64 %11, i64* %7
%12 = load i64, i64* %6
%13 = load i64, i64* %7
%14 = icmp slt i64 %12, %13
br i1 %14, label %15, label %16
15: ; preds = %2
store i32 -1, i32* %3
br label %22
16: ; preds = %2
%17 = load i64, i64* %6
%18 = load i64, i64* %7
%19 = icmp sgt i64 %17, %18
br i1 %19, label %20, label %21
20: ; preds = %16
store i32 1, i32* %3
br label %22
21: ; preds = %16
store i32 0, i32* %3
br label %22
22: ; preds = %21, %20, %15
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @mymeancmp(i8* readnone %0, i8* readnone %1) {
%3 = icmp slt i8* %0, %1
%4 = icmp sgt i8* %0, %1
%5 = zext i1 %4 to i32
%6 = select i1 %3, i32 -1, i32 %5
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
void writew(uint16_t val, const void *addr) {
  *((volatile uint16_t *)addr) = val;
}


x86 assembly (clang, -O0):
<writew>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<writew>:
mov    %edi,(%rsi)
ret

LLVM IR (-O0):
define void @writew(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i32*
store volatile i32 %5, i32* %7
ret void
}

LLVM IR (-O2):
define void @writew(i32 %0, i8* %1) {
%3 = bitcast i8* %1 to i32*
store volatile i32 %0, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char k, o, c;
  scanf("%c", &k);
  c = k - 'a';
  o = 'z' - c;
  printf("%c", o);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x5(%rbp),%eax
sub    $0x61,%eax
mov    %al,-0x7(%rbp)
movsbl -0x7(%rbp),%ecx
mov    $0x7a,%eax
sub    %ecx,%eax
mov    %al,-0x6(%rbp)
lea    0xea2(%rip),%rdi
movsbl -0x6(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xf(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    $0xdb,%al
sub    0xf(%rsp),%al
movsbl %al,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
%8 = sub nsw i32 %7, 97
%9 = trunc i32 %8 to i8
store i8 %9, i8* %4
%10 = load i8, i8* %4
%11 = sext i8 %10 to i32
%12 = sub nsw i32 122, %11
%13 = trunc i32 %12 to i8
store i8 %13, i8* %3
%14 = load i8, i8* %3
%15 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = sub i8 -37, %3
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %4)
ret i32 0
}
/* Variables and functions */
void *memcpy(void *to, const void *from __attribute__((__unused__)),
             size_t len __attribute__((__unused__))) {
  return to;
}


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

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

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

LLVM IR (-O2):
define i8* @memcpy(i8* readnone returned %0, i8* nocapture readnone %1, i64 %2) {
ret i8* %0
}
void ktsan_split_page(struct page *page, unsigned int order) {}


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

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

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

LLVM IR (-O2):
%struct.page = type opaque
define void @ktsan_split_page(%struct.page* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
double cblas_dsdot(int const, float const *, int const, float const *,
                   int const);
double c_dsdot(const int N, const float *X, const int strideX, const float *Y,
               const int strideY) {
  return cblas_dsdot(N, X, strideX, Y, strideY);
}


x86 assembly (clang, -O0):
<c_dsdot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
call   1030 <cblas_dsdot@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_dsdot>:
jmp    1030 <cblas_dsdot@plt>

LLVM IR (-O0):
define double @c_dsdot(i32 %0, float* %1, i32 %2, float* %3, i32 %4) {
%6 = alloca i32
%7 = alloca float*
%8 = alloca i32
%9 = alloca float*
%10 = alloca i32
store i32 %0, i32* %6
store float* %1, float** %7
store i32 %2, i32* %8
store float* %3, float** %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load float*, float** %7
%13 = load i32, i32* %8
%14 = load float*, float** %9
%15 = load i32, i32* %10
%16 = call double @cblas_dsdot(i32 %11, float* %12, i32 %13, float* %14, i32 %15)
ret double %16
}

LLVM IR (-O2):
define double @c_dsdot(i32 %0, float* %1, i32 %2, float* %3, i32 %4) {
%6 = tail call double @cblas_dsdot(i32 %0, float* %1, i32 %2, float* %3, i32 %4)
ret double %6
}
long long foo(int len) { return (long long)(((long long)1 << len) - 1); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%rax
sub    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %edi,%ecx
mov    $0xffffffffffffffff,%rax
shl    %cl,%rax
not    %rax
ret

LLVM IR (-O0):
define i64 @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = shl i64 1, %4
%6 = sub nsw i64 %5, 1
ret i64 %6
}

LLVM IR (-O2):
define i64 @foo(i32 %0) {
%2 = zext i32 %0 to i64
%3 = shl nsw i64 -1, %2
%4 = xor i64 %3, -1
ret i64 %4
}
/* Variables and functions */
int eql(char const *, char const *);
int mystrcmp(const void *p1, const void *p2) {
  return eql((const char *)p1, (const char *)p2);
}


x86 assembly (clang, -O0):
<mystrcmp>:
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 <eql@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrcmp>:
jmp    1030 <eql@plt>

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

LLVM IR (-O2):
define i32 @mystrcmp(i8* %0, i8* %1) {
%3 = tail call i32 @eql(i8* %0, i8* %1)
ret i32 %3
}
void test_invalid_clause() {
  int i;
#pragma omp target simd foo bar
  for (i = 0; i < 16; ++i)
    ;
}


x86 assembly (clang, -O0):
<test_invalid_clause>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1128 <test_invalid_clause+0x28>
jmp    111a <test_invalid_clause+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <test_invalid_clause+0xb>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test_invalid_clause() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 16
br i1 %4, label %5, label %9
5: ; preds = %2
br label %6
6: ; preds = %5
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
br label %2
9: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @test_invalid_clause() {
ret void
}
/* Type definitions */
struct plainstring {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ plainstring_loadbuffer(struct plainstring *, char *, int);
void plainstring_set_char(struct plainstring *this_string, char c) {
  plainstring_loadbuffer(this_string, &c, 1);
}


x86 assembly (clang, -O0):
<plainstring_set_char>:
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 <plainstring_loadbuffer@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.plainstring = type { i32 }
define void @plainstring_set_char(%struct.plainstring* %0, i8 signext %1) {
%3 = alloca %struct.plainstring*
%4 = alloca i8
store %struct.plainstring* %0, %struct.plainstring** %3
store i8 %1, i8* %4
%5 = load %struct.plainstring*, %struct.plainstring** %3
%6 = call i32 @plainstring_loadbuffer(%struct.plainstring* %5, i8* %4, i32 1)
ret void
}

LLVM IR (-O2):
%struct.plainstring = type { i32 }
define void @plainstring_set_char(%struct.plainstring* %0, i8 signext %1) {
%3 = alloca i8
store i8 %1, i8* %3
%4 = call i32 @plainstring_loadbuffer(%struct.plainstring* %0, i8* %3, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ daemonize(char *);
int /*<<< orphan*/ system(char *);
int main(int argc, char *argv[]) {
  daemonize("a.out");
  while (1) {
  }
  system("echo 1  >> /home/jemore/aa");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <daemonize@plt>
jmp    1132 <main+0x22>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <daemonize@plt>
nopl   (%rax)
jmp    1120 <main+0x10>

LLVM IR (-O0):
@.str = [6 x i8] c"a.out\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @daemonize(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %2, %7
br label %7
}

LLVM IR (-O2):
@.str = [6 x i8] c"a.out\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @daemonize(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %2, %4
br label %4
}
char *hb_energy_get_source_msr(void) { return "X86 MSR"; }


x86 assembly (clang, -O0):
<hb_energy_get_source_msr>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hb_energy_get_source_msr>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [8 x i8] c"X86 MSR\00"
define i8* @hb_energy_get_source_msr() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [8 x i8] c"X86 MSR\00"
define i8* @hb_energy_get_source_msr() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}
int rmdir(const char *path) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @rmdir(i8* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t pmsafe(uint32_t addr) { return addr & 0x00000fff; }


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

x86 assembly (clang, -O2):
<pmsafe>:
mov    %edi,%eax
and    $0xfff,%eax
ret

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

LLVM IR (-O2):
define i32 @pmsafe(i32 %0) {
%2 = and i32 %0, 4095
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void result_end(void) { printf("\n    ]"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"\0A ]\00"
define void @result_end() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"\0A ]\00"
define void @result_end() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
float fract(double);
double sin(float);
float hash(float n) { return fract(sin(n) * 43758.5453); }


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <sin@plt>
movsd  0xec1(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <fract@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
push   %rax
call   1040 <sin@plt>
mulsd  0xed2(%rip),%xmm0
pop    %rax
jmp    1030 <fract@plt>

LLVM IR (-O0):
define float @hash(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call double @sin(float %3)
%5 = fmul double %4, 0x40E55DD17318FC50
%6 = call float @fract(double %5)
ret float %6
}

LLVM IR (-O2):
define float @hash(float %0) {
%2 = tail call double @sin(float %0)
%3 = fmul double %2, 0x40E55DD17318FC50
%4 = tail call float @fract(double %3)
ret float %4
}