xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ memmove(char *, char *, int);
char *strtrim(char *, int);
char *_jsonTrimBrackets(char *pcLBrck, char *pcRBrck) {
  *pcRBrck = '\0';
  memmove(pcLBrck, pcLBrck + 1, (pcRBrck - pcLBrck));
  return strtrim(pcLBrck, 3);
}


x86 assembly (clang, -O0):
<_jsonTrimBrackets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x1,%rsi
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%edx
call   1040 <memmove@plt>
mov    -0x8(%rbp),%rdi
mov    $0x3,%esi
call   1030 <strtrim@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_jsonTrimBrackets>:
push   %rbx
mov    %rsi,%rdx
mov    %rdi,%rbx
movb   $0x0,(%rsi)
lea    0x1(%rdi),%rsi
sub    %ebx,%edx
call   1040 <memmove@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
pop    %rbx
jmp    1030 <strtrim@plt>

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

LLVM IR (-O2):
define i8* @_jsonTrimBrackets(i8* %0, i8* %1) {
store i8 0, i8* %1
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = ptrtoint i8* %1 to i64
%5 = ptrtoint i8* %0 to i64
%6 = sub i64 %4, %5
%7 = trunc i64 %6 to i32
%8 = tail call i32 @memmove(i8* %0, i8* %3, i32 %7)
%9 = tail call i8* @strtrim(i8* %0, i32 3)
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ monitor_voltages();
int main(int argc, char *argv[]) {
  monitor_voltages();
  return 0;
}


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)
mov    $0x0,%al
call   1030 <monitor_voltages@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
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 (...) @monitor_voltages()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @monitor_voltages()
ret i32 0
}
void detach_controlling_tty(void) {}


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

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

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

LLVM IR (-O2):
define void @detach_controlling_tty() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int no = 1;
  int sum = 0;
  do {
    sum += no;
    no++;
  } while (no <= 5);
  printf("1 到5的合计值是 %d \n", sum);
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"1 \E5\88\B05\E7\9A\84\E5\90\88\E8\AE\A1\E5\80\BC\E6\98\AF %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %10, %0
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = add nsw i32 %6, %5
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
store i32 %9, i32* %2
br label %10
10: ; preds = %4
%11 = load i32, i32* %2
%12 = icmp sle i32 %11, 5
br i1 %12, label %4, label %13
13: ; preds = %10
%14 = load i32, i32* %3
%15 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"1 \E5\88\B05\E7\9A\84\E5\90\88\E8\AE\A1\E5\80\BC\E6\98\AF %d \0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 15)
ret i32 0
}
/* Variables and functions */
float ANTweenTimingFunctionCircOut(float, int /*<<< orphan*/, int, float);
float ANTweenProgressTimingFunctionCircOut(float time, float duration) {
  return ANTweenTimingFunctionCircOut(time, 0, 1, duration);
}


x86 assembly (clang, -O0):
<ANTweenProgressTimingFunctionCircOut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <ANTweenTimingFunctionCircOut@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ANTweenProgressTimingFunctionCircOut>:
xor    %edi,%edi
mov    $0x1,%esi
jmp    1030 <ANTweenTimingFunctionCircOut@plt>

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

LLVM IR (-O2):
define float @ANTweenProgressTimingFunctionCircOut(float %0, float %1) {
%3 = tail call float @ANTweenTimingFunctionCircOut(float %0, i32 0, i32 1, float %1)
ret float %3
}
/* Type definitions */
typedef int uint64_t;
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
uint64_t time_ms(void) {
  struct timeval tval;
  gettimeofday(&tval, NULL);
  return 1e3 * tval.tv_sec + 1e-3 * tval.tv_usec;
}


x86 assembly (clang, -O0):
<time_ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdl -0x8(%rbp),%xmm0
cvtsi2sdl -0x4(%rbp),%xmm2
movsd  0xed1(%rip),%xmm1
mulsd  %xmm2,%xmm1
movsd  0xebd(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_ms>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdl (%rsp),%xmm0
cvtsi2sdl 0x4(%rsp),%xmm1
mulsd  0xed2(%rip),%xmm1
mulsd  0xed2(%rip),%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @time_ms() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = sitofp i32 %4 to double
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = sitofp i32 %7 to double
%9 = fmul double 1.000000e-03, %8
%10 = call double @llvm.fmuladd.f64(double 1.000000e+03, double %5, double %9)
%11 = fptosi double %10 to i32
ret i32 %11
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @time_ms() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = sitofp i32 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sitofp i32 %8 to double
%10 = fmul double %9, 1.000000e-03
%11 = tail call double @llvm.fmuladd.f64(double %6, double 1.000000e+03, double %10)
%12 = fptosi double %11 to i32
ret i32 %12
}
/* Variables and functions */
scalar_t__ isspace(int);
int /*<<< orphan*/ *strchr(char *, int);
int is_seperator(int c) {
  return isspace(c) || c == '\0' || strchr(",.()+-/*=~%<>[];", c) != NULL;
}


