xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ X509_NAME;
typedef int /*<<< orphan*/ X509;

/* Variables and functions */
int /*<<< orphan*/ X509_NAME_free(int /*<<< orphan*/ *);
int /*<<< orphan*/ *X509_new();
int /*<<< orphan*/ X509_set_version(int /*<<< orphan*/ *, int);
X509 *make_cert() {
  X509 *ret = NULL;
  X509 *crt = NULL;
  X509_NAME *issuer = NULL;
  crt = X509_new();
  if (crt == NULL)
    goto out;
  if (!X509_set_version(crt, 3))
    goto out;
  ret = crt;
  crt = NULL;
out:
  X509_NAME_free(issuer);
  return ret;
}


x86 assembly (clang, -O0):
<make_cert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    $0x0,%al
call   1050 <X509_new@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116b <make_cert+0x3b>
jmp    1197 <make_cert+0x67>
mov    -0x10(%rbp),%rdi
mov    $0x3,%esi
call   1030 <X509_set_version@plt>
cmp    $0x0,%eax
jne    1187 <make_cert+0x57>
jmp    1197 <make_cert+0x67>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <X509_NAME_free@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_cert>:
push   %r14
push   %rbx
push   %rax
xor    %r14d,%r14d
xor    %eax,%eax
call   1050 <X509_new@plt>
test   %rax,%rax
je     115c <make_cert+0x2c>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x3,%esi
call   1030 <X509_set_version@plt>
xor    %r14d,%r14d
test   %eax,%eax
cmovne %rbx,%r14
xor    %edi,%edi
call   1040 <X509_NAME_free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32* @make_cert() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32*
store i32* null, i32** %1
store i32* null, i32** %2
store i32* null, i32** %3
%4 = call i32* (...) @X509_new()
store i32* %4, i32** %2
%5 = load i32*, i32** %2
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %8
7: ; preds = %0
br label %15
8: ; preds = %0
%9 = load i32*, i32** %2
%10 = call i32 @X509_set_version(i32* %9, i32 3)
%11 = icmp ne i32 %10, 0
br i1 %11, label %13, label %12
12: ; preds = %8
br label %15
13: ; preds = %8
%14 = load i32*, i32** %2
store i32* %14, i32** %1
store i32* null, i32** %2
br label %15
15: ; preds = %13, %12, %7
%16 = load i32*, i32** %3
%17 = call i32 @X509_NAME_free(i32* %16)
%18 = load i32*, i32** %1
ret i32* %18
}

LLVM IR (-O2):
define i32* @make_cert() {
%1 = tail call i32* (...) @X509_new()
%2 = icmp eq i32* %1, null
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i32 @X509_set_version(i32* %1, i32 3)
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32* null, i32* %1
br label %7
7: ; preds = %3, %0
%8 = phi i32* [ null, %0 ], [ %6, %3 ]
%9 = tail call i32 @X509_NAME_free(i32* null)
ret i32* %8
}
void call2g(long l, double d2, char c, float f1, short s, double d1, int i,
            float f2) {
  c = 'a';
  f1 = 0.0;
  s = 5;
  d1 = 0.0;
  i = 6;
  f2 = 0.1;
  l = 7;
  d2 = 0.2;
}


