xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int num, m;
  scanf("%d", &num);
  scanf("%d", &m);
  printf("%d", num << m);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xec1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%ecx
shl    %cl,%esi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%cl
shl    %cl,%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"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = shl i32 %5, %6
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = shl i32 %7, %8
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_cmpord_pd(int /*<<< orphan*/, int /*<<< orphan*/);
__m128d test_mm_cmpord_pd(__m128d A, __m128d B) { return _mm_cmpord_pd(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_cmpord_pd>:
jmp    1030 <_mm_cmpord_pd@plt>

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

LLVM IR (-O2):
define i32 @test_mm_cmpord_pd(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmpord_pd(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
char *lTrim(int /*<<< orphan*/);
int /*<<< orphan*/ rTrim(char *);
char *allTrim(char *buf) { return lTrim(rTrim(buf)); }


x86 assembly (clang, -O0):
<allTrim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <rTrim@plt>
mov    %eax,%edi
call   1030 <lTrim@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allTrim>:
push   %rax
call   1040 <rTrim@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <lTrim@plt>

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

LLVM IR (-O2):
define i8* @allTrim(i8* %0) {
%2 = tail call i32 @rTrim(i8* %0)
%3 = tail call i8* @lTrim(i32 %2)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ test_alex();
int main() {
  test_alex();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_alex()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void *hello(void *arg) {
  char *msg = "Hola mundo";
  printf("%s\n", msg);
}


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

x86 assembly (clang, -O2):
<hello>:
lea    0xef4(%rip),%rdi
lea    0xee2(%rip),%rsi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"Hola mundo\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define noalias i8* @hello(i8* nocapture readnone %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i8* undef
}
void gtk_container_child_set_property() {}


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

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

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

LLVM IR (-O2):
define void @gtk_container_child_set_property() {
ret void
}
int ft_count_if(char **tab, int (*f)(char *)) {
  int i;
  i = 0;
  while (tab[i])
    if (f(tab[i]) == 1)
      i++;
  return (i);
}


x86 assembly (clang, -O0):
<ft_count_if>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1153 <ft_count_if+0x53>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq -0x14(%rbp),%rdx
mov    (%rcx,%rdx,8),%rdi
call   *%rax
cmp    $0x1,%eax
jne    114e <ft_count_if+0x4e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <ft_count_if+0x17>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_count_if>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1138 <ft_count_if+0x38>
mov    %rsi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
call   *%r14
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
add    %ecx,%ebx
mov    (%r15,%rbx,8),%rdi
test   %rdi,%rdi
jne    1120 <ft_count_if+0x20>
jmp    113a <ft_count_if+0x3a>
xor    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @ft_count_if(i8** nocapture %0, i32 (i8*)* nocapture %1) {
%3 = load i8*, i8** %0
%4 = icmp eq i8* %3, null
br i1 %4, label %16, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %14, %5 ], [ %3, %2 ]
%7 = phi i32 [ %11, %5 ], [ 0, %2 ]
%8 = tail call i32 %1(i8* %6)
%9 = icmp eq i32 %8, 1
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %7, %10
%12 = zext i32 %11 to i64
%13 = getelementptr inbounds i8*, i8** %0, i64 %12
%14 = load i8*, i8** %13
%15 = icmp eq i8* %14, null
br i1 %15, label %16, label %5
16: ; preds = %5, %2
%17 = phi i32 [ 0, %2 ], [ %11, %5 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ DecodeDEa_xxxxdddxssmmmrrr();
int /*<<< orphan*/ DoBinOr(int /*<<< orphan*/);
void DoCodeOrDEa(void) { DoBinOr(DecodeDEa_xxxxdddxssmmmrrr()); }


x86 assembly (clang, -O0):
<DoCodeOrDEa>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <DecodeDEa_xxxxdddxssmmmrrr@plt>
mov    %eax,%edi
call   1040 <DoBinOr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoCodeOrDEa>:
push   %rax
xor    %eax,%eax
call   1030 <DecodeDEa_xxxxdddxssmmmrrr@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <DoBinOr@plt>

LLVM IR (-O0):
define void @DoCodeOrDEa() {
%1 = call i32 (...) @DecodeDEa_xxxxdddxssmmmrrr()
%2 = call i32 @DoBinOr(i32 %1)
ret void
}

LLVM IR (-O2):
define void @DoCodeOrDEa() {
%1 = tail call i32 (...) @DecodeDEa_xxxxdddxssmmmrrr()
%2 = tail call i32 @DoBinOr(i32 %1)
ret void
}
/* Type definitions */
struct command_queue {
  int dummy;
};

/* Variables and functions */
int cq_is_empty(const struct command_queue *h) {
  if (h == NULL)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<cq_is_empty>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <cq_is_empty+0x1f>
movl   $0x1,-0x4(%rbp)
jmp    1126 <cq_is_empty+0x26>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cq_is_empty>:
xor    %eax,%eax
test   %rdi,%rdi
sete   %al
ret

LLVM IR (-O0):
%struct.command_queue = type { i32 }
define i32 @cq_is_empty(%struct.command_queue* %0) {
%2 = alloca i32
%3 = alloca %struct.command_queue*
store %struct.command_queue* %0, %struct.command_queue** %3
%4 = load %struct.command_queue*, %struct.command_queue** %3
%5 = icmp eq %struct.command_queue* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
%struct.command_queue = type { i32 }
define i32 @cq_is_empty(%struct.command_queue* readnone %0) {
%2 = icmp eq %struct.command_queue* %0, null
%3 = zext i1 %2 to i32
ret i32 %3
}
void gll_coordinates_order5_square(double *out_3001728889501436902) {
  out_3001728889501436902[0] = -1.0;
  out_3001728889501436902[1] = -0.765055323929465;
  out_3001728889501436902[2] = -0.285231516480645;
  out_3001728889501436902[3] = 0.285231516480645;
  out_3001728889501436902[4] = 0.765055323929465;
  out_3001728889501436902[5] = 1.0;
}


x86 assembly (clang, -O0):
<gll_coordinates_order5_square>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xf14(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0xefc(%rip),%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movsd  0xee3(%rip),%xmm0
movsd  %xmm0,0x10(%rax)
mov    -0x8(%rbp),%rax
movsd  0xeca(%rip),%xmm0
movsd  %xmm0,0x18(%rax)
mov    -0x8(%rbp),%rax
movsd  0xeb1(%rip),%xmm0
movsd  %xmm0,0x20(%rax)
mov    -0x8(%rbp),%rax
movsd  0xe98(%rip),%xmm0
movsd  %xmm0,0x28(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<gll_coordinates_order5_square>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
movaps 0xeff(%rip),%xmm0
movups %xmm0,0x10(%rdi)
movaps 0xf04(%rip),%xmm0
movups %xmm0,0x20(%rdi)
ret

LLVM IR (-O0):
define void @gll_coordinates_order5_square(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
store double -1.000000e+00, double* %4
%5 = load double*, double** %2
%6 = getelementptr inbounds double, double* %5, i64 1
store double 0xBFE87B554D7D0C31, double* %6
%7 = load double*, double** %2
%8 = getelementptr inbounds double, double* %7, i64 2
store double 0xBFD2413BB0C4A9A9, double* %8
%9 = load double*, double** %2
%10 = getelementptr inbounds double, double* %9, i64 3
store double 0x3FD2413BB0C4A9A9, double* %10
%11 = load double*, double** %2
%12 = getelementptr inbounds double, double* %11, i64 4
store double 0x3FE87B554D7D0C31, double* %12
%13 = load double*, double** %2
%14 = getelementptr inbounds double, double* %13, i64 5
store double 1.000000e+00, double* %14
ret void
}

LLVM IR (-O2):
define void @gll_coordinates_order5_square(double* nocapture writeonly %0) {
%2 = bitcast double* %0 to <2 x double>*
store <2 x double> <double -1.000000e+00, double 0xBFE87B554D7D0C31>, <2 x double>* %2
%3 = getelementptr inbounds double, double* %0, i64 2
%4 = bitcast double* %3 to <2 x double>*
store <2 x double> <double 0xBFD2413BB0C4A9A9, double 0x3FD2413BB0C4A9A9>, <2 x double>* %4
%5 = getelementptr inbounds double, double* %0, i64 4
%6 = bitcast double* %5 to <2 x double>*
store <2 x double> <double 0x3FE87B554D7D0C31, double 1.000000e+00>, <2 x double>* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void destroy(void *context) { free(context); }


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

x86 assembly (clang, -O2):
<destroy>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @destroy(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setInputGain(void *, unsigned char);
void fsetInputGain(void *d, float f) {
  setInputGain(d, (unsigned char)(f * 127.0));
}


x86 assembly (clang, -O0):
<fsetInputGain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeca(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
movzbl %al,%esi
call   1030 <setInputGain@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsetInputGain>:
cvtss2sd %xmm0,%xmm0
mulsd  0xee4(%rip),%xmm0
cvttsd2si %xmm0,%eax
movzbl %al,%esi
jmp    1030 <setInputGain@plt>

LLVM IR (-O0):
define void @fsetInputGain(i8* %0, float %1) {
%3 = alloca i8*
%4 = alloca float
store i8* %0, i8** %3
store float %1, float* %4
%5 = load i8*, i8** %3
%6 = load float, float* %4
%7 = fpext float %6 to double
%8 = fmul double %7, 1.270000e+02
%9 = fptoui double %8 to i8
%10 = call i32 @setInputGain(i8* %5, i8 zeroext %9)
ret void
}

LLVM IR (-O2):
define void @fsetInputGain(i8* %0, float %1) {
%3 = fpext float %1 to double
%4 = fmul double %3, 1.270000e+02
%5 = fptoui double %4 to i8
%6 = tail call i32 @setInputGain(i8* %0, i8 zeroext %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ add(int);
void *pthread_fun(void *arg) {
  int *num2 = (int *)arg;
  add(13);
}


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

x86 assembly (clang, -O2):
<pthread_fun>:
mov    $0xd,%edi
jmp    1030 <add@plt>

LLVM IR (-O0):
define i8* @pthread_fun(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
store i32* %6, i32** %4
%7 = call i32 @add(i32 13)
%8 = load i8*, i8** %2
ret i8* %8
}

LLVM IR (-O2):
define noalias i8* @pthread_fun(i8* nocapture readnone %0) {
%2 = tail call i32 @add(i32 13)
ret i8* undef
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ no_return();
void wrap_malloc(int **x) {
  *x = (int *)malloc(sizeof(int));
  if (!*x) {
    no_return();
  }
}


x86 assembly (clang, -O0):
<wrap_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1155 <wrap_malloc+0x35>
mov    $0x0,%al
call   1040 <no_return@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrap_malloc>:
push   %rbx
mov    %rdi,%rbx
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,(%rbx)
test   %rax,%rax
je     1138 <wrap_malloc+0x18>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
jmp    1040 <no_return@plt>

LLVM IR (-O0):
define void @wrap_malloc(i32** %0) {
%2 = alloca i32**
store i32** %0, i32*** %2
%3 = call i64 @malloc(i32 4)
%4 = inttoptr i64 %3 to i32*
%5 = load i32**, i32*** %2
store i32* %4, i32** %5
%6 = load i32**, i32*** %2
%7 = load i32*, i32** %6
%8 = icmp ne i32* %7, null
br i1 %8, label %11, label %9
9: ; preds = %1
%10 = call i32 (...) @no_return()
br label %11
11: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
define void @wrap_malloc(i32** nocapture writeonly %0) {
%2 = tail call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %0
%4 = icmp eq i64 %2, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (...) @no_return()
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int close(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
extern int Close(int fd) {
  int result;
  if ((result = close(fd)) < 0) {
    perror("close file error");
    exit(6);
  }
  return result;
}


x86 assembly (clang, -O0):
<Close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jge    1165 <Close+0x35>
lea    0xeaa(%rip),%rdi
call   1040 <perror@plt>
mov    $0x6,%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Close>:
push   %rax
call   1030 <close@plt>
test   %eax,%eax
js     113c <Close+0xc>
pop    %rcx
ret
lea    0xebd(%rip),%rdi
call   1040 <perror@plt>
mov    $0x6,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"close file error\00"
define i32 @Close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @close(i32 %4)
store i32 %5, i32* %3
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 6)
unreachable
10: ; preds = %1
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
@.str = [17 x i8] c"close file error\00"
define i32 @Close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 6)
unreachable
7: ; preds = %1
ret i32 %2
}
long list_index(long y) { return (y - 1) / 2; }


x86 assembly (clang, -O0):
<list_index>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sub    $0x1,%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_index>:
lea    -0x1(%rdi),%rax
shr    $0x3f,%rax
add    %rdi,%rax
add    $0xffffffffffffffff,%rax
sar    %rax
ret

LLVM IR (-O0):
define i64 @list_index(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sub nsw i64 %3, 1
%5 = sdiv i64 %4, 2
ret i64 %5
}

LLVM IR (-O2):
define i64 @list_index(i64 %0) {
%2 = add nsw i64 %0, -1
%3 = sdiv i64 %2, 2
ret i64 %3
}
void CalculateSparePicture() {}


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

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

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

LLVM IR (-O2):
define void @CalculateSparePicture() {
ret void
}
/* Variables and functions */
int gcd(int, int);
int mul(int a, int b) { return a * b / gcd(a, b); }


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

x86 assembly (clang, -O2):
<mul>:
push   %rbx
mov    %esi,%ebx
imul   %edi,%ebx
call   1030 <gcd@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
pop    %rbx
ret

LLVM IR (-O0):
define i32 @mul(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 = mul nsw i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @gcd(i32 %8, i32 %9)
%11 = sdiv i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @mul(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = tail call i32 @gcd(i32 %0, i32 %1)
%5 = sdiv i32 %3, %4
ret i32 %5
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double stdlib_strided_dsempn(int, int, double *, int);
int main() {
  double x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  double v = stdlib_strided_dsempn(N, 1, x, stride);
  printf("standard error of the mean: %lf\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x40(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x40,%edx
call   1040 <memcpy@plt>
movl   $0x4,-0x44(%rbp)
movl   $0x2,-0x48(%rbp)
mov    -0x44(%rbp),%edi
lea    -0x40(%rbp),%rdx
mov    -0x48(%rbp),%ecx
mov    $0x1,%esi
call   1050 <stdlib_strided_dsempn@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movaps 0xf05(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb1(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdx
mov    $0x4,%edi
mov    $0x1,%esi
mov    $0x2,%ecx
call   1040 <stdlib_strided_dsempn@plt>
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00, double 5.000000e+00, double 6.000000e+00, double 7.000000e+00, double 8.000000e+00]
@.str = [33 x i8] c"standard error of the mean: %lf\0A\00"
define i32 @main() {
%1 = alloca [8 x double]
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = bitcast [8 x double]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call double @stdlib_strided_dsempn(i32 %6, i32 1, double* %7, i32 %8)
store double %9, double* %4
%10 = load double, double* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00, double 5.000000e+00, double 6.000000e+00, double 7.000000e+00, double 8.000000e+00]
@.str = [33 x i8] c"standard error of the mean: %lf\0A\00"
define i32 @main() {
%1 = alloca [8 x double]
%2 = bitcast [8 x double]* %1 to i8*
%3 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 0
%4 = call double @stdlib_strided_dsempn(i32 4, i32 1, double* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), double %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ u32;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ WriteUint32Le(int /*<<< orphan*/, void *);
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, float *, int);
int32_t WriteFloatLe(float value, void *out) {
  assert(out != NULL);
  uint32_t u32;
  memcpy(&u32, &value, sizeof(u32));
  return WriteUint32Le(u32, out);
}


x86 assembly (clang, -O0):
<WriteFloatLe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    -0x14(%rbp),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x4,%edx
call   1050 <memcpy@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <WriteUint32Le@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteFloatLe>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movss  %xmm0,0xc(%rsp)
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
lea    0x8(%rsp),%rdi
lea    0xc(%rsp),%rsi
mov    $0x4,%edx
call   1050 <memcpy@plt>
mov    0x8(%rsp),%edi
mov    %rbx,%rsi
call   1030 <WriteUint32Le@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @WriteFloatLe(float %0, i8* %1) {
%3 = alloca float
%4 = alloca i8*
%5 = alloca i32
store float %0, float* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = icmp ne i8* %6, null
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = call i32 @memcpy(i32* %5, float* %3, i32 4)
%11 = load i32, i32* %5
%12 = load i8*, i8** %4
%13 = call i32 @WriteUint32Le(i32 %11, i8* %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @WriteFloatLe(float %0, i8* %1) {
%3 = alloca float
%4 = alloca i32
store float %0, float* %3
%5 = icmp ne i8* %1, null
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = bitcast i32* %4 to i8*
%9 = call i32 @memcpy(i32* %4, float* %3, i32 4)
%10 = load i32, i32* %4
%11 = call i32 @WriteUint32Le(i32 %10, i8* %1)
ret i32 %11
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ si_addr;
};
typedef TYPE_1__ siginfo_t;

/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int getpid();
int /*<<< orphan*/ printf(char *, int, int, int /*<<< orphan*/);
void segv_handler(int sig, siginfo_t *info, void *arg) {
  printf("SIG: %d in %d @ %p\n", sig, getpid(), info->si_addr);
  _exit(1);
}


x86 assembly (clang, -O0):
<segv_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1040 <getpid@plt>
mov    -0x1c(%rbp),%esi
mov    %eax,%edx
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
lea    0xe9e(%rip),%rdi
call   1050 <printf@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<segv_handler>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <getpid@plt>
mov    (%rbx),%ecx
lea    0xeb8(%rip),%rdi
mov    %ebp,%esi
mov    %eax,%edx
call   1050 <printf@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
@.str = [20 x i8] c"SIG: %d in %d @ %p\0A\00"
define void @segv_handler(i32 %0, %struct.TYPE_3__* %1, i8* %2) {
%4 = alloca i32
%5 = alloca %struct.TYPE_3__*
%6 = alloca i8*
store i32 %0, i32* %4
store %struct.TYPE_3__* %1, %struct.TYPE_3__** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = call i32 (...) @getpid()
%9 = load %struct.TYPE_3__*, %struct.TYPE_3__** %5
%10 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %9, i32 0, i32 0
%11 = load i32, i32* %10
%12 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8, i32 %11)
%13 = call i32 @_exit(i32 1)
unreachable
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
@.str = [20 x i8] c"SIG: %d in %d @ %p\0A\00"
define void @segv_handler(i32 %0, %struct.TYPE_3__* nocapture %1, i8* nocapture readnone %2) {
%4 = tail call i32 (...) @getpid()
%5 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %4, i32 %6)
%8 = tail call i32 @_exit(i32 1)
unreachable
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ x;
};
typedef TYPE_1__ XKeyReleasedEvent;

/* Variables and functions */
int get_XKeyReleasedEvent_x(void *_p) {
  return (int)((XKeyReleasedEvent *)_p)->x;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XKeyReleasedEvent_x(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int MV_GetReverseStereo();
int FX_GetReverseStereo(void) { return MV_GetReverseStereo(); }


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

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

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

LLVM IR (-O2):
define i32 @FX_GetReverseStereo() {
%1 = tail call i32 (...) @MV_GetReverseStereo()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void pad(int n) {
  int i;
  for (i = 0; i < n; i++)
    printf(" ");
}


x86 assembly (clang, -O0):
<pad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <pad+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <pad+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pad>:
push   %rbx
test   %edi,%edi
jle    112f <pad+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <pad+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @pad(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @putchar(i32 32)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
float f_to_c(int fahrenheit) {
  float celsius = (fahrenheit - 32) / 1.8;
  return celsius;
}


x86 assembly (clang, -O0):
<f_to_c>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
cvtsi2sd %eax,%xmm0
movsd  0xee7(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_to_c>:
add    $0xffffffe0,%edi
cvtsi2sd %edi,%xmm0
divsd  0xef1(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @f_to_c(i32 %0) {
%2 = alloca i32
%3 = alloca float
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 32
%6 = sitofp i32 %5 to double
%7 = fdiv double %6, 1.800000e+00
%8 = fptrunc double %7 to float
store float %8, float* %3
%9 = load float, float* %3
ret float %9
}

LLVM IR (-O2):
define float @f_to_c(i32 %0) {
%2 = add nsw i32 %0, -32
%3 = sitofp i32 %2 to double
%4 = fdiv double %3, 1.800000e+00
%5 = fptrunc double %4 to float
ret float %5
}
void inclass_element2CONTROLX(char c) {}


x86 assembly (clang, -O0):
<inclass_element2CONTROLX>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @inclass_element2CONTROLX(i8 signext %0) {
ret void
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcat(char *, char *);
char *getString() {
  char *string;
  string = malloc(sizeof(char) * 100);
  strcat(string, "bla");
  strcat(string, "/");
  strcat(string, "blub");
  printf("string : '%s'\n", string);
  return string;
}


x86 assembly (clang, -O0):
<getString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x64,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeaf(%rip),%rsi
call   1050 <strcat@plt>
mov    -0x8(%rbp),%rdi
lea    0xea3(%rip),%rsi
call   1050 <strcat@plt>
mov    -0x8(%rbp),%rdi
lea    0xe95(%rip),%rsi
call   1050 <strcat@plt>
mov    -0x8(%rbp),%rsi
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getString>:
push   %rbx
mov    $0x64,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xebb(%rip),%rsi
mov    %rax,%rdi
call   1050 <strcat@plt>
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcat@plt>
lea    0xea3(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcat@plt>
lea    0xe99(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"bla\00"
@.str.1 = [2 x i8] c"/\00"
@.str.2 = [5 x i8] c"blub\00"
@.str.3 = [15 x i8] c"string : '%s'\0A\00"
define i8* @getString() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 100)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @strcat(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %1
%6 = call i32 @strcat(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%7 = load i8*, i8** %1
%8 = call i32 @strcat(i8* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%9 = load i8*, i8** %1
%10 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8* %9)
%11 = load i8*, i8** %1
ret i8* %11
}

LLVM IR (-O2):
@.str = [4 x i8] c"bla\00"
@.str.1 = [2 x i8] c"/\00"
@.str.2 = [5 x i8] c"blub\00"
@.str.3 = [15 x i8] c"string : '%s'\0A\00"
define i8* @getString() {
%1 = tail call dereferenceable_or_null(100) i8* @malloc(i32 100)
%2 = tail call i32 @strcat(i8* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @strcat(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @strcat(i8* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8* %1)
ret i8* %1
}
void ff_hevc_put_hevc_epel_hv64_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_epel_hv64_8_sse4() {
ret void
}
void atmc_add32(volatile unsigned int *address, int value) {
  asm volatile("lock ; "
               "addl %1,%0"
               : "=m"(*address)
               : "ir"(value), "m"(*address));
}


x86 assembly (clang, -O0):
<atmc_add32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rdx
lock add %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<atmc_add32>:
lock add %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @atmc_add32(i32* %0, i32 %1) {
tail call void asm sideeffect "lock ; addl $1,$0", "=*m,ir,*m,~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %0, i32 %1, i32* elementtype(i32) %0)
ret void
}
unsigned hexval(int c) {
  if ('0' <= c && c <= '9')
    return c - '0';
  if ('a' <= c && c <= 'f')
    return c - 'a' + 10;
  if ('A' <= c && c <= 'F')
    return c - 'A' + 10;
  return 0xA3;
}


x86 assembly (clang, -O0):
<hexval>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    $0x30,%eax
cmp    -0x8(%rbp),%eax
jg     112d <hexval+0x2d>
cmpl   $0x39,-0x8(%rbp)
jg     112d <hexval+0x2d>
mov    -0x8(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    1186 <hexval+0x86>
mov    $0x61,%eax
cmp    -0x8(%rbp),%eax
jg     1156 <hexval+0x56>
cmpl   $0x66,-0x8(%rbp)
jg     1156 <hexval+0x56>
mov    -0x8(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    1186 <hexval+0x86>
mov    $0x41,%eax
cmp    -0x8(%rbp),%eax
jg     117f <hexval+0x7f>
cmpl   $0x46,-0x8(%rbp)
jg     117f <hexval+0x7f>
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    1186 <hexval+0x86>
movl   $0xa3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexval>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
jb     1127 <hexval+0x27>
lea    -0x61(%rdi),%eax
cmp    $0x5,%eax
ja     1116 <hexval+0x16>
add    $0xffffffa9,%edi
mov    %edi,%eax
ret
lea    -0x41(%rdi),%eax
add    $0xffffffc9,%edi
cmp    $0x6,%eax
mov    $0xa3,%eax
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define i32 @hexval(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 48, %4
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 57
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 48
store i32 %11, i32* %2
br label %33
12: ; preds = %6, %1
%13 = load i32, i32* %3
%14 = icmp sle i32 97, %13
br i1 %14, label %15, label %22
15: ; preds = %12
%16 = load i32, i32* %3
%17 = icmp sle i32 %16, 102
br i1 %17, label %18, label %22
18: ; preds = %15
%19 = load i32, i32* %3
%20 = sub nsw i32 %19, 97
%21 = add nsw i32 %20, 10
store i32 %21, i32* %2
br label %33
22: ; preds = %15, %12
%23 = load i32, i32* %3
%24 = icmp sle i32 65, %23
br i1 %24, label %25, label %32
25: ; preds = %22
%26 = load i32, i32* %3
%27 = icmp sle i32 %26, 70
br i1 %27, label %28, label %32
28: ; preds = %25
%29 = load i32, i32* %3
%30 = sub nsw i32 %29, 65
%31 = add nsw i32 %30, 10
store i32 %31, i32* %2
br label %33
32: ; preds = %25, %22
store i32 163, i32* %2
br label %33
33: ; preds = %32, %28, %18, %9
%34 = load i32, i32* %2
ret i32 %34
}

LLVM IR (-O2):
define i32 @hexval(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
br i1 %3, label %14, label %4
4: ; preds = %1
%5 = add i32 %0, -97
%6 = icmp ult i32 %5, 6
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = add nsw i32 %0, -87
br label %14
9: ; preds = %4
%10 = add i32 %0, -65
%11 = icmp ult i32 %10, 6
%12 = add nsw i32 %0, -55
%13 = select i1 %11, i32 %12, i32 163
br label %14
14: ; preds = %1, %9, %7
%15 = phi i32 [ %8, %7 ], [ %13, %9 ], [ %2, %1 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int foo1(void) {
  putchar('a');
  return 0;
}


x86 assembly (clang, -O0):
<foo1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x61,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo1() {
%1 = call i32 @putchar(i8 signext 97)
ret i32 0
}

LLVM IR (-O2):
define i32 @foo1() {
%1 = tail call i32 @putchar(i8 signext 97)
ret i32 0
}
unsigned long long bit_window(unsigned long long value, unsigned int offset,
                              unsigned int bits) {
  unsigned long long mask = (1ULL << bits) - 1;
  value = (value >> offset) & mask;
  return value;
}


x86 assembly (clang, -O0):
<bit_window>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%rax
sub    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shr    %cl,%rax
and    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_window>:
mov    %edx,%ecx
mov    $0xffffffffffffffff,%rax
shl    %cl,%rax
not    %rax
mov    %esi,%ecx
shr    %cl,%rdi
and    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @bit_window(i64 %0, i32 %1, i32 %2) {
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
store i64 %0, i64* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = zext i32 %8 to i64
%10 = shl i64 1, %9
%11 = sub i64 %10, 1
store i64 %11, i64* %7
%12 = load i64, i64* %4
%13 = load i32, i32* %5
%14 = zext i32 %13 to i64
%15 = lshr i64 %12, %14
%16 = load i64, i64* %7
%17 = and i64 %15, %16
store i64 %17, i64* %4
%18 = load i64, i64* %4
ret i64 %18
}

LLVM IR (-O2):
define i64 @bit_window(i64 %0, i32 %1, i32 %2) {
%4 = zext i32 %2 to i64
%5 = shl nsw i64 -1, %4
%6 = xor i64 %5, -1
%7 = zext i32 %1 to i64
%8 = lshr i64 %0, %7
%9 = and i64 %8, %6
ret i64 %9
}
int doXOR(int v1, int v2) { return v1 ^ v2; }


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

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

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

LLVM IR (-O2):
define i32 @doXOR(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
ret i32 %3
}
void gtk_menu_item_remove_submenu() {}


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

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

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

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

/* Variables and functions */
void swapBytes(uint8_t *byte1, uint8_t *byte2) {
  uint8_t temp = *byte1;
  *byte1 = *byte2;
  *byte2 = temp;
}


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

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

LLVM IR (-O0):
define void @swapBytes(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @swapBytes(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int block4x4_etc2_rgb8_get_mode(unsigned char const *);
int block4x4_etc2_eac_get_mode(const unsigned char *bitstring) {
  return block4x4_etc2_rgb8_get_mode(&bitstring[8]);
}


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

x86 assembly (clang, -O2):
<block4x4_etc2_eac_get_mode>:
add    $0x8,%rdi
jmp    1030 <block4x4_etc2_rgb8_get_mode@plt>

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

LLVM IR (-O2):
define i32 @block4x4_etc2_eac_get_mode(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 8
%3 = tail call i32 @block4x4_etc2_rgb8_get_mode(i8* %2)
ret i32 %3
}
/* Variables and functions */
float max3float(float, float, float);
int /*<<< orphan*/ printf(char *, float);
int main() {
  float x1 = 3.5, x2 = 10., x3 = 25.3, res = 0.;
  printf("%f\n", res = max3float(x1, x2, x3));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xed1(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xec0(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xeaf(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  -0x10(%rbp),%xmm2
call   1040 <max3float@plt>
movss  %xmm0,-0x14(%rbp)
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movss  0xed7(%rip),%xmm0
movss  0xed3(%rip),%xmm1
movss  0xecf(%rip),%xmm2
call   1040 <max3float@plt>
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
store i32 0, i32* %1
store float 3.500000e+00, float* %2
store float 1.000000e+01, float* %3
store float 0x40394CCCC0000000, float* %4
store float 0.000000e+00, float* %5
%6 = load float, float* %2
%7 = load float, float* %3
%8 = load float, float* %4
%9 = call float @max3float(float %6, float %7, float %8)
store float %9, float* %5
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = tail call float @max3float(float 3.500000e+00, float 1.000000e+01, float 0x40394CCCC0000000)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %1)
ret i32 0
}