xunge/DecIR huggingface dataset:
void uppercase(ch) char *ch;
{ (*ch) = (isupper(*ch) ? (*ch) : toupper(*ch)); }


x86 assembly (clang, -O0):
<uppercase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isupper@plt>
cmp    $0x0,%eax
je     1150 <uppercase+0x30>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    115f <uppercase+0x3f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uppercase>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
movsbl (%rdi),%ebp
mov    %ebp,%edi
call   1040 <isupper@plt>
test   %eax,%eax
jne    113d <uppercase+0x1d>
mov    %ebp,%edi
call   1030 <toupper@plt>
mov    %eax,%ebp
mov    %bpl,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @uppercase(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = call i32 @isupper(i32 %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
br label %17
12: ; preds = %1
%13 = load i8*, i8** %2
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = call i32 @toupper(i32 %15)
br label %17
17: ; preds = %12, %8
%18 = phi i32 [ %11, %8 ], [ %16, %12 ]
%19 = trunc i32 %18 to i8
%20 = load i8*, i8** %2
store i8 %19, i8* %20
ret void
}

LLVM IR (-O2):
define void @uppercase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = tail call i32 @isupper(i32 %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @toupper(i32 %3)
br label %8
8: ; preds = %1, %6
%9 = phi i32 [ %7, %6 ], [ %3, %1 ]
%10 = trunc i32 %9 to i8
store i8 %10, i8* %0
ret void
}
/* Variables and functions */
char getchar();
scalar_t__ isalpha(char);
int /*<<< orphan*/ putchar(char);
int main(int argc, char const *argv[]) {
  char ch;
  while ((ch = getchar()) != '\n') {
    if (isalpha(ch))
      putchar(ch + 1);
    else
      putchar(ch);
  }
  putchar(ch);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x11(%rbp)
movsbl %al,%eax
cmp    $0xa,%eax
je     1191 <main+0x61>
movsbl -0x11(%rbp),%edi
call   1050 <isalpha@plt>
cmp    $0x0,%rax
je     1183 <main+0x53>
movsbl -0x11(%rbp),%eax
add    $0x1,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    118c <main+0x5c>
movsbl -0x11(%rbp),%edi
call   1030 <putchar@plt>
jmp    1146 <main+0x16>
movsbl -0x11(%rbp),%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%al
je     1166 <main+0x36>
movsbl %al,%ebx
mov    %ebx,%edi
call   1050 <isalpha@plt>
cmp    $0x1,%rax
sbb    $0xff,%bl
movsbl %bl,%edi
call   1030 <putchar@plt>
jmp    1140 <main+0x10>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call signext i8 (...) @getchar()
%4 = icmp eq i8 %3, 10
br i1 %4, label %14, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %12, %5 ], [ %3, %2 ]
%7 = tail call i64 @isalpha(i8 signext %6)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i8
%10 = add i8 %6, %9
%11 = tail call i32 @putchar(i8 signext %10)
%12 = tail call signext i8 (...) @getchar()
%13 = icmp eq i8 %12, 10
br i1 %13, label %14, label %5
14: ; preds = %5, %2
%15 = tail call i32 @putchar(i8 signext 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
int /*<<< orphan*/ g(int);
void main() {
  f(1);
  if (1) {
    g(1);
  } else {
    g(1);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <f@plt>
mov    $0x1,%edi
call   1040 <g@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <f@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <g@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 @f(i32 1)
%2 = call i32 @g(i32 1)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @f(i32 1)
%2 = tail call i32 @g(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char const *,
                           char *);
int /*<<< orphan*/ stderr;
char *strerror(int);
void die_with_std_error(const char *message, int errnum) {
  char *cause = strerror(errnum);
  fprintf(stderr, "%s%s\ncause: %s", "disl-agent: error: ", message, cause);
  exit(10002);
}


x86 assembly (clang, -O0):
<die_with_std_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <strerror@plt>
mov    %rax,-0x18(%rbp)
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0xe9d(%rip),%rsi
lea    0xea5(%rip),%rdx
call   1030 <fprintf@plt>
mov    $0x2712,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die_with_std_error>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1050 <strerror@plt>
mov    0x2e9e(%rip),%rcx
mov    (%rcx),%edi
lea    0xeb5(%rip),%rsi
lea    0xebd(%rip),%rdx
mov    %rbx,%rcx
mov    %rax,%r8
call   1030 <fprintf@plt>
mov    $0x2712,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"%s%s\0Acause: %s\00"
@.str.1 = [20 x i8] c"disl-agent: error: \00"
define void @die_with_std_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = call i8* @strerror(i32 %6)
store i8* %7, i8** %5
%8 = load i32, i32* @stderr
%9 = load i8*, i8** %3
%10 = load i8*, i8** %5
%11 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %9, i8* %10)
%12 = call i32 @exit(i32 10002)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"%s%s\0Acause: %s\00"
@.str.1 = [20 x i8] c"disl-agent: error: \00"
define void @die_with_std_error(i8* %0, i32 %1) {
%3 = tail call i8* @strerror(i32 %1)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %3)
%6 = tail call i32 @exit(i32 10002)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ yylex();
int main() { yylex(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @yylex()
ret i32 0
}
int ds92lx1621_remove(struct i2c_client *client) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.i2c_client = type opaque
define i32 @ds92lx1621_remove(%struct.i2c_client* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
struct list {
  int dummy;
};

/* Variables and functions */
int list_index(struct list *, int (*)(void *, void *), void *);
short int list_exists(struct list *list, int (*object_compare)(void *, void *),
                      void *object) {
  return list_index(list, object_compare, object) == -1 ? 0 : 1;
}


x86 assembly (clang, -O0):
<list_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <list_index@plt>
mov    %eax,%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0xffffffff,%edx
cmove  %ecx,%eax
cwtl
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_exists>:
push   %rax
call   1030 <list_index@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.list = type { i32 }
define signext i16 @list_exists(%struct.list* %0, i32 (i8*, i8*)* %1, i8* %2) {
%4 = alloca %struct.list*
%5 = alloca i32 (i8*, i8*)*
%6 = alloca i8*
store %struct.list* %0, %struct.list** %4
store i32 (i8*, i8*)* %1, i32 (i8*, i8*)** %5
store i8* %2, i8** %6
%7 = load %struct.list*, %struct.list** %4
%8 = load i32 (i8*, i8*)*, i32 (i8*, i8*)** %5
%9 = load i8*, i8** %6
%10 = call i32 @list_index(%struct.list* %7, i32 (i8*, i8*)* %8, i8* %9)
%11 = icmp eq i32 %10, -1
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 0, i32 1
%14 = trunc i32 %13 to i16
ret i16 %14
}

LLVM IR (-O2):
%struct.list = type { i32 }
define signext i16 @list_exists(%struct.list* %0, i32 (i8*, i8*)* %1, i8* %2) {
%4 = tail call i32 @list_index(%struct.list* %0, i32 (i8*, i8*)* %1, i8* %2)
%5 = icmp ne i32 %4, -1
%6 = zext i1 %5 to i16
ret i16 %6
}
/* Variables and functions */
int countFields(char *, char);
char **malloc(int);
int /*<<< orphan*/ str_split(char *, char, char **);
char **parseCommand(char *cmd, int *num_of_fields) {
  *num_of_fields = countFields(cmd, ' ');
  char **fields = malloc(sizeof(char *) * (*num_of_fields));
  str_split(cmd, ' ', fields);
  return fields;
}


x86 assembly (clang, -O0):
<parseCommand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x20,%esi
call   1030 <countFields@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
movslq (%rax),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x20,%esi
call   1040 <str_split@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseCommand>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    $0x20,%esi
call   1030 <countFields@plt>
mov    %eax,(%r14)
lea    0x0(,%rax,8),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    $0x20,%esi
mov    %rax,%rdx
call   1040 <str_split@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8** @parseCommand(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i8**
store i8* %0, i8** %3
store i32* %1, i32** %4
%6 = load i8*, i8** %3
%7 = call i32 @countFields(i8* %6, i8 signext 32)
%8 = load i32*, i32** %4
store i32 %7, i32* %8
%9 = load i32*, i32** %4
%10 = load i32, i32* %9
%11 = sext i32 %10 to i64
%12 = mul i64 8, %11
%13 = trunc i64 %12 to i32
%14 = call i8** @malloc(i32 %13)
store i8** %14, i8*** %5
%15 = load i8*, i8** %3
%16 = load i8**, i8*** %5
%17 = call i32 @str_split(i8* %15, i8 signext 32, i8** %16)
%18 = load i8**, i8*** %5
ret i8** %18
}

LLVM IR (-O2):
define i8** @parseCommand(i8* %0, i32* nocapture writeonly %1) {
%3 = tail call i32 @countFields(i8* %0, i8 signext 32)
store i32 %3, i32* %1
%4 = shl i32 %3, 3
%5 = tail call i8** @malloc(i32 %4)
%6 = tail call i32 @str_split(i8* %0, i8 signext 32, i8** %5)
ret i8** %5
}
/* Variables and functions */
int /*<<< orphan*/ A_NORMAL;
int /*<<< orphan*/ COLOR_PAIR(int /*<<< orphan*/);
int /*<<< orphan*/ COLOR_WHITE;
int /*<<< orphan*/ attrset(int /*<<< orphan*/);
int /*<<< orphan*/ mvaddstr(int /*<<< orphan*/, int /*<<< orphan*/, char *);
void editor_draw_filename(char *file) {
  attrset(COLOR_PAIR(COLOR_WHITE));
  mvaddstr(0, 0, file);
  attrset(A_NORMAL);
}


x86 assembly (clang, -O0):
<editor_draw_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1030 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1040 <attrset@plt>
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
mov    %esi,%edi
call   1050 <mvaddstr@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
call   1040 <attrset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<editor_draw_filename>:
push   %rbx
mov    %rdi,%rbx
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1030 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1040 <attrset@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    %rbx,%rdx
call   1050 <mvaddstr@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
pop    %rbx
jmp    1040 <attrset@plt>

LLVM IR (-O0):
@COLOR_WHITE = global i32 0
@A_NORMAL = global i32 0
define void @editor_draw_filename(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @COLOR_WHITE
%4 = call i32 @COLOR_PAIR(i32 %3)
%5 = call i32 @attrset(i32 %4)
%6 = load i8*, i8** %2
%7 = call i32 @mvaddstr(i32 0, i32 0, i8* %6)
%8 = load i32, i32* @A_NORMAL
%9 = call i32 @attrset(i32 %8)
ret void
}

LLVM IR (-O2):
@COLOR_WHITE = global i32 0
@A_NORMAL = global i32 0
define void @editor_draw_filename(i8* %0) {
%2 = load i32, i32* @COLOR_WHITE
%3 = tail call i32 @COLOR_PAIR(i32 %2)
%4 = tail call i32 @attrset(i32 %3)
%5 = tail call i32 @mvaddstr(i32 0, i32 0, i8* %0)
%6 = load i32, i32* @A_NORMAL
%7 = tail call i32 @attrset(i32 %6)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ __infer_nondet_int();
wint_t putwc(wchar_t c, FILE *stream) { return __infer_nondet_int(); }


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

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

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

LLVM IR (-O2):
define i32 @putwc(i32 %0, i32* nocapture readnone %1) {
%3 = tail call i32 (...) @__infer_nondet_int()
ret i32 %3
}
int fig_ign(int figlen, unsigned char *fig) { return 0; }


x86 assembly (clang, -O0):
<fig_ign>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @fig_ign(i32 %0, i8* nocapture readnone %1) {
ret i32 0
}
int test(int X) { return X; }


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

x86 assembly (clang, -O2):
<test>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @test(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ XIconSize;

/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ malloc(int);
void *alloc_XIconSize(void) {
  XIconSize *_p = (XIconSize *)malloc(sizeof(XIconSize));
  if (_p == NULL)
    abort();
  return (void *)_p;
}


x86 assembly (clang, -O0):
<alloc_XIconSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1148 <alloc_XIconSize+0x28>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_XIconSize>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1132 <alloc_XIconSize+0x12>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @alloc_XIconSize() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
%9 = load i32*, i32** %1
%10 = bitcast i32* %9 to i8*
ret i8* %10
}

LLVM IR (-O2):
define i8* @alloc_XIconSize() {
%1 = tail call i64 @malloc(i32 4)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = inttoptr i64 %1 to i8*
ret i8* %6
}
int nfs4_state_start(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @nfs4_state_start() {
ret i32 0
}
int false_contigs(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @false_contigs() {
ret i32 1
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _HibernateWriteComplete();
void HibernateRTCMatchSet(uint32_t ui32Match, uint32_t ui32Value) {
  ;
  (*((volatile unsigned long *)(0x400FC004))) = ui32Value;
  _HibernateWriteComplete();
}


x86 assembly (clang, -O0):
<HibernateRTCMatchSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    $0x400fc004,%eax
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <_HibernateWriteComplete@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateRTCMatchSet>:
mov    %rsi,0x400fc004
40
xor    %eax,%eax
jmp    1030 <_HibernateWriteComplete@plt>

LLVM IR (-O0):
define void @HibernateRTCMatchSet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
store volatile i64 %5, i64* inttoptr (i64 1074774020 to i64*)
%6 = call i32 (...) @_HibernateWriteComplete()
ret void
}

LLVM IR (-O2):
define void @HibernateRTCMatchSet(i64 %0, i64 %1) {
store volatile i64 %1, i64* inttoptr (i64 1074774020 to i64*)
%3 = tail call i32 (...) @_HibernateWriteComplete()
ret void
}
/* Variables and functions */
int updateColour(char *, char *);
int updateUlColour(char *value) { return updateColour(value, "web.colour_ul"); }


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

x86 assembly (clang, -O2):
<updateUlColour>:
lea    0xee9(%rip),%rsi
jmp    1030 <updateColour@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"web.colour_ul\00"
define i32 @updateUlColour(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @updateColour(i8* %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
@.str = [14 x i8] c"web.colour_ul\00"
define i32 @updateUlColour(i8* %0) {
%2 = tail call i32 @updateColour(i8* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
int test_imm_B9int16_reg(short val) {
  return ((val) & (0xB9 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B9int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xb9,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_B9int16_reg(i16 signext %0) {
%2 = and i16 %0, 185
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fesetround(int);
void change_rounding(int rounding_mode) { fesetround(rounding_mode); }


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

x86 assembly (clang, -O2):
<change_rounding>:
jmp    1030 <fesetround@plt>

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

LLVM IR (-O2):
define void @change_rounding(i32 %0) {
%2 = tail call i32 @fesetround(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void textcolor(int color) { printf("\033[%02dm", color + 30); }


x86 assembly (clang, -O0):
<textcolor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
add    $0x1e,%esi
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<textcolor>:
lea    0x1e(%rdi),%esi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"\1B[%02dm\00"
define void @textcolor(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 30
%5 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"\1B[%02dm\00"
define void @textcolor(i32 %0) {
%2 = add nsw i32 %0, 30
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_io_bit(int, int);
void TOSH_SET_ONE_WIRE_PIN() { set_io_bit(0x70, 5); }


x86 assembly (clang, -O0):
<TOSH_SET_ONE_WIRE_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0x70,%edi
mov    $0x5,%esi
call   1030 <set_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_SET_ONE_WIRE_PIN>:
mov    $0x70,%edi
mov    $0x5,%esi
jmp    1030 <set_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_SET_ONE_WIRE_PIN() {
%1 = call i32 @set_io_bit(i32 112, i32 5)
ret void
}

LLVM IR (-O2):
define void @TOSH_SET_ONE_WIRE_PIN() {
%1 = tail call i32 @set_io_bit(i32 112, i32 5)
ret void
}
void counter$output$output(int arg_0x82b4c28) {
  int_to_leds_m$input$output(arg_0x82b4c28);
  int_to_rfm_m$input$output(arg_0x82b4c28);
}


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

x86 assembly (clang, -O2):
<counter$output$output>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <int_to_leds_m$input$output@plt>
mov    %ebx,%edi
xor    %eax,%eax
pop    %rbx
jmp    1040 <int_to_rfm_m$input$output@plt>

LLVM IR (-O0):
define void @"counter$output$output"(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, ...) bitcast (i32 (...)* @"int_to_leds_m$input$output" to i32 (i32, ...)*)(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 (i32, ...) bitcast (i32 (...)* @"int_to_rfm_m$input$output" to i32 (i32, ...)*)(i32 %5)
ret void
}

LLVM IR (-O2):
define void @"counter$output$output"(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @"int_to_leds_m$input$output" to i32 (i32, ...)*)(i32 %0)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @"int_to_rfm_m$input$output" to i32 (i32, ...)*)(i32 %0)
ret void
}
/* Type definitions */
struct index_packet {
  int dummy;
};

/* Variables and functions */
int pgwrite_big_endian(unsigned char *, struct index_packet *);
int pgwrite_little_endian(unsigned char *, struct index_packet *);
int flatpack__pgwrite(unsigned char *page, struct index_packet *source,
                      int little_endian) {
  if (little_endian)
    return pgwrite_little_endian(page, source);
  else
    return pgwrite_big_endian(page, source);
}


x86 assembly (clang, -O0):
<flatpack__pgwrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1152 <flatpack__pgwrite+0x32>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <pgwrite_little_endian@plt>
mov    %eax,-0x4(%rbp)
jmp    1162 <flatpack__pgwrite+0x42>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <pgwrite_big_endian@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flatpack__pgwrite>:
test   %edx,%edx
je     1129 <flatpack__pgwrite+0x9>
jmp    1030 <pgwrite_little_endian@plt>
jmp    1040 <pgwrite_big_endian@plt>

LLVM IR (-O0):
%struct.index_packet = type { i32 }
define i32 @flatpack__pgwrite(i8* %0, %struct.index_packet* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca %struct.index_packet*
%7 = alloca i32
store i8* %0, i8** %5
store %struct.index_packet* %1, %struct.index_packet** %6
store i32 %2, i32* %7
%8 = load i32, i32* %7
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load i8*, i8** %5
%12 = load %struct.index_packet*, %struct.index_packet** %6
%13 = call i32 @pgwrite_little_endian(i8* %11, %struct.index_packet* %12)
store i32 %13, i32* %4
br label %18
14: ; preds = %3
%15 = load i8*, i8** %5
%16 = load %struct.index_packet*, %struct.index_packet** %6
%17 = call i32 @pgwrite_big_endian(i8* %15, %struct.index_packet* %16)
store i32 %17, i32* %4
br label %18
18: ; preds = %14, %10
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
%struct.index_packet = type { i32 }
define i32 @flatpack__pgwrite(i8* %0, %struct.index_packet* %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @pgwrite_little_endian(i8* %0, %struct.index_packet* %1)
br label %9
7: ; preds = %3
%8 = tail call i32 @pgwrite_big_endian(i8* %0, %struct.index_packet* %1)
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
ret i32 %10
}
/* Type definitions */
struct rpc {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ eval_rpc(double *, struct rpc *, double, double, double);
void rpc_localization(double lonlat[2], struct rpc *r, double ijh[3]) {
  eval_rpc(lonlat, r, ijh[0], ijh[1], ijh[2]);
}


x86 assembly (clang, -O0):
<rpc_localization>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm2
call   1030 <eval_rpc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpc_localization>:
movsd  (%rdx),%xmm0
movsd  0x8(%rdx),%xmm1
movsd  0x10(%rdx),%xmm2
jmp    1030 <eval_rpc@plt>

LLVM IR (-O0):
%struct.rpc = type { i32 }
define void @rpc_localization(double* %0, %struct.rpc* %1, double* %2) {
%4 = alloca double*
%5 = alloca %struct.rpc*
%6 = alloca double*
store double* %0, double** %4
store %struct.rpc* %1, %struct.rpc** %5
store double* %2, double** %6
%7 = load double*, double** %4
%8 = load %struct.rpc*, %struct.rpc** %5
%9 = load double*, double** %6
%10 = getelementptr inbounds double, double* %9, i64 0
%11 = load double, double* %10
%12 = load double*, double** %6
%13 = getelementptr inbounds double, double* %12, i64 1
%14 = load double, double* %13
%15 = load double*, double** %6
%16 = getelementptr inbounds double, double* %15, i64 2
%17 = load double, double* %16
%18 = call i32 @eval_rpc(double* %7, %struct.rpc* %8, double %11, double %14, double %17)
ret void
}

LLVM IR (-O2):
%struct.rpc = type { i32 }
define void @rpc_localization(double* %0, %struct.rpc* %1, double* nocapture %2) {
%4 = load double, double* %2
%5 = getelementptr inbounds double, double* %2, i64 1
%6 = load double, double* %5
%7 = getelementptr inbounds double, double* %2, i64 2
%8 = load double, double* %7
%9 = tail call i32 @eval_rpc(double* %0, %struct.rpc* %1, double %4, double %6, double %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ printf(char *, char const *);
void die(const char *msg) {
  printf("ERROR: %s \n", msg);
  _exit(-1);
}


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"ERROR: %s \0A\00"
define void @die(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @_exit(i32 -1)
unreachable
}
int greatest_common_divisor(int x, int y) {
  int a = x;
  int b = y;
  int t = b % a;
  while (t > 0) {
    b = a;
    a = t;
    t = b % a;
  }
  return a;
}


x86 assembly (clang, -O0):
<greatest_common_divisor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1145 <greatest_common_divisor+0x45>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x14(%rbp)
jmp    1120 <greatest_common_divisor+0x20>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<greatest_common_divisor>:
mov    %esi,%eax
cltd
idiv   %edi
test   %edx,%edx
jle    1120 <greatest_common_divisor+0x20>
nopl   0x0(%rax)
mov    %edx,%ecx
mov    %edi,%eax
cltd
idiv   %ecx
mov    %ecx,%edi
test   %edx,%edx
jg     1110 <greatest_common_divisor+0x10>
mov    %ecx,%eax
ret
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @greatest_common_divisor(i32 %0, i32 %1) {
%3 = srem i32 %1, %0
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %2, %5
%6 = phi i32 [ %8, %5 ], [ %3, %2 ]
%7 = phi i32 [ %6, %5 ], [ %0, %2 ]
%8 = srem i32 %7, %6
%9 = icmp sgt i32 %8, 0
br i1 %9, label %5, label %10
10: ; preds = %5, %2
%11 = phi i32 [ %0, %2 ], [ %6, %5 ]
ret i32 %11
}
/* Variables and functions */
int inb(int);
int /*<<< orphan*/ outb(int, int);
void disable_irq(unsigned char channel) {
  if (channel > 7)
    outb(0xA1, inb(0xA1) | (1 << (channel - 8)));
  else
    outb(0x21, inb(0x21) | (1 << channel));
}


x86 assembly (clang, -O0):
<disable_irq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x7,%eax
jle    1166 <disable_irq+0x46>
mov    $0xa1,%edi
call   1040 <inb@plt>
mov    %eax,%esi
movzbl -0x1(%rbp),%ecx
sub    $0x8,%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     %eax,%esi
mov    $0xa1,%edi
call   1030 <outb@plt>
jmp    1189 <disable_irq+0x69>
mov    $0x21,%edi
call   1040 <inb@plt>
mov    %eax,%esi
movzbl -0x1(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     %eax,%esi
mov    $0x21,%edi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disable_irq>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
cmp    $0x8,%bl
jb     113e <disable_irq+0x1e>
mov    $0xa1,%ebp
mov    $0xa1,%edi
call   1040 <inb@plt>
add    $0xfffffff8,%ebx
jmp    114d <disable_irq+0x2d>
mov    $0x21,%ebp
mov    $0x21,%edi
call   1040 <inb@plt>
bts    %ebx,%eax
mov    %ebp,%edi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @disable_irq(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp sgt i32 %4, 7
br i1 %5, label %6, label %14
6: ; preds = %1
%7 = call i32 @inb(i32 161)
%8 = load i8, i8* %2
%9 = zext i8 %8 to i32
%10 = sub nsw i32 %9, 8
%11 = shl i32 1, %10
%12 = or i32 %7, %11
%13 = call i32 @outb(i32 161, i32 %12)
br label %21
14: ; preds = %1
%15 = call i32 @inb(i32 33)
%16 = load i8, i8* %2
%17 = zext i8 %16 to i32
%18 = shl i32 1, %17
%19 = or i32 %15, %18
%20 = call i32 @outb(i32 33, i32 %19)
br label %21
21: ; preds = %14, %6
ret void
}

LLVM IR (-O2):
define void @disable_irq(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = icmp ugt i8 %0, 7
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @inb(i32 161)
%6 = add nsw i32 %2, -8
br label %9
7: ; preds = %1
%8 = tail call i32 @inb(i32 33)
br label %9
9: ; preds = %7, %4
%10 = phi i32 [ %2, %7 ], [ %6, %4 ]
%11 = phi i32 [ %8, %7 ], [ %5, %4 ]
%12 = phi i32 [ 33, %7 ], [ 161, %4 ]
%13 = shl nuw i32 1, %10
%14 = or i32 %11, %13
%15 = tail call i32 @outb(i32 %12, i32 %14)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ read(int, unsigned char *, int);
int /*<<< orphan*/ write(int, unsigned char *, int);
int programmer_reset(int port) {
  unsigned char receive;
  unsigned char command = 'Z';
  command = 1;
  write(port, &command, 1);
  read(port, &receive, 1);
  if (receive != 'Q') {
    ;
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<programmer_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movb   $0x5a,-0xa(%rbp)
movb   $0x1,-0xa(%rbp)
mov    -0x8(%rbp),%edi
lea    -0xa(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x8(%rbp),%edi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1040 <read@plt>
movzbl -0x9(%rbp),%eax
cmp    $0x51,%eax
je     116e <programmer_reset+0x4e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1175 <programmer_reset+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<programmer_reset>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
movb   $0x1,0xe(%rsp)
lea    0xe(%rsp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
lea    0xf(%rsp),%rsi
mov    %ebx,%edi
mov    $0x1,%edx
call   1040 <read@plt>
xor    %eax,%eax
cmpb   $0x51,0xf(%rsp)
setne  %al
neg    %eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @programmer_reset(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8
%5 = alloca i8
store i32 %0, i32* %3
store i8 90, i8* %5
store i8 1, i8* %5
%6 = load i32, i32* %3
%7 = call i32 @write(i32 %6, i8* %5, i32 1)
%8 = load i32, i32* %3
%9 = call i32 @read(i32 %8, i8* %4, i32 1)
%10 = load i8, i8* %4
%11 = zext i8 %10 to i32
%12 = icmp ne i32 %11, 81
br i1 %12, label %13, label %14
13: ; preds = %1
store i32 -1, i32* %2
br label %15
14: ; preds = %1
store i32 0, i32* %2
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @programmer_reset(i32 %0) {
%2 = alloca i8
%3 = alloca i8
store i8 1, i8* %3
%4 = call i32 @write(i32 %0, i8* %3, i32 1)
%5 = call i32 @read(i32 %0, i8* %2, i32 1)
%6 = load i8, i8* %2
%7 = icmp ne i8 %6, 81
%8 = sext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
double sin(double);
double sinc(double t) {
  if (!t)
    return 1.0;
  return sin(t) / t;
}


x86 assembly (clang, -O0):
<sinc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1147 <sinc+0x37>
jp     1147 <sinc+0x37>
movsd  0xec3(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115b <sinc+0x4b>
movsd  -0x10(%rbp),%xmm0
call   1030 <sin@plt>
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinc>:
push   %rax
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    111d <sinc+0xd>
jnp    112e <sinc+0x1e>
movsd  %xmm0,(%rsp)
call   1030 <sin@plt>
divsd  (%rsp),%xmm0
pop    %rax
ret
movsd  0xeca(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @sinc(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp une double %4, 0.000000e+00
br i1 %5, label %7, label %6
6: ; preds = %1
store double 1.000000e+00, double* %2
br label %12
7: ; preds = %1
%8 = load double, double* %3
%9 = call double @sin(double %8)
%10 = load double, double* %3
%11 = fdiv double %9, %10
store double %11, double* %2
br label %12
12: ; preds = %7, %6
%13 = load double, double* %2
ret double %13
}

LLVM IR (-O2):
define double @sinc(double %0) {
%2 = fcmp une double %0, 0.000000e+00
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call double @sin(double %0)
%5 = fdiv double %4, %0
br label %6
6: ; preds = %1, %3
%7 = phi double [ %5, %3 ], [ 1.000000e+00, %1 ]
ret double %7
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int wr_skip(int /*<<< orphan*/);
int tar_endwr(void) { return (wr_skip((off_t)(2 * 512))); }


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

x86 assembly (clang, -O2):
<tar_endwr>:
mov    $0x400,%edi
jmp    1030 <wr_skip@plt>

LLVM IR (-O0):
define i32 @tar_endwr() {
%1 = call i32 @wr_skip(i32 1024)
ret i32 %1
}

LLVM IR (-O2):
define i32 @tar_endwr() {
%1 = tail call i32 @wr_skip(i32 1024)
ret i32 %1
}
const char *response404() {
  char *response = "HTTP/1.1 404 not found\r\n"
                   "Server:WDLS/1.0.0(Unix)\r\n\r\n"
                   "<html><body><h>404</h></body></html>";
  return response;
}


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

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

LLVM IR (-O0):
@.str = [88 x i8] c"HTTP/1.1 404 not found\0D\0AServer:WDLS/1.0.0(Unix)\0D\0A\0D\0A<html><body><h>404</h></body></html>\00"
define i8* @response404() {
%1 = alloca i8*
store i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
@.str = [88 x i8] c"HTTP/1.1 404 not found\0D\0AServer:WDLS/1.0.0(Unix)\0D\0A\0D\0A<html><body><h>404</h></body></html>\00"
define i8* @response404() {
ret i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str, i64 0, i64 0)
}
int test_imm_8Bint16_mem(short *val) {
  return ((*val) & (-0x8B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_8Bint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0xffffff75,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_8Bint16_mem>:
movzwl (%rdi),%eax
test   $0xff75,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_8Bint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -139
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int c;
  int x, y;
  x = __VERIFIER_nondet_int();
  y = __VERIFIER_nondet_int();
  c = 0;
  while ((x > 0) && (y > 0)) {
    x = x - 1;
    y = y - 1;
    c = c + 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0x11(%rbp)
jle    1153 <main+0x43>
cmpl   $0x0,-0x10(%rbp)
setg   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1163 <main+0x53>
jmp    1183 <main+0x73>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113a <main+0x2a>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Variables and functions */
char *kore_malloc(size_t);
int /*<<< orphan*/ kore_strlcpy(char *, char const *, size_t);
int strlen(char const *);
char *kore_strdup(const char *str) {
  size_t len;
  char *nstr;
  len = strlen(str) + 1;
  nstr = kore_malloc(len);
  kore_strlcpy(nstr, str, len);
  return (nstr);
}


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

x86 assembly (clang, -O2):
<kore_strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1030 <kore_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1050 <kore_strlcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @kore_strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @kore_malloc(i64 %4)
%6 = tail call i32 @kore_strlcpy(i8* %5, i8* %0, i64 %4)
ret i8* %5
}
int foo(float x) { return __builtin_log((double)x); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <log@plt>
cvttsd2si %xmm0,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
cvtss2sd %xmm0,%xmm0
call   1030 <log@plt>
cvttsd2si %xmm0,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @foo(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call double @log(double %4)
%6 = fptosi double %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @foo(float %0) {
%2 = fpext float %0 to double
%3 = tail call double @log(double %2)
%4 = fptosi double %3 to i32
ret i32 %4
}
int g3_isOnBoard(int i, int j) { return i >= 0 && j >= 0 && j < 7 && i < 6; }


x86 assembly (clang, -O0):
<g3_isOnBoard>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x9(%rbp)
jl     1141 <g3_isOnBoard+0x41>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jl     1141 <g3_isOnBoard+0x41>
xor    %eax,%eax
cmpl   $0x7,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jge    1141 <g3_isOnBoard+0x41>
cmpl   $0x6,-0x4(%rbp)
setl   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g3_isOnBoard>:
mov    %esi,%eax
or     %edi,%eax
setns  %al
cmp    $0x7,%esi
setl   %cl
and    %al,%cl
cmp    $0x6,%edi
setl   %al
and    %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @g3_isOnBoard(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 = icmp sge i32 %5, 0
br i1 %6, label %7, label %16
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp sge i32 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %7
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 7
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i32, i32* %3
%15 = icmp slt i32 %14, 6
br label %16
16: ; preds = %13, %10, %7, %2
%17 = phi i1 [ false, %10 ], [ false, %7 ], [ false, %2 ], [ %15, %13 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @g3_isOnBoard(i32 %0, i32 %1) {
%3 = or i32 %1, %0
%4 = icmp sgt i32 %3, -1
%5 = icmp slt i32 %1, 7
%6 = and i1 %5, %4
%7 = icmp slt i32 %0, 6
%8 = and i1 %7, %6
%9 = zext i1 %8 to i32
ret i32 %9
}
void X509_NAME_get_index_by_NID(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_NAME_get_index_by_NID() {
ret void
}
void av_sha_alloc() {}


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

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

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

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