xunge/DecIR huggingface dataset:
/* Type definitions */
struct bufferevent_openssl {
  int dummy;
};
struct bufferevent {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ consider_writing(struct bufferevent_openssl *);
void be_openssl_writecb(struct bufferevent *bev_base, void *ctx) {
  struct bufferevent_openssl *bev_ssl = ctx;
  consider_writing(bev_ssl);
}


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

x86 assembly (clang, -O2):
<be_openssl_writecb>:
mov    %rsi,%rdi
jmp    1030 <consider_writing@plt>

LLVM IR (-O0):
%struct.bufferevent = type { i32 }
%struct.bufferevent_openssl = type { i32 }
define void @be_openssl_writecb(%struct.bufferevent* %0, i8* %1) {
%3 = alloca %struct.bufferevent*
%4 = alloca i8*
%5 = alloca %struct.bufferevent_openssl*
store %struct.bufferevent* %0, %struct.bufferevent** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to %struct.bufferevent_openssl*
store %struct.bufferevent_openssl* %7, %struct.bufferevent_openssl** %5
%8 = load %struct.bufferevent_openssl*, %struct.bufferevent_openssl** %5
%9 = call i32 @consider_writing(%struct.bufferevent_openssl* %8)
ret void
}

LLVM IR (-O2):
%struct.bufferevent = type { i32 }
%struct.bufferevent_openssl = type { i32 }
define void @be_openssl_writecb(%struct.bufferevent* nocapture readnone %0, i8* %1) {
%3 = bitcast i8* %1 to %struct.bufferevent_openssl*
%4 = tail call i32 @consider_writing(%struct.bufferevent_openssl* %3)
ret void
}
/* Variables and functions */
int mountCommandWrapper(int, char *, char *, char *, char *, char **);
int doPwMount(char *dev, char *where, char *fs, char *options, char **err) {
  return mountCommandWrapper(1, dev, where, fs, options, err);
}


x86 assembly (clang, -O0):
<doPwMount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    $0x1,%edi
call   1030 <mountCommandWrapper@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doPwMount>:
mov    %r8,%r9
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <mountCommandWrapper@plt>

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

LLVM IR (-O2):
define i32 @doPwMount(i8* %0, i8* %1, i8* %2, i8* %3, i8** %4) {
%6 = tail call i32 @mountCommandWrapper(i32 1, i8* %0, i8* %1, i8* %2, i8* %3, i8** %4)
ret i32 %6
}
int fork() {
  int retval;
  __asm__("int $0x80      \n\t"
          "mov %%eax, %0"
          : "=m"(retval)
          : "a"(2)
          : "memory");
  return retval;
}


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

x86 assembly (clang, -O2):
<fork>:
mov    $0x2,%eax
int    $0x80
mov    %eax,-0x4(%rsp)
mov    -0x4(%rsp),%eax
ret

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

LLVM IR (-O2):
define i32 @fork() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = load i32, i32* %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char);
int main() {
  printf("Bug:\t%f\n", ('\x80' >> 4) * 16.0f + 0.5f);
  printf("No bug:\t%f\n", ((unsigned char)'\x80' >> 4) * 16.0f + 0.5f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
movzbl %al,%esi
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
mov    $0x80,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"Bug:\09%f\0A\00"
@.str.1 = [12 x i8] c"No bug:\09%f\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8 zeroext poison)
%3 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8 zeroext -128)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"Bug:\09%f\0A\00"
@.str.1 = [12 x i8] c"No bug:\09%f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8 zeroext poison)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8 zeroext -128)
ret i32 0
}
/* Variables and functions */
int char_to_int(char);
int add_chars(char c1, char c2) { return char_to_int(c1) + char_to_int(c2); }


