xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int x;
  scanf("%d", &x);
  printf("O valor fornecido foi: ");
  printf("%d", x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xec3(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [24 x i8] c"O valor fornecido foi: \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [24 x i8] c"O valor fornecido foi: \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ signal(int, void (*)(int));
void sigint(int signo) {
  printf("caught %d\n", signo);
  signal(signo, sigint);
}


x86 assembly (clang, -O0):
<sigint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
mov    0x2e9c(%rip),%rsi
call   1040 <signal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigint>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    0x2ea8(%rip),%rsi
mov    %ebx,%edi
pop    %rbx
jmp    1040 <signal@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"caught %d\0A\00"
define void @sigint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @signal(i32 %5, void (i32)* @sigint)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"caught %d\0A\00"
define void @sigint(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @signal(i32 %0, void (i32)* @sigint)
ret void
}
/* Variables and functions */
char *month_name(int);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  printf("Month: %s\n", month_name(-1));
  printf("Month: %s\n", month_name(14));
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xffffffff,%edi
call   1040 <month_name@plt>
mov    %rax,%rsi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    $0xe,%edi
call   1040 <month_name@plt>
mov    %rax,%rsi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xffffffff,%edi
call   1040 <month_name@plt>
lea    0xece(%rip),%rbx
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    $0xe,%edi
call   1040 <month_name@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"Month: %s\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i8* @month_name(i32 -1)
%3 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i8* @month_name(i32 14)
%5 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"Month: %s\0A\00"
define i32 @main() {
%1 = tail call i8* @month_name(i32 -1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = tail call i8* @month_name(i32 14)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ link_error();
unsigned long strlen(char const *);
void foo(const char *str) {
  long unsigned int a = strlen(str);
  long unsigned int b = strlen(str);
  if (a != b)
    link_error();
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
je     115b <foo+0x3b>
mov    $0x0,%al
call   1040 <link_error@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @foo(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
store i64 %6, i64* %3
%7 = load i8*, i8** %2
%8 = call i64 @strlen(i8* %7)
store i64 %8, i64* %4
%9 = load i64, i64* %3
%10 = load i64, i64* %4
%11 = icmp ne i64 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %1
%13 = call i32 (...) @link_error()
br label %14
14: ; preds = %12, %1
ret void
}

LLVM IR (-O2):
define void @foo(i8* nocapture %0) {
ret void
}
const char *last_slash(const char *str) {
  const char *last = str;
  while (*str != 0) {
    if (*str == '/')
      last = str;
    str++;
  }
  return last + 1;
}


x86 assembly (clang, -O0):
<last_slash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1149 <last_slash+0x49>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1138 <last_slash+0x38>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <last_slash+0x10>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<last_slash>:
mov    %rdi,%rax
jmp    1117 <last_slash+0x17>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rdi,%rax
add    $0x1,%rdi
movzbl (%rdi),%ecx
cmp    $0x2f,%cl
je     1110 <last_slash+0x10>
test   %cl,%cl
jne    1113 <last_slash+0x13>
add    $0x1,%rax
ret

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

LLVM IR (-O2):
define i8* @last_slash(i8* %0) {
br label %2
2: ; preds = %7, %1
%3 = phi i8* [ %0, %1 ], [ %9, %7 ]
%4 = phi i8* [ %0, %1 ], [ %8, %7 ]
%5 = load i8, i8* %3
switch i8 %5, label %7 [
i8 0, label %10
i8 47, label %6
]
6: ; preds = %2
br label %7
7: ; preds = %2, %6
%8 = phi i8* [ %3, %6 ], [ %4, %2 ]
%9 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
10: ; preds = %2
%11 = getelementptr inbounds i8, i8* %4, i64 1
ret i8* %11
}
/* Type definitions */
struct sqlConnection {
  int dummy;
};
typedef int /*<<< orphan*/ query;

/* Variables and functions */
char *sqlQuickString(struct sqlConnection *, char *);
int /*<<< orphan*/ sqlSafef(char *, int, char *, int);
char *visiGeneSubmitId(struct sqlConnection *conn, int id) {
  char query[256];
  sqlSafef(query, sizeof(query),
           "select imageFile.submitId from image,imageFile "
           "where image.id = %d and image.imageFile = imageFile.id",
           id);
  return sqlQuickString(conn, query);
}


x86 assembly (clang, -O0):
<visiGeneSubmitId>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0xc(%rbp),%ecx
mov    $0x100,%esi
lea    0xeb8(%rip),%rdx
call   1040 <sqlSafef@plt>
mov    -0x8(%rbp),%rdi
lea    -0x110(%rbp),%rsi
call   1030 <sqlQuickString@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<visiGeneSubmitId>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %esi,%ecx
mov    %rdi,%rbx
lea    0xeca(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x100,%esi
call   1040 <sqlSafef@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <sqlQuickString@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.sqlConnection = type { i32 }
@.str = [102 x i8] c"select imageFile.submitId from image,imageFile where image.id = %d and image.imageFile = imageFile.id\00"
define i8* @visiGeneSubmitId(%struct.sqlConnection* %0, i32 %1) {
%3 = alloca %struct.sqlConnection*
%4 = alloca i32
%5 = alloca [256 x i8]
store %struct.sqlConnection* %0, %struct.sqlConnection** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %4
%8 = call i32 @sqlSafef(i8* %6, i32 256, i8* getelementptr inbounds ([102 x i8], [102 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load %struct.sqlConnection*, %struct.sqlConnection** %3
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%11 = call i8* @sqlQuickString(%struct.sqlConnection* %9, i8* %10)
ret i8* %11
}

LLVM IR (-O2):
%struct.sqlConnection = type { i32 }
@.str = [102 x i8] c"select imageFile.submitId from image,imageFile where image.id = %d and image.imageFile = imageFile.id\00"
define i8* @visiGeneSubmitId(%struct.sqlConnection* %0, i32 %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = call i32 @sqlSafef(i8* %4, i32 256, i8* getelementptr inbounds ([102 x i8], [102 x i8]* @.str, i64 0, i64 0), i32 %1)
%6 = call i8* @sqlQuickString(%struct.sqlConnection* %0, i8* %4)
ret i8* %6
}
/* Variables and functions */
double sqrt(int /*<<< orphan*/);
int /*<<< orphan*/ squared_dist(double *, double *, int);
double eucdist(double *A, double *B, int vlen) {
  return sqrt(squared_dist(A, B, vlen));
}


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

x86 assembly (clang, -O2):
<eucdist>:
push   %rax
call   1030 <squared_dist@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define double @eucdist(double* %0, double* %1, i32 %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca i32
store double* %0, double** %4
store double* %1, double** %5
store i32 %2, i32* %6
%7 = load double*, double** %4
%8 = load double*, double** %5
%9 = load i32, i32* %6
%10 = call i32 @squared_dist(double* %7, double* %8, i32 %9)
%11 = call double @sqrt(i32 %10)
ret double %11
}

LLVM IR (-O2):
define double @eucdist(double* %0, double* %1, i32 %2) {
%4 = tail call i32 @squared_dist(double* %0, double* %1, i32 %2)
%5 = tail call double @sqrt(i32 %4)
ret double %5
}
int _isatty_r(struct _reent *r, int fd) {
  r = r;
  fd = fd;
  return 1;
}


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

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

LLVM IR (-O0):
%struct._reent = type opaque
define i32 @_isatty_r(%struct._reent* %0, i32 %1) {
%3 = alloca %struct._reent*
%4 = alloca i32
store %struct._reent* %0, %struct._reent** %3
store i32 %1, i32* %4
%5 = load %struct._reent*, %struct._reent** %3
store %struct._reent* %5, %struct._reent** %3
%6 = load i32, i32* %4
store i32 %6, i32* %4
ret i32 1
}

LLVM IR (-O2):
%struct._reent = type opaque
define i32 @_isatty_r(%struct._reent* nocapture readnone %0, i32 %1) {
ret i32 1
}
/* Variables and functions */
void matrix_scan_user(void) {}


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

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

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

LLVM IR (-O2):
define void @matrix_scan_user() {
ret void
}
void gdk_region_subtract() {}


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

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

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

LLVM IR (-O2):
define void @gdk_region_subtract() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GetResponse(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                               int /*<<< orphan*/);
int /*<<< orphan*/ PMII_singinit();
int /*<<< orphan*/ accept_one_connection(int /*<<< orphan*/);
int /*<<< orphan*/ dump_PMI2_Command(int /*<<< orphan*/ *);
void phony(void) {
  if (0) {
    accept_one_connection(0);
    GetResponse(NULL, NULL, 0);
    dump_PMI2_Command(NULL);
    PMII_singinit();
  }
}


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

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

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

LLVM IR (-O2):
define void @phony() {
ret void
}
/* Variables and functions */
int snprintf(char *, int, char *, char const *);
const char *get_status_file_path(const char *filename) {
  static char path[272];
  int len;
  len = snprintf(path, 272, "/proc/%s/status", filename);
  if (len < 0 || len >= 272) {
    return NULL;
  }
  return path;
}


x86 assembly (clang, -O0):
<get_status_file_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
lea    0x2f19(%rip),%rdi
mov    $0x110,%esi
lea    0xecd(%rip),%rdx
call   1030 <snprintf@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     1152 <get_status_file_path+0x42>
cmpl   $0x110,-0x14(%rbp)
jl     115f <get_status_file_path+0x4f>
movq   $0x0,-0x8(%rbp)
jmp    116a <get_status_file_path+0x5a>
lea    0x2eda(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_status_file_path>:
push   %rbx
mov    %rdi,%rcx
lea    0x2f25(%rip),%rbx
lea    0xede(%rip),%rdx
mov    %rbx,%rdi
mov    $0x110,%esi
call   1030 <snprintf@plt>
xor    %ecx,%ecx
cmp    $0x110,%eax
cmovb  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@get_status_file_path.path = internal global [272 x i8] zeroinitializer
@.str = [16 x i8] c"/proc/%s/status\00"
define i8* @get_status_file_path(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @snprintf(i8* getelementptr inbounds ([272 x i8], [272 x i8]* @get_status_file_path.path, i64 0, i64 0), i32 272, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %1
%10 = load i32, i32* %4
%11 = icmp sge i32 %10, 272
br i1 %11, label %12, label %13
12: ; preds = %9, %1
store i8* null, i8** %2
br label %14
13: ; preds = %9
store i8* getelementptr inbounds ([272 x i8], [272 x i8]* @get_status_file_path.path, i64 0, i64 0), i8** %2
br label %14
14: ; preds = %13, %12
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
@get_status_file_path.path = internal global [272 x i8] zeroinitializer
@.str = [16 x i8] c"/proc/%s/status\00"
define i8* @get_status_file_path(i8* %0) {
%2 = tail call i32 @snprintf(i8* getelementptr inbounds ([272 x i8], [272 x i8]* @get_status_file_path.path, i64 0, i64 0), i32 272, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = icmp ugt i32 %2, 271
%4 = select i1 %3, i8* null, i8* getelementptr inbounds ([272 x i8], [272 x i8]* @get_status_file_path.path, i64 0, i64 0)
ret i8* %4
}
int main(void) {
  int c = 0;
  typedef union a b;
  union a {
    int a;
  };
  b a;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ outb(int /*<<< orphan*/, int);
void iowait() { outb(0, 0x80); }


x86 assembly (clang, -O0):
<iowait>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x80,%esi
call   1030 <outb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<iowait>:
xor    %edi,%edi
mov    $0x80,%esi
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @iowait() {
%1 = call i32 @outb(i32 0, i32 128)
ret void
}

LLVM IR (-O2):
define void @iowait() {
%1 = tail call i32 @outb(i32 0, i32 128)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_vector(void *x) { free(x); }


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

x86 assembly (clang, -O2):
<free_vector>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_vector(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void func_a(int a) {
  for (int i = 0; i < a; i++) {
    printf("func_a! %d of %d\n", i, a);
  }
}


x86 assembly (clang, -O0):
<func_a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    114e <func_a+0x3e>
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <func_a+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_a>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
jle    1143 <func_a+0x33>
mov    %edi,%ebx
xor    %ebp,%ebp
lea    0xedd(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1130 <func_a+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [18 x i8] c"func_a! %d of %d\0A\00"
define void @func_a(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %4, label %3
3: ; preds = %4, %1
ret void
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %0)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %3, label %4
}
__attribute__((no, noclone)) short foo10(short arg) {
  short ret = 1;
  if (arg + 1 < 0 || arg + 1 > ((!1) ? ((1L << (sizeof(char) * 8 - 1)) - 1)
                                     : ((1L << (sizeof(char) * 8)) - 1)))
    return ret;
  arg = arg + 1;
  ret = (unsigned char)arg;
  return arg;
}


x86 assembly (clang, -O0):
<foo10>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
movw   $0x1,-0x6(%rbp)
movswl -0x4(%rbp),%eax
add    $0x1,%eax
cmp    $0x0,%eax
jl     1136 <foo10+0x36>
movswl -0x4(%rbp),%eax
add    $0x1,%eax
cltq
cmp    $0xff,%rax
jle    1143 <foo10+0x43>
mov    -0x6(%rbp),%ax
mov    %ax,-0x2(%rbp)
jmp    1161 <foo10+0x61>
movswl -0x4(%rbp),%eax
add    $0x1,%eax
mov    %ax,-0x4(%rbp)
mov    -0x4(%rbp),%ax
movzbl %al,%eax
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo10>:
lea    0x1(%rdi),%ecx
add    $0xffffff01,%edi
movzwl %di,%eax
cmp    $0xff00,%eax
mov    $0x1,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define signext i16 @foo10(i16 signext %0) {
%2 = alloca i16
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 1, i16* %4
%5 = load i16, i16* %3
%6 = sext i16 %5 to i32
%7 = add nsw i32 %6, 1
%8 = icmp slt i32 %7, 0
br i1 %8, label %15, label %9
9: ; preds = %1
%10 = load i16, i16* %3
%11 = sext i16 %10 to i32
%12 = add nsw i32 %11, 1
%13 = sext i32 %12 to i64
%14 = icmp sgt i64 %13, 255
br i1 %14, label %15, label %17
15: ; preds = %9, %1
%16 = load i16, i16* %4
store i16 %16, i16* %2
br label %26
17: ; preds = %9
%18 = load i16, i16* %3
%19 = sext i16 %18 to i32
%20 = add nsw i32 %19, 1
%21 = trunc i32 %20 to i16
store i16 %21, i16* %3
%22 = load i16, i16* %3
%23 = trunc i16 %22 to i8
%24 = zext i8 %23 to i16
store i16 %24, i16* %4
%25 = load i16, i16* %3
store i16 %25, i16* %2
br label %26
26: ; preds = %17, %15
%27 = load i16, i16* %2
ret i16 %27
}

LLVM IR (-O2):
define signext i16 @foo10(i16 signext %0) {
%2 = add i16 %0, 1
%3 = add i16 %0, -255
%4 = icmp ult i16 %3, -256
%5 = select i1 %4, i16 1, i16 %2
ret i16 %5
}
/* Type definitions */
typedef int u_int;

/* Variables and functions */
u_int atmsw_vpc_hash(u_int vpi) { return ((vpi ^ (vpi >> 8)) & (256 - 1)); }


x86 assembly (clang, -O0):
<atmsw_vpc_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
xor    %ecx,%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atmsw_vpc_hash>:
mov    %edi,%eax
shr    $0x8,%eax
xor    %edi,%eax
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @atmsw_vpc_hash(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 8
%6 = xor i32 %3, %5
%7 = and i32 %6, 255
ret i32 %7
}

LLVM IR (-O2):
define i32 @atmsw_vpc_hash(i32 %0) {
%2 = lshr i32 %0, 8
%3 = xor i32 %2, %0
%4 = and i32 %3, 255
ret i32 %4
}
int ioctl(int fd, int op, ...) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ioctl(i32 %0, i32 %1, ...) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ op1_undefined();
int /*<<< orphan*/ op2_undefined();
int /*<<< orphan*/ op3_undefined();
int main() {
  op1_undefined();
  op2_undefined();
  op3_undefined();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @op1_undefined()
%2 = tail call i32 (...) @op2_undefined()
%3 = tail call i32 (...) @op3_undefined()
ret i32 0
}
void rl_reset_terminal(p) char *p;
{ (void)p; }


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

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

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

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


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

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

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

LLVM IR (-O2):
define i32 @testThreadSupport() {
ret i32 0
}
/* Type definitions */
struct obj {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cintern(char *);
int /*<<< orphan*/ setvar(int /*<<< orphan*/, int /*<<< orphan*/, struct obj *);
void init_ss_version(void) {
  setvar(cintern("*ss-version*"),
         cintern("$Id: ss.c,v 1.1.1.1 2003/01/15 23:55:10 ulric Exp $"),
         ((struct obj *)0));
}


x86 assembly (clang, -O0):
<init_ss_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1040 <cintern@plt>
mov    %eax,-0x4(%rbp)
lea    0xecf(%rip),%rdi
call   1040 <cintern@plt>
mov    -0x4(%rbp),%edi
mov    %eax,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <setvar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_ss_version>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1040 <cintern@plt>
mov    %eax,%ebx
lea    0xed7(%rip),%rdi
call   1040 <cintern@plt>
mov    %ebx,%edi
mov    %eax,%esi
xor    %edx,%edx
pop    %rbx
jmp    1030 <setvar@plt>

LLVM IR (-O0):
%struct.obj = type { i32 }
@.str = [13 x i8] c"*ss-version*\00"
@.str.1 = [52 x i8] c"$Id: ss.c,v 1.1.1.1 2003/01/15 23:55:10 ulric Exp $\00"
define void @init_ss_version() {
%1 = call i32 @cintern(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @cintern(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @setvar(i32 %1, i32 %2, %struct.obj* null)
ret void
}

LLVM IR (-O2):
%struct.obj = type { i32 }
@.str = [13 x i8] c"*ss-version*\00"
@.str.1 = [52 x i8] c"$Id: ss.c,v 1.1.1.1 2003/01/15 23:55:10 ulric Exp $\00"
define void @init_ss_version() {
%1 = tail call i32 @cintern(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @cintern(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @setvar(i32 %1, i32 %2, %struct.obj* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int _usage(void) {
  fputs("Usage: "
        "file"
        " [-dh][-M file][-m file] file ...\n       "
        "file"
        " -i [-h] file ...\n",
        stderr);
  return 1;
}


x86 assembly (clang, -O0):
<_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [75 x i8] c"Usage: file [-dh][-M file][-m file] file ...\0A file -i [-h] file ...\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [75 x i8] c"Usage: file [-dh][-M file][-m file] file ...\0A file -i [-h] file ...\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
/* Type definitions */
struct point3d_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct point3d_t *);
void destroy_point3d(struct point3d_t *point3d) { free(point3d); }


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

x86 assembly (clang, -O2):
<destroy_point3d>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.point3d_t = type { i32 }
define void @destroy_point3d(%struct.point3d_t* %0) {
%2 = alloca %struct.point3d_t*
store %struct.point3d_t* %0, %struct.point3d_t** %2
%3 = load %struct.point3d_t*, %struct.point3d_t** %2
%4 = call i32 @free(%struct.point3d_t* %3)
ret void
}

LLVM IR (-O2):
%struct.point3d_t = type { i32 }
define void @destroy_point3d(%struct.point3d_t* nocapture %0) {
%2 = tail call i32 @free(%struct.point3d_t* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ core1_print(char *, char const *);
void U_EMRPOLYGON_print(const char *contents) {
  core1_print("U_EMRPOLYGON", contents);
}


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

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"U_EMRPOLYGON\00"
define void @U_EMRPOLYGON_print(i8* %0) {
%2 = tail call i32 @core1_print(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ UINT64_MAX;
int /*<<< orphan*/ xsd_integer_value(char const *, int /*<<< orphan*/,
                                     int /*<<< orphan*/);
uint64_t xsd_uint64_value(const char *literal) {
  return (uint64_t)xsd_integer_value(literal, 0, UINT64_MAX);
}


x86 assembly (clang, -O0):
<xsd_uint64_value>:
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   1030 <xsd_integer_value@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xsd_uint64_value>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
jmp    1030 <xsd_integer_value@plt>

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

LLVM IR (-O2):
@UINT64_MAX = global i32 0
define i32 @xsd_uint64_value(i8* %0) {
%2 = load i32, i32* @UINT64_MAX
%3 = tail call i32 @xsd_integer_value(i8* %0, i32 0, i32 %2)
ret i32 %3
}
void McASPRxFmtMaskSet(unsigned int baseAddr, unsigned int mask) {
  (*((volatile unsigned int *)(baseAddr + (0x64)))) = mask;
}


x86 assembly (clang, -O0):
<McASPRxFmtMaskSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x64,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<McASPRxFmtMaskSet>:
add    $0x64,%edi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @McASPRxFmtMaskSet(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = add i32 %6, 100
%8 = zext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store volatile i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @McASPRxFmtMaskSet(i32 %0, i32 %1) {
%3 = add i32 %0, 100
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
store volatile i32 %1, i32* %5
ret void
}
/* Type definitions */
struct rlimit {
  int dummy;
};
typedef enum __rlimit_resource {
  ____Placeholder___rlimit_resource
} __rlimit_resource;
typedef int /*<<< orphan*/ __pid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int prlimit(__pid_t pid, enum __rlimit_resource resource,
            __const struct rlimit *new_rlimit, struct rlimit *old_rlimit) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<prlimit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prlimit>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.rlimit = type { i32 }
@ENOSYS = global i32 0
define i32 @prlimit(i32 %0, i32 %1, %struct.rlimit* %2, %struct.rlimit* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.rlimit*
%8 = alloca %struct.rlimit*
store i32 %0, i32* %5
store i32 %1, i32* %6
store %struct.rlimit* %2, %struct.rlimit** %7
store %struct.rlimit* %3, %struct.rlimit** %8
%9 = load i32, i32* @ENOSYS
%10 = call i32 @__set_errno(i32 %9)
ret i32 -1
}

LLVM IR (-O2):
%struct.rlimit = type { i32 }
@ENOSYS = global i32 0
define i32 @prlimit(i32 %0, i32 %1, %struct.rlimit* nocapture readnone %2, %struct.rlimit* nocapture readnone %3) {
%5 = load i32, i32* @ENOSYS
%6 = tail call i32 @__set_errno(i32 %5)
ret i32 -1
}
assert(_Bool b) {
  _Noreturn void abort();
  if (!b)
    abort();
}


x86 assembly (clang, -O0):
<assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
and    $0x1,%al
mov    %al,-0x5(%rbp)
testb  $0x1,-0x5(%rbp)
jne    112f <assert+0x1f>
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert>:
test   %edi,%edi
je     1115 <assert+0x5>
ret
push   %rax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @assert(i1 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = zext i1 %0 to i8
store i8 %4, i8* %3
%5 = load i8, i8* %3
%6 = trunc i8 %5 to i1
br i1 %6, label %8, label %7
7: ; preds = %1
unreachable
8: ; preds = %1
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @assert(i1 zeroext %0) {
br i1 %0, label %3, label %2
2: ; preds = %1
tail call void @abort()
unreachable
3: ; preds = %1
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ irc_katr_otacka_cm();
int /*<<< orphan*/ irc_vozik_otacka_cm();
int /*<<< orphan*/ new_log(char *);
int /*<<< orphan*/ usleep(int);
int /*<<< orphan*/ width_src();
void hardware_config(void) {
  new_log("Nastaveni paramteru");
  irc_katr_otacka_cm();
  usleep(50000);
  irc_vozik_otacka_cm();
  usleep(50000);
  width_src();
}


x86 assembly (clang, -O0):
<hardware_config>:
push   %rbp
mov    %rsp,%rbp
lea    0xea5(%rip),%rdi
call   1040 <new_log@plt>
mov    $0x0,%al
call   1030 <irc_katr_otacka_cm@plt>
mov    $0xc350,%edi
call   1070 <usleep@plt>
mov    $0x0,%al
call   1050 <irc_vozik_otacka_cm@plt>
mov    $0xc350,%edi
call   1070 <usleep@plt>
mov    $0x0,%al
call   1060 <width_src@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hardware_config>:
push   %rax
lea    0xea8(%rip),%rdi
call   1040 <new_log@plt>
xor    %eax,%eax
call   1030 <irc_katr_otacka_cm@plt>
mov    $0xc350,%edi
call   1070 <usleep@plt>
xor    %eax,%eax
call   1050 <irc_vozik_otacka_cm@plt>
mov    $0xc350,%edi
call   1070 <usleep@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <width_src@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"Nastaveni paramteru\00"
define void @hardware_config() {
%1 = call i32 @new_log(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @irc_katr_otacka_cm()
%3 = call i32 @usleep(i32 50000)
%4 = call i32 (...) @irc_vozik_otacka_cm()
%5 = call i32 @usleep(i32 50000)
%6 = call i32 (...) @width_src()
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"Nastaveni paramteru\00"
define void @hardware_config() {
%1 = tail call i32 @new_log(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @irc_katr_otacka_cm()
%3 = tail call i32 @usleep(i32 50000)
%4 = tail call i32 (...) @irc_vozik_otacka_cm()
%5 = tail call i32 @usleep(i32 50000)
%6 = tail call i32 (...) @width_src()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int _usage(void) {
  fputs("Usage: "
        "rmdir"
        " [-p] dir...\n  -p	Remove all directories in a pathname\n",
        stderr);
  return 1;
}


x86 assembly (clang, -O0):
<_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [68 x i8] c"Usage: rmdir [-p] dir...\0A -p\09Remove all directories in a pathname\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [68 x i8] c"Usage: rmdir [-p] dir...\0A -p\09Remove all directories in a pathname\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
void isa_write32(unsigned short port, unsigned int val) {
  *(int *)((void *)(0xfe000000 | (port))) = val;
}


x86 assembly (clang, -O0):
<isa_write32>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
movzwl -0x2(%rbp),%eax
or     $0xfe000000,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<isa_write32>:
mov    %edi,%eax
mov    $0xfe000000,%ecx
mov    %esi,(%rax,%rcx,1)
ret

LLVM IR (-O0):
define void @isa_write32(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i16, i16* %3
%7 = zext i16 %6 to i32
%8 = or i32 -33554432, %7
%9 = zext i32 %8 to i64
%10 = inttoptr i64 %9 to i8*
%11 = bitcast i8* %10 to i32*
store i32 %5, i32* %11
ret void
}

LLVM IR (-O2):
define void @isa_write32(i16 zeroext %0, i32 %1) {
%3 = zext i16 %0 to i64
%4 = or i64 %3, 4261412864
%5 = inttoptr i64 %4 to i32*
store i32 %1, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_binary_search();
int /*<<< orphan*/ test_lower_upper_bound();
int /*<<< orphan*/ test_max();
int /*<<< orphan*/ test_min();
int /*<<< orphan*/ test_minimum_maximum_element();
int /*<<< orphan*/ test_signum();
int /*<<< orphan*/ test_sort();
int main() {
  test_min();
  test_max();
  test_signum();
  test_sort();
  test_lower_upper_bound();
  test_binary_search();
  test_minimum_maximum_element();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <test_min@plt>
mov    $0x0,%al
call   1090 <test_max@plt>
mov    $0x0,%al
call   1030 <test_signum@plt>
mov    $0x0,%al
call   1080 <test_sort@plt>
mov    $0x0,%al
call   1040 <test_lower_upper_bound@plt>
mov    $0x0,%al
call   1060 <test_binary_search@plt>
mov    $0x0,%al
call   1050 <test_minimum_maximum_element@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <test_min@plt>
xor    %eax,%eax
call   1090 <test_max@plt>
xor    %eax,%eax
call   1030 <test_signum@plt>
xor    %eax,%eax
call   1080 <test_sort@plt>
xor    %eax,%eax
call   1040 <test_lower_upper_bound@plt>
xor    %eax,%eax
call   1060 <test_binary_search@plt>
xor    %eax,%eax
call   1050 <test_minimum_maximum_element@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_min()
%3 = call i32 (...) @test_max()
%4 = call i32 (...) @test_signum()
%5 = call i32 (...) @test_sort()
%6 = call i32 (...) @test_lower_upper_bound()
%7 = call i32 (...) @test_binary_search()
%8 = call i32 (...) @test_minimum_maximum_element()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_min()
%2 = tail call i32 (...) @test_max()
%3 = tail call i32 (...) @test_signum()
%4 = tail call i32 (...) @test_sort()
%5 = tail call i32 (...) @test_lower_upper_bound()
%6 = tail call i32 (...) @test_binary_search()
%7 = tail call i32 (...) @test_minimum_maximum_element()
ret i32 0
}
/* Variables and functions */
char toupper(char);
int isbase(char c) {
  char C;
  C = toupper(c);
  if ((C == 'A') || (C == 'C') || (C == 'G') || (C == 'T'))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isbase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <toupper@plt>
mov    %al,-0x6(%rbp)
movsbl -0x6(%rbp),%eax
cmp    $0x41,%eax
je     115e <isbase+0x4e>
movsbl -0x6(%rbp),%eax
cmp    $0x43,%eax
je     115e <isbase+0x4e>
movsbl -0x6(%rbp),%eax
cmp    $0x47,%eax
je     115e <isbase+0x4e>
movsbl -0x6(%rbp),%eax
cmp    $0x54,%eax
jne    116a <isbase+0x5a>
movl   $0x1,-0x4(%rbp)
jmp    1171 <isbase+0x61>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isbase>:
push   %rax
call   1030 <toupper@plt>
mov    %eax,%ecx
add    $0xbf,%cl
cmp    $0x13,%cl
ja     1135 <isbase+0x25>
mov    $0x1,%eax
movzbl %cl,%ecx
mov    $0x80045,%edx
bt     %rcx,%rdx
jae    1135 <isbase+0x25>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @isbase(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
%5 = load i8, i8* %3
%6 = call signext i8 @toupper(i8 signext %5)
store i8 %6, i8* %4
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 65
br i1 %9, label %22, label %10
10: ; preds = %1
%11 = load i8, i8* %4
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 67
br i1 %13, label %22, label %14
14: ; preds = %10
%15 = load i8, i8* %4
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 71
br i1 %17, label %22, label %18
18: ; preds = %14
%19 = load i8, i8* %4
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 84
br i1 %21, label %22, label %23
22: ; preds = %18, %14, %10, %1
store i32 1, i32* %2
br label %24
23: ; preds = %18
store i32 0, i32* %2
br label %24
24: ; preds = %23, %22
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @isbase(i8 signext %0) {
%2 = tail call signext i8 @toupper(i8 signext %0)
switch i8 %2, label %3 [
i8 84, label %4
i8 71, label %4
i8 67, label %4
i8 65, label %4
]
3: ; preds = %1
br label %4
4: ; preds = %1, %1, %1, %1, %3
%5 = phi i32 [ 0, %3 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t set32_H_0(uint32_t x) { return x &= 0x3FFFFFFF; }


x86 assembly (clang, -O0):
<set32_H_0>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3fffffff,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set32_H_0>:
mov    %edi,%eax
and    $0x3fffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @set32_H_0(i32 %0) {
%2 = and i32 %0, 1073741823
ret i32 %2
}
/* Type definitions */
struct array {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ array_cleanup(struct array *);
int /*<<< orphan*/ free(struct array *);
void array_destroy(struct array *a) {
  array_cleanup(a);
  free(a);
}


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

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

LLVM IR (-O0):
%struct.array = type { i32 }
define void @array_destroy(%struct.array* %0) {
%2 = alloca %struct.array*
store %struct.array* %0, %struct.array** %2
%3 = load %struct.array*, %struct.array** %2
%4 = call i32 @array_cleanup(%struct.array* %3)
%5 = load %struct.array*, %struct.array** %2
%6 = call i32 @free(%struct.array* %5)
ret void
}

LLVM IR (-O2):
%struct.array = type { i32 }
define void @array_destroy(%struct.array* %0) {
%2 = tail call i32 @array_cleanup(%struct.array* %0)
%3 = tail call i32 @free(%struct.array* %0)
ret void
}
void api() {}


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

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

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

LLVM IR (-O2):
define void @api() {
ret void
}
int ATSC_I2C_Deinit(void) {}


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

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

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

LLVM IR (-O2):
define i32 @ATSC_I2C_Deinit() {
ret i32 undef
}
unsigned size_smhd(const struct qt_atom *self) { return 16; }


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

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

LLVM IR (-O0):
%struct.qt_atom = type opaque
define i32 @size_smhd(%struct.qt_atom* %0) {
%2 = alloca %struct.qt_atom*
store %struct.qt_atom* %0, %struct.qt_atom** %2
ret i32 16
}

LLVM IR (-O2):
%struct.qt_atom = type opaque
define i32 @size_smhd(%struct.qt_atom* nocapture readnone %0) {
ret i32 16
}