x86 assembly (clang, -O0):
<call2g>:
push   %rbp
mov    %rsp,%rbp
mov    %dx,%ax
mov    %sil,%dl
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %dl,-0x11(%rbp)
movss  %xmm1,-0x18(%rbp)
mov    %ax,-0x1a(%rbp)
movsd  %xmm2,-0x28(%rbp)
mov    %ecx,-0x2c(%rbp)
movss  %xmm3,-0x30(%rbp)
movb   $0x61,-0x11(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
movw   $0x5,-0x1a(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
movl   $0x6,-0x2c(%rbp)
movss  0xeb3(%rip),%xmm0
movss  %xmm0,-0x30(%rbp)
movq   $0x7,-0x8(%rbp)
movsd  0xe96(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @call2g(i64 %0, double %1, i8 signext %2, float %3, i16 signext %4, double %5, i32 %6, float %7) {
%9 = alloca i64
%10 = alloca double
%11 = alloca i8
%12 = alloca float
%13 = alloca i16
%14 = alloca double
%15 = alloca i32
%16 = alloca float
store i64 %0, i64* %9
store double %1, double* %10
store i8 %2, i8* %11
store float %3, float* %12
store i16 %4, i16* %13
store double %5, double* %14
store i32 %6, i32* %15
store float %7, float* %16
store i8 97, i8* %11
store float 0.000000e+00, float* %12
store i16 5, i16* %13
store double 0.000000e+00, double* %14
store i32 6, i32* %15
store float 0x3FB99999A0000000, float* %16
store i64 7, i64* %9
store double 2.000000e-01, double* %10
ret void
}

LLVM IR (-O2):
define void @call2g(i64 %0, double %1, i8 signext %2, float %3, i16 signext %4, double %5, i32 %6, float %7) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
const char *readSonar() {
  time_t ticks = time(NULL);
  static char sonar[1025];
  sprintf(sonar, "%.24s", ctime(&ticks));
  printf("%s\n", sonar);
  return sonar;
}


x86 assembly (clang, -O0):
<readSonar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <ctime@plt>
mov    %rax,%rdx
lea    0x2ee9(%rip),%rdi
lea    0xe92(%rip),%rsi
call   1060 <sprintf@plt>
lea    0xe8c(%rip),%rdi
lea    0x2ecf(%rip),%rsi
call   1040 <printf@plt>
lea    0x2ec3(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readSonar>:
push   %rbx
sub    $0x10,%rsp
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <ctime@plt>
lea    0x2eef(%rip),%rbx
lea    0xe98(%rip),%rsi
mov    %rbx,%rdi
mov    %rax,%rdx
call   1060 <sprintf@plt>
lea    0xe8c(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@readSonar.sonar = internal global [1025 x i8] zeroinitializer
@.str = [6 x i8] c"%.24s\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i8* @readSonar() {
%1 = alloca i32
%2 = call i32 @time(i32* null)
store i32 %2, i32* %1
%3 = call i8* @ctime(i32* %1)
%4 = call i32 @sprintf(i8* getelementptr inbounds ([1025 x i8], [1025 x i8]* @readSonar.sonar, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1025 x i8], [1025 x i8]* @readSonar.sonar, i64 0, i64 0))
ret i8* getelementptr inbounds ([1025 x i8], [1025 x i8]* @readSonar.sonar, i64 0, i64 0)
}

LLVM IR (-O2):
@readSonar.sonar = internal global [1025 x i8] zeroinitializer
@.str = [6 x i8] c"%.24s\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i8* @readSonar() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call i8* @ctime(i32* %1)
%5 = call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([1025 x i8], [1025 x i8]* @readSonar.sonar, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1025 x i8], [1025 x i8]* @readSonar.sonar, i64 0, i64 0))
ret i8* getelementptr inbounds ([1025 x i8], [1025 x i8]* @readSonar.sonar, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void randomInit(void) { srand(time(NULL)); }


x86 assembly (clang, -O0):
<randomInit>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @randomInit() {
%1 = call i32 @time(i32* null)
%2 = call i32 @srand(i32 %1)
ret void
}

LLVM IR (-O2):
define void @randomInit() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void bn_err(const char *err) {
  fprintf(stderr, "bignum lib error: %s\n", err);
  exit(1);
}


x86 assembly (clang, -O0):
<bn_err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<bn_err>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"bignum lib error: %s\0A\00"
define void @bn_err(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"bignum lib error: %s\0A\00"
define void @bn_err(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
scalar_t__ is_upalpha(char const);
char *skip_upalpha(const char *s, int sz) {
  while (sz > 0 && is_upalpha(*s)) {
    s++;
    sz--;
  }
  return (char *)s;
}


x86 assembly (clang, -O0):
<skip_upalpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0xd(%rbp)
jle    1144 <skip_upalpha+0x34>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <is_upalpha@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1154 <skip_upalpha+0x44>
jmp    116e <skip_upalpha+0x5e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    111f <skip_upalpha+0xf>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_upalpha>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
test   %esi,%esi
jle    1139 <skip_upalpha+0x29>
mov    %esi,%ebp
add    $0x1,%ebp
nop
movsbl (%rbx),%edi
call   1030 <is_upalpha@plt>
test   %rax,%rax
je     1139 <skip_upalpha+0x29>
add    $0x1,%rbx
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
jg     1120 <skip_upalpha+0x10>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @skip_upalpha(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %15, %2
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = call i64 @is_upalpha(i8 signext %10)
%12 = icmp ne i64 %11, 0
br label %13
13: ; preds = %8, %5
%14 = phi i1 [ false, %5 ], [ %12, %8 ]
br i1 %14, label %15, label %20
15: ; preds = %13
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %3
%18 = load i32, i32* %4
%19 = add nsw i32 %18, -1
store i32 %19, i32* %4
br label %5
20: ; preds = %13
%21 = load i8*, i8** %3
ret i8* %21
}

LLVM IR (-O2):
define i8* @skip_upalpha(i8* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2, %10
%5 = phi i32 [ %12, %10 ], [ %1, %2 ]
%6 = phi i8* [ %11, %10 ], [ %0, %2 ]
%7 = load i8, i8* %6
%8 = tail call i64 @is_upalpha(i8 signext %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %4
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = add nsw i32 %5, -1
%13 = icmp sgt i32 %5, 1
br i1 %13, label %4, label %14
14: ; preds = %4, %10, %2
%15 = phi i8* [ %0, %2 ], [ %11, %10 ], [ %6, %4 ]
ret i8* %15
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void warn(char *message) { fprintf(stderr, "WARNING: %s\n", message); }


x86 assembly (clang, -O0):
<warn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<warn>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [13 x i8] c"WARNING: %s\0A\00"
define void @warn(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int strtol(char const *, char **, int);
int hexconv(const char *parameter, const char *datastr) {
  char *endptr;
  int value = strtol(datastr, &endptr, 16);
  if (*endptr != '\0') {
    fprintf(stderr, "Error: %s: invalid argument\n", parameter);
    exit(1);
  }
  return value;
}


x86 assembly (clang, -O0):
<hexconv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x10,%edx
call   1040 <strtol@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1188 <hexconv+0x58>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe87(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexconv>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rax
mov    %rdi,%rbx
lea    0x8(%rsp),%rsi
mov    %rax,%rdi
mov    $0x10,%edx
call   1040 <strtol@plt>
mov    0x8(%rsp),%rcx
cmpb   $0x0,(%rcx)
jne    115d <hexconv+0x2d>
add    $0x10,%rsp
pop    %rbx
ret
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
lea    0xe93(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"Error: %s: invalid argument\0A\00"
define i32 @hexconv(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strtol(i8* %7, i8** %5, i32 16)
store i32 %8, i32* %6
%9 = load i8*, i8** %5
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %2
%14 = load i32, i32* @stderr
%15 = load i8*, i8** %3
%16 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = call i32 @exit(i32 1)
unreachable
18: ; preds = %2
%19 = load i32, i32* %6
ret i32 %19
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"Error: %s: invalid argument\0A\00"
define i32 @hexconv(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i32 @strtol(i8* %1, i8** %3, i32 16)
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = tail call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %0)
%12 = tail call i32 @exit(i32 1)
unreachable
13: ; preds = %2
ret i32 %5
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_size;
};
typedef int /*<<< orphan*/ int64_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fileno(int /*<<< orphan*/ *);
int /*<<< orphan*/ fstat(int, struct stat *);
int64_t getFileSize(FILE *fp) {
  struct stat buf;
  int fd = fileno(fp);
  fstat(fd, &buf);
  int64_t size = buf.st_size;
  return size;
}


x86 assembly (clang, -O0):
<getFileSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fileno@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1040 <fstat@plt>
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFileSize>:
push   %rax
call   1030 <fileno@plt>
mov    %rsp,%rsi
mov    %eax,%edi
call   1040 <fstat@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @getFileSize(i32* %0) {
%2 = alloca i32*
%3 = alloca %struct.stat
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %2
%6 = load i32*, i32** %2
%7 = call i32 @fileno(i32* %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = call i32 @fstat(i32 %8, %struct.stat* %3)
%10 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%11 = load i32, i32* %10
store i32 %11, i32* %5
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @getFileSize(i32* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = tail call i32 @fileno(i32* %0)
%5 = call i32 @fstat(i32 %4, %struct.stat* %2)
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ do_something(int);
void f(int m, int n) {
  int j;
  for (j = m; j < m + 10 && j < n; j++)
    do_something(j);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x4(%rbp),%edx
add    $0xa,%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0xd(%rbp)
jge    1146 <f+0x36>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
setl   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1156 <f+0x46>
jmp    116c <f+0x5c>
mov    -0xc(%rbp),%edi
call   1030 <do_something@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <f+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbp
push   %r14
push   %rbx
cmp    %esi,%edi
jge    1133 <f+0x23>
mov    %esi,%r14d
mov    %edi,%ebx
lea    0x9(%rbx),%ebp
mov    %ebx,%edi
call   1030 <do_something@plt>
cmp    %ebp,%ebx
jge    1133 <f+0x23>
add    $0x1,%ebx
cmp    %r14d,%ebx
jl     1120 <f+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @f(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
store i32 %6, i32* %5
br label %7
7: ; preds = %21, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 10
%11 = icmp slt i32 %8, %10
br i1 %11, label %12, label %16
12: ; preds = %7
%13 = load i32, i32* %5
%14 = load i32, i32* %4
%15 = icmp slt i32 %13, %14
br label %16
16: ; preds = %12, %7
%17 = phi i1 [ false, %7 ], [ %15, %12 ]
br i1 %17, label %18, label %24
18: ; preds = %16
%19 = load i32, i32* %5
%20 = call i32 @do_something(i32 %19)
br label %21
21: ; preds = %18
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %7
24: ; preds = %16
ret void
}

LLVM IR (-O2):
define void @f(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = add nsw i32 %0, 9
br label %6
6: ; preds = %4, %6
%7 = phi i32 [ %9, %6 ], [ %0, %4 ]
%8 = tail call i32 @do_something(i32 %7)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %7, %5
%11 = icmp slt i32 %9, %1
%12 = and i1 %10, %11
br i1 %12, label %6, label %13
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pain() {
  int my_var = 3;
  printf("Hello world\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello world\0A\00"
define i32 @pain() {
%1 = alloca i32
store i32 3, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"Hello world\00"
define i32 @pain() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void *calloc(size_t, size_t);
void *c_calloc(size_t num_elements, size_t size) {
  void *result = calloc(num_elements, size);
  assert(result != NULL);
  return result;
}


x86 assembly (clang, -O0):
<c_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_calloc>:
push   %rbx
call   1030 <calloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1040 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @c_calloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp ne i8* %3, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
ret i8* %3
}
void trap_UI_ClosePopup(const char *arg0) {}


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

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

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

LLVM IR (-O2):
define void @trap_UI_ClosePopup(i8* nocapture %0) {
ret void
}
void TH_init(void) { return; }


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

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

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

LLVM IR (-O2):
define void @TH_init() {
ret void
}
const char *Len_Name(void) { return "Len"; }


x86 assembly (clang, -O0):
<Len_Name>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Len_Name>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"Len\00"
define i8* @Len_Name() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [4 x i8] c"Len\00"
define i8* @Len_Name() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
int isLower(char *i) {
  switch (*i) {
  case 'a':
  case 'b':
  case 'c':
  case 'd':
  case 'e':
  case 'f':
  case 'g':
  case 'h':
  case 'i':
  case 'j':
  case 'k':
  case 'l':
  case 'm':
  case 'n':
  case 'o':
  case 'p':
  case 'q':
  case 'r':
  case 's':
  case 't':
  case 'u':
  case 'v':
  case 'w':
  case 'x':
  case 'y':
  case 'z':
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<isLower>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
add    $0xffffff9f,%eax
sub    $0x19,%eax
ja     112c <isLower+0x2c>
jmp    1120 <isLower+0x20>
movl   $0x1,-0x4(%rbp)
jmp    1133 <isLower+0x33>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isLower>:
movsbl (%rdi),%ecx
add    $0xffffff9f,%ecx
xor    %eax,%eax
cmp    $0x1a,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @isLower(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 97, label %7
i32 98, label %7
i32 99, label %7
i32 100, label %7
i32 101, label %7
i32 102, label %7
i32 103, label %7
i32 104, label %7
i32 105, label %7
i32 106, label %7
i32 107, label %7
i32 108, label %7
i32 109, label %7
i32 110, label %7
i32 111, label %7
i32 112, label %7
i32 113, label %7
i32 114, label %7
i32 115, label %7
i32 116, label %7
i32 117, label %7
i32 118, label %7
i32 119, label %7
i32 120, label %7
i32 121, label %7
i32 122, label %7
]
7: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %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 @isLower(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = add nsw i32 %3, -97
%5 = icmp ult i32 %4, 26
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
int is_empty(uint64_t v) { return (v == (uint64_t)-1); }


x86 assembly (clang, -O0):
<is_empty>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0xffffffffffffffff,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_empty>:
xor    %eax,%eax
cmp    $0xffffffffffffffff,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @is_empty(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, -1
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @is_empty(i64 %0) {
%2 = icmp eq i64 %0, -1
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ give_shell();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
void vuln(char *input) {
  char buf[16];
  int secret = 0;
  strcpy(buf, input);
  if (secret == 0xc0deface) {
    give_shell();
  } else {
    printf("The secret is %x\n", secret);
  }
}


x86 assembly (clang, -O0):
<vuln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
cmpl   $0xc0deface,-0x24(%rbp)
jne    1169 <vuln+0x39>
mov    $0x0,%al
call   1050 <give_shell@plt>
jmp    1178 <vuln+0x48>
mov    -0x24(%rbp),%esi
lea    0xe8d(%rip),%rdi
call   1040 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vuln>:
sub    $0x18,%rsp
mov    %rdi,%rsi
mov    %rsp,%rdi
call   1030 <strcpy@plt>
lea    0xeca(%rip),%rdi
xor    %esi,%esi
call   1040 <printf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"The secret is %x\0A\00"
define void @vuln(i8* %0) {
%2 = alloca i8*
%3 = alloca [16 x i8]
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %4
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%6 = load i8*, i8** %2
%7 = call i32 @strcpy(i8* %5, i8* %6)
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, -1059128626
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call i32 (...) @give_shell()
br label %15
12: ; preds = %1
%13 = load i32, i32* %4
%14 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %12, %10
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"The secret is %x\0A\00"
define void @vuln(i8* %0) {
%2 = alloca [16 x i8]
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* %0)
%5 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ getcwd(char *, int);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, char *);
int lpwd() {
  char *wd = (char *)malloc(1024);
  getcwd(wd, 1024);
  printf("Current working directory: %s\n", wd);
  free(wd);
  return 1;
}


x86 assembly (clang, -O0):
<lpwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x400,%edi
call   1060 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x400,%esi
call   1050 <getcwd@plt>
mov    -0x8(%rbp),%rsi
lea    0xe91(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lpwd>:
push   %rbx
mov    $0x400,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x400,%esi
call   1050 <getcwd@plt>
lea    0xe9e(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Current working directory: %s\0A\00"
define i32 @lpwd() {
%1 = alloca i8*
%2 = call i64 @malloc(i32 1024)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i32 @getcwd(i8* %4, i32 1024)
%6 = load i8*, i8** %1
%7 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %1
%9 = call i32 @free(i8* %8)
ret i32 1
}

LLVM IR (-O2):
@.str = [31 x i8] c"Current working directory: %s\0A\00"
define i32 @lpwd() {
%1 = tail call i64 @malloc(i32 1024)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 @getcwd(i8* %2, i32 1024)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = tail call i32 @free(i8* %2)
ret i32 1
}
void fn(int n) { __extension__ _Generic(n, int : 0); }


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

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

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

LLVM IR (-O2):
define void @fn(i32 %0) {
ret void
}
char *wrapc_getusername(void) { return "unknown"; }


x86 assembly (clang, -O0):
<wrapc_getusername>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrapc_getusername>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [8 x i8] c"unknown\00"
define i8* @wrapc_getusername() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [8 x i8] c"unknown\00"
define i8* @wrapc_getusername() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int ir_hash_remove(unsigned char *);
int ir_remove_command(unsigned char *code) { return ir_hash_remove(code); }


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

x86 assembly (clang, -O2):
<ir_remove_command>:
jmp    1030 <ir_hash_remove@plt>

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

LLVM IR (-O2):
define i32 @ir_remove_command(i8* %0) {
%2 = tail call i32 @ir_hash_remove(i8* %0)
ret i32 %2
}
/* Variables and functions */
void const *GppcFinfoV1();
const void *pg_finfo_project_spi(void) { return GppcFinfoV1(); }


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

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

LLVM IR (-O0):
define i8* @pg_finfo_project_spi() {
%1 = call i8* (...) @GppcFinfoV1()
ret i8* %1
}

LLVM IR (-O2):
define i8* @pg_finfo_project_spi() {
%1 = tail call i8* (...) @GppcFinfoV1()
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void myCLibFoo() { printf("This comes from my C library!\n"); }


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"This comes from my C library!\0A\00"
define void @myCLibFoo() {
%1 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [30 x i8] c"This comes from my C library!\00"
define void @myCLibFoo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret void
}
__attribute__((no, noclone)) int foo(__int128 x) {
  __int128 v = x & (((__int128)-1 << 63) | 0x7ff);
  return v == 0 || v == ((__int128)-1 << 63);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
movabs $0x80000000000007ff,%rdx
and    %rdx,%rax
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rcx
mov    -0x28(%rbp),%rdx
mov    $0x1,%al
or     %rdx,%rcx
mov    %al,-0x31(%rbp)
je     1172 <foo+0x72>
jmp    1154 <foo+0x54>
movaps -0x30(%rbp),%xmm0
movaps 0xea1(%rip),%xmm1
pcmpeqb %xmm1,%xmm0
pmovmskb %xmm0,%eax
sub    $0xffff,%eax
sete   %al
mov    %al,-0x31(%rbp)
mov    -0x31(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movabs $0x80000000000007ff,%rax
and    %rdi,%rax
mov    %rax,%rcx
or     %rsi,%rcx
sete   %cl
movabs $0x8000000000000000,%rdx
xor    %rax,%rdx
not    %rsi
or     %rdx,%rsi
sete   %al
or     %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @foo(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = bitcast i128* %3 to { i64, i64 }*
%7 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %6, i32 0, i32 0
store i64 %0, i64* %7
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %6, i32 0, i32 1
store i64 %1, i64* %8
%9 = load i128, i128* %3
store i128 %9, i128* %4
%10 = load i128, i128* %4
%11 = and i128 %10, -9223372036854773761
store i128 %11, i128* %5
%12 = load i128, i128* %5
%13 = icmp eq i128 %12, 0
br i1 %13, label %17, label %14
14: ; preds = %2
%15 = load i128, i128* %5
%16 = icmp eq i128 %15, -9223372036854775808
br label %17
17: ; preds = %14, %2
%18 = phi i1 [ true, %2 ], [ %16, %14 ]
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @foo(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = and i64 %0, -9223372036854773761
%6 = zext i64 %5 to i128
%7 = or i128 %4, %6
%8 = icmp eq i128 %7, 0
%9 = icmp eq i128 %7, -9223372036854775808
%10 = or i1 %8, %9
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ reqbuf;

/* Variables and functions */
int ph_rpc(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
int phSetBusy(int busyFlag) {
  char reqbuf[64];
  snprintf(reqbuf, sizeof(reqbuf), "SETBUSY %d", busyFlag);
  return ph_rpc(reqbuf);
}


x86 assembly (clang, -O0):
<phSetBusy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x40,%esi
lea    0xec2(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x50(%rbp),%rdi
call   1040 <ph_rpc@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<phSetBusy>:
push   %rbx
sub    $0x40,%rsp
mov    %edi,%ecx
lea    0xed2(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x40,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <ph_rpc@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"SETBUSY %d\00"
define i32 @phSetBusy(i32 %0) {
%2 = alloca i32
%3 = alloca [64 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @snprintf(i8* %4, i32 64, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%8 = call i32 @ph_rpc(i8* %7)
ret i32 %8
}

LLVM IR (-O2):
@.str = [11 x i8] c"SETBUSY %d\00"
define i32 @phSetBusy(i32 %0) {
%2 = alloca [64 x i8]
%3 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 64, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = call i32 @ph_rpc(i8* %3)
ret i32 %5
}
void mem_Init(void) {}


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

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

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

LLVM IR (-O2):
define void @mem_Init() {
ret void
}
int maxOverlap(int a, int b) {
  if (a < b)
    return a;
  else
    return b;
}


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

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

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

LLVM IR (-O2):
define i32 @maxOverlap(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
double M_PI;
double cos(double);
double real(double magn, double angle) {
  return magn * cos((angle * M_PI / 180));
}


x86 assembly (clang, -O0):
<real>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    0x2eb0(%rip),%rax
mulsd  (%rax),%xmm0
movsd  0xebc(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<real>:
push   %rax
movsd  %xmm0,(%rsp)
mov    0x2ecb(%rip),%rax
mulsd  (%rax),%xmm1
divsd  0xed7(%rip),%xmm1
movapd %xmm1,%xmm0
call   1030 <cos@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @real(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = load double, double* @M_PI
%8 = fmul double %6, %7
%9 = fdiv double %8, 1.800000e+02
%10 = call double @cos(double %9)
%11 = fmul double %5, %10
ret double %11
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @real(double %0, double %1) {
%3 = load double, double* @M_PI
%4 = fmul double %3, %1
%5 = fdiv double %4, 1.800000e+02
%6 = tail call double @cos(double %5)
%7 = fmul double %6, %0
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ put8(unsigned char);
void shrd_reg32_reg32_imm8(unsigned int reg1, unsigned int reg2,
                           unsigned char imm8) {
  put8(0x0F);
  put8(0xAC);
  put8(0xC0 | (reg2 << 3) | reg1);
  put8(imm8);
}


x86 assembly (clang, -O0):
<shrd_reg32_reg32_imm8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    $0xf,%edi
call   1030 <put8@plt>
mov    $0xac,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%eax
shl    $0x3,%eax
or     $0xc0,%eax
or     -0x4(%rbp),%eax
movzbl %al,%edi
call   1030 <put8@plt>
movzbl -0x9(%rbp),%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shrd_reg32_reg32_imm8>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
mov    $0xf,%edi
call   1030 <put8@plt>
mov    $0xac,%edi
call   1030 <put8@plt>
shl    $0x3,%ebp
or     %ebx,%ebp
or     $0xc0,%bpl
movzbl %bpl,%edi
call   1030 <put8@plt>
mov    %r14d,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @shrd_reg32_reg32_imm8(i32 %0, i32 %1, i8 zeroext %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8 %2, i8* %6
%7 = call i32 @put8(i8 zeroext 15)
%8 = call i32 @put8(i8 zeroext -84)
%9 = load i32, i32* %5
%10 = shl i32 %9, 3
%11 = or i32 192, %10
%12 = load i32, i32* %4
%13 = or i32 %11, %12
%14 = trunc i32 %13 to i8
%15 = call i32 @put8(i8 zeroext %14)
%16 = load i8, i8* %6
%17 = call i32 @put8(i8 zeroext %16)
ret void
}

LLVM IR (-O2):
define void @shrd_reg32_reg32_imm8(i32 %0, i32 %1, i8 zeroext %2) {
%4 = tail call i32 @put8(i8 zeroext 15)
%5 = tail call i32 @put8(i8 zeroext -84)
%6 = shl i32 %1, 3
%7 = or i32 %6, %0
%8 = trunc i32 %7 to i8
%9 = or i8 %8, -64
%10 = tail call i32 @put8(i8 zeroext %9)
%11 = tail call i32 @put8(i8 zeroext %2)
ret void
}
void gtk_text_iter_get_line_offset() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_iter_get_line_offset() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ utest_control();
void utest_adts_snapshot(void) {
  utest_control();
  return;
}


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

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

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

LLVM IR (-O2):
define void @utest_adts_snapshot() {
%1 = tail call i32 (...) @utest_control()
ret void
}
char *__fcrypt(key, salt) const char *key;
const char *salt;
{ return crypt(key, salt); }


x86 assembly (clang, -O0):
<__fcrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <crypt@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @__fcrypt(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** %4
%7 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @crypt to i32 (i8*, i8*, ...)*)(i8* %5, i8* %6)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
ret i8* %9
}

LLVM IR (-O2):
define i8* @__fcrypt(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @crypt to i32 (i8*, i8*, ...)*)(i8* %0, i8* %1)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
void RTTestIPassedV(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTestIPassedV() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void rtld_fdputchar(int fd, int c) {
  char c1;
  c1 = c;
  write(fd, &c1, 1);
}


x86 assembly (clang, -O0):
<rtld_fdputchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,-0x9(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtld_fdputchar>:
push   %rax
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @rtld_fdputchar(i32 %0, i32 %1) {
%3 = alloca i8
%4 = trunc i32 %1 to i8
store i8 %4, i8* %3
%5 = call i32 @write(i32 %0, i8* %3, i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __u16;

/* Variables and functions */
int /*<<< orphan*/ __put_unaligned_le16(int /*<<< orphan*/, void *);
void put_unaligned_le16(__u16 val, void *p) { __put_unaligned_le16(val, p); }


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

x86 assembly (clang, -O2):
<put_unaligned_le16>:
jmp    1030 <__put_unaligned_le16@plt>

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

LLVM IR (-O2):
define void @put_unaligned_le16(i32 %0, i8* %1) {
%3 = tail call i32 @__put_unaligned_le16(i32 %0, i8* %1)
ret void
}
void gtk_ui_manager_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_ui_manager_get_type() {
ret void
}
void __DEINIT() {}


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

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

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

LLVM IR (-O2):
define void @__DEINIT() {
ret void
}
int Operand_br2_encode(unsigned int *valp) {
  int error;
  error = (*valp & ~(0x7 << 1)) != 0;
  *valp = *valp >> 1;
  return error;
}


x86 assembly (clang, -O0):
<Operand_br2_encode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xfffffff1,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
shr    $0x1,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_br2_encode>:
mov    (%rdi),%ecx
xor    %eax,%eax
test   $0xfffffff1,%ecx
setne  %al
shr    %ecx
mov    %ecx,(%rdi)
ret

LLVM IR (-O0):
define i32 @Operand_br2_encode(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = and i32 %5, -15
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
store i32 %8, i32* %3
%9 = load i32*, i32** %2
%10 = load i32, i32* %9
%11 = lshr i32 %10, 1
%12 = load i32*, i32** %2
store i32 %11, i32* %12
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @Operand_br2_encode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, -15
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
%6 = lshr i32 %2, 1
store i32 %6, i32* %0
ret i32 %5
}