x86 assembly (clang, -O0):
<add_chars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <char_to_int@plt>
mov    %eax,-0x8(%rbp)
movsbl -0x2(%rbp),%edi
call   1030 <char_to_int@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_chars>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
call   1030 <char_to_int@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <char_to_int@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @add_chars(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = call i32 @char_to_int(i8 signext %5)
%7 = load i8, i8* %4
%8 = call i32 @char_to_int(i8 signext %7)
%9 = add nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @add_chars(i8 signext %0, i8 signext %1) {
%3 = tail call i32 @char_to_int(i8 signext %0)
%4 = tail call i32 @char_to_int(i8 signext %1)
%5 = add nsw i32 %4, %3
ret i32 %5
}
int func(void) {
  int n = 3;
  int m = 5;
  n = (-m);
  return 0;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
movl   $0x3,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

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

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


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

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

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

LLVM IR (-O2):
@__const.main.x = [8 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00, double 5.000000e+00, double 6.000000e+00, double 7.000000e+00, double 8.000000e+00]
@.str = [10 x i8] c"sum: %lf\0A\00"
define i32 @main() {
%1 = alloca [8 x double]
%2 = bitcast [8 x double]* %1 to i8*
%3 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 0
%4 = call double @stdlib_strided_dsumkbn(i32 4, double* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %4)
ret i32 0
}
void sys_yield(void) { asm volatile("int %0\n" : : "i"(48) : "cc", "memory"); }


x86 assembly (clang, -O0):
<sys_yield>:
push   %rbp
mov    %rsp,%rbp
int    $0x30
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_yield>:
int    $0x30
ret

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

LLVM IR (-O2):
define void @sys_yield() {
tail call void asm sideeffect "int $0\0A", "i,~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(i32 48)
ret void
}
void ScaleARGBRowDownEven_SSE2() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ ASN1_item_free(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ X509_CINF_it;
void X509_CINF_free(X509_CINF *a) {
  ASN1_item_free((ASN1_VALUE *)a, &X509_CINF_it);
}


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

x86 assembly (clang, -O2):
<X509_CINF_free>:
mov    0x2ed1(%rip),%rsi
jmp    1030 <ASN1_item_free@plt>

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

LLVM IR (-O2):
@X509_CINF_it = global i32 0
define void @X509_CINF_free(i32* %0) {
%2 = tail call i32 @ASN1_item_free(i32* %0, i32* @X509_CINF_it)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ run(int /*<<< orphan*/ *);
int /*<<< orphan*/ *stdin;
int main(int argc, char const *argv[]) {
  FILE *input = (argc == 1) ? stdin : fopen("B-examp-practice.in", "rt");
  assert(input);
  run(input);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1163 <main+0x33>
mov    0x2e91(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    117a <main+0x4a>
lea    0xe96(%rip),%rdi
lea    0xea3(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x18(%rbp),%rdi
call   1030 <run@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x1,%edi
jne    1142 <main+0x12>
mov    0x2eab(%rip),%rax
mov    (%rax),%rbx
jmp    1158 <main+0x28>
lea    0xeb7(%rip),%rdi
lea    0xec4(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    %rbx,%rdi
call   1040 <assert@plt>
mov    %rbx,%rdi
call   1030 <run@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32* null
@.str = [20 x i8] c"B-examp-practice.in\00"
@.str.1 = [3 x i8] c"rt\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32*, i32** @stdin
br label %13
11: ; preds = %2
%12 = call i32* @fopen(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11, %9
%14 = phi i32* [ %10, %9 ], [ %12, %11 ]
store i32* %14, i32** %6
%15 = load i32*, i32** %6
%16 = call i32 @assert(i32* %15)
%17 = load i32*, i32** %6
%18 = call i32 @run(i32* %17)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32* null
@.str = [20 x i8] c"B-examp-practice.in\00"
@.str.1 = [3 x i8] c"rt\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = load i32*, i32** @stdin
br label %8
6: ; preds = %2
%7 = tail call i32* @fopen(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
%9 = phi i32* [ %5, %4 ], [ %7, %6 ]
%10 = tail call i32 @assert(i32* %9)
%11 = tail call i32 @run(i32* %9)
ret i32 0
}
long long pow_up(long long n) {
  long long ans = 1;
  long long base = 3;
  while (n) {
    if (n & 1)
      ans = (ans * base) % 1000000007;
    base = (base * base) % 1000000007;
    n >>= 1;
  }
  return ans;
}


x86 assembly (clang, -O0):
<pow_up>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1,-0x10(%rbp)
movq   $0x3,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1174 <pow_up+0x74>
mov    -0x8(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     114c <pow_up+0x4c>
mov    -0x10(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    $0x3b9aca07,%ecx
cqto
idiv   %rcx
mov    %rdx,-0x10(%rbp)
mov    -0x18(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    $0x3b9aca07,%ecx
cqto
idiv   %rcx
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1118 <pow_up+0x18>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow_up>:
mov    $0x1,%ecx
test   %rdi,%rdi
je     1174 <pow_up+0x74>
mov    $0x3,%esi
movabs $0x89705f3112a28fe5,%r8
5f 70 89
jmp    1147 <pow_up+0x47>
nopl   0x0(%rax,%rax,1)
imul   %rsi,%rsi
mov    %rsi,%rax
mul    %r8
shr    $0x1d,%rdx
imul   $0x3b9aca07,%rdx,%rax
sub    %rax,%rsi
mov    %rdi,%rax
sar    %rax
cmp    $0x1,%rdi
mov    %rax,%rdi
jbe    1174 <pow_up+0x74>
test   $0x1,%dil
je     1120 <pow_up+0x20>
imul   %rsi,%rcx
mov    %rcx,%rax
imul   %r8
add    %rcx,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x1d,%rdx
add    %rax,%rdx
imul   $0x3b9aca07,%rdx,%rax
sub    %rax,%rcx
jmp    1120 <pow_up+0x20>
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @pow_up(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %2
store i64 1, i64* %3
store i64 3, i64* %4
br label %5
5: ; preds = %17, %1
%6 = load i64, i64* %2
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %24
8: ; preds = %5
%9 = load i64, i64* %2
%10 = and i64 %9, 1
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %8
%13 = load i64, i64* %3
%14 = load i64, i64* %4
%15 = mul nsw i64 %13, %14
%16 = srem i64 %15, 1000000007
store i64 %16, i64* %3
br label %17
17: ; preds = %12, %8
%18 = load i64, i64* %4
%19 = load i64, i64* %4
%20 = mul nsw i64 %18, %19
%21 = srem i64 %20, 1000000007
store i64 %21, i64* %4
%22 = load i64, i64* %2
%23 = ashr i64 %22, 1
store i64 %23, i64* %2
br label %5
24: ; preds = %5
%25 = load i64, i64* %3
ret i64 %25
}

LLVM IR (-O2):
define i64 @pow_up(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %18, label %3
3: ; preds = %1, %12
%4 = phi i64 [ %15, %12 ], [ 3, %1 ]
%5 = phi i64 [ %13, %12 ], [ 1, %1 ]
%6 = phi i64 [ %16, %12 ], [ %0, %1 ]
%7 = and i64 %6, 1
%8 = icmp eq i64 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %3
%10 = mul nsw i64 %4, %5
%11 = srem i64 %10, 1000000007
br label %12
12: ; preds = %9, %3
%13 = phi i64 [ %11, %9 ], [ %5, %3 ]
%14 = mul nuw nsw i64 %4, %4
%15 = urem i64 %14, 1000000007
%16 = ashr i64 %6, 1
%17 = icmp ult i64 %6, 2
br i1 %17, label %18, label %3
18: ; preds = %12, %1
%19 = phi i64 [ 1, %1 ], [ %13, %12 ]
ret i64 %19
}
void void_runner_commit(long iterations) {
  long i;
  long j;
  i = 0;
  j = 0;
loop1:
  j = j + 1;
  i = i + 1;
  if (i < iterations) {
    goto loop1;
  }
  return;
}


x86 assembly (clang, -O0):
<void_runner_commit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jge    1143 <void_runner_commit+0x43>
jmp    1118 <void_runner_commit+0x18>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @void_runner_commit(i64 %0) {
ret void
}
/* Variables and functions */
char *memchr(char *, char, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
char *strchr(char *str, char value) { return memchr(str, value, strlen(str)); }


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x9(%rbp),%al
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%edx
mov    -0xa(%rbp),%al
movsbl %al,%esi
call   1040 <memchr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <memchr@plt>

LLVM IR (-O0):
define i8* @strchr(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8*, i8** %3
%6 = load i8, i8* %4
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = call i8* @memchr(i8* %5, i8 signext %6, i32 %8)
ret i8* %9
}

LLVM IR (-O2):
define i8* @strchr(i8* %0, i8 signext %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i8* @memchr(i8* %0, i8 signext %1, i32 %3)
ret i8* %4
}
char *_Locale_extract_numeric_name(const char *__DUMMY_PAR1,
                                   char *__DUMMY_PAR) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @_Locale_extract_numeric_name(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* null
}
void func3(void) {
  enum {
    IDENT = 0,
  };
}


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

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

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

LLVM IR (-O2):
define void @func3() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
int main() {
  int times = 10;
  while (times--)
    foo(times);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     1147 <main+0x37>
mov    -0x8(%rbp),%edi
call   1030 <foo@plt>
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x9,%edi
call   1030 <foo@plt>
mov    $0x8,%edi
call   1030 <foo@plt>
mov    $0x7,%edi
call   1030 <foo@plt>
mov    $0x6,%edi
call   1030 <foo@plt>
mov    $0x5,%edi
call   1030 <foo@plt>
mov    $0x4,%edi
call   1030 <foo@plt>
mov    $0x3,%edi
call   1030 <foo@plt>
mov    $0x2,%edi
call   1030 <foo@plt>
mov    $0x1,%edi
call   1030 <foo@plt>
xor    %edi,%edi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 9)
%2 = tail call i32 @foo(i32 8)
%3 = tail call i32 @foo(i32 7)
%4 = tail call i32 @foo(i32 6)
%5 = tail call i32 @foo(i32 5)
%6 = tail call i32 @foo(i32 4)
%7 = tail call i32 @foo(i32 3)
%8 = tail call i32 @foo(i32 2)
%9 = tail call i32 @foo(i32 1)
%10 = tail call i32 @foo(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
long double __ieee754_fmodl(long double x, long double y) {
  fputs("__ieee754_fmodl not implemented\n", stderr);
  __set_errno(ENOSYS);
  return 0.0;
}


x86 assembly (clang, -O0):
<__ieee754_fmodl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
lea    0xebc(%rip),%rdi
call   1040 <fputs@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
fldz
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ieee754_fmodl>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1040 <fputs@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
fldz
pop    %rax
ret

LLVM IR (-O0):
@.str = [33 x i8] c"__ieee754_fmodl not implemented\0A\00"
@stderr = global i32 0
@ENOSYS = global i32 0
define x86_fp80 @__ieee754_fmodl(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load i32, i32* @stderr
%6 = call i32 @fputs(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @ENOSYS
%8 = call i32 @__set_errno(i32 %7)
ret x86_fp80 0xK00000000000000000000
}

LLVM IR (-O2):
@.str = [33 x i8] c"__ieee754_fmodl not implemented\0A\00"
@stderr = global i32 0
@ENOSYS = global i32 0
define x86_fp80 @__ieee754_fmodl(x86_fp80 %0, x86_fp80 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @ENOSYS
%6 = tail call i32 @__set_errno(i32 %5)
ret x86_fp80 0xK00000000000000000000
}
/* Variables and functions */
int /*<<< orphan*/ sendInputEventT(int, int const);
void sendInputEvent(const int cCode) {
  sendInputEventT(1, cCode);
  sendInputEventT(0, cCode);
}


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

x86 assembly (clang, -O2):
<sendInputEvent>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%edi
mov    %ebx,%esi
call   1030 <sendInputEventT@plt>
xor    %edi,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <sendInputEventT@plt>

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

LLVM IR (-O2):
define void @sendInputEvent(i32 %0) {
%2 = tail call i32 @sendInputEventT(i32 1, i32 %0)
%3 = tail call i32 @sendInputEventT(i32 0, i32 %0)
ret void
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
unsigned long delta_timeval(struct timeval const *, struct timeval *);
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
unsigned long delta_timeval_now(const struct timeval *start) {
  struct timeval end;
  gettimeofday(&end, NULL);
  return delta_timeval(start, &end);
}


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

x86 assembly (clang, -O2):
<delta_timeval_now>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <delta_timeval@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i64 @delta_timeval_now(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
%3 = alloca %struct.timeval
store %struct.timeval* %0, %struct.timeval** %2
%4 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
%5 = load %struct.timeval*, %struct.timeval** %2
%6 = call i64 @delta_timeval(%struct.timeval* %5, %struct.timeval* %3)
ret i64 %6
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i64 @delta_timeval_now(%struct.timeval* %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%5 = call i64 @delta_timeval(%struct.timeval* %0, %struct.timeval* %2)
ret i64 %5
}
/* Variables and functions */
short S2S(short);
__attribute__((__visibility__("default"))) __attribute__((used)) signed short
rS2S(signed short *x) {
  return S2S(*x);
}


x86 assembly (clang, -O0):
<rS2S>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edi
call   1030 <S2S@plt>
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rS2S>:
movswl (%rdi),%edi
jmp    1030 <S2S@plt>

LLVM IR (-O0):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i16 (i16*)* @rS2S to i8*)], section "llvm.metadata"
define signext i16 @rS2S(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = call signext i16 @S2S(i16 signext %4)
ret i16 %5
}

LLVM IR (-O2):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i16 (i16*)* @rS2S to i8*)], section "llvm.metadata"
define signext i16 @rS2S(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = tail call signext i16 @S2S(i16 signext %2)
ret i16 %3
}
int sinon(const char *ligne) {
  if (ligne[0] == 'S' && ligne[1] == 'i' && ligne[2] == 'n' &&
      ligne[3] == 'o' && ligne[4] == 'n')
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<sinon>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x53,%eax
jne    1168 <sinon+0x68>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x69,%eax
jne    1168 <sinon+0x68>
mov    -0x10(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x6e,%eax
jne    1168 <sinon+0x68>
mov    -0x10(%rbp),%rax
movsbl 0x3(%rax),%eax
cmp    $0x6f,%eax
jne    1168 <sinon+0x68>
mov    -0x10(%rbp),%rax
movsbl 0x4(%rax),%eax
cmp    $0x6e,%eax
jne    1168 <sinon+0x68>
movl   $0x1,-0x4(%rbp)
jmp    116f <sinon+0x6f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinon>:
cmpb   $0x53,(%rdi)
jne    1122 <sinon+0x22>
cmpb   $0x69,0x1(%rdi)
jne    1122 <sinon+0x22>
cmpb   $0x6e,0x2(%rdi)
jne    1122 <sinon+0x22>
cmpb   $0x6f,0x3(%rdi)
jne    1122 <sinon+0x22>
mov    $0x1,%eax
cmpb   $0x6e,0x4(%rdi)
je     1124 <sinon+0x24>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @sinon(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 83
br i1 %8, label %9, label %34
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 105
br i1 %14, label %15, label %34
15: ; preds = %9
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 2
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 110
br i1 %20, label %21, label %34
21: ; preds = %15
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i64 3
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 111
br i1 %26, label %27, label %34
27: ; preds = %21
%28 = load i8*, i8** %3
%29 = getelementptr inbounds i8, i8* %28, i64 4
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = icmp eq i32 %31, 110
br i1 %32, label %33, label %34
33: ; preds = %27
store i32 1, i32* %2
br label %35
34: ; preds = %27, %21, %15, %9, %1
store i32 0, i32* %2
br label %35
35: ; preds = %34, %33
%36 = load i32, i32* %2
ret i32 %36
}

LLVM IR (-O2):
define i32 @sinon(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 83
br i1 %3, label %4, label %20
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 105
br i1 %7, label %8, label %20
8: ; preds = %4
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 110
br i1 %11, label %12, label %20
12: ; preds = %8
%13 = getelementptr inbounds i8, i8* %0, i64 3
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 111
br i1 %15, label %16, label %20
16: ; preds = %12
%17 = getelementptr inbounds i8, i8* %0, i64 4
%18 = load i8, i8* %17
%19 = icmp eq i8 %18, 110
br i1 %19, label %21, label %20
20: ; preds = %16, %12, %8, %4, %1
br label %21
21: ; preds = %16, %20
%22 = phi i32 [ 0, %20 ], [ 1, %16 ]
ret i32 %22
}
void C(int *s1, int *s2, int ymax) {
  if (*s1 + *s2 <= ymax) {
    *s2 = *s1 + *s2;
    *s1 = 0;
  } else {
    *s1 = *s1 - (ymax - *s2);
    *s2 = ymax;
  }
}


x86 assembly (clang, -O0):
<C>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
add    (%rcx),%eax
cmp    -0x14(%rbp),%eax
jg     1145 <C+0x45>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
add    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
jmp    1165 <C+0x65>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%rdx
sub    (%rdx),%eax
sub    %eax,%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):
<C>:
mov    (%rdi),%eax
mov    (%rsi),%r8d
lea    (%r8,%rax,1),%ecx
cmp    %edx,%ecx
jle    1117 <C+0x17>
sub    %edx,%eax
add    %r8d,%eax
mov    %eax,(%rdi)
mov    %edx,(%rsi)
ret
mov    %ecx,(%rsi)
movl   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @C(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* %7
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = add nsw i32 %8, %10
%12 = load i32, i32* %6
%13 = icmp sle i32 %11, %12
br i1 %13, label %14, label %22
14: ; preds = %3
%15 = load i32*, i32** %4
%16 = load i32, i32* %15
%17 = load i32*, i32** %5
%18 = load i32, i32* %17
%19 = add nsw i32 %16, %18
%20 = load i32*, i32** %5
store i32 %19, i32* %20
%21 = load i32*, i32** %4
store i32 0, i32* %21
br label %33
22: ; preds = %3
%23 = load i32*, i32** %4
%24 = load i32, i32* %23
%25 = load i32, i32* %6
%26 = load i32*, i32** %5
%27 = load i32, i32* %26
%28 = sub nsw i32 %25, %27
%29 = sub nsw i32 %24, %28
%30 = load i32*, i32** %4
store i32 %29, i32* %30
%31 = load i32, i32* %6
%32 = load i32*, i32** %5
store i32 %31, i32* %32
br label %33
33: ; preds = %22, %14
ret void
}

LLVM IR (-O2):
define void @C(i32* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %1
%6 = add nsw i32 %5, %4
%7 = icmp sgt i32 %6, %2
br i1 %7, label %9, label %8
8: ; preds = %3
store i32 %6, i32* %1
store i32 0, i32* %0
br label %12
9: ; preds = %3
%10 = sub i32 %4, %2
%11 = add i32 %10, %5
store i32 %11, i32* %0
store i32 %2, i32* %1
br label %12
12: ; preds = %9, %8
ret void
}
void foo039(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo039(i32 %0) {
ret void
}
int cornet_run() {
  void taskscheduler();
  taskscheduler();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @cornet_run() {
tail call void (...) @taskscheduler()
ret i32 0
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int __infer_nondet_int();
int futimes(int fildes, const struct timeval times[2]) {
  int ret = __infer_nondet_int();
  if (ret < -1 || ret > 0)
    while (1)
      ;
  return ret;
}


x86 assembly (clang, -O0):
<futimes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_int@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jl     113d <futimes+0x2d>
cmpl   $0x0,-0x14(%rbp)
jle    1147 <futimes+0x37>
jmp    1142 <futimes+0x32>
jmp    1142 <futimes+0x32>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<futimes>:
push   %rax
xor    %eax,%eax
call   1030 <__infer_nondet_int@plt>
lea    -0x1(%rax),%ecx
cmp    $0xfffffffd,%ecx
ja     1122 <futimes+0x12>
jmp    1120 <futimes+0x10>
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i32 @futimes(i32 %0, %struct.timeval* %1) {
%3 = alloca i32
%4 = alloca %struct.timeval*
%5 = alloca i32
store i32 %0, i32* %3
store %struct.timeval* %1, %struct.timeval** %4
%6 = call i32 (...) @__infer_nondet_int()
store i32 %6, i32* %5
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, -1
br i1 %8, label %12, label %9
9: ; preds = %2
%10 = load i32, i32* %5
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %9, %2
br label %13
13: ; preds = %12, %13
br label %13
14: ; preds = %9
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @futimes(i32 %0, %struct.timeval* nocapture readnone %1) {
%3 = tail call i32 (...) @__infer_nondet_int()
%4 = add i32 %3, -1
%5 = icmp ult i32 %4, -2
br i1 %5, label %6, label %7
6: ; preds = %2, %6
br label %6
7: ; preds = %2
ret i32 %3
}
void cpu_boost_timeout(unsigned int freq_mhz, unsigned int duration_ms) {}


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

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

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

LLVM IR (-O2):
define void @cpu_boost_timeout(i32 %0, i32 %1) {
ret void
}
long double testl(long double x, int sel1, int sel2) {
  long double input = sel1 ? -x : __builtin_fabsl(x);
  if (sel2)
    return __builtin_cosl(input);
  else
    return __builtin_coshl(input);
}


x86 assembly (clang, -O0):
<testl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
fldt   0x10(%rbp)
fstpt  -0x20(%rbp)
mov    %edi,-0x24(%rbp)
mov    %esi,-0x28(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     114b <testl+0x2b>
fldt   -0x20(%rbp)
fchs
fstpt  -0x4c(%rbp)
jmp    1153 <testl+0x33>
fldt   -0x20(%rbp)
fabs
fstpt  -0x4c(%rbp)
fldt   -0x4c(%rbp)
fstpt  -0x40(%rbp)
cmpl   $0x0,-0x28(%rbp)
je     1178 <testl+0x58>
fldt   -0x40(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <cosl@plt>
fstpt  -0x10(%rbp)
jmp    1188 <testl+0x68>
fldt   -0x40(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <coshl@plt>
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testl>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
test   %edi,%edi
fld    %st(0)
fchs
fxch   %st(1)
fabs
fxch   %st(1)
fcmove %st(1),%st
fstp   %st(1)
test   %esi,%esi
je     1149 <testl+0x29>
fstpt  (%rsp)
call   1040 <cosl@plt>
add    $0x18,%rsp
ret
fstpt  (%rsp)
call   1030 <coshl@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @testl(x86_fp80 %0, i32 %1, i32 %2) {
%4 = alloca x86_fp80
%5 = alloca x86_fp80
%6 = alloca i32
%7 = alloca i32
%8 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%9 = load i32, i32* %6
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %3
%12 = load x86_fp80, x86_fp80* %5
%13 = fneg x86_fp80 %12
br label %17
14: ; preds = %3
%15 = load x86_fp80, x86_fp80* %5
%16 = call x86_fp80 @llvm.fabs.f80(x86_fp80 %15)
br label %17
17: ; preds = %14, %11
%18 = phi x86_fp80 [ %13, %11 ], [ %16, %14 ]
store x86_fp80 %18, x86_fp80* %8
%19 = load i32, i32* %7
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %17
%22 = load x86_fp80, x86_fp80* %8
%23 = call x86_fp80 @cosl(x86_fp80 %22)
store x86_fp80 %23, x86_fp80* %4
br label %27
24: ; preds = %17
%25 = load x86_fp80, x86_fp80* %8
%26 = call x86_fp80 @coshl(x86_fp80 %25)
store x86_fp80 %26, x86_fp80* %4
br label %27
27: ; preds = %24, %21
%28 = load x86_fp80, x86_fp80* %4
ret x86_fp80 %28
}

LLVM IR (-O2):
define x86_fp80 @testl(x86_fp80 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, 0
%5 = fneg x86_fp80 %0
%6 = tail call x86_fp80 @llvm.fabs.f80(x86_fp80 %0)
%7 = select i1 %4, x86_fp80 %6, x86_fp80 %5
%8 = icmp eq i32 %2, 0
br i1 %8, label %11, label %9
9: ; preds = %3
%10 = tail call x86_fp80 @cosl(x86_fp80 %7)
br label %13
11: ; preds = %3
%12 = tail call x86_fp80 @coshl(x86_fp80 %7)
br label %13
13: ; preds = %11, %9
%14 = phi x86_fp80 [ %10, %9 ], [ %12, %11 ]
ret x86_fp80 %14
}
void *test_anti_range_118(short n) {
  extern void *alloc_anti_range_118(short) __attribute__((alloc_size(1)));
  if ((-0x7fff - 1) + 2 <= n && n <= 0)
    n = (-0x7fff - 1) + 2 - 1;
  return alloc_anti_range_118(n);
}


x86 assembly (clang, -O0):
<test_anti_range_118>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%ecx
mov    $0xffff8002,%eax
cmp    %ecx,%eax
jg     1143 <test_anti_range_118+0x33>
movswl -0x2(%rbp),%eax
cmp    $0x0,%eax
jg     1143 <test_anti_range_118+0x33>
movw   $0x8001,-0x2(%rbp)
movswl -0x2(%rbp),%edi
call   1030 <alloc_anti_range_118@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_118>:
lea    0x7ffe(%rdi),%eax
movzwl %ax,%eax
cmp    $0x7fff,%eax
mov    $0x8001,%eax
cmovae %edi,%eax
movswl %ax,%edi
jmp    1030 <alloc_anti_range_118@plt>

LLVM IR (-O0):
define i8* @test_anti_range_118(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = icmp sle i32 -32766, %4
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i16, i16* %2
%8 = sext i16 %7 to i32
%9 = icmp sle i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %6
store i16 -32767, i16* %2
br label %11
11: ; preds = %10, %6, %1
%12 = load i16, i16* %2
%13 = call i8* @alloc_anti_range_118(i16 signext %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @test_anti_range_118(i16 signext %0) {
%2 = add i16 %0, 32766
%3 = icmp ult i16 %2, 32767
%4 = select i1 %3, i16 -32767, i16 %0
%5 = tail call i8* @alloc_anti_range_118(i16 signext %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void terminate_connected_mode(int socket) {
  printf("Deconnection...\n");
  close(socket);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<terminate_connected_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<terminate_connected_mode>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1040 <close@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Deconnection...\0A\00"
@EXIT_SUCCESS = global i32 0
define void @terminate_connected_mode(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @close(i32 %4)
%6 = load i32, i32* @EXIT_SUCCESS
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [16 x i8] c"Deconnection...\00"
define void @terminate_connected_mode(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @close(i32 %0)
%4 = load i32, i32* @EXIT_SUCCESS
%5 = tail call i32 @exit(i32 %4)
unreachable
}
XGetPointerControl() {}


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

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

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

LLVM IR (-O2):
define i32 @XGetPointerControl() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ init_io();
int /*<<< orphan*/ setupGlobalConstructors();
void init_default_std() {
  setupGlobalConstructors();
  init_io();
}


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

x86 assembly (clang, -O2):
<init_default_std>:
push   %rax
xor    %eax,%eax
call   1030 <setupGlobalConstructors@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <init_io@plt>

LLVM IR (-O0):
define void @init_default_std() {
%1 = call i32 (...) @setupGlobalConstructors()
%2 = call i32 (...) @init_io()
ret void
}

LLVM IR (-O2):
define void @init_default_std() {
%1 = tail call i32 (...) @setupGlobalConstructors()
%2 = tail call i32 (...) @init_io()
ret void
}
void color_(col) int *col;
{ color(*col); }


x86 assembly (clang, -O0):
<color_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    $0x0,%al
call   1030 <color@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<color_>:
mov    (%rdi),%edi
xor    %eax,%eax
jmp    1030 <color@plt>

LLVM IR (-O0):
define void @color_(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = call i32 (i32, ...) bitcast (i32 (...)* @color to i32 (i32, ...)*)(i32 %4)
ret void
}

LLVM IR (-O2):
define void @color_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @color to i32 (i32, ...)*)(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int main(void) {
  int k;
  k = 0;
#pragma xmp task on p(2 : 3, 1 : 4 : 2)
  { k = 1; }
#pragma xmp task on p(2 : 3, 1 : 4 : 2) nocomm
  { k = 0; }
#pragma xmp reduction(+ : k)
#pragma xmp task on p(1, 1)
  {
    if (k != 0) {
      printf("ERROR\n");
      exit(1);
    }
  }
  k = 0;
#pragma xmp task on t(1, 1)
  { k = 1; }
#pragma xmp task on t(1, 1) nocomm
  { k = 0; }
#pragma xmp reduction(+ : k)
#pragma xmp task on p(1, 1)
  {
    if (k != 0) {
      printf("ERROR\n");
      exit(1);
    } else {
      printf("PASS\n");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1164 <main+0x44>
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1199 <main+0x79>
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
lea    0xe67(%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
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [5 x i8] c"PASS\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void get_max_accel_(int *itf, int *sizef, long *Mesh_pointer) {}


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

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

LLVM IR (-O0):
define void @get_max_accel_(i32* %0, i32* %1, i64* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i64*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i64* %2, i64** %6
ret void
}

LLVM IR (-O2):
define void @get_max_accel_(i32* nocapture %0, i32* nocapture %1, i64* nocapture %2) {
ret void
}