xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ twoSum(int *, int, int, int *, int *);
int main() {
  int a[] = {1, 2, 3, 3, 5, 6};
  int b, c;
  twoSum(a, 6, 9, &b, &c);
  printf("%d %d\n", b, c);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x6,%esi
mov    $0x9,%edx
lea    -0x24(%rbp),%rcx
lea    -0x28(%rbp),%r8
call   1040 <twoSum@plt>
mov    -0x24(%rbp),%esi
mov    -0x28(%rbp),%edx
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xee5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
mov    $0x6,%esi
mov    $0x9,%edx
call   1040 <twoSum@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

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

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

/* Variables and functions */
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, int);
void uninitvar_fscanf(void) {
  FILE *stream;
  char *format;
  int i;
  (void)fscanf(stream, format, i);
}


x86 assembly (clang, -O0):
<uninitvar_fscanf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <fscanf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_fscanf>:
jmp    1030 <fscanf@plt>

LLVM IR (-O0):
define void @uninitvar_fscanf() {
%1 = alloca i32*
%2 = alloca i8*
%3 = alloca i32
%4 = load i32*, i32** %1
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = call i32 @fscanf(i32* %4, i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @uninitvar_fscanf() {
%1 = tail call i32 @fscanf(i32* undef, i8* undef, i32 undef)
ret void
}
/* Variables and functions */
double sla_epj(double *);
double csla_epj(double date) { return sla_epj(&date); }


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

x86 assembly (clang, -O2):
<csla_epj>:
push   %rax
movsd  %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <sla_epj@plt>
pop    %rax
ret

LLVM IR (-O0):
define double @csla_epj(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call double @sla_epj(double* %2)
ret double %3
}

LLVM IR (-O2):
define double @csla_epj(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call double @sla_epj(double* %2)
ret double %3
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", getpid());
  while (1)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xec1(%rip),%rdi
call   1040 <printf@plt>
jmp    1144 <main+0x24>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
cs nopw 0x0(%rax,%rax,1)
jmp    1140 <main+0x20>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
br label %3
3: ; preds = %0, %3
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ BNCIO(int);
int BNCOffset() {
  int ii, stat = 99;
  char com1, data;
  BNCIO(13);
  return (stat);
}


x86 assembly (clang, -O0):
<BNCOffset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x63,-0x8(%rbp)
mov    $0xd,%edi
call   1030 <BNCIO@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BNCOffset>:
push   %rax
mov    $0xd,%edi
call   1030 <BNCIO@plt>
mov    $0x63,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @BNCOffset() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
store i32 99, i32* %2
%5 = call i32 @BNCIO(i32 13)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @BNCOffset() {
%1 = tail call i32 @BNCIO(i32 13)
ret i32 99
}
/* Variables and functions */
int /*<<< orphan*/ LC_TIME;
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
void set_c_locale() { setlocale(LC_TIME, "C"); }


x86 assembly (clang, -O0):
<set_c_locale>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <setlocale@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_c_locale>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <setlocale@plt>

LLVM IR (-O0):
@LC_TIME = global i32 0
@.str = [2 x i8] c"C\00"
define void @set_c_locale() {
%1 = load i32, i32* @LC_TIME
%2 = call i32 @setlocale(i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@LC_TIME = global i32 0
@.str = [2 x i8] c"C\00"
define void @set_c_locale() {
%1 = load i32, i32* @LC_TIME
%2 = tail call i32 @setlocale(i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
int access(char *, int /*<<< orphan*/);
int check_file(char *file) { return access(file, F_OK); }


x86 assembly (clang, -O0):
<check_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_file>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <access@plt>

LLVM IR (-O0):
@F_OK = global i32 0
define i32 @check_file(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @F_OK
%5 = call i32 @access(i8* %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@F_OK = global i32 0
define i32 @check_file(i8* nocapture %0) {
%2 = load i32, i32* @F_OK
%3 = tail call i32 @access(i8* %0, i32 %2)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ SSL_CTX;
typedef int /*<<< orphan*/ SSL;

/* Variables and functions */
int /*<<< orphan*/ *SSL_new(int /*<<< orphan*/ *);
int /*<<< orphan*/ SSL_set_fd(int /*<<< orphan*/ *, int);
SSL *zopenssl_create_SSL(SSL_CTX *ctx, int fd) {
  SSL *ssl;
  ssl = SSL_new(ctx);
  SSL_set_fd(ssl, fd);
  return ssl;
}


x86 assembly (clang, -O0):
<zopenssl_create_SSL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <SSL_new@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <SSL_set_fd@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zopenssl_create_SSL>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
call   1040 <SSL_new@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %ebp,%esi
call   1030 <SSL_set_fd@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32* @zopenssl_create_SSL(i32* %0, i32 %1) {
%3 = tail call i32* @SSL_new(i32* %0)
%4 = tail call i32 @SSL_set_fd(i32* %3, i32 %1)
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void g() { printf("Function g\n"); }


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

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

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

LLVM IR (-O2):
@str = [11 x i8] c"Function g\00"
define void @g() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *realloc(char *, scalar_t__);
int /*<<< orphan*/ strcat(char *, char *);
scalar_t__ strlen(char *);
char *append_dup_string(char *s, char *suffix) {
  s = realloc(s, (strlen(s) + strlen(suffix) + 1));
  strcat(s, suffix);
  return s;
}


x86 assembly (clang, -O0):
<append_dup_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdi
add    %rax,%rsi
add    $0x1,%rsi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <strcat@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<append_dup_string>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1030 <strlen@plt>
lea    (%r15,%rax,1),%rsi
add    $0x1,%rsi
mov    %rbx,%rdi
call   1040 <realloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1050 <strcat@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @append_dup_string(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* %8)
%10 = add nsw i64 %7, %9
%11 = add nsw i64 %10, 1
%12 = call i8* @realloc(i8* %5, i64 %11)
store i8* %12, i8** %3
%13 = load i8*, i8** %3
%14 = load i8*, i8** %4
%15 = call i32 @strcat(i8* %13, i8* %14)
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
define i8* @append_dup_string(i8* nocapture %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add i64 %3, 1
%6 = add i64 %5, %4
%7 = tail call i8* @realloc(i8* %0, i64 %6)
%8 = tail call i32 @strcat(i8* %7, i8* %1)
ret i8* %7
}
int IsSwitch(char *pszArg) {
  switch (*pszArg) {
  case '-':
  case '/':
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<IsSwitch>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
or     $0x2,%eax
sub    $0x2f,%eax
je     1120 <IsSwitch+0x20>
jmp    112c <IsSwitch+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1133 <IsSwitch+0x33>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsSwitch>:
mov    (%rdi),%cl
and    $0xfd,%cl
xor    %eax,%eax
cmp    $0x2d,%cl
sete   %al
ret

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

LLVM IR (-O2):
define i32 @IsSwitch(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -3
%4 = icmp eq i8 %3, 45
%5 = zext i1 %4 to i32
ret i32 %5
}
char *saveString(s)
char *s;
{
  char *result;
  result = (char *)malloc(strlen(s) + 1);
  strcpy(result, s);
  return (result);
}


x86 assembly (clang, -O0):
<saveString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<saveString>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @saveString(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add i64 %5, 1
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i8* @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @saveString(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i8* @strcpy(i8* dereferenceable(1) %4, i8* dereferenceable(1) %0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_error(char *msg) { printf("# ERROR: %s\n", msg); }


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

x86 assembly (clang, -O2):
<print_error>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"# ERROR: %s\0A\00"
define void @print_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"# ERROR: %s\0A\00"
define void @print_error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void driver_mstp_fini() {}


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

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

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

LLVM IR (-O2):
define void @driver_mstp_fini() {
ret void
}
int(min)(int a, int b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <min+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <min+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @min(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ eat(int);
int /*<<< orphan*/ put_forks(int);
int /*<<< orphan*/ take_forks(int);
int /*<<< orphan*/ think(int);
void philosopher(int i) {
  int max = 5;
  while (1) {
    think(i);
    take_forks(i);
    eat(i);
    put_forks(i);
    max--;
  }
}


x86 assembly (clang, -O0):
<philosopher>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <think@plt>
mov    -0x4(%rbp),%edi
call   1060 <take_forks@plt>
mov    -0x4(%rbp),%edi
call   1030 <eat@plt>
mov    -0x4(%rbp),%edi
call   1050 <put_forks@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    %eax,-0x8(%rbp)
jmp    1152 <philosopher+0x12>

x86 assembly (clang, -O2):
<philosopher>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1040 <think@plt>
mov    %ebx,%edi
call   1060 <take_forks@plt>
mov    %ebx,%edi
call   1030 <eat@plt>
mov    %ebx,%edi
call   1050 <put_forks@plt>
jmp    1150 <philosopher+0x10>

LLVM IR (-O0):
define void @philosopher(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 5, i32* %3
br label %4
4: ; preds = %1, %4
%5 = load i32, i32* %2
%6 = call i32 @think(i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @take_forks(i32 %7)
%9 = load i32, i32* %2
%10 = call i32 @eat(i32 %9)
%11 = load i32, i32* %2
%12 = call i32 @put_forks(i32 %11)
%13 = load i32, i32* %3
%14 = add nsw i32 %13, -1
store i32 %14, i32* %3
br label %4
}

LLVM IR (-O2):
define void @philosopher(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @think(i32 %0)
%4 = tail call i32 @take_forks(i32 %0)
%5 = tail call i32 @eat(i32 %0)
%6 = tail call i32 @put_forks(i32 %0)
br label %2
}
/* Variables and functions */
double cbrt(double);
int /*<<< orphan*/ printf(char *, double, double);
int main(int argc, char **argv) {
  double cube = 64.0;
  printf("Cube = %f\nCube Root = %f\n", cube, cbrt(cube));
  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)
movsd  0xec2(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <cbrt@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
call   1040 <cbrt@plt>
movaps %xmm0,%xmm1
lea    0xed0(%rip),%rdi
movsd  0xec0(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Cube = %f\0ACube Root = %f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store double 6.400000e+01, double* %6
%7 = load double, double* %6
%8 = load double, double* %6
%9 = call double @cbrt(double %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), double %7, double %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"Cube = %f\0ACube Root = %f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call double @cbrt(double 6.400000e+01)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), double 6.400000e+01, double %3)
ret i32 0
}
void X509_VERIFY_PARAM_set_trust(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_VERIFY_PARAM_set_trust() {
ret void
}
void trickle_lock() {}


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

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

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

LLVM IR (-O2):
define void @trickle_lock() {
ret void
}
int test_imm_94int32_reg(int val) { return ((val) & (0x94 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_94int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x94,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_94int32_reg(i32 %0) {
%2 = and i32 %0, 148
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct sk_buff {
  int dummy;
};

/* Variables and functions */
struct sk_buff *alloc_skb(unsigned int, int);
int /*<<< orphan*/ record_transfer_skb(struct sk_buff *, int);
int /*<<< orphan*/ skb_reserve(struct sk_buff *, int);
struct sk_buff *__dev_alloc_skb(unsigned int length, int gfp_mask) {
  struct sk_buff *skb;
  skb = alloc_skb(length + 16, gfp_mask);
  if (skb) {
    record_transfer_skb(skb, (0x77));
    skb_reserve(skb, 16);
  }
  return skb;
}


x86 assembly (clang, -O0):
<__dev_alloc_skb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
add    $0x10,%edi
mov    -0x8(%rbp),%esi
call   1050 <alloc_skb@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1177 <__dev_alloc_skb+0x47>
mov    -0x10(%rbp),%rdi
mov    $0x77,%esi
call   1030 <record_transfer_skb@plt>
mov    -0x10(%rbp),%rdi
mov    $0x10,%esi
call   1040 <skb_reserve@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__dev_alloc_skb>:
push   %rbx
add    $0x10,%edi
call   1050 <alloc_skb@plt>
mov    %rax,%rbx
test   %rax,%rax
je     115b <__dev_alloc_skb+0x2b>
mov    %rbx,%rdi
mov    $0x77,%esi
call   1030 <record_transfer_skb@plt>
mov    %rbx,%rdi
mov    $0x10,%esi
call   1040 <skb_reserve@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.sk_buff = type { i32 }
define %struct.sk_buff* @__dev_alloc_skb(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.sk_buff*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = add i32 %6, 16
%8 = load i32, i32* %4
%9 = call %struct.sk_buff* @alloc_skb(i32 %7, i32 %8)
store %struct.sk_buff* %9, %struct.sk_buff** %5
%10 = load %struct.sk_buff*, %struct.sk_buff** %5
%11 = icmp ne %struct.sk_buff* %10, null
br i1 %11, label %12, label %17
12: ; preds = %2
%13 = load %struct.sk_buff*, %struct.sk_buff** %5
%14 = call i32 @record_transfer_skb(%struct.sk_buff* %13, i32 119)
%15 = load %struct.sk_buff*, %struct.sk_buff** %5
%16 = call i32 @skb_reserve(%struct.sk_buff* %15, i32 16)
br label %17
17: ; preds = %12, %2
%18 = load %struct.sk_buff*, %struct.sk_buff** %5
ret %struct.sk_buff* %18
}

LLVM IR (-O2):
%struct.sk_buff = type { i32 }
define %struct.sk_buff* @__dev_alloc_skb(i32 %0, i32 %1) {
%3 = add i32 %0, 16
%4 = tail call %struct.sk_buff* @alloc_skb(i32 %3, i32 %1)
%5 = icmp eq %struct.sk_buff* %4, null
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = tail call i32 @record_transfer_skb(%struct.sk_buff* %4, i32 119)
%8 = tail call i32 @skb_reserve(%struct.sk_buff* %4, i32 16)
br label %9
9: ; preds = %6, %2
ret %struct.sk_buff* %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void auto_terminate(int s __attribute__((unused))) { exit(2); }


x86 assembly (clang, -O0):
<auto_terminate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x2,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<auto_terminate>:
push   %rax
mov    $0x2,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @auto_terminate(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
define void @auto_terminate(i32 %0) {
%2 = tail call i32 @exit(i32 2)
unreachable
}
/* Variables and functions */
float sqrtf(float);
void sqrt_s(float *source, float *target) { *target = sqrtf(*source); }


x86 assembly (clang, -O0):
<sqrt_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
call   1030 <sqrtf@plt>
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqrt_s>:
push   %rbx
mov    %rsi,%rbx
movss  (%rdi),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1126 <sqrt_s+0x16>
sqrtss %xmm0,%xmm0
jmp    112b <sqrt_s+0x1b>
call   1030 <sqrtf@plt>
movss  %xmm0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @sqrt_s(float* nocapture %0, float* nocapture writeonly %1) {
%3 = load float, float* %0
%4 = tail call float @sqrtf(float %3)
store float %4, float* %1
ret void
}
void ConsoleC$Console$input(char *arg_0x8a38188) {
  StressTestC$Console$input(arg_0x8a38188);
  StreamC$Console$input(arg_0x8a38188);
  StackC$Console$input(arg_0x8a38188);
  ChunkStorageC$Console$input(arg_0x8a38188);
  RootDirectoryM$Console$input(arg_0x8a38188);
  CheckpointC$Console$input(arg_0x8a38188);
}


x86 assembly (clang, -O0):
<ConsoleC$Console$input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1050 <StressTestC$Console$input@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1070 <StreamC$Console$input@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1060 <StackC$Console$input@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <ChunkStorageC$Console$input@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <RootDirectoryM$Console$input@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1080 <CheckpointC$Console$input@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConsoleC$Console$input>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <StressTestC$Console$input@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <StreamC$Console$input@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <StackC$Console$input@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <ChunkStorageC$Console$input@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <RootDirectoryM$Console$input@plt>
mov    %rbx,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1080 <CheckpointC$Console$input@plt>

LLVM IR (-O0):
define void @"ConsoleC$Console$input"(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @"StressTestC$Console$input" to i32 (i8*, ...)*)(i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @"StreamC$Console$input" to i32 (i8*, ...)*)(i8* %5)
%7 = load i8*, i8** %2
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @"StackC$Console$input" to i32 (i8*, ...)*)(i8* %7)
%9 = load i8*, i8** %2
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @"ChunkStorageC$Console$input" to i32 (i8*, ...)*)(i8* %9)
%11 = load i8*, i8** %2
%12 = call i32 (i8*, ...) bitcast (i32 (...)* @"RootDirectoryM$Console$input" to i32 (i8*, ...)*)(i8* %11)
%13 = load i8*, i8** %2
%14 = call i32 (i8*, ...) bitcast (i32 (...)* @"CheckpointC$Console$input" to i32 (i8*, ...)*)(i8* %13)
ret void
}

LLVM IR (-O2):
define void @"ConsoleC$Console$input"(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @"StressTestC$Console$input" to i32 (i8*, ...)*)(i8* %0)
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @"StreamC$Console$input" to i32 (i8*, ...)*)(i8* %0)
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @"StackC$Console$input" to i32 (i8*, ...)*)(i8* %0)
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @"ChunkStorageC$Console$input" to i32 (i8*, ...)*)(i8* %0)
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @"RootDirectoryM$Console$input" to i32 (i8*, ...)*)(i8* %0)
%7 = tail call i32 (i8*, ...) bitcast (i32 (...)* @"CheckpointC$Console$input" to i32 (i8*, ...)*)(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GarbageCollect();
void Heap_GarbageCollect() { GarbageCollect(); }


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

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

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

LLVM IR (-O2):
define void @Heap_GarbageCollect() {
%1 = tail call i32 (...) @GarbageCollect()
ret void
}
void foo_2_1_2_2_2_2_2_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_2_2_2_2_2_2_1() {
ret void
}
int str_len(char s[]) {
  int i;
  for (i = 0; s[i] != '\0'; ++i)
    ;
  return i;
}


x86 assembly (clang, -O0):
<str_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1137 <str_len+0x37>
jmp    1129 <str_len+0x29>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <str_len+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_len>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <str_len+0x10>
ret

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

LLVM IR (-O2):
define i32 @str_len(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int detail;
};
typedef TYPE_1__ XConfigureRequestEvent;

/* Variables and functions */
void set_XConfigureRequestEvent_detail(void *_p, int _v) {
  ((XConfigureRequestEvent *)_p)->detail = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XConfigureRequestEvent_detail>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XConfigureRequestEvent_detail(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
int test_imm_08int8_reg(signed char val) {
  return ((val) & (0x08 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_08int8_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, 8
%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_08int8_reg(i8 signext %0) {
%2 = and i8 %0, 8
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
long sum2recur(int n, int m) {
  if ((n < 0) && (m < 0))
    return 1;
  return 3 + sum2recur(n - 1, m - 2);
}


x86 assembly (clang, -O0):
<sum2recur>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    113f <sum2recur+0x2f>
cmpl   $0x0,-0x10(%rbp)
jge    113f <sum2recur+0x2f>
movq   $0x1,-0x8(%rbp)
jmp    1158 <sum2recur+0x48>
mov    -0xc(%rbp),%edi
sub    $0x1,%edi
mov    -0x10(%rbp),%esi
sub    $0x2,%esi
call   1030 <sum2recur@plt>
add    $0x3,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum2recur>:
test   %edi,%esi
js     1123 <sum2recur+0x23>
add    $0xfffffffe,%esi
add    $0xffffffff,%edi
mov    $0x1,%eax
nop
lea    -0x2(%rsi),%ecx
lea    -0x1(%rdi),%edx
add    $0x3,%rax
test   %edi,%esi
mov    %edx,%edi
mov    %ecx,%esi
jns    1110 <sum2recur+0x10>
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i64 @sum2recur(i32 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %8
store i64 1, i64* %3
br label %19
12: ; preds = %8, %2
%13 = load i32, i32* %4
%14 = sub nsw i32 %13, 1
%15 = load i32, i32* %5
%16 = sub nsw i32 %15, 2
%17 = call i64 @sum2recur(i32 %14, i32 %16)
%18 = add nsw i64 3, %17
store i64 %18, i64* %3
br label %19
19: ; preds = %12, %11
%20 = load i64, i64* %3
ret i64 %20
}

LLVM IR (-O2):
define i64 @sum2recur(i32 %0, i32 %1) {
%3 = and i32 %1, %0
%4 = icmp slt i32 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %10, %5 ], [ %1, %2 ]
%7 = phi i32 [ %9, %5 ], [ %0, %2 ]
%8 = phi i64 [ %11, %5 ], [ 0, %2 ]
%9 = add nsw i32 %7, -1
%10 = add nsw i32 %6, -2
%11 = add nuw nsw i64 %8, 3
%12 = and i32 %10, %9
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5
%15 = add nuw i64 %8, 4
br label %16
16: ; preds = %14, %2
%17 = phi i64 [ 1, %2 ], [ %15, %14 ]
ret i64 %17
}
int chdir(s)
char *s;
{ return (0); }


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

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

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

LLVM IR (-O2):
define i32 @chdir(i8* nocapture readnone %0) {
ret i32 0
}
float convert_tempoToMS(float tempo) { return 60000.0f / tempo; }


x86 assembly (clang, -O0):
<convert_tempoToMS>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
divss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_tempoToMS>:
movss  0xef8(%rip),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @convert_tempoToMS(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fdiv float 6.000000e+04, %3
ret float %4
}

LLVM IR (-O2):
define float @convert_tempoToMS(float %0) {
%2 = fdiv float 6.000000e+04, %0
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ bb_error_msg_and_die(char *);
int /*<<< orphan*/ exit(int);
void *malloc(size_t);
void *xmalloc(size_t size) {
  void *ptr = malloc(size);
  if (ptr == NULL && size != 0) {
    bb_error_msg_and_die("No memory");
    exit(1);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1175 <xmalloc+0x45>
cmpq   $0x0,-0x8(%rbp)
je     1175 <xmalloc+0x45>
lea    0xe9a(%rip),%rdi
call   1030 <bb_error_msg_and_die@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <malloc@plt>
test   %rbx,%rbx
je     1143 <xmalloc+0x13>
test   %rax,%rax
je     1145 <xmalloc+0x15>
pop    %rbx
ret
lea    0xeb4(%rip),%rdi
call   1030 <bb_error_msg_and_die@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"No memory\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
%4 = icmp ne i64 %0, 0
%5 = and i1 %4, %3
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = tail call i32 @bb_error_msg_and_die(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ bor2wav(char *, char *);
int syntax();
int main(int argc, char **argv) {
  if (argc != 3)
    return syntax();
  return !!bor2wav(argv[1], argv[2]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     114f <main+0x2f>
mov    $0x0,%al
call   1030 <syntax@plt>
mov    %eax,-0x4(%rbp)
jmp    1176 <main+0x56>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1040 <bor2wav@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x3,%edi
jne    113e <main+0x1e>
push   %rax
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rsi
call   1040 <bor2wav@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret
xor    %eax,%eax
jmp    1030 <syntax@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (...) @syntax()
br label %14
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = getelementptr inbounds i8*, i8** %1, i64 2
%10 = load i8*, i8** %9
%11 = tail call i32 @bor2wav(i8* %8, i8* %10)
%12 = icmp ne i32 %11, 0
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %6, %4
%15 = phi i32 [ %5, %4 ], [ %13, %6 ]
ret i32 %15
}
AR0IR1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{
  if ((p0[10000000]) <= (*p1))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<AR0IR1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    0x2625a00(%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jg     113a <AR0IR1+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <AR0IR1+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AR0IR1>:
mov    0x2625a00(%r8),%ecx
xor    %eax,%eax
cmp    (%r9),%ecx
setle  %al
ret

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

LLVM IR (-O2):
define i32 @AR0IR1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture %4, i32* nocapture %5) {
%7 = getelementptr inbounds i32, i32* %4, i64 10000000
%8 = load i32, i32* %7
%9 = load i32, i32* %5
%10 = icmp sle i32 %8, %9
%11 = zext i1 %10 to i32
ret i32 %11
}
long char_putstringp(string, px, py, flag)
char string[];
long px, py;
long flag;
{
  long char_setcursor(), char_putstring();
  if (char_setcursor(px, py) == 0)
    return (0);
  if (char_putstring(string, flag) == 0)
    return (0);
  return (1);
}


x86 assembly (clang, -O0):
<char_putstringp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1030 <char_setcursor@plt>
cmp    $0x0,%rax
jne    115e <char_putstringp+0x3e>
movq   $0x0,-0x8(%rbp)
jmp    118c <char_putstringp+0x6c>
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    $0x0,%al
call   1040 <char_putstring@plt>
cmp    $0x0,%rax
jne    1184 <char_putstringp+0x64>
movq   $0x0,-0x8(%rbp)
jmp    118c <char_putstringp+0x6c>
movq   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_putstringp>:
push   %r15
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
mov    %rsi,%rdi
mov    %rdx,%rsi
xor    %eax,%eax
call   1030 <char_setcursor@plt>
test   %rax,%rax
je     1154 <char_putstringp+0x34>
mov    %r15,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <char_putstring@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i64 @char_putstringp(i8* %0, i64 %1, i64 %2, i64 %3) {
%5 = tail call i64 (i64, i64, ...) bitcast (i64 (...)* @char_setcursor to i64 (i64, i64, ...)*)(i64 %1, i64 %2)
%6 = icmp eq i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = tail call i64 (i8*, i64, ...) bitcast (i64 (...)* @char_putstring to i64 (i8*, i64, ...)*)(i8* %0, i64 %3)
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i64
br label %11
11: ; preds = %7, %4
%12 = phi i64 [ 0, %4 ], [ %10, %7 ]
ret i64 %12
}
void cache_results() {}


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

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

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

LLVM IR (-O2):
define void @cache_results() {
ret void
}
void parallel_for_1(float *r, int a, double b) {
#pragma omp parallel
  {
#pragma omp parallel
    {
#pragma omp for
      for (int i = 0; i < 100; ++i) {
        *r = a + b;
      }
    }
  }
}


x86 assembly (clang, -O0):
<parallel_for_1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x64,-0x1c(%rbp)
jge    1145 <parallel_for_1+0x45>
cvtsi2sdl -0xc(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1117 <parallel_for_1+0x17>
pop    %rbp
ret

x86 assembly (clang, -O2):
<parallel_for_1>:
cvtsi2sd %esi,%xmm1
addsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
movss  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @parallel_for_1(float* %0, i32 %1, double %2) {
%4 = alloca float*
%5 = alloca i32
%6 = alloca double
%7 = alloca i32
store float* %0, float** %4
store i32 %1, i32* %5
store double %2, double* %6
store i32 0, i32* %7
br label %8
8: ; preds = %18, %3
%9 = load i32, i32* %7
%10 = icmp slt i32 %9, 100
br i1 %10, label %11, label %21
11: ; preds = %8
%12 = load i32, i32* %5
%13 = sitofp i32 %12 to double
%14 = load double, double* %6
%15 = fadd double %13, %14
%16 = fptrunc double %15 to float
%17 = load float*, float** %4
store float %16, float* %17
br label %18
18: ; preds = %11
%19 = load i32, i32* %7
%20 = add nsw i32 %19, 1
store i32 %20, i32* %7
br label %8
21: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @parallel_for_1(float* nocapture writeonly %0, i32 %1, double %2) {
%4 = sitofp i32 %1 to double
%5 = fadd double %4, %2
%6 = fptrunc double %5 to float
store float %6, float* %0
ret void
}
void glEnd(void) {}


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

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

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

LLVM IR (-O2):
define void @glEnd() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XShapeGetRectangles() {
  printf("XShapeGetRectangles called\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [27 x i8] c"XShapeGetRectangles called\00"
define i32 @XShapeGetRectangles() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret i32 0
}