xunge/DecIR huggingface dataset:
unsigned strhash(const char *x) {
  unsigned h = 0;
  while (*x)
    h = h * 13 + *(x++);
  return h;
}


x86 assembly (clang, -O0):
<strhash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113c <strhash+0x3c>
imul   $0xd,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strhash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strhash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1127 <strhash+0x27>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
lea    (%rax,%rax,2),%edx
lea    (%rax,%rdx,4),%edx
movsbl %cl,%eax
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <strhash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strhash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = mul i32 %6, 13
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i32
%11 = add i32 %8, %10
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %15
}
float fahr_to_celsius(float fahr) { return 5.0 * (fahr - 32.0) / 9.0; }


x86 assembly (clang, -O0):
<fahr_to_celsius>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xef6(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xee2(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xece(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fahr_to_celsius>:
cvtss2sd %xmm0,%xmm0
addsd  0xef4(%rip),%xmm0
mulsd  0xef4(%rip),%xmm0
divsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @fahr_to_celsius(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fsub double %4, 3.200000e+01
%6 = fmul double 5.000000e+00, %5
%7 = fdiv double %6, 9.000000e+00
%8 = fptrunc double %7 to float
ret float %8
}

LLVM IR (-O2):
define float @fahr_to_celsius(float %0) {
%2 = fpext float %0 to double
%3 = fadd double %2, -3.200000e+01
%4 = fmul double %3, 5.000000e+00
%5 = fdiv double %4, 9.000000e+00
%6 = fptrunc double %5 to float
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ dec_top();
size_t get_top();
int /*<<< orphan*/ printf(char *);
int pop(unsigned int *stack) {
  if (get_top() == 0) {
    printf("stack underflow\n");
    return (-2);
  } else {
    dec_top();
    return stack[get_top()];
  }
  return 0;
}


x86 assembly (clang, -O0):
<pop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <get_top@plt>
cmp    $0x0,%rax
jne    1165 <pop+0x35>
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
movl   $0xfffffffe,-0x4(%rbp)
jmp    1188 <pop+0x58>
mov    $0x0,%al
call   1040 <dec_top@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1050 <get_top@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pop>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <get_top@plt>
test   %rax,%rax
je     1153 <pop+0x23>
xor    %eax,%eax
call   1040 <dec_top@plt>
xor    %eax,%eax
call   1050 <get_top@plt>
mov    (%rbx,%rax,4),%eax
pop    %rbx
ret
lea    0xea6(%rip),%rdi
call   1030 <puts@plt>
mov    $0xfffffffe,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@str = [16 x i8] c"stack underflow\00"
define i32 @pop(i32* nocapture %0) {
%2 = tail call i64 (...) @get_top()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
br label %11
6: ; preds = %1
%7 = tail call i32 (...) @dec_top()
%8 = tail call i64 (...) @get_top()
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
br label %11
11: ; preds = %6, %4
%12 = phi i32 [ -2, %4 ], [ %10, %6 ]
ret i32 %12
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ read(int, ...);
size_t receive_msg(char **msg, int fd) {
  size_t len = 0;
  read(fd, &len, sizeof(size_t));
  (*msg) = malloc((len + 1) * sizeof(char));
  (*msg)[len] = 0;
  read(fd, (*msg), len);
  return len;
}


x86 assembly (clang, -O0):
<receive_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0xc(%rbp),%edi
lea    -0x18(%rbp),%rsi
mov    $0x8,%edx
mov    $0x0,%al
call   1030 <read@plt>
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
shl    $0x0,%rdi
call   1040 <malloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1030 <read@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<receive_msg>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebp
mov    %rdi,%r14
movq   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x8,%edx
mov    %ebp,%edi
xor    %eax,%eax
call   1030 <read@plt>
mov    0x8(%rsp),%rbx
lea    0x1(%rbx),%rdi
call   1040 <malloc@plt>
mov    %rax,(%r14)
movb   $0x0,(%rax,%rbx,1)
mov    %ebp,%edi
mov    %rax,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <read@plt>
mov    0x8(%rsp),%rax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i64 @receive_msg(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
%5 = alloca i64
store i8** %0, i8*** %3
store i32 %1, i32* %4
store i64 0, i64* %5
%6 = load i32, i32* %4
%7 = call i32 (i32, ...) @read(i32 %6, i64* %5, i64 8)
%8 = load i64, i64* %5
%9 = add i64 %8, 1
%10 = mul i64 %9, 1
%11 = call i8* @malloc(i64 %10)
%12 = load i8**, i8*** %3
store i8* %11, i8** %12
%13 = load i8**, i8*** %3
%14 = load i8*, i8** %13
%15 = load i64, i64* %5
%16 = getelementptr inbounds i8, i8* %14, i64 %15
store i8 0, i8* %16
%17 = load i32, i32* %4
%18 = load i8**, i8*** %3
%19 = load i8*, i8** %18
%20 = load i64, i64* %5
%21 = call i32 (i32, ...) @read(i32 %17, i8* %19, i64 %20)
%22 = load i64, i64* %5
ret i64 %22
}

LLVM IR (-O2):
define i64 @receive_msg(i8** nocapture writeonly %0, i32 %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
store i64 0, i64* %3
%5 = call i32 (i32, ...) @read(i32 %1, i64* %3, i64 8)
%6 = load i64, i64* %3
%7 = add i64 %6, 1
%8 = call i8* @malloc(i64 %7)
store i8* %8, i8** %0
%9 = getelementptr inbounds i8, i8* %8, i64 %6
store i8 0, i8* %9
%10 = call i32 (i32, ...) @read(i32 %1, i8* %8, i64 %6)
%11 = load i64, i64* %3
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "Usage: measure-corr freq time\n");
  fprintf(stderr, " freq - frequency expressed in MHz (122.88 or 125),\n");
  fprintf(stderr,
          " time - measurement time expressed in seconds (from 1 to 30).\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xef0(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf17(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"Usage: measure-corr freq time\0A\00"
@.str.1 = [53 x i8] c" freq - frequency expressed in MHz (122.88 or 125),\0A\00"
@.str.2 = [63 x i8] c" time - measurement time expressed in seconds (from 1 to 30).\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"Usage: measure-corr freq time\0A\00"
@.str.1 = [53 x i8] c" freq - frequency expressed in MHz (122.88 or 125),\0A\00"
@.str.2 = [63 x i8] c" time - measurement time expressed in seconds (from 1 to 30).\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void inversOff(void) { printf("\x01B[0m"); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[0m\00"
define void @inversOff() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
void XSyncValueLessThan() {}


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

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

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

LLVM IR (-O2):
define void @XSyncValueLessThan() {
ret void
}
double coul(double r) {
  if (r == 0.)
    return 0.;
  return -1. / r;
}


x86 assembly (clang, -O0):
<coul>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    112e <coul+0x2e>
jp     112e <coul+0x2e>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1140 <coul+0x40>
movsd  0xeca(%rip),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<coul>:
movapd %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jne    1111 <coul+0x11>
jp     1111 <coul+0x11>
ret
movsd  0xee7(%rip),%xmm0
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @coul(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oeq double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store double 0.000000e+00, double* %2
br label %10
7: ; preds = %1
%8 = load double, double* %3
%9 = fdiv double -1.000000e+00, %8
store double %9, double* %2
br label %10
10: ; preds = %7, %6
%11 = load double, double* %2
ret double %11
}

LLVM IR (-O2):
define double @coul(double %0) {
%2 = fcmp oeq double %0, 0.000000e+00
%3 = fdiv double -1.000000e+00, %0
%4 = select i1 %2, double 0.000000e+00, double %3
ret double %4
}
/* Variables and functions */
char *dcc_find_extension_const(char const *);
int /*<<< orphan*/ strcmp(char const *, char *);
int dcc_is_object(const char *filename) {
  const char *dot;
  dot = dcc_find_extension_const(filename);
  if (!dot)
    return 0;
  return !strcmp(dot, ".o");
}


x86 assembly (clang, -O0):
<dcc_is_object>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <dcc_find_extension_const@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1150 <dcc_is_object+0x30>
movl   $0x0,-0x4(%rbp)
jmp    1170 <dcc_is_object+0x50>
mov    -0x18(%rbp),%rdi
lea    0xea5(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcc_is_object>:
push   %rax
call   1030 <dcc_find_extension_const@plt>
test   %rax,%rax
je     1145 <dcc_is_object+0x25>
lea    0xece(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c".o\00"
define i32 @dcc_is_object(i8* %0) {
%2 = tail call i8* @dcc_find_extension_const(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @strcmp(i8* %2, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
void foo794(int p) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define i32 @test_imm_EDuint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -19
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int Pri(int x) {
  switch ((char)x) {
  case '*':
  case '/':
    return 2;
  case '+':
  case '-':
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<Pri>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movsbl -0x8(%rbp),%eax
add    $0xffffffd6,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x5,%eax
ja     1149 <Pri+0x49>
mov    -0x10(%rbp),%rax
lea    0xed8(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x2,-0x4(%rbp)
jmp    1150 <Pri+0x50>
movl   $0x1,-0x4(%rbp)
jmp    1150 <Pri+0x50>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Pri>:
movsbl %dil,%ecx
add    $0xffffffd6,%ecx
xor    %eax,%eax
cmp    $0x5,%ecx
ja     111b <Pri+0x1b>
movslq %ecx,%rax
lea    0xee8(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @Pri(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = trunc i32 %4 to i8
%6 = sext i8 %5 to i32
switch i32 %6, label %9 [
i32 42, label %7
i32 47, label %7
i32 43, label %8
i32 45, label %8
]
7: ; preds = %1, %1
store i32 2, i32* %2
br label %10
8: ; preds = %1, %1
store i32 1, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %8, %7
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@switch.table.Pri = [6 x i32] [i32 2, i32 1, i32 0, i32 1, i32 0, i32 2]
define i32 @Pri(i32 %0) {
%2 = shl i32 %0, 24
%3 = ashr exact i32 %2, 24
%4 = add nsw i32 %3, -42
%5 = icmp ult i32 %4, 6
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = sext i32 %4 to i64
%8 = getelementptr inbounds [6 x i32], [6 x i32]* @switch.table.Pri, i64 0, i64 %7
%9 = load i32, i32* %8
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ 0, %1 ]
ret i32 %11
}
void w16(void *x, long long y) { *(long long *)(x + 32752) = y; }


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

x86 assembly (clang, -O2):
<w16>:
mov    %rsi,0x7ff0(%rdi)
ret

LLVM IR (-O0):
define void @w16(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = getelementptr i8, i8* %6, i64 32752
%8 = bitcast i8* %7 to i64*
store i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @w16(i8* nocapture writeonly %0, i64 %1) {
%3 = getelementptr i8, i8* %0, i64 32752
%4 = bitcast i8* %3 to i64*
store i64 %1, i64* %4
ret void
}
/* Type definitions */
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *last_mod_timestamp(char *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
void format_mod_timestamp(char *filename, char *f_timestamp) {
  char *format = "%a, %d %b %Y %H:%M:%S %Z";
  struct tm *timestamp = last_mod_timestamp(filename);
  strftime(f_timestamp, 8192, format, timestamp);
}


x86 assembly (clang, -O0):
<format_mod_timestamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <last_mod_timestamp@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x2000,%esi
call   1040 <strftime@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<format_mod_timestamp>:
push   %rbx
mov    %rsi,%rbx
call   1030 <last_mod_timestamp@plt>
lea    0xed0(%rip),%rdx
mov    %rbx,%rdi
mov    $0x2000,%esi
mov    %rax,%rcx
pop    %rbx
jmp    1040 <strftime@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [25 x i8] c"%a, %d %b %Y %H:%M:%S %Z\00"
define void @format_mod_timestamp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca %struct.tm*
store i8* %0, i8** %3
store i8* %1, i8** %4
store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8** %5
%7 = load i8*, i8** %3
%8 = call %struct.tm* @last_mod_timestamp(i8* %7)
store %struct.tm* %8, %struct.tm** %6
%9 = load i8*, i8** %4
%10 = load i8*, i8** %5
%11 = load %struct.tm*, %struct.tm** %6
%12 = call i32 @strftime(i8* %9, i32 8192, i8* %10, %struct.tm* %11)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [25 x i8] c"%a, %d %b %Y %H:%M:%S %Z\00"
define void @format_mod_timestamp(i8* %0, i8* %1) {
%3 = tail call %struct.tm* @last_mod_timestamp(i8* %0)
%4 = tail call i32 @strftime(i8* %1, i32 8192, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), %struct.tm* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ stdout;
double putchard(double x) {
  putchar((char)x);
  fflush(stdout);
  return 0;
}


x86 assembly (clang, -O0):
<putchard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
xorps  %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchard>:
push   %rax
cvttsd2si %xmm0,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
xorpd  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@stdout = global i32 0
define double @putchard(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptosi double %3 to i8
%5 = call i32 @putchar(i8 signext %4)
%6 = load i32, i32* @stdout
%7 = call i32 @fflush(i32 %6)
ret double 0.000000e+00
}

LLVM IR (-O2):
@stdout = global i32 0
define double @putchard(double %0) {
%2 = fptosi double %0 to i8
%3 = tail call i32 @putchar(i8 signext %2)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
ret double 0.000000e+00
}
double cpuinfo_get_speed(void) { return 1000.0; }


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

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

LLVM IR (-O0):
define double @cpuinfo_get_speed() {
ret double 1.000000e+03
}

LLVM IR (-O2):
define double @cpuinfo_get_speed() {
ret double 1.000000e+03
}
void makeLine(float vals, float labels) {}


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

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

LLVM IR (-O0):
define void @makeLine(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
ret void
}

LLVM IR (-O2):
define void @makeLine(float %0, float %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_rwlock_t;

/* Variables and functions */
int pthread_rwlock_rdlock(pthread_rwlock_t *lock) {}


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

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

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

LLVM IR (-O2):
define i32 @pthread_rwlock_rdlock(i32* nocapture readnone %0) {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
scalar_t__ sigprocmask(int, int /*<<< orphan*/ const *, int /*<<< orphan*/ *);
int /*<<< orphan*/ unix_error(char *);
void Sigprocmask(int how, const sigset_t *set, sigset_t *oldset) {
  if (sigprocmask(how, set, oldset) < 0) {
    unix_error("sigprocmask error");
  }
}


x86 assembly (clang, -O0):
<Sigprocmask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <sigprocmask@plt>
cmp    $0x0,%rax
jge    1159 <Sigprocmask+0x39>
lea    0xeac(%rip),%rdi
call   1040 <unix_error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sigprocmask>:
push   %rax
call   1030 <sigprocmask@plt>
test   %rax,%rax
js     112d <Sigprocmask+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <unix_error@plt>

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

LLVM IR (-O2):
@.str = [18 x i8] c"sigprocmask error\00"
define void @Sigprocmask(i32 %0, i32* %1, i32* %2) {
%4 = tail call i64 @sigprocmask(i32 %0, i32* %1, i32* %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @unix_error(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ VIM_SIF_I2cWriteByte(unsigned char, unsigned char);
void SensorSetReg_OV7660(unsigned short uAddr, unsigned short uVal) {
  VIM_SIF_I2cWriteByte((unsigned char)uAddr, (unsigned char)uVal);
}


x86 assembly (clang, -O0):
<SensorSetReg_OV7660>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x2(%rbp),%ax
mov    %al,%cl
mov    -0x4(%rbp),%ax
movzbl %cl,%edi
movzbl %al,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SensorSetReg_OV7660>:
movzbl %dil,%edi
movzbl %sil,%esi
jmp    1030 <VIM_SIF_I2cWriteByte@plt>

LLVM IR (-O0):
define void @SensorSetReg_OV7660(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = trunc i16 %5 to i8
%7 = load i16, i16* %4
%8 = trunc i16 %7 to i8
%9 = call i32 @VIM_SIF_I2cWriteByte(i8 zeroext %6, i8 zeroext %8)
ret void
}

LLVM IR (-O2):
define void @SensorSetReg_OV7660(i16 zeroext %0, i16 zeroext %1) {
%3 = trunc i16 %0 to i8
%4 = trunc i16 %1 to i8
%5 = tail call i32 @VIM_SIF_I2cWriteByte(i8 zeroext %3, i8 zeroext %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ set_warn_handler(void *);
int /*<<< orphan*/ warn_err_obj_line(char const *, int);
void die_err_obj_line(const char *obj, int line) {
  set_warn_handler(((void *)0));
  warn_err_obj_line(obj, line);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<die_err_obj_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1030 <set_warn_handler@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <warn_err_obj_line@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die_err_obj_line>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %edi,%edi
call   1030 <set_warn_handler@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1050 <warn_err_obj_line@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @die_err_obj_line(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 @set_warn_handler(i8* null)
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @warn_err_obj_line(i8* %6, i32 %7)
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @die_err_obj_line(i8* %0, i32 %1) {
%3 = tail call i32 @set_warn_handler(i8* null)
%4 = tail call i32 @warn_err_obj_line(i8* %0, i32 %1)
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
}
void *func1(void *arg) {
  static int num = 123;
  int i = 0;
  for (i = 0; i < 3; i++) {
    printf("in func1\n");
    sleep(1);
  }
  return &num;
}


x86 assembly (clang, -O0):
<func1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    116c <func1+0x4c>
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
mov    $0x0,%al
call   1040 <sleep@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113a <func1+0x1a>
lea    0x2ebd(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func1>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1040 <sleep@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1040 <sleep@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1040 <sleep@plt>
lea    0x2ec5(%rip),%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@func1.num = internal global i32 123
@str = [9 x i8] c"in func1\00"
define i8* @func1(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @sleep to i32 (i32, ...)*)(i32 1)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @sleep to i32 (i32, ...)*)(i32 1)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @sleep to i32 (i32, ...)*)(i32 1)
ret i8* bitcast (i32* @func1.num to i8*)
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int rand(int /*<<< orphan*/, int);
int main() {
  int x = rand(0, 1000);
  int y = -x;
  int s = x + y + 1;
  int z = 42 / s;
  assert(z == 42);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
mov    $0x3e8,%esi
call   1040 <rand@plt>
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    $0x2a,%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x10(%rbp)
cmpl   $0x2a,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
mov    $0x3e8,%esi
call   1040 <rand@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = call i32 @rand(i32 0, i32 1000)
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = sub nsw i32 0, %6
store i32 %7, i32* %2
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = add nsw i32 %8, %9
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = sdiv i32 42, %12
store i32 %13, i32* %4
%14 = load i32, i32* %4
%15 = icmp eq i32 %14, 42
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @rand(i32 0, i32 1000)
%2 = tail call i32 @assert(i32 1)
ret i32 0
}
int test_imm_7Bint8_reg(signed char val) {
  return ((val) & (-0x7B << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_7Bint8_reg(i8 signext %0) {
%2 = and i8 %0, -123
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ ENGINE;

/* Variables and functions */
int e_rsax_destroy(ENGINE *e) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @e_rsax_destroy(i32* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
void Reserved_Handler12(void) {
  while (1)
    ;
}


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

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

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

LLVM IR (-O2):
define void @Reserved_Handler12() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
scalar_t__ isprint(char);
void safestring(char *c) {
  for (; *c; ++c)
    if (!(*c & 0x80 || isprint(*c)))
      *c = '.';
}


x86 assembly (clang, -O0):
<safestring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1171 <safestring+0x61>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
and    $0x80,%eax
cmp    $0x0,%eax
jne    115b <safestring+0x4b>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isprint@plt>
cmp    $0x0,%rax
jne    115b <safestring+0x4b>
mov    -0x8(%rbp),%rax
movb   $0x2e,(%rax)
jmp    1160 <safestring+0x50>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <safestring+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safestring>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1142 <safestring+0x32>
mov    %rdi,%rbx
add    $0x1,%rbx
jmp    112b <safestring+0x1b>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     1142 <safestring+0x32>
test   %al,%al
js     1120 <safestring+0x10>
movsbl %al,%edi
call   1030 <isprint@plt>
test   %rax,%rax
jne    1120 <safestring+0x10>
movb   $0x2e,-0x1(%rbx)
jmp    1120 <safestring+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @safestring(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %12
%5 = phi i8 [ %14, %12 ], [ %2, %1 ]
%6 = phi i8* [ %13, %12 ], [ %0, %1 ]
%7 = icmp sgt i8 %5, -1
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = tail call i64 @isprint(i8 signext %5)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %8
store i8 46, i8* %6
br label %12
12: ; preds = %4, %8, %11
%13 = getelementptr inbounds i8, i8* %6, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %12, %1
ret void
}
double f4_cb_send_pre_double_double_double_double_long(
    double (*cb)(double, double, double, double, long)) {
  long r = 33;
  return cb(8.25, 9.25, 10.25, 11.25, r) + 1.0;
}


x86 assembly (clang, -O0):
<f4_cb_send_pre_double_double_double_double_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x21,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
movsd  0xee4(%rip),%xmm0
movsd  0xee4(%rip),%xmm1
movsd  0xee4(%rip),%xmm2
movsd  0xee4(%rip),%xmm3
call   *%rax
movsd  0xeba(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_cb_send_pre_double_double_double_double_long>:
push   %rax
mov    %rdi,%rax
movsd  0xef4(%rip),%xmm0
movsd  0xef4(%rip),%xmm1
movsd  0xef4(%rip),%xmm2
movsd  0xef4(%rip),%xmm3
mov    $0x21,%edi
call   *%rax
addsd  0xeed(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f4_cb_send_pre_double_double_double_double_long(double (double, double, double, double, i64)* %0) {
%2 = alloca double (double, double, double, double, i64)*
%3 = alloca i64
store double (double, double, double, double, i64)* %0, double (double, double, double, double, i64)** %2
store i64 33, i64* %3
%4 = load double (double, double, double, double, i64)*, double (double, double, double, double, i64)** %2
%5 = load i64, i64* %3
%6 = call double %4(double 8.250000e+00, double 9.250000e+00, double 1.025000e+01, double 1.125000e+01, i64 %5)
%7 = fadd double %6, 1.000000e+00
ret double %7
}

LLVM IR (-O2):
define double @f4_cb_send_pre_double_double_double_double_long(double (double, double, double, double, i64)* nocapture %0) {
%2 = tail call double %0(double 8.250000e+00, double 9.250000e+00, double 1.025000e+01, double 1.125000e+01, i64 33)
%3 = fadd double %2, 1.000000e+00
ret double %3
}
int fun1218() { return 1218; }


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

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

LLVM IR (-O0):
define i32 @fun1218() {
ret i32 1218
}

LLVM IR (-O2):
define i32 @fun1218() {
ret i32 1218
}
/* Variables and functions */
int /*<<< orphan*/ irc_ctcp(char *, char *);
char *strtok(char *, char *);
void child_ctcp(char *p) {
  char *target, *msg;
  target = strtok(p, " ");
  msg = strtok(NULL, "");
  irc_ctcp(target, msg);
}


x86 assembly (clang, -O0):
<child_ctcp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xeb6(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <irc_ctcp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<child_ctcp>:
push   %rbx
lea    0xed8(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,%rbx
lea    0xeca(%rip),%rsi
xor    %edi,%edi
call   1040 <strtok@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1030 <irc_ctcp@plt>

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
@.str.1 = [1 x i8] zeroinitializer
define void @child_ctcp(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @strtok(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %6, i8** %3
%7 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
store i8* %7, i8** %4
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = call i32 @irc_ctcp(i8* %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
@.str.1 = [1 x i8] zeroinitializer
define void @child_ctcp(i8* %0) {
%2 = tail call i8* @strtok(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @irc_ctcp(i8* %2, i8* %3)
ret void
}
/* Type definitions */
struct xmp_context {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ reportv(struct xmp_context *, int /*<<< orphan*/, char *,
                           int);
void get_cmnt(struct xmp_context *ctx, int size, FILE *f) {
  reportv(ctx, 0, "Comment size   : %d\n", size);
}


x86 assembly (clang, -O0):
<get_cmnt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
xor    %esi,%esi
lea    0xecd(%rip),%rdx
call   1030 <reportv@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_cmnt>:
mov    %esi,%ecx
lea    0xee7(%rip),%rdx
xor    %esi,%esi
jmp    1030 <reportv@plt>

LLVM IR (-O0):
%struct.xmp_context = type { i32 }
@.str = [21 x i8] c"Comment size : %d\0A\00"
define void @get_cmnt(%struct.xmp_context* %0, i32 %1, i32* %2) {
%4 = alloca %struct.xmp_context*
%5 = alloca i32
%6 = alloca i32*
store %struct.xmp_context* %0, %struct.xmp_context** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load %struct.xmp_context*, %struct.xmp_context** %4
%8 = load i32, i32* %5
%9 = call i32 @reportv(%struct.xmp_context* %7, i32 0, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %8)
ret void
}

LLVM IR (-O2):
%struct.xmp_context = type { i32 }
@.str = [21 x i8] c"Comment size : %d\0A\00"
define void @get_cmnt(%struct.xmp_context* %0, i32 %1, i32* nocapture readnone %2) {
%4 = tail call i32 @reportv(%struct.xmp_context* %0, i32 0, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
size_t CHAR_BIT;
size_t bits_size(size_t n) { return (n + CHAR_BIT - 1) / CHAR_BIT; }


x86 assembly (clang, -O0):
<bits_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2ecd(%rip),%rcx
add    (%rcx),%rax
sub    $0x1,%rax
mov    0x2ebf(%rip),%rcx
xor    %edx,%edx
divq   (%rcx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bits_size>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%rcx
lea    (%rdi,%rcx,1),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
je     1124 <bits_size+0x24>
xor    %edx,%edx
div    %rcx
ret
xor    %edx,%edx
div    %ecx
ret

LLVM IR (-O0):
@CHAR_BIT = global i64 0
define i64 @bits_size(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* @CHAR_BIT
%5 = add i64 %3, %4
%6 = sub i64 %5, 1
%7 = load i64, i64* @CHAR_BIT
%8 = udiv i64 %6, %7
ret i64 %8
}

LLVM IR (-O2):
@CHAR_BIT = global i64 0
define i64 @bits_size(i64 %0) {
%2 = load i64, i64* @CHAR_BIT
%3 = add i64 %0, -1
%4 = add i64 %3, %2
%5 = udiv i64 %4, %2
ret i64 %5
}
/* Variables and functions */
long ang2pix_ring_z_phi(long, int /*<<< orphan*/, double);
int /*<<< orphan*/ cos(double);
void ang2pix_ring(long nside, double theta, double phi, long *ipix) {
  *ipix = ang2pix_ring_z_phi(nside, cos(theta), phi);
}


x86 assembly (clang, -O0):
<ang2pix_ring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <cos@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%esi
movsd  -0x18(%rbp),%xmm0
call   1030 <ang2pix_ring_z_phi@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ang2pix_ring>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
movsd  %xmm1,(%rsp)
mov    %rdi,%rbx
call   1040 <cos@plt>
mov    %rbx,%rdi
mov    %eax,%esi
movsd  (%rsp),%xmm0
call   1030 <ang2pix_ring_z_phi@plt>
mov    %rax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @ang2pix_ring(i64 %0, double %1, double %2, i64* %3) {
%5 = alloca i64
%6 = alloca double
%7 = alloca double
%8 = alloca i64*
store i64 %0, i64* %5
store double %1, double* %6
store double %2, double* %7
store i64* %3, i64** %8
%9 = load i64, i64* %5
%10 = load double, double* %6
%11 = call i32 @cos(double %10)
%12 = load double, double* %7
%13 = call i64 @ang2pix_ring_z_phi(i64 %9, i32 %11, double %12)
%14 = load i64*, i64** %8
store i64 %13, i64* %14
ret void
}

LLVM IR (-O2):
define void @ang2pix_ring(i64 %0, double %1, double %2, i64* nocapture writeonly %3) {
%5 = tail call i32 @cos(double %1)
%6 = tail call i64 @ang2pix_ring_z_phi(i64 %0, i32 %5, double %2)
store i64 %6, i64* %3
ret void
}
void msm_enable_wdog_debug(void) {}


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

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

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

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

/* Variables and functions */
int RuntimeQueryGLXVersion(Display *dpy, int screen) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @RuntimeQueryGLXVersion(i32* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int pad(int tab, int col) {
  while (col < tab) {
    putchar(' ');
    col++;
  }
  return (col);
}


x86 assembly (clang, -O0):
<pad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1142 <pad+0x32>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    111e <pad+0xe>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pad>:
mov    %esi,%eax
cmp    %edi,%esi
jge    1137 <pad+0x27>
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %edi,%ebp
sub    %eax,%ebp
nop
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1120 <pad+0x10>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @pad(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
br label %5
5: ; preds = %9, %2
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %5
%10 = call i32 @putchar(i8 signext 32)
%11 = load i32, i32* %4
%12 = add nsw i32 %11, 1
store i32 %12, i32* %4
br label %5
13: ; preds = %5
%14 = load i32, i32* %4
ret i32 %14
}

LLVM IR (-O2):
define i32 @pad(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, %0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = tail call i32 @putchar(i8 signext 32)
%7 = add i32 %5, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %1, %2 ], [ %0, %4 ]
ret i32 %10
}