xunge/DecIR huggingface dataset:
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_add_filter(void *bus, void **slot, void *callback, void *userdata) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_add_filter>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
mov    0x2ec3(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_add_filter>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_add_filter(i8* %0, i8** %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8** %1, i8*** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i32, i32* @EINVAL
%10 = sub nsw i32 0, %9
ret i32 %10
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_add_filter(i8* nocapture readnone %0, i8** nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3) {
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}
/* Type definitions */
struct afp_volume {
  int dummy;
};
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int EPERM;
int extra_translate(struct afp_volume *, char const *, char **);
int /*<<< orphan*/ free(char *);
int appledouble_mkdir(struct afp_volume *volume, const char *path,
                      mode_t mode) {
  int resource;
  char *newpath;
  resource = extra_translate(volume, path, &newpath);
  free(newpath);
  if (resource == 0)
    return 0;
  return -EPERM;
}


x86 assembly (clang, -O0):
<appledouble_mkdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x28(%rbp),%rdx
call   1040 <extra_translate@plt>
mov    %eax,-0x20(%rbp)
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
cmpl   $0x0,-0x20(%rbp)
jne    1166 <appledouble_mkdir+0x46>
movl   $0x0,-0x4(%rbp)
jmp    1174 <appledouble_mkdir+0x54>
xor    %eax,%eax
mov    0x2e69(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<appledouble_mkdir>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rdx
call   1040 <extra_translate@plt>
mov    %eax,%ebx
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
mov    0x2e96(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
test   %ebx,%ebx
cmove  %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.afp_volume = type { i32 }
@EPERM = global i32 0
define i32 @appledouble_mkdir(%struct.afp_volume* %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.afp_volume*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
store %struct.afp_volume* %0, %struct.afp_volume** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%10 = load %struct.afp_volume*, %struct.afp_volume** %5
%11 = load i8*, i8** %6
%12 = call i32 @extra_translate(%struct.afp_volume* %10, i8* %11, i8** %9)
store i32 %12, i32* %8
%13 = load i8*, i8** %9
%14 = call i32 @free(i8* %13)
%15 = load i32, i32* %8
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %3
store i32 0, i32* %4
br label %21
18: ; preds = %3
%19 = load i32, i32* @EPERM
%20 = sub nsw i32 0, %19
store i32 %20, i32* %4
br label %21
21: ; preds = %18, %17
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
%struct.afp_volume = type { i32 }
@EPERM = global i32 0
define i32 @appledouble_mkdir(%struct.afp_volume* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = bitcast i8** %4 to i8*
%6 = call i32 @extra_translate(%struct.afp_volume* %0, i8* %1, i8** %4)
%7 = load i8*, i8** %4
%8 = call i32 @free(i8* %7)
%9 = icmp eq i32 %6, 0
%10 = load i32, i32* @EPERM
%11 = sub nsw i32 0, %10
%12 = select i1 %9, i32 0, i32 %11
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void fetch_err(char *report) {
  fprintf(stderr, "%s\n", report);
  fprintf(stderr, "Please specify a valid http or ftp address.\n");
  exit(1);
}


x86 assembly (clang, -O0):
<fetch_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
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xead(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [45 x i8] c"Please specify a valid http or ftp address.\0A\00"
define void @fetch_err(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [45 x i8] c"Please specify a valid http or ftp address.\0A\00"
define void @fetch_err(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *, int *, int *, int *);
void func1(int *a, int *b, int *c, int *d) { scanf("%d %d %d %d", a, b, c, d); }


x86 assembly (clang, -O0):
<func1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
lea    0xec1(%rip),%rdi
call   1030 <scanf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func1>:
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xedd(%rip),%rdi
jmp    1030 <scanf@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"%d %d %d %d\00"
define void @func1(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = tail call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %0, i32* %1, i32* %2, i32* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DecryptKey(int /*<<< orphan*/, unsigned char *,
                              unsigned char *, unsigned char *);
int memcmp(unsigned char *, unsigned char *, int);
int investigate(unsigned char *hash, unsigned char *ckey) {
  unsigned char key[5];
  DecryptKey(0, ckey, hash, key);
  return memcmp(key, ckey, 5);
}


x86 assembly (clang, -O0):
<investigate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
lea    -0x15(%rbp),%rcx
xor    %edi,%edi
call   1030 <DecryptKey@plt>
lea    -0x15(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x5,%edx
call   1040 <memcmp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<investigate>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%rdx
lea    0x3(%rsp),%r14
xor    %edi,%edi
mov    %r14,%rcx
call   1030 <DecryptKey@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x5,%edx
call   1040 <memcmp@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @investigate(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [5 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = load i8*, i8** %3
%8 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 0
%9 = call i32 @DecryptKey(i32 0, i8* %6, i8* %7, i8* %8)
%10 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 0
%11 = load i8*, i8** %4
%12 = call i32 @memcmp(i8* %10, i8* %11, i32 5)
ret i32 %12
}

LLVM IR (-O2):
define i32 @investigate(i8* %0, i8* %1) {
%3 = alloca [5 x i8]
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%5 = call i32 @DecryptKey(i32 0, i8* %1, i8* %0, i8* %4)
%6 = call i32 @memcmp(i8* %4, i8* %1, i32 5)
ret i32 %6
}
int calcgcd(int a, int b) {
  if (!b)
    return a;
  else
    return calcgcd(b, a % b);
}


x86 assembly (clang, -O0):
<calcgcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1133 <calcgcd+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1147 <calcgcd+0x37>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%esi
call   1030 <calcgcd@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcgcd>:
mov    %edi,%eax
test   %esi,%esi
je     111d <calcgcd+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <calcgcd+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @calcgcd(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* %5
%7 = icmp ne i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = load i32, i32* %4
store i32 %9, i32* %3
br label %16
10: ; preds = %2
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = srem i32 %12, %13
%15 = call i32 @calcgcd(i32 %11, i32 %14)
store i32 %15, i32* %3
br label %16
16: ; preds = %10, %8
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @calcgcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %5, %4 ]
ret i32 %10
}
/* Type definitions */
struct rlimit {
  int dummy;
};

/* Variables and functions */
int maximize_fdlimit() {
  struct rlimit r;
  static int maxfds = -1;
  if (maxfds > 0)
    return maxfds;
  return 0;
}


x86 assembly (clang, -O0):
<maximize_fdlimit>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f15(%rip)
jle    111f <maximize_fdlimit+0x1f>
mov    0x2f09(%rip),%eax
mov    %eax,-0x4(%rbp)
jmp    1126 <maximize_fdlimit+0x26>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.rlimit = type { i32 }
@maximize_fdlimit.maxfds = internal global i32 -1
define i32 @maximize_fdlimit() {
%1 = alloca i32
%2 = alloca %struct.rlimit
%3 = load i32, i32* @maximize_fdlimit.maxfds
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = load i32, i32* @maximize_fdlimit.maxfds
store i32 %6, i32* %1
br label %8
7: ; preds = %0
store i32 0, i32* %1
br label %8
8: ; preds = %7, %5
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @maximize_fdlimit() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gexit();
void gexit_() { gexit(); }


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

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

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

LLVM IR (-O2):
define void @gexit_() {
%1 = tail call i32 (...) @gexit()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(unsigned int);
void _glfwPlatformSleep(double time) {
  if (time > 0) {
    usleep((unsigned int)(time * 1000000));
  }
}


x86 assembly (clang, -O0):
<_glfwPlatformSleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    114c <_glfwPlatformSleep+0x3c>
movsd  -0x8(%rbp),%xmm0
movsd  0xec4(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
mov    %eax,%edi
call   1030 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_glfwPlatformSleep>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    112c <_glfwPlatformSleep+0x1c>
mulsd  0xede(%rip),%xmm0
cvttsd2si %xmm0,%rdi
jmp    1030 <usleep@plt>
ret

LLVM IR (-O0):
define void @_glfwPlatformSleep(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ogt double %3, 0.000000e+00
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load double, double* %2
%7 = fmul double %6, 1.000000e+06
%8 = fptoui double %7 to i32
%9 = call i32 @usleep(i32 %8)
br label %10
10: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @_glfwPlatformSleep(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = fmul double %0, 1.000000e+06
%5 = fptoui double %4 to i32
%6 = tail call i32 @usleep(i32 %5)
br label %7
7: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
long ftell(int /*<<< orphan*/ *);
int FileSize(FILE *fp) {
  long pos;
  fseek(fp, 0, SEEK_END);
  pos = ftell(fp);
  fseek(fp, 0, SEEK_SET);
  return pos;
}


x86 assembly (clang, -O0):
<FileSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e80(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FileSize>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eba(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %rbx,%rdi
call   1030 <ftell@plt>
mov    %rax,%r14
mov    0x2e8f(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i32 @FileSize(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* @SEEK_END
%6 = call i32 @fseek(i32* %4, i32 0, i32 %5)
%7 = load i32*, i32** %2
%8 = call i64 @ftell(i32* %7)
store i64 %8, i64* %3
%9 = load i32*, i32** %2
%10 = load i32, i32* @SEEK_SET
%11 = call i32 @fseek(i32* %9, i32 0, i32 %10)
%12 = load i64, i64* %3
%13 = trunc i64 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i32 @FileSize(i32* nocapture %0) {
%2 = load i32, i32* @SEEK_END
%3 = tail call i32 @fseek(i32* %0, i32 0, i32 %2)
%4 = tail call i64 @ftell(i32* %0)
%5 = load i32, i32* @SEEK_SET
%6 = tail call i32 @fseek(i32* %0, i32 0, i32 %5)
%7 = trunc i64 %4 to i32
ret i32 %7
}
double Fdouble(double a) { return a - 10; }


x86 assembly (clang, -O0):
<Fdouble>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
subsd  %xmm1,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @Fdouble(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double %3, 1.000000e+01
ret double %4
}

LLVM IR (-O2):
define double @Fdouble(double %0) {
%2 = fadd double %0, -1.000000e+01
ret double %2
}
long next(const long v) {
  long t = v | (v - 1);
  return ((t + 1) | (((~t & -~t) - 1) >> (__builtin_ctz(v) + 1)));
}


x86 assembly (clang, -O0):
<next>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    $0x1,%rcx
or     %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    -0x10(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x10(%rbp),%rsi
xor    $0xffffffffffffffff,%rsi
xor    %ecx,%ecx
sub    %rsi,%rcx
and    %rcx,%rdx
sub    $0x1,%rdx
mov    -0x8(%rbp),%rcx
bsf    %ecx,%ecx
add    $0x1,%ecx
mov    %ecx,%ecx
sar    %cl,%rdx
mov    %rdx,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next>:
lea    -0x1(%rdi),%rax
or     %rdi,%rax
lea    0x1(%rax),%rdx
not    %rax
and    %rdx,%rax
add    $0xffffffffffffffff,%rax
bsf    %edi,%ecx
add    $0x1,%cl
sar    %cl,%rax
or     %rdx,%rax
ret

LLVM IR (-O0):
define i64 @next(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = load i64, i64* %2
%6 = sub nsw i64 %5, 1
%7 = or i64 %4, %6
store i64 %7, i64* %3
%8 = load i64, i64* %3
%9 = add nsw i64 %8, 1
%10 = load i64, i64* %3
%11 = xor i64 %10, -1
%12 = load i64, i64* %3
%13 = xor i64 %12, -1
%14 = sub nsw i64 0, %13
%15 = and i64 %11, %14
%16 = sub nsw i64 %15, 1
%17 = load i64, i64* %2
%18 = trunc i64 %17 to i32
%19 = call i32 @llvm.cttz.i32(i32 %18, i1 true)
%20 = add nsw i32 %19, 1
%21 = zext i32 %20 to i64
%22 = ashr i64 %16, %21
%23 = or i64 %9, %22
ret i64 %23
}

LLVM IR (-O2):
define i64 @next(i64 %0) {
%2 = add nsw i64 %0, -1
%3 = or i64 %2, %0
%4 = add i64 %3, 1
%5 = xor i64 %3, -1
%6 = and i64 %4, %5
%7 = add nsw i64 %6, -1
%8 = trunc i64 %0 to i32
%9 = tail call i32 @llvm.cttz.i32(i32 %8, i1 true)
%10 = add nuw nsw i32 %9, 1
%11 = zext i32 %10 to i64
%12 = ashr i64 %7, %11
%13 = or i64 %12, %4
ret i64 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void my_version(void) {
  printf("version: %d\n", 3);
  printf("(C) SuSE Linux AG, Nuernberg, Germany, 2003, 2004\n");
  return;
}


x86 assembly (clang, -O0):
<my_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x3,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_version>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed2(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"version: %d\0A\00"
@.str.1 = [51 x i8] c"(C) SuSE Linux AG, Nuernberg, Germany, 2003, 2004\0A\00"
define void @my_version() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 3)
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"version: %d\0A\00"
@str = [50 x i8] c"(C) SuSE Linux AG, Nuernberg, Germany, 2003, 2004\00"
define void @my_version() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 3)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mpfr_get_version();
int main() {
  mpfr_get_version();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @mpfr_get_version()
ret i32 0
}
/* Variables and functions */
int is_first_in_group_UndSecAltIDGrp(size_t __tag) {
  return (__tag == (458)) ? 1 : 0;
}


x86 assembly (clang, -O0):
<is_first_in_group_UndSecAltIDGrp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x1ca,%rdx
cmove  %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @is_first_in_group_UndSecAltIDGrp(i64 %0) {
%2 = icmp eq i64 %0, 458
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
long double cbrt(double);
long double cbrtl(long double x) { return cbrt((double)x); }


x86 assembly (clang, -O0):
<cbrtl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <cbrt@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbrtl>:
fldt   0x8(%rsp)
fstpl  -0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
jmp    1030 <cbrt@plt>

LLVM IR (-O0):
define x86_fp80 @cbrtl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call x86_fp80 @cbrt(double %4)
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @cbrtl(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call x86_fp80 @cbrt(double %2)
ret x86_fp80 %3
}
/* Variables and functions */
int /*<<< orphan*/ gpio_set_value(unsigned int, int);
int /*<<< orphan*/ might_sleep();
void gpio_set_value_cansleep(unsigned gpio, int value) {
  might_sleep();
  gpio_set_value(gpio, value);
}


x86 assembly (clang, -O0):
<gpio_set_value_cansleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <might_sleep@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <gpio_set_value@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpio_set_value_cansleep>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <might_sleep@plt>
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <gpio_set_value@plt>

LLVM IR (-O0):
define void @gpio_set_value_cansleep(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @might_sleep()
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @gpio_set_value(i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
define void @gpio_set_value_cansleep(i32 %0, i32 %1) {
%3 = tail call i32 (...) @might_sleep()
%4 = tail call i32 @gpio_set_value(i32 %0, i32 %1)
ret void
}
int get_index(int i, int j) { return ((200) - 1) * (i - 1) + (j - 1); }


x86 assembly (clang, -O0):
<get_index>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
imul   $0xc7,%eax,%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_index>:
imul   $0xc7,%edi,%eax
add    %esi,%eax
add    $0xffffff38,%eax
ret

LLVM IR (-O0):
define i32 @get_index(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 = sub nsw i32 %5, 1
%7 = mul nsw i32 199, %6
%8 = load i32, i32* %4
%9 = sub nsw i32 %8, 1
%10 = add nsw i32 %7, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @get_index(i32 %0, i32 %1) {
%3 = mul i32 %0, 199
%4 = add i32 %1, -200
%5 = add i32 %4, %3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *);
void sprint_movc_PC(char *str) {
  sprintf(str, "MOVC  A, @A+PC                  ");
}


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

x86 assembly (clang, -O2):
<sprint_movc_PC>:
movups 0xf09(%rip),%xmm0
movups %xmm0,0x10(%rdi)
movups 0xeee(%rip),%xmm0
movups %xmm0,(%rdi)
movb   $0x0,0x20(%rdi)
ret

LLVM IR (-O0):
@.str = [33 x i8] c"MOVC A, @A+PC \00"
define void @sprint_movc_PC(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @sprintf(i8* %3, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"MOVC A, @A+PC \00"
define void @sprint_movc_PC(i8* nocapture writeonly %0) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(33) %0, i8* align 1 dereferenceable(33) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i64 33, i1 false)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int rol(int, int);
int ror(int, int);
uint32_t bswap32(uint32_t v) {
  return rol(v & 0xFF00FF00, 8) | ror(v & 0x00FF00FF, 8);
}


x86 assembly (clang, -O0):
<bswap32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
and    $0xff00ff00,%edi
mov    $0x8,%esi
call   1030 <rol@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
and    $0xff00ff,%edi
mov    $0x8,%esi
call   1040 <ror@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bswap32>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
and    $0xff00ff00,%edi
mov    $0x8,%esi
call   1030 <rol@plt>
mov    %eax,%ebp
and    $0xff00ff,%ebx
mov    %ebx,%edi
mov    $0x8,%esi
call   1040 <ror@plt>
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @bswap32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -16711936
%5 = call i32 @rol(i32 %4, i32 8)
%6 = load i32, i32* %2
%7 = and i32 %6, 16711935
%8 = call i32 @ror(i32 %7, i32 8)
%9 = or i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @bswap32(i32 %0) {
%2 = and i32 %0, -16711936
%3 = tail call i32 @rol(i32 %2, i32 8)
%4 = and i32 %0, 16711935
%5 = tail call i32 @ror(i32 %4, i32 8)
%6 = or i32 %5, %3
ret i32 %6
}
/* Type definitions */
struct nlmsghdr {
  int /*<<< orphan*/ nlmsg_len;
};

/* Variables and functions */
int send(int, struct nlmsghdr *, int /*<<< orphan*/, int /*<<< orphan*/);
int netlink_send(int nl, struct nlmsghdr *n) {
  if ((nl < 0) || (!n))
    return -1;
  return send(nl, n, n->nlmsg_len, 0);
}


x86 assembly (clang, -O0):
<netlink_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1134 <netlink_send+0x24>
cmpq   $0x0,-0x10(%rbp)
jne    1140 <netlink_send+0x30>
movl   $0xffffffff,-0x4(%rbp)
jmp    1157 <netlink_send+0x47>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
xor    %ecx,%ecx
call   1030 <send@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<netlink_send>:
test   %edi,%edi
js     1122 <netlink_send+0x12>
test   %rsi,%rsi
je     1122 <netlink_send+0x12>
mov    (%rsi),%edx
xor    %ecx,%ecx
jmp    1030 <send@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.nlmsghdr = type { i32 }
define i32 @netlink_send(i32 %0, %struct.nlmsghdr* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.nlmsghdr*
store i32 %0, i32* %4
store %struct.nlmsghdr* %1, %struct.nlmsghdr** %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load %struct.nlmsghdr*, %struct.nlmsghdr** %5
%10 = icmp ne %struct.nlmsghdr* %9, null
br i1 %10, label %12, label %11
11: ; preds = %8, %2
store i32 -1, i32* %3
br label %19
12: ; preds = %8
%13 = load i32, i32* %4
%14 = load %struct.nlmsghdr*, %struct.nlmsghdr** %5
%15 = load %struct.nlmsghdr*, %struct.nlmsghdr** %5
%16 = getelementptr inbounds %struct.nlmsghdr, %struct.nlmsghdr* %15, i32 0, i32 0
%17 = load i32, i32* %16
%18 = call i32 @send(i32 %13, %struct.nlmsghdr* %14, i32 %17, i32 0)
store i32 %18, i32* %3
br label %19
19: ; preds = %12, %11
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
%struct.nlmsghdr = type { i32 }
define i32 @netlink_send(i32 %0, %struct.nlmsghdr* %1) {
%3 = icmp sgt i32 %0, -1
%4 = icmp ne %struct.nlmsghdr* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = getelementptr inbounds %struct.nlmsghdr, %struct.nlmsghdr* %1, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i32 @send(i32 %0, %struct.nlmsghdr* %1, i32 %8, i32 0)
br label %10
10: ; preds = %2, %6
%11 = phi i32 [ %9, %6 ], [ -1, %2 ]
ret i32 %11
}
double Cube(double arg) { return (arg * arg * arg); }


x86 assembly (clang, -O0):
<Cube>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cube>:
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @Cube(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
%6 = load double, double* %2
%7 = fmul double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @Cube(double %0) {
%2 = fmul double %0, %0
%3 = fmul double %2, %0
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ japi_fillrect(int, int, int, int, int);
void j_fillrect(int arg0, int arg1, int arg2, int arg3, int arg4) {
  japi_fillrect(arg0, arg1, arg2, arg3, arg4);
}


x86 assembly (clang, -O0):
<j_fillrect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
call   1030 <japi_fillrect@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<j_fillrect>:
jmp    1030 <japi_fillrect@plt>

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

LLVM IR (-O2):
define void @j_fillrect(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @japi_fillrect(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ thread_finished();
void interpose_pthread_cleanup(void *arg) {
  thread_finished();
  free(arg);
}


x86 assembly (clang, -O0):
<interpose_pthread_cleanup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <thread_finished@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<interpose_pthread_cleanup>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <thread_finished@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @interpose_pthread_cleanup(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @thread_finished()
%4 = load i8*, i8** %2
%5 = call i32 @free(i8* %4)
ret void
}

LLVM IR (-O2):
define void @interpose_pthread_cleanup(i8* nocapture %0) {
%2 = tail call i32 (...) @thread_finished()
%3 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cgdefl(int);
int /*<<< orphan*/ gendata();
void gendefl(int id) {
  gendata();
  cgdefl(id);
}


x86 assembly (clang, -O0):
<gendefl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <gendata@plt>
mov    -0x4(%rbp),%edi
call   1030 <cgdefl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gendefl>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <gendata@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <cgdefl@plt>

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

LLVM IR (-O2):
define void @gendefl(i32 %0) {
%2 = tail call i32 (...) @gendata()
%3 = tail call i32 @cgdefl(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("cl_d3d10.h standalone test PASSED.\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"cl_d3d10.h standalone test PASSED.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [35 x i8] c"cl_d3d10.h standalone test PASSED.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int SIGTERM;
int /*<<< orphan*/ printf(char *);
void sig_term_handler(int signo) {
  if (signo == SIGTERM)
    printf("received SIGTERM\n");
}


x86 assembly (clang, -O0):
<sig_term_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ec3(%rip),%rcx
cmp    (%rcx),%eax
jne    1139 <sig_term_handler+0x29>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_term_handler>:
mov    0x2ed1(%rip),%rax
cmp    %edi,(%rax)
jne    1127 <sig_term_handler+0x17>
lea    0xede(%rip),%rdi
jmp    1030 <puts@plt>
ret

LLVM IR (-O0):
@SIGTERM = global i32 0
@.str = [18 x i8] c"received SIGTERM\0A\00"
define void @sig_term_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGTERM
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@SIGTERM = global i32 0
@str = [17 x i8] c"received SIGTERM\00"
define void @sig_term_handler(i32 %0) {
%2 = load i32, i32* @SIGTERM
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
void nop() {}


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

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

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

LLVM IR (-O2):
define void @nop() {
ret void
}
/* Variables and functions */
int bs_get_info(int, char *, char **);
int /*<<< orphan*/ snprintf(char *, int, char *);
int bs_list_tubes(int fd, char **yaml) {
  char command[64] = {0};
  snprintf(command, 64, "list-tubes\r\n");
  return bs_get_info(fd, command, yaml);
}


x86 assembly (clang, -O0):
<bs_list_tubes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1050 <memset@plt>
lea    -0x50(%rbp),%rdi
mov    $0x40,%esi
lea    0xea1(%rip),%rdx
call   1040 <snprintf@plt>
mov    -0x4(%rbp),%edi
lea    -0x50(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <bs_get_info@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bs_list_tubes>:
push   %rbp
push   %r14
push   %rbx
sub    $0x40,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
xorps  %xmm0,%xmm0
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
lea    0xeb6(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x40,%esi
call   1040 <snprintf@plt>
mov    %ebp,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <bs_get_info@plt>
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"list-tubes\0D\0A\00"
define i32 @bs_list_tubes(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [64 x i8]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = bitcast [64 x i8]* %5 to i8*
%7 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%8 = call i32 @snprintf(i8* %7, i32 64, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %3
%10 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%11 = load i8**, i8*** %4
%12 = call i32 @bs_get_info(i32 %9, i8* %10, i8** %11)
ret i32 %12
}

LLVM IR (-O2):
@.str = [13 x i8] c"list-tubes\0D\0A\00"
define i32 @bs_list_tubes(i32 %0, i8** %1) {
%3 = alloca [64 x i8]
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 64, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @bs_get_info(i32 %0, i8* %4, i8** %1)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ imprimirCriptografado(char *);
int /*<<< orphan*/ stdin;
int main(void) {
  char linha[64];
  while (fgets(linha, 64, stdin) != NULL) {
    imprimirCriptografado(linha);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
mov    0x2eae(%rip),%rax
mov    (%rax),%edx
mov    $0x40,%esi
call   1030 <fgets@plt>
cmp    $0x0,%rax
je     115e <main+0x3e>
lea    -0x50(%rbp),%rdi
call   1040 <imprimirCriptografado@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    0x2eba(%rip),%r14
mov    (%r14),%edx
mov    %rsp,%rdi
mov    $0x40,%esi
call   1030 <fgets@plt>
test   %rax,%rax
je     116d <main+0x4d>
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1040 <imprimirCriptografado@plt>
mov    (%r14),%edx
mov    %rbx,%rdi
mov    $0x40,%esi
call   1030 <fgets@plt>
test   %rax,%rax
jne    1150 <main+0x30>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [64 x i8]
store i32 0, i32* %1
br label %3
3: ; preds = %8, %0
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%5 = load i32, i32* @stdin
%6 = call i32* @fgets(i8* %4, i32 64, i32 %5)
%7 = icmp ne i32* %6, null
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%10 = call i32 @imprimirCriptografado(i8* %9)
br label %3
11: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @main() {
%1 = alloca [64 x i8]
%2 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32* @fgets(i8* %2, i32 64, i32 %3)
%5 = icmp eq i32* %4, null
br i1 %5, label %11, label %6
6: ; preds = %0, %6
%7 = call i32 @imprimirCriptografado(i8* %2)
%8 = load i32, i32* @stdin
%9 = call i32* @fgets(i8* %2, i32 64, i32 %8)
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %6
11: ; preds = %6, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void shlib_second(int dummy) { abort(); }


x86 assembly (clang, -O0):
<shlib_second>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<shlib_second>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define void @shlib_second(i32 %0) {
%2 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int /*<<< orphan*/);
void say(const char *s) { write(2, s, strlen(s)); }


x86 assembly (clang, -O0):
<say>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x2,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<say>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define void @say(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @write(i32 2, i8* %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ console_close(int);
void command_quit(int id, char *input) {
  (void)input;
  console_close(id);
}


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

x86 assembly (clang, -O2):
<command_quit>:
jmp    1030 <console_close@plt>

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

LLVM IR (-O2):
define void @command_quit(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32 @console_close(i32 %0)
ret void
}
void flip_goto(void) {}


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

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

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

LLVM IR (-O2):
define void @flip_goto() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *name) {
  printf("%s filename num-bytes [x]\n", name);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [27 x i8] c"%s filename num-bytes [x]\0A\00"
@EXIT_SUCCESS = global i32 0
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ memmove(void *, void const *, size_t);
void __attribute__((weak))
__aeabi_memmove_impl2(void *dest, const void *src, size_t n) {
  memmove(dest, src, n);
}


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

x86 assembly (clang, -O2):
<__aeabi_memmove_impl2>:
jmp    1030 <memmove@plt>

LLVM IR (-O0):
define weak void @__aeabi_memmove_impl2(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @memmove(i8* %7, i8* %8, i64 %9)
ret void
}

LLVM IR (-O2):
define weak void @__aeabi_memmove_impl2(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @memmove(i8* %0, i8* %1, i64 %2)
ret void
}
adrx0adrreg1(r0, r1, x0, x1, p0, p1) unsigned short r0, r1;
unsigned short *p0, *p1;
{
  if ((((unsigned short *)10000000)[x0]) <= (p1[1111111 / 4]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adrx0adrreg1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movslq -0xc(%rbp),%rcx
mov    $0x989680,%eax
movzwl (%rax,%rcx,2),%eax
mov    -0x20(%rbp),%rcx
movzwl 0x87a22(%rcx),%ecx
cmp    %ecx,%eax
jg     114b <adrx0adrreg1+0x4b>
movl   $0x1,-0x4(%rbp)
jmp    1152 <adrx0adrreg1+0x52>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrx0adrreg1>:
movslq %edx,%rax
movzwl 0x989680(%rax,%rax,1),%ecx
xor    %eax,%eax
cmp    0x87a22(%r9),%cx
setbe  %al
ret

LLVM IR (-O0):
define i32 @adrx0adrreg1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i32, i32* %10
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i16, i16* inttoptr (i64 10000000 to i16*), i64 %17
%19 = load i16, i16* %18
%20 = zext i16 %19 to i32
%21 = load i16*, i16** %13
%22 = getelementptr inbounds i16, i16* %21, i64 277777
%23 = load i16, i16* %22
%24 = zext i16 %23 to i32
%25 = icmp sle i32 %20, %24
br i1 %25, label %26, label %27
26: ; preds = %6
store i32 1, i32* %7
br label %28
27: ; preds = %6
store i32 0, i32* %7
br label %28
28: ; preds = %27, %26
%29 = load i32, i32* %7
ret i32 %29
}

LLVM IR (-O2):
define i32 @adrx0adrreg1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i16, i16* inttoptr (i64 10000000 to i16*), i64 %7
%9 = load i16, i16* %8
%10 = getelementptr inbounds i16, i16* %5, i64 277777
%11 = load i16, i16* %10
%12 = icmp ule i16 %9, %11
%13 = zext i1 %12 to i32
ret i32 %13
}