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

/* Variables and functions */
scalar_t__ is_local(int /*<<< orphan*/);
bool is_valid_addr(uint32_t addr) { return is_local(addr) || true; }


x86 assembly (clang, -O0):
<is_valid_addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <is_local@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    113f <is_valid_addr+0x2f>
mov    $0x1,%al
mov    %al,-0x5(%rbp)
jmp    113f <is_valid_addr+0x2f>
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_addr>:
push   %rax
call   1030 <is_local@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_valid_addr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @is_local(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %1
br label %7
7: ; preds = %6, %1
%8 = phi i1 [ true, %1 ], [ true, %6 ]
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @is_valid_addr(i32 %0) {
%2 = tail call i64 @is_local(i32 %0)
ret i32 1
}
void foo516(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo516(i32 %0) {
ret void
}
/* Variables and functions */
int fatorial(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num;
  scanf("%d", &num);
  while (num != -1) {
    printf("%d\n", fatorial(num));
    scanf("%d", &num);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0xffffffff,-0x8(%rbp)
je     1184 <main+0x54>
mov    -0x8(%rbp),%edi
call   1040 <fatorial@plt>
mov    %eax,%esi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
lea    0xe8a(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
jmp    114f <main+0x1f>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xec0(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
cmp    $0xffffffff,%edi
je     1193 <main+0x63>
lea    0xea9(%rip),%r14
lea    0xe9f(%rip),%r15
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
call   1040 <fatorial@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
cmp    $0xffffffff,%edi
jne    1170 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\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)
br label %4
4: ; preds = %7, %0
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, -1
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = load i32, i32* %2
%9 = call i32 @fatorial(i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %4
12: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\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 = load i32, i32* %1
%5 = icmp eq i32 %4, -1
br i1 %5, label %13, label %6
6: ; preds = %0, %6
%7 = phi i32 [ %11, %6 ], [ %4, %0 ]
%8 = call i32 @fatorial(i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%11 = load i32, i32* %1
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %6
13: ; preds = %6, %0
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
void print_date(time_t info, FILE *fp) {
  struct tm *timeinfo;
  char str[80];
  timeinfo = localtime(&info);
  strftime(str, 80, "%A  |  %d %B %Y", timeinfo);
  fprintf(fp, "%s", str);
}


x86 assembly (clang, -O0):
<print_date>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x18(%rbp)
lea    -0x70(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x50,%esi
lea    0xea0(%rip),%rdx
call   1050 <strftime@plt>
mov    -0x10(%rbp),%rdi
lea    -0x70(%rbp),%rdx
lea    0xe9c(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_date>:
push   %r14
push   %rbx
sub    $0x68,%rsp
mov    %rsi,%r14
mov    %edi,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
lea    0xeb1(%rip),%rdx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x50,%esi
mov    %rax,%rcx
call   1050 <strftime@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <fputs@plt>
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [16 x i8] c"%A | %d %B %Y\00"
@.str.1 = [3 x i8] c"%s\00"
define void @print_date(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca %struct.tm*
%6 = alloca [80 x i8]
store i32 %0, i32* %3
store i32* %1, i32** %4
%7 = call %struct.tm* @localtime(i32* %3)
store %struct.tm* %7, %struct.tm** %5
%8 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%9 = load %struct.tm*, %struct.tm** %5
%10 = call i32 @strftime(i8* %8, i32 80, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), %struct.tm* %9)
%11 = load i32*, i32** %4
%12 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%13 = call i32 @fprintf(i32* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %12)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [16 x i8] c"%A | %d %B %Y\00"
define void @print_date(i32 %0, i32* nocapture %1) {
%3 = alloca i32
%4 = alloca [80 x i8]
store i32 %0, i32* %3
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%6 = call %struct.tm* @localtime(i32* %3)
%7 = call i32 @strftime(i8* %5, i32 80, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), %struct.tm* %6)
%8 = call i32 @fputs(i8* %5, i32* %1)
ret void
}
void builtin_cdr(struct Context *ctx, unsigned int stack_track) {}


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

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

LLVM IR (-O0):
%struct.Context = type opaque
define void @builtin_cdr(%struct.Context* %0, i32 %1) {
%3 = alloca %struct.Context*
%4 = alloca i32
store %struct.Context* %0, %struct.Context** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.Context = type opaque
define void @builtin_cdr(%struct.Context* nocapture %0, i32 %1) {
ret void
}
int getValue(char a, char *varTbl, int *valTbl) {
  int i;
  for (i = 0; varTbl[i] != '#'; i++)
    if (varTbl[i] == a)
      return valTbl[i];
}


x86 assembly (clang, -O0):
<getValue>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x23,%eax
je     116c <getValue+0x6c>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x5(%rbp),%ecx
cmp    %ecx,%eax
jne    1159 <getValue+0x59>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x4(%rbp)
jmp    116c <getValue+0x6c>
jmp    115e <getValue+0x5e>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1119 <getValue+0x19>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getValue>:
mov    (%rsi),%r8b
cmp    $0x23,%r8b
je     1125 <getValue+0x25>
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmp    %dil,%r8b
je     1126 <getValue+0x26>
movzbl 0x1(%rsi,%rcx,1),%r8d
add    $0x1,%rcx
cmp    $0x23,%r8b
jne    1110 <getValue+0x10>
ret
mov    %ecx,%eax
mov    (%rdx,%rax,4),%eax
ret

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

LLVM IR (-O2):
define i32 @getValue(i8 signext %0, i8* nocapture %1, i32* nocapture %2) {
%4 = load i8, i8* %1
%5 = icmp eq i8 %4, 35
br i1 %5, label %19, label %6
6: ; preds = %3, %14
%7 = phi i64 [ %15, %14 ], [ 0, %3 ]
%8 = phi i8 [ %17, %14 ], [ %4, %3 ]
%9 = icmp eq i8 %8, %0
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = and i64 %7, 4294967295
%12 = getelementptr inbounds i32, i32* %2, i64 %11
%13 = load i32, i32* %12
br label %19
14: ; preds = %6
%15 = add nuw i64 %7, 1
%16 = getelementptr inbounds i8, i8* %1, i64 %15
%17 = load i8, i8* %16
%18 = icmp eq i8 %17, 35
br i1 %18, label %19, label %6
19: ; preds = %14, %3, %10
%20 = phi i32 [ %13, %10 ], [ undef, %3 ], [ undef, %14 ]
ret i32 %20
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3_stmt;

/* Variables and functions */
int /*<<< orphan*/ SQLITE_TRANSIENT;
int /*<<< orphan*/ finishedStmt(int /*<<< orphan*/ *);
int /*<<< orphan*/ *getStmt(char *);
int runUpdate(int /*<<< orphan*/ *);
int /*<<< orphan*/ sqlite3_bind_text(int /*<<< orphan*/ *, int, char *, int,
                                     int /*<<< orphan*/);
int rmConfigValue(char *key) {
  sqlite3_stmt *stmt = getStmt("DELETE FROM config WHERE key=?");
  sqlite3_bind_text(stmt, 1, key, -1, SQLITE_TRANSIENT);
  int result = runUpdate(stmt);
  finishedStmt(stmt);
  return result;
}


x86 assembly (clang, -O0):
<rmConfigValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xead(%rip),%rdi
call   1040 <getStmt@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    0x2e75(%rip),%rax
mov    (%rax),%r8d
mov    $0x1,%esi
mov    $0xffffffff,%ecx
call   1050 <sqlite3_bind_text@plt>
mov    -0x10(%rbp),%rdi
call   1030 <runUpdate@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <finishedStmt@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rmConfigValue>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
lea    0xeb2(%rip),%rdi
call   1040 <getStmt@plt>
mov    %rax,%rbx
mov    0x2e83(%rip),%rax
mov    (%rax),%r8d
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %r14,%rdx
mov    $0xffffffff,%ecx
call   1050 <sqlite3_bind_text@plt>
mov    %rbx,%rdi
call   1030 <runUpdate@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1060 <finishedStmt@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [31 x i8] c"DELETE FROM config WHERE key=?\00"
@SQLITE_TRANSIENT = global i32 0
define i32 @rmConfigValue(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i32
store i8* %0, i8** %2
%5 = call i32* @getStmt(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = load i8*, i8** %2
%8 = load i32, i32* @SQLITE_TRANSIENT
%9 = call i32 @sqlite3_bind_text(i32* %6, i32 1, i8* %7, i32 -1, i32 %8)
%10 = load i32*, i32** %3
%11 = call i32 @runUpdate(i32* %10)
store i32 %11, i32* %4
%12 = load i32*, i32** %3
%13 = call i32 @finishedStmt(i32* %12)
%14 = load i32, i32* %4
ret i32 %14
}

LLVM IR (-O2):
@.str = [31 x i8] c"DELETE FROM config WHERE key=?\00"
@SQLITE_TRANSIENT = global i32 0
define i32 @rmConfigValue(i8* %0) {
%2 = tail call i32* @getStmt(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @SQLITE_TRANSIENT
%4 = tail call i32 @sqlite3_bind_text(i32* %2, i32 1, i8* %0, i32 -1, i32 %3)
%5 = tail call i32 @runUpdate(i32* %2)
%6 = tail call i32 @finishedStmt(i32* %2)
ret i32 %5
}
/* Variables and functions */
long pop_stack();
long pop_expr_stack(void) { return pop_stack(); }


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

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

LLVM IR (-O0):
define i64 @pop_expr_stack() {
%1 = call i64 (...) @pop_stack()
ret i64 %1
}

LLVM IR (-O2):
define i64 @pop_expr_stack() {
%1 = tail call i64 (...) @pop_stack()
ret i64 %1
}
/* Variables and functions */
int __sysapi_create_timer(long, long, int /*<<< orphan*/);
int sysapi_create_oneshot_timer(long secs, long usecs) {
  return __sysapi_create_timer(secs, usecs, 0);
}


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

x86 assembly (clang, -O2):
<sysapi_create_oneshot_timer>:
xor    %edx,%edx
jmp    1030 <__sysapi_create_timer@plt>

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

LLVM IR (-O2):
define i32 @sysapi_create_oneshot_timer(i64 %0, i64 %1) {
%3 = tail call i32 @__sysapi_create_timer(i64 %0, i64 %1, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ nocall(char *);
void execinitrec() { nocall("execinitrec"); }


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"execinitrec\00"
define void @execinitrec() {
%1 = tail call i32 @nocall(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
process_mnemonic(m) char *m;
{}


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

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

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

LLVM IR (-O2):
define i32 @process_mnemonic(i8* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Cvar_SetWithFlag_f(int);
void Cvar_Setu_f(void) { Cvar_SetWithFlag_f(2); }


x86 assembly (clang, -O0):
<Cvar_Setu_f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <Cvar_SetWithFlag_f@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cvar_Setu_f>:
mov    $0x2,%edi
jmp    1030 <Cvar_SetWithFlag_f@plt>

LLVM IR (-O0):
define void @Cvar_Setu_f() {
%1 = call i32 @Cvar_SetWithFlag_f(i32 2)
ret void
}

LLVM IR (-O2):
define void @Cvar_Setu_f() {
%1 = tail call i32 @Cvar_SetWithFlag_f(i32 2)
ret void
}
/* Type definitions */
typedef scalar_t__ pid_t;
typedef int /*<<< orphan*/ clockid_t;

/* Variables and functions */
int ENOENT;
int EPERM;
scalar_t__ getpid();
int clock_getcpuclockid(pid_t pid, clockid_t *clock_id) {
  if (pid != 0 && pid != getpid())
    return EPERM;
  return ENOENT;
}


x86 assembly (clang, -O0):
<clock_getcpuclockid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115b <clock_getcpuclockid+0x4b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
je     115b <clock_getcpuclockid+0x4b>
mov    0x2e7f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1167 <clock_getcpuclockid+0x57>
mov    0x2e76(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clock_getcpuclockid>:
push   %rbx
test   %rdi,%rdi
je     1125 <clock_getcpuclockid+0x15>
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <getpid@plt>
cmp    %rbx,%rax
jne    112e <clock_getcpuclockid+0x1e>
mov    0x2eac(%rip),%rax
jmp    1135 <clock_getcpuclockid+0x25>
mov    0x2e9b(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@EPERM = global i32 0
@ENOENT = global i32 0
define i32 @clock_getcpuclockid(i64 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i32*
store i64 %0, i64* %4
store i32* %1, i32** %5
%6 = load i64, i64* %4
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i64, i64* %4
%10 = call i64 (...) @getpid()
%11 = icmp ne i64 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = load i32, i32* @EPERM
store i32 %13, i32* %3
br label %16
14: ; preds = %8, %2
%15 = load i32, i32* @ENOENT
store i32 %15, i32* %3
br label %16
16: ; preds = %14, %12
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@EPERM = global i32 0
@ENOENT = global i32 0
define i32 @clock_getcpuclockid(i64 %0, i32* nocapture readnone %1) {
%3 = icmp eq i64 %0, 0
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i64 (...) @getpid()
%6 = icmp eq i64 %5, %0
br i1 %6, label %7, label %8
7: ; preds = %4, %2
br label %8
8: ; preds = %4, %7
%9 = phi i32* [ @ENOENT, %7 ], [ @EPERM, %4 ]
%10 = load i32, i32* %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ fred();
void main() { fred(); }


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

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

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @fred()
ret void
}
void lerrsf(msg, arg) const char msg[], arg[];
{
  char errmsg[2048];
  (void)sprintf(errmsg, msg, arg);
  flexerror(errmsg);
}


x86 assembly (clang, -O0):
<lerrsf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x810,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x810(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x810(%rbp),%rdi
mov    $0x0,%al
call   1030 <flexerror@plt>
add    $0x810,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lerrsf>:
push   %rbx
sub    $0x800,%rsp
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <flexerror@plt>
add    $0x800,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @lerrsf(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [2048 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [2048 x i8], [2048 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 (i8*, i8*, ...) @sprintf(i8* %6, i8* %7, i8* %8)
%10 = getelementptr inbounds [2048 x i8], [2048 x i8]* %5, i64 0, i64 0
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @flexerror to i32 (i8*, ...)*)(i8* %10)
ret void
}

LLVM IR (-O2):
define void @lerrsf(i8* nocapture %0, i8* %1) {
%3 = alloca [2048 x i8]
%4 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%5 = call i32 (i8*, i8*, ...) @sprintf(i8* %4, i8* dereferenceable(1) %0, i8* %1)
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @flexerror to i32 (i8*, ...)*)(i8* %4)
ret void
}
int kvmppc_smt_threads(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @kvmppc_smt_threads() {
ret i32 1
}

LLVM IR (-O2):
define i32 @kvmppc_smt_threads() {
ret i32 1
}
void invalidateStringOutParameter(char **path, unsigned int *pathLength) {
  *path = 0x0;
  if (pathLength != 0x0) {
    *pathLength = 0;
  }
}


x86 assembly (clang, -O0):
<invalidateStringOutParameter>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
cmpq   $0x0,-0x10(%rbp)
je     112c <invalidateStringOutParameter+0x2c>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<invalidateStringOutParameter>:
movq   $0x0,(%rdi)
test   %rsi,%rsi
je     1112 <invalidateStringOutParameter+0x12>
movl   $0x0,(%rsi)
ret

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

LLVM IR (-O2):
define void @invalidateStringOutParameter(i8** nocapture writeonly %0, i32* writeonly %1) {
store i8* null, i8** %0
%3 = icmp eq i32* %1, null
br i1 %3, label %5, label %4
4: ; preds = %2
store i32 0, i32* %1
br label %5
5: ; preds = %4, %2
ret void
}
int isblank(int c) {
  return ((unsigned char)c == ' ') || ((unsigned char)c == '\t');
}


x86 assembly (clang, -O0):
<isblank>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movzbl %al,%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x5(%rbp)
je     112a <isblank+0x2a>
mov    -0x4(%rbp),%eax
movzbl %al,%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isblank>:
movzbl %dil,%eax
cmp    $0x20,%eax
sete   %cl
cmp    $0x9,%eax
sete   %al
or     %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @isblank(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
%5 = zext i8 %4 to i32
%6 = icmp eq i32 %5, 32
br i1 %6, label %12, label %7
7: ; preds = %1
%8 = load i32, i32* %2
%9 = trunc i32 %8 to i8
%10 = zext i8 %9 to i32
%11 = icmp eq i32 %10, 9
br label %12
12: ; preds = %7, %1
%13 = phi i1 [ true, %1 ], [ %11, %7 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @isblank(i32 %0) {
%2 = and i32 %0, 255
%3 = icmp eq i32 %2, 32
%4 = icmp eq i32 %2, 9
%5 = or i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
double power(double x, int y) {
  if (y <= 1)
    return x;
  return x * power(x, y - 1);
}


x86 assembly (clang, -O0):
<power>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jg     1139 <power+0x29>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1164 <power+0x54>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x14(%rbp),%edi
sub    $0x1,%edi
call   1030 <power@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<power>:
cmp    $0x1,%edi
jle    113f <power+0x2f>
push   %rax
add    $0xffffffff,%edi
movsd  %xmm0,(%rsp)
movsd  (%rsp),%xmm0
call   1030 <power@plt>
movsd  (%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
movsd  (%rsp),%xmm0
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define double @power(double %0, i32 %1) {
%3 = icmp slt i32 %1, 2
br i1 %3, label %4, label %6
4: ; preds = %2, %6
%5 = phi double [ %9, %6 ], [ %0, %2 ]
ret double %5
6: ; preds = %2
%7 = add nsw i32 %1, -1
%8 = tail call double @power(double %0, i32 %7)
%9 = fmul double %8, %0
br label %4
}
/* Variables and functions */
void *allocate_frame();
void *get_next_available_virtual_frame(int);
int /*<<< orphan*/ map_page(void *, void *, int);
void *allocate_vframe() {
  void *frame = allocate_frame();
  void *vframe = get_next_available_virtual_frame(1);
  map_page(frame, vframe, 2);
  return vframe;
}


x86 assembly (clang, -O0):
<allocate_vframe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <allocate_frame@plt>
mov    %rax,-0x8(%rbp)
mov    $0x1,%edi
call   1050 <get_next_available_virtual_frame@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x2,%edx
call   1040 <map_page@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocate_vframe>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <allocate_frame@plt>
mov    %rax,%r14
mov    $0x1,%edi
call   1050 <get_next_available_virtual_frame@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
mov    $0x2,%edx
call   1040 <map_page@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @allocate_vframe() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* (...) @allocate_frame()
store i8* %3, i8** %1
%4 = call i8* @get_next_available_virtual_frame(i32 1)
store i8* %4, i8** %2
%5 = load i8*, i8** %1
%6 = load i8*, i8** %2
%7 = call i32 @map_page(i8* %5, i8* %6, i32 2)
%8 = load i8*, i8** %2
ret i8* %8
}

LLVM IR (-O2):
define i8* @allocate_vframe() {
%1 = tail call i8* (...) @allocate_frame()
%2 = tail call i8* @get_next_available_virtual_frame(i32 1)
%3 = tail call i32 @map_page(i8* %1, i8* %2, i32 2)
ret i8* %2
}
void print_buffer(const char *string, void *buffer, int len) {
  (void)(string);
  (void)(buffer);
  (void)(len);
}


x86 assembly (clang, -O0):
<print_buffer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @print_buffer(i8* nocapture %0, i8* nocapture %1, i32 %2) {
ret void
}
__attribute__((used)) const char *__lsan_default_suppressions() {
  return "leak:foobar\nleak:^leak*Supp$\n";
}


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"leak:foobar\0Aleak:^leak*Supp$\0A\00"
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i8* ()* @__lsan_default_suppressions to i8*)], section "llvm.metadata"
define i8* @__lsan_default_suppressions() {
ret i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [30 x i8] c"leak:foobar\0Aleak:^leak*Supp$\0A\00"
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i8* ()* @__lsan_default_suppressions to i8*)], section "llvm.metadata"
define i8* @__lsan_default_suppressions() {
ret i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ control_mouse(int);
void time_cb(int fd, short event, void *arg) { control_mouse(1); }


x86 assembly (clang, -O0):
<time_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    %rdx,-0x10(%rbp)
mov    $0x1,%edi
call   1030 <control_mouse@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_cb>:
mov    $0x1,%edi
jmp    1030 <control_mouse@plt>

LLVM IR (-O0):
define void @time_cb(i32 %0, i16 signext %1, i8* %2) {
%4 = alloca i32
%5 = alloca i16
%6 = alloca i8*
store i32 %0, i32* %4
store i16 %1, i16* %5
store i8* %2, i8** %6
%7 = call i32 @control_mouse(i32 1)
ret void
}

LLVM IR (-O2):
define void @time_cb(i32 %0, i16 signext %1, i8* nocapture readnone %2) {
%4 = tail call i32 @control_mouse(i32 1)
ret void
}
void handle_mouse() {}


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

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

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

LLVM IR (-O2):
define void @handle_mouse() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ngen2(char *, char *, int, int);
void cginitlw(int v, int a) { ngen2("%s\t$%d,%d(%%rbp)", "movq", v, a); }


x86 assembly (clang, -O0):
<cginitlw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xed5(%rip),%rdi
lea    0xedf(%rip),%rsi
call   1030 <ngen2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cginitlw>:
mov    %esi,%ecx
mov    %edi,%edx
lea    0xee5(%rip),%rdi
lea    0xeef(%rip),%rsi
jmp    1030 <ngen2@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"%s\09$%d,%d(%%rbp)\00"
@.str.1 = [5 x i8] c"movq\00"
define void @cginitlw(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @ngen2(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"%s\09$%d,%d(%%rbp)\00"
@.str.1 = [5 x i8] c"movq\00"
define void @cginitlw(i32 %0, i32 %1) {
%3 = tail call i32 @ngen2(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void ALechoState_Delete(void *ptr) { free(ptr); }


x86 assembly (clang, -O0):
<ALechoState_Delete>:
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):
<ALechoState_Delete>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @ALechoState_Delete(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 @ALechoState_Delete(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int main(int, char **, char **);
void _start(int argc, char **argv, char **envp) {
  int result;
  result = main(argc, argv, envp);
  exit(result);
}


x86 assembly (clang, -O0):
<_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <main@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<_start>:
push   %rax
call   1030 <main@plt>
mov    %eax,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @_start(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8**
%7 = alloca i32
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
%8 = load i32, i32* %4
%9 = load i8**, i8*** %5
%10 = load i8**, i8*** %6
%11 = call i32 @main(i32 %8, i8** %9, i8** %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = call i32 @exit(i32 %12)
unreachable
}

LLVM IR (-O2):
define void @_start(i32 %0, i8** %1, i8** %2) {
%4 = tail call i32 @main(i32 %0, i8** %1, i8** %2)
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ cPrintf(char *);
void help08(void) {
  cPrintf("  p                 show PSW\n");
  cPrintf("  p  <data>         set PSW to <data>\n");
}


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

x86 assembly (clang, -O2):
<help08>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <cPrintf@plt>
lea    0xefa(%rip),%rdi
pop    %rax
jmp    1030 <cPrintf@plt>

LLVM IR (-O0):
@.str = [30 x i8] c" p show PSW\0A\00"
@.str.1 = [39 x i8] c" p <data> set PSW to <data>\0A\00"
define void @help08() {
%1 = call i32 @cPrintf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @cPrintf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c" p show PSW\0A\00"
@.str.1 = [39 x i8] c" p <data> set PSW to <data>\0A\00"
define void @help08() {
%1 = tail call i32 @cPrintf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @cPrintf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
scalar_t__ malloc(int);
scalar_t__ pthread_mutex_init(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
pthread_mutex_t *gen_posix_mutex_build(void) {
  pthread_mutex_t *mutex_p = NULL;
  mutex_p = (pthread_mutex_t *)malloc(sizeof(pthread_mutex_t));
  if (!mutex_p) {
    return (NULL);
  }
  if ((pthread_mutex_init(mutex_p, NULL)) < 0) {
    free(mutex_p);
    return (NULL);
  }
  return (mutex_p);
}


x86 assembly (clang, -O0):
<gen_posix_mutex_build>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x10(%rbp)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1166 <gen_posix_mutex_build+0x36>
movq   $0x0,-0x8(%rbp)
jmp    119b <gen_posix_mutex_build+0x6b>
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <pthread_mutex_init@plt>
cmp    $0x0,%rax
jge    1193 <gen_posix_mutex_build+0x63>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
jmp    119b <gen_posix_mutex_build+0x6b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_posix_mutex_build>:
push   %rbx
mov    $0x4,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     115a <gen_posix_mutex_build+0x2a>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
call   1050 <pthread_mutex_init@plt>
test   %rax,%rax
jns    115c <gen_posix_mutex_build+0x2c>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i32* @gen_posix_mutex_build() {
%1 = alloca i32*
%2 = alloca i32*
store i32* null, i32** %2
%3 = call i64 @malloc(i32 4)
%4 = inttoptr i64 %3 to i32*
store i32* %4, i32** %2
%5 = load i32*, i32** %2
%6 = icmp ne i32* %5, null
br i1 %6, label %8, label %7
7: ; preds = %0
store i32* null, i32** %1
br label %17
8: ; preds = %0
%9 = load i32*, i32** %2
%10 = call i64 @pthread_mutex_init(i32* %9, i32* null)
%11 = icmp slt i64 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %8
%13 = load i32*, i32** %2
%14 = call i32 @free(i32* %13)
store i32* null, i32** %1
br label %17
15: ; preds = %8
%16 = load i32*, i32** %2
store i32* %16, i32** %1
br label %17
17: ; preds = %15, %12, %7
%18 = load i32*, i32** %1
ret i32* %18
}

LLVM IR (-O2):
define i32* @gen_posix_mutex_build() {
%1 = tail call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to i32*
%3 = icmp eq i64 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %0
%5 = tail call i64 @pthread_mutex_init(i32* %2, i32* null)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @free(i32* %2)
br label %9
9: ; preds = %4, %0, %7
%10 = phi i32* [ null, %7 ], [ null, %0 ], [ %2, %4 ]
ret i32* %10
}
void psocReadMemoryBarrier() { __asm__ __volatile__("" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @psocReadMemoryBarrier() {
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ checkbit(int /*<<< orphan*/, int);
int /*<<< orphan*/ read_byte_data(int /*<<< orphan*/, int);
uint8_t get_interrupt_polarity(uint8_t address) {
  return checkbit(read_byte_data(address, 0x0A), 1);
}


x86 assembly (clang, -O0):
<get_interrupt_polarity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xa,%esi
call   1030 <read_byte_data@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1040 <checkbit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_interrupt_polarity>:
push   %rax
mov    $0xa,%esi
call   1030 <read_byte_data@plt>
mov    %eax,%edi
mov    $0x1,%esi
pop    %rax
jmp    1040 <checkbit@plt>

LLVM IR (-O0):
define i32 @get_interrupt_polarity(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @read_byte_data(i32 %3, i32 10)
%5 = call i32 @checkbit(i32 %4, i32 1)
ret i32 %5
}

LLVM IR (-O2):
define i32 @get_interrupt_polarity(i32 %0) {
%2 = tail call i32 @read_byte_data(i32 %0, i32 10)
%3 = tail call i32 @checkbit(i32 %2, i32 1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, ...);
int sock_block(int fd) {
  int flags;
  flags = fcntl(fd, F_GETFL);
  flags &= ~(O_NONBLOCK);
  return fcntl(fd, F_SETFL, flags);
}


x86 assembly (clang, -O0):
<sock_block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
mov    $0x0,%al
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
mov    0x2eb0(%rip),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e8b(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    $0x0,%al
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sock_block>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
call   1030 <fcntl@plt>
mov    0x2ebe(%rip),%rcx
mov    (%rcx),%edx
not    %edx
and    %eax,%edx
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
xor    %eax,%eax
pop    %rbx
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
@F_SETFL = global i32 0
define i32 @sock_block(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @F_GETFL
%6 = call i32 (i32, i32, ...) @fcntl(i32 %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* @O_NONBLOCK
%8 = xor i32 %7, -1
%9 = load i32, i32* %3
%10 = and i32 %9, %8
store i32 %10, i32* %3
%11 = load i32, i32* %2
%12 = load i32, i32* @F_SETFL
%13 = load i32, i32* %3
%14 = call i32 (i32, i32, ...) @fcntl(i32 %11, i32 %12, i32 %13)
ret i32 %14
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
@F_SETFL = global i32 0
define i32 @sock_block(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %2)
%4 = load i32, i32* @O_NONBLOCK
%5 = xor i32 %4, -1
%6 = and i32 %3, %5
%7 = load i32, i32* @F_SETFL
%8 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %7, i32 %6)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ changeGlobalInteger(int);
void start() { changeGlobalInteger(42); }


x86 assembly (clang, -O0):
<start>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2a,%edi
call   1030 <changeGlobalInteger@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<start>:
mov    $0x2a,%edi
jmp    1030 <changeGlobalInteger@plt>

LLVM IR (-O0):
define void @start() {
%1 = call i32 @changeGlobalInteger(i32 42)
ret void
}

LLVM IR (-O2):
define void @start() {
%1 = tail call i32 @changeGlobalInteger(i32 42)
ret void
}
/* Variables and functions */
char *calloc(int, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
int system(char *);
void *play(void *arg) {
  char *cmd = calloc(1, 128);
  snprintf(cmd, 128, "./madplay %s -a -20 &", (char *)arg);
  int ret = system(cmd);
  printf("ret: %d\n", ret);
}


x86 assembly (clang, -O0):
<play>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x1,%edi
mov    $0x80,%esi
call   1060 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x80,%esi
lea    0xe8d(%rip),%rdx
call   1050 <snprintf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <system@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xe88(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<play>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x1,%edi
mov    $0x80,%esi
call   1060 <calloc@plt>
mov    %rax,%rbx
lea    0xea0(%rip),%rdx
mov    %rax,%rdi
mov    $0x80,%esi
mov    %r14,%rcx
call   1050 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
lea    0xe97(%rip),%rdi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"./madplay %s -a -20 &\00"
@.str.1 = [9 x i8] c"ret: %d\0A\00"
define i8* @play(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
%6 = call i8* @calloc(i32 1, i32 128)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = load i8*, i8** %3
%9 = call i32 @snprintf(i8* %7, i32 128, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i8*, i8** %4
%11 = call i32 @system(i8* %10)
store i32 %11, i32* %5
%12 = load i32, i32* %5
%13 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = load i8*, i8** %2
ret i8* %14
}

LLVM IR (-O2):
@.str = [22 x i8] c"./madplay %s -a -20 &\00"
@.str.1 = [9 x i8] c"ret: %d\0A\00"
define noalias i8* @play(i8* %0) {
%2 = tail call dereferenceable_or_null(128) i8* @calloc(i32 1, i32 128)
%3 = tail call i32 @snprintf(i8* %2, i32 128, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @system(i8* %2)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i8* undef
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ display;
};
struct TYPE_4__ {
  TYPE_1__ xcreatewindow;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void *get_XEvent_xcreatewindow_display(void *_p) {
  return (void *)((XEvent *)_p)->xcreatewindow.display;
}


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

x86 assembly (clang, -O2):
<get_XEvent_xcreatewindow_display>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i8* @get_XEvent_xcreatewindow_display(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}

LLVM IR (-O2):
define i8* @get_XEvent_xcreatewindow_display(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
scalar_t__ islower(int);
int toupper(int c) { return islower(c) ? c - 'a' + 'A' : c; }


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     113e <toupper+0x2e>
mov    -0x4(%rbp),%eax
sub    $0x61,%eax
add    $0x41,%eax
mov    %eax,-0x8(%rbp)
jmp    1144 <toupper+0x34>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <islower@plt>
lea    -0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @islower(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 97
%9 = add nsw i32 %8, 65
br label %12
10: ; preds = %1
%11 = load i32, i32* %2
br label %12
12: ; preds = %10, %6
%13 = phi i32 [ %9, %6 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = tail call i64 @islower(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
void INT_Excep_ICU_IRQ11(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ kputnum(int /*<<< orphan*/, int);
void kputhex(int32_t _num) { kputnum(_num, 16); }


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

x86 assembly (clang, -O2):
<kputhex>:
mov    $0x10,%esi
jmp    1030 <kputnum@plt>

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

LLVM IR (-O2):
define void @kputhex(i32 %0) {
%2 = tail call i32 @kputnum(i32 %0, i32 16)
ret void
}