x86 assembly (clang, -O0):
<is_seperator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <isspace@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    116d <is_seperator+0x4d>
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     116d <is_seperator+0x4d>
mov    -0x4(%rbp),%esi
lea    0xea2(%rip),%rdi
call   1030 <strchr@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_seperator>:
push   %rbx
mov    %edi,%ebx
call   1040 <isspace@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %ebx,%ebx
je     1152 <is_seperator+0x32>
test   %rcx,%rcx
jne    1152 <is_seperator+0x32>
lea    0xec0(%rip),%rdi
mov    %ebx,%esi
call   1030 <strchr@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c",.()+-/*=~%<>[];\00"
define i32 @is_seperator(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isspace(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %6
%10 = load i32, i32* %2
%11 = call i32* @strchr(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = icmp ne i32* %11, null
br label %13
13: ; preds = %9, %6, %1
%14 = phi i1 [ true, %6 ], [ true, %1 ], [ %12, %9 ]
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
@.str = [17 x i8] c",.()+-/*=~%<>[];\00"
define i32 @is_seperator(i32 %0) {
%2 = tail call i64 @isspace(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i32 %0, 0
%5 = or i1 %4, %3
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = tail call i32* @strchr(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %0)
%8 = icmp ne i32* %7, null
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %1
%11 = phi i32 [ 1, %1 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
scalar_t__ strcasecmp(char *, char *);
int check_auth(char *username, char *password) {
  if (strcasecmp(username, "fred") != 0)
    return -1;
  if (strcasecmp(password, "nerk") != 0)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<check_auth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed5(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
je     1146 <check_auth+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1173 <check_auth+0x63>
mov    -0x18(%rbp),%rdi
lea    0xeb4(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
je     116c <check_auth+0x5c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1173 <check_auth+0x63>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_auth>:
push   %rbx
mov    %rsi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcasecmp@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
je     112f <check_auth+0x1f>
pop    %rbx
ret
lea    0xecf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
neg    %rax
sbb    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"fred\00"
@.str.1 = [5 x i8] c"nerk\00"
define i32 @check_auth(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = call i64 @strcasecmp(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 -1, i32* %3
br label %16
10: ; preds = %2
%11 = load i8*, i8** %5
%12 = call i64 @strcasecmp(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %10
store i32 -1, i32* %3
br label %16
15: ; preds = %10
store i32 0, i32* %3
br label %16
16: ; preds = %15, %14, %9
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@.str = [5 x i8] c"fred\00"
@.str.1 = [5 x i8] c"nerk\00"
define i32 @check_auth(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i64 @strcasecmp(i8* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp ne i64 %6, 0
%8 = sext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ -1, %2 ], [ %8, %5 ]
ret i32 %10
}
void swap(int *a1, int *a2) {
  int temp;
  temp = *a1;
  *a1 = *a2;
  *a2 = temp;
}


x86 assembly (clang, -O0):
<swap>:
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):
<swap>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @swap(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 @swap(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
}
int getUniqueName(char *name) {
  int ret = 0;
  return ret;
}


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

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

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

LLVM IR (-O2):
define i32 @getUniqueName(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ change(char *);
int /*<<< orphan*/ printf(char *, char *);
main() {
  char *name = "name";
  change(name);
  printf("%s", name);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <change@plt>
mov    -0x8(%rbp),%rsi
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <change@plt>
lea    0xece(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"name\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = tail call i32 @change(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int rte_is_power_of_2(uint32_t n) { return ((n - 1) & n) == 0; }


x86 assembly (clang, -O0):
<rte_is_power_of_2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
and    -0x4(%rbp),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rte_is_power_of_2>:
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @rte_is_power_of_2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 1
%5 = load i32, i32* %2
%6 = and i32 %4, %5
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @rte_is_power_of_2(i32 %0) {
%2 = tail call i32 @llvm.ctpop.i32(i32 %0)
%3 = icmp ult i32 %2, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct cdrom_tochdr {
  int dummy;
};
typedef int /*<<< orphan*/ header;

/* Variables and functions */
int /*<<< orphan*/ memset(struct cdrom_tochdr *, int /*<<< orphan*/, int);
int main(void) {
  struct cdrom_tochdr header;
  (void)memset(&header, 0, sizeof(header));
  (void)header;
  return sizeof(struct cdrom_tochdr);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    $0x4,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.cdrom_tochdr = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.cdrom_tochdr
store i32 0, i32* %1
%3 = call i32 @memset(%struct.cdrom_tochdr* %2, i32 0, i32 4)
ret i32 4
}

LLVM IR (-O2):
%struct.cdrom_tochdr = type { i32 }
define i32 @main() {
%1 = alloca %struct.cdrom_tochdr
%2 = bitcast %struct.cdrom_tochdr* %1 to i8*
%3 = call i32 @memset(%struct.cdrom_tochdr* %1, i32 0, i32 4)
ret i32 4
}
void fibonacci(int *f) {
  f[0] = 1;
  f[1] = 1;
  int i;
  for (i = 2; i < 20; ++i)
    f[i] = f[i - 2] + f[i - 1];
}


x86 assembly (clang, -O0):
<fibonacci>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x8(%rbp),%rax
movl   $0x1,0x4(%rax)
movl   $0x2,-0xc(%rbp)
cmpl   $0x14,-0xc(%rbp)
jge    1167 <fibonacci+0x67>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
add    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <fibonacci+0x24>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @fibonacci(i32* nocapture %0) {
%2 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 2, i32 3>, <4 x i32>* %2
%3 = getelementptr inbounds i32, i32* %0, i64 4
%4 = bitcast i32* %3 to <4 x i32>*
store <4 x i32> <i32 5, i32 8, i32 13, i32 21>, <4 x i32>* %4
%5 = getelementptr inbounds i32, i32* %0, i64 8
%6 = bitcast i32* %5 to <4 x i32>*
store <4 x i32> <i32 34, i32 55, i32 89, i32 144>, <4 x i32>* %6
%7 = getelementptr inbounds i32, i32* %0, i64 12
%8 = bitcast i32* %7 to <4 x i32>*
store <4 x i32> <i32 233, i32 377, i32 610, i32 987>, <4 x i32>* %8
%9 = getelementptr inbounds i32, i32* %0, i64 16
%10 = bitcast i32* %9 to <4 x i32>*
store <4 x i32> <i32 1597, i32 2584, i32 4181, i32 6765>, <4 x i32>* %10
ret void
}
/* Variables and functions */
double erf(double);
double ighmm_rand_get_PHI(double x) {
  return (erf(x * 0.70710678118654752440084436210) + 1.0) / 2.0;
}


x86 assembly (clang, -O0):
<ighmm_rand_get_PHI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeeb(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <erf@plt>
movsd  0xed1(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xebd(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ighmm_rand_get_PHI>:
push   %rax
mulsd  0xee7(%rip),%xmm0
call   1030 <erf@plt>
addsd  0xee2(%rip),%xmm0
mulsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @ighmm_rand_get_PHI(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 0x3FE6A09E667F3BCD
%5 = call double @erf(double %4)
%6 = fadd double %5, 1.000000e+00
%7 = fdiv double %6, 2.000000e+00
ret double %7
}

LLVM IR (-O2):
define double @ighmm_rand_get_PHI(double %0) {
%2 = fmul double %0, 0x3FE6A09E667F3BCD
%3 = tail call double @erf(double %2)
%4 = fadd double %3, 1.000000e+00
%5 = fmul double %4, 5.000000e-01
ret double %5
}
/* Variables and functions */
double premier(double, double);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  printf("Appel de premier");
  double r = premier(20.0, 40.0);
  printf("Retour de l'appel %dx+%d est %f", 10, 20, r);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsd  0xec2(%rip),%xmm0
movsd  0xec2(%rip),%xmm1
call   1030 <premier@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    0xec5(%rip),%rdi
mov    $0xa,%esi
mov    $0x14,%edx
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsd  0xec9(%rip),%xmm0
movsd  0xec9(%rip),%xmm1
call   1030 <premier@plt>
lea    0xed6(%rip),%rdi
mov    $0xa,%esi
mov    $0x14,%edx
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Appel de premier\00"
@.str.1 = [32 x i8] c"Retour de l'appel %dx+%d est %f\00"
define i32 @main() {
%1 = alloca double
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = call double @premier(double 2.000000e+01, double 4.000000e+01)
store double %3, double* %1
%4 = load double, double* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 10, i32 20, double %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Appel de premier\00"
@.str.1 = [32 x i8] c"Retour de l'appel %dx+%d est %f\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = tail call double @premier(double 2.000000e+01, double 4.000000e+01)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 10, i32 20, double %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void writelines(char *lineptr[], int nlines, int decr) {
  int i;
  for (i = 0; i < nlines; i++)
    printf("%s\n", lineptr[i]);
}


x86 assembly (clang, -O0):
<writelines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115b <writelines+0x4b>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <writelines+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writelines>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <writelines+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <writelines+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @writelines(i8** %0, i32 %1, i32 %2) {
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8** %0, i8*** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %19, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %5
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %22
12: ; preds = %8
%13 = load i8**, i8*** %4
%14 = load i32, i32* %7
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8*, i8** %13, i64 %15
%17 = load i8*, i8** %16
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %17)
br label %19
19: ; preds = %12
%20 = load i32, i32* %7
%21 = add nsw i32 %20, 1
store i32 %21, i32* %7
br label %8
22: ; preds = %8
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @writelines(i8** nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %14
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = getelementptr inbounds i8*, i8** %0, i64 %8
%10 = load i8*, i8** %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %3
ret void
}
void foo510() {}


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

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

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

LLVM IR (-O2):
define void @foo510() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help() {
  printf("Usage: ds18b20_reader [options]\n"
         "Repeatedly read the temperature from a DS18B20 sensor\n"
         "\n"
         "Options:\n"
         " -d, --device NAME\tSet the DS18B20 serial number\n"
         " -i, --interval SECONDS\tRead every SECONDS seconds (default: 5)\n"
         " -h, --help\t\tGive this help\n"
         " -v, --version\t\tDisplay version information\n"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [283 x i8] c"Usage: ds18b20_reader [options]\0ARepeatedly read the temperature from a DS18B20 sensor\0A\0AOptions:\0A -d, --device NAME\09Set the DS18B20 serial number\0A -i, --interval SECONDS\09Read every SECONDS seconds (default: 5)\0A -h, --help\09\09Give this help\0A -v, --version\09\09Display version information\0A\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([283 x i8], [283 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [282 x i8] c"Usage: ds18b20_reader [options]\0ARepeatedly read the temperature from a DS18B20 sensor\0A\0AOptions:\0A -d, --device NAME\09Set the DS18B20 serial number\0A -i, --interval SECONDS\09Read every SECONDS seconds (default: 5)\0A -h, --help\09\09Give this help\0A -v, --version\09\09Display version information\0A\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([282 x i8], [282 x i8]* @str, i64 0, i64 0))
ret void
}
void dereference_ifthenelse(int *p) {
  int x;
  x = *(1 ? p : p);
  int y = *(1 ? p : p);
  *(1 ? p : p);
}


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

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

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

LLVM IR (-O2):
define void @dereference_ifthenelse(i32* nocapture %0) {
ret void
}
int test_01(int a) {
  if (127 <= a)
    a = 127;
  else if (a <= -128)
    a = -128;
  return a;
}


x86 assembly (clang, -O0):
<test_01>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x7f,%eax
cmp    -0x4(%rbp),%eax
jg     1121 <test_01+0x21>
movl   $0x7f,-0x4(%rbp)
jmp    1137 <test_01+0x37>
cmpl   $0xffffff80,-0x4(%rbp)
jg     1132 <test_01+0x32>
movl   $0xffffff80,-0x4(%rbp)
jmp    1137 <test_01+0x37>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_01>:
cmp    $0xffffff81,%edi
mov    $0xffffff80,%ecx
cmovge %edi,%ecx
cmp    $0x7f,%ecx
mov    $0x7f,%eax
cmovl  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_01(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 127, %3
br i1 %4, label %5, label %6
5: ; preds = %1
store i32 127, i32* %2
br label %11
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp sle i32 %7, -128
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 -128, i32* %2
br label %10
10: ; preds = %9, %6
br label %11
11: ; preds = %10, %5
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @test_01(i32 %0) {
%2 = icmp sgt i32 %0, -128
%3 = select i1 %2, i32 %0, i32 -128
%4 = icmp slt i32 %3, 127
%5 = select i1 %4, i32 %3, i32 127
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ EVP_sha512();
int /*<<< orphan*/ PKCS5_PBKDF2_HMAC(char *, int, char *, int, int,
                                     int /*<<< orphan*/, int /*<<< orphan*/,
                                     char *);
int /*<<< orphan*/ SHA_DIGEST_LENGTH;
void hash_letter(char letter, uint32_t salt, char *buffer) {
  PKCS5_PBKDF2_HMAC(&letter, 1, (char *)(&salt), sizeof(uint32_t), (100000),
                    EVP_sha512(), SHA_DIGEST_LENGTH, buffer);
}


x86 assembly (clang, -O0):
<hash_letter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1040 <EVP_sha512@plt>
mov    -0x18(%rbp),%rdx
mov    %eax,%r9d
mov    0x2e96(%rip),%rax
mov    (%rax),%r10d
mov    -0x10(%rbp),%rax
lea    -0x1(%rbp),%rdi
mov    $0x1,%esi
mov    $0x4,%ecx
mov    $0x186a0,%r8d
mov    %r10d,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <PKCS5_PBKDF2_HMAC@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_letter>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %dil,0x3(%rsp)
mov    %esi,0x4(%rsp)
xor    %eax,%eax
call   1040 <EVP_sha512@plt>
mov    0x2eaa(%rip),%rcx
mov    (%rcx),%ebx
lea    0x3(%rsp),%rdi
lea    0x4(%rsp),%rdx
mov    $0x1,%esi
mov    $0x4,%ecx
mov    $0x186a0,%r8d
mov    %eax,%r9d
push   %r14
push   %rbx
call   1030 <PKCS5_PBKDF2_HMAC@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SHA_DIGEST_LENGTH = global i32 0
define void @hash_letter(i8 signext %0, i32 %1, i8* %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i8*
store i8 %0, i8* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = bitcast i32* %5 to i8*
%8 = call i32 (...) @EVP_sha512()
%9 = load i32, i32* @SHA_DIGEST_LENGTH
%10 = load i8*, i8** %6
%11 = call i32 @PKCS5_PBKDF2_HMAC(i8* %4, i32 1, i8* %7, i32 4, i32 100000, i32 %8, i32 %9, i8* %10)
ret void
}

LLVM IR (-O2):
@SHA_DIGEST_LENGTH = global i32 0
define void @hash_letter(i8 signext %0, i32 %1, i8* %2) {
%4 = alloca i8
%5 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
%6 = bitcast i32* %5 to i8*
%7 = tail call i32 (...) @EVP_sha512()
%8 = load i32, i32* @SHA_DIGEST_LENGTH
%9 = call i32 @PKCS5_PBKDF2_HMAC(i8* %4, i32 1, i8* %6, i32 4, i32 100000, i32 %7, i32 %8, i8* %2)
ret void
}
/* Variables and functions */
float fmax(int /*<<< orphan*/, float);
int /*<<< orphan*/ fmin(float, float);
float float_clamp(float value, float min, float max) {
  return fmax(fmin(value, max), min);
}


x86 assembly (clang, -O0):
<float_clamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
call   1030 <fmin@plt>
mov    %eax,%edi
movss  -0x8(%rbp),%xmm0
call   1040 <fmax@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<float_clamp>:
push   %rax
movss  %xmm1,0x4(%rsp)
movaps %xmm2,%xmm1
call   1030 <fmin@plt>
mov    %eax,%edi
movss  0x4(%rsp),%xmm0
pop    %rax
jmp    1040 <fmax@plt>

LLVM IR (-O0):
define float @float_clamp(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %6
%9 = call i32 @fmin(float %7, float %8)
%10 = load float, float* %5
%11 = call float @fmax(i32 %9, float %10)
ret float %11
}

LLVM IR (-O2):
define float @float_clamp(float %0, float %1, float %2) {
%4 = tail call i32 @fmin(float %0, float %2)
%5 = tail call float @fmax(i32 %4, float %1)
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ pmmap_memset(int);
void pmmap_mark_all_used() { pmmap_memset(0xff); }


x86 assembly (clang, -O0):
<pmmap_mark_all_used>:
push   %rbp
mov    %rsp,%rbp
mov    $0xff,%edi
call   1030 <pmmap_memset@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmmap_mark_all_used>:
mov    $0xff,%edi
jmp    1030 <pmmap_memset@plt>

LLVM IR (-O0):
define void @pmmap_mark_all_used() {
%1 = call i32 @pmmap_memset(i32 255)
ret void
}

LLVM IR (-O2):
define void @pmmap_mark_all_used() {
%1 = tail call i32 @pmmap_memset(i32 255)
ret void
}
/* Type definitions */
struct gpio {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gpio_mode(struct gpio *, int, int);
void gpio_c_output(int bit) {
  gpio_mode((struct gpio *)0x40011000, bit, 3 | 0);
}


x86 assembly (clang, -O0):
<gpio_c_output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x40011000,%edi
mov    $0x3,%edx
call   1030 <gpio_mode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpio_c_output>:
mov    %edi,%esi
mov    $0x40011000,%edi
mov    $0x3,%edx
jmp    1030 <gpio_mode@plt>

LLVM IR (-O0):
%struct.gpio = type { i32 }
define void @gpio_c_output(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @gpio_mode(%struct.gpio* inttoptr (i64 1073811456 to %struct.gpio*), i32 %3, i32 3)
ret void
}

LLVM IR (-O2):
%struct.gpio = type { i32 }
define void @gpio_c_output(i32 %0) {
%2 = tail call i32 @gpio_mode(%struct.gpio* inttoptr (i64 1073811456 to %struct.gpio*), i32 %0, i32 3)
ret void
}
void lock_release(int *lock) { __sync_lock_release(lock); }


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

x86 assembly (clang, -O2):
<lock_release>:
movl   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @lock_release(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
store atomic i32 0, i32* %3 release
ret void
}

LLVM IR (-O2):
define void @lock_release(i32* nocapture writeonly %0) {
store atomic i32 0, i32* %0 release
ret void
}
int ThreadIsInterrupted() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ThreadIsInterrupted() {
ret i32 0
}
/* Type definitions */
typedef unsigned int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ __disable_irq();
unsigned int __get_PRIMASK();
__attribute__((always_)) unsigned int irq_disable(void) {
  uint32_t mask = __get_PRIMASK();
  __disable_irq();
  return mask;
}


x86 assembly (clang, -O0):
<irq_disable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <__get_PRIMASK@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__disable_irq@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irq_disable>:
push   %rbx
xor    %eax,%eax
call   1040 <__get_PRIMASK@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <__disable_irq@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @irq_disable() {
%1 = alloca i32
%2 = call i32 (...) @__get_PRIMASK()
store i32 %2, i32* %1
%3 = call i32 (...) @__disable_irq()
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @irq_disable() {
%1 = tail call i32 (...) @__get_PRIMASK()
%2 = tail call i32 (...) @__disable_irq()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_context_get_index() {
  printf("NOT IMPLEMENTED:"
         "pa_context_get_index"
         "\n");
}


x86 assembly (clang, -O0):
<pa_context_get_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [37 x i8] c"NOT IMPLEMENTED:pa_context_get_index\00"
define i32 @pa_context_get_index() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int hash(int key, int TableSize) { return key % TableSize; }


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

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

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

LLVM IR (-O2):
define i32 @hash(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ x;

/* Variables and functions */
int /*<<< orphan*/ putchar(int);
void printbits(int x) {
  for (int i = sizeof(x) << 3; i; i--)
    putchar('0' + ((x >> (i - 1)) & 1));
}


x86 assembly (clang, -O0):
<printbits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x20,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1150 <printbits+0x40>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
sar    %cl,%edi
and    $0x1,%edi
add    $0x30,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <printbits+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printbits>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x1f,%ebp
nopw   0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    %ebp,%ecx
shr    %cl,%edi
and    $0x1,%edi
or     $0x30,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jb     1120 <printbits+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @printbits(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 32, i32* %3
br label %4
4: ; preds = %15, %1
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %18
7: ; preds = %4
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = sub nsw i32 %9, 1
%11 = ashr i32 %8, %10
%12 = and i32 %11, 1
%13 = add nsw i32 48, %12
%14 = call i32 @putchar(i32 %13)
br label %15
15: ; preds = %7
%16 = load i32, i32* %3
%17 = add nsw i32 %16, -1
store i32 %17, i32* %3
br label %4
18: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @printbits(i32 %0) {
br label %3
2: ; preds = %3
ret void
3: ; preds = %1, %3
%4 = phi i32 [ 32, %1 ], [ %5, %3 ]
%5 = add nsw i32 %4, -1
%6 = lshr i32 %0, %5
%7 = and i32 %6, 1
%8 = or i32 %7, 48
%9 = tail call i32 @putchar(i32 %8)
%10 = icmp eq i32 %5, 0
br i1 %10, label %2, label %3
}
/* Variables and functions */
int GrublersFormula(int, int, int, int *);
int /*<<< orphan*/ printf(char *, int);
void test_GrublersFormula() {
  int N = 8;
  int m = 3;
  int J = 9;
  int f[9] = {1, 1, 1, 1, 1, 1, 1, 1, 1};
  int dof = GrublersFormula(m, N, J, f);
  printf("dof=%d\n", dof);
}


x86 assembly (clang, -O0):
<test_GrublersFormula>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x8,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x9,-0xc(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xea8(%rip),%rsi
mov    $0x24,%edx
call   1050 <memcpy@plt>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    -0x30(%rbp),%rcx
call   1040 <GrublersFormula@plt>
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%esi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_GrublersFormula>:
sub    $0x28,%rsp
mov    0xef6(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebf(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rcx
mov    $0x3,%edi
mov    $0x8,%esi
mov    $0x9,%edx
call   1040 <GrublersFormula@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.test_GrublersFormula.f = [9 x i32] [i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1]
@.str = [8 x i8] c"dof=%d\0A\00"
define void @test_GrublersFormula() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [9 x i32]
%5 = alloca i32
store i32 8, i32* %1
store i32 3, i32* %2
store i32 9, i32* %3
%6 = bitcast [9 x i32]* %4 to i8*
%7 = load i32, i32* %2
%8 = load i32, i32* %1
%9 = load i32, i32* %3
%10 = getelementptr inbounds [9 x i32], [9 x i32]* %4, i64 0, i64 0
%11 = call i32 @GrublersFormula(i32 %7, i32 %8, i32 %9, i32* %10)
store i32 %11, i32* %5
%12 = load i32, i32* %5
%13 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %12)
ret void
}

LLVM IR (-O2):
@__const.test_GrublersFormula.f = [9 x i32] [i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1]
@.str = [8 x i8] c"dof=%d\0A\00"
define void @test_GrublersFormula() {
%1 = alloca [9 x i32]
%2 = bitcast [9 x i32]* %1 to i8*
%3 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%4 = call i32 @GrublersFormula(i32 3, i32 8, i32 9, i32* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
/* Variables and functions */
int html_closetext(int);
int html_opentext(int);
int html_string(char *, char *);
int html_text(int code, char *text) {
  return html_opentext(code) + html_string("%s", text) + html_closetext(code);
}


x86 assembly (clang, -O0):
<html_text>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <html_opentext@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeab(%rip),%rdi
call   1030 <html_string@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <html_closetext@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<html_text>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebp
call   1050 <html_opentext@plt>
mov    %eax,%r15d
lea    0xeb5(%rip),%rdi
mov    %r14,%rsi
call   1030 <html_string@plt>
mov    %eax,%ebx
add    %r15d,%ebx
mov    %ebp,%edi
call   1040 <html_closetext@plt>
add    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @html_text(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 = call i32 @html_opentext(i32 %5)
%7 = load i8*, i8** %4
%8 = call i32 @html_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = add nsw i32 %6, %8
%10 = load i32, i32* %3
%11 = call i32 @html_closetext(i32 %10)
%12 = add nsw i32 %9, %11
ret i32 %12
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @html_text(i32 %0, i8* %1) {
%3 = tail call i32 @html_opentext(i32 %0)
%4 = tail call i32 @html_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%5 = add nsw i32 %4, %3
%6 = tail call i32 @html_closetext(i32 %0)
%7 = add nsw i32 %5, %6
ret i32 %7
}
void XkbListComponents() {}


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

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

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

LLVM IR (-O2):
define void @XkbListComponents() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ discoverytest();
void test() { discoverytest(); }


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

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

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

LLVM IR (-O2):
define void @test() {
%1 = tail call i32 (...) @discoverytest()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ g_store(int);
void dstore(int n) { g_store(n); }


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

x86 assembly (clang, -O2):
<dstore>:
jmp    1030 <g_store@plt>

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

LLVM IR (-O2):
define void @dstore(i32 %0) {
%2 = tail call i32 @g_store(i32 %0)
ret void
}