xunge/DecIR huggingface dataset:
void rop3_167_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = S | T;
  stk2 = *D & stk3;
  stk1 = T ^ stk2;
  stk1 = ~stk1;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_167_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xa(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_167_0_0>:
or     %edx,%esi
and    (%rdi),%sil
xor    %dl,%sil
not    %sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_167_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = load i8, i8* %6
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %9
%16 = load i8*, i8** %4
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = and i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8, i8* %6
%24 = zext i8 %23 to i32
%25 = load i8, i8* %8
%26 = zext i8 %25 to i32
%27 = xor i32 %24, %26
%28 = trunc i32 %27 to i8
store i8 %28, i8* %7
%29 = load i8, i8* %7
%30 = zext i8 %29 to i32
%31 = xor i32 %30, -1
%32 = trunc i32 %31 to i8
store i8 %32, i8* %7
%33 = load i8, i8* %7
%34 = load i8*, i8** %4
store i8 %33, i8* %34
ret void
}

LLVM IR (-O2):
define void @rop3_167_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = or i8 %2, %1
%5 = load i8, i8* %0
%6 = and i8 %5, %4
%7 = xor i8 %6, %2
%8 = xor i8 %7, -1
store i8 %8, i8* %0
ret void
}
/* Type definitions */
struct forth_runtime_context {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ forth_open_or_create_file(struct forth_runtime_context *,
                                             int /*<<< orphan*/);
void forth_open_file(struct forth_runtime_context *rctx) {
  forth_open_or_create_file(rctx, 0);
}


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

x86 assembly (clang, -O2):
<forth_open_file>:
xor    %esi,%esi
jmp    1030 <forth_open_or_create_file@plt>

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

LLVM IR (-O2):
%struct.forth_runtime_context = type { i32 }
define void @forth_open_file(%struct.forth_runtime_context* %0) {
%2 = tail call i32 @forth_open_or_create_file(%struct.forth_runtime_context* %0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void Apigee_protobuf_c_out_of_memory_default(void) {
  fprintf(stderr, "Out Of Memory!!!\n");
  abort();
}


x86 assembly (clang, -O0):
<Apigee_protobuf_c_out_of_memory_default>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<Apigee_protobuf_c_out_of_memory_default>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"Out Of Memory!!!\0A\00"
define void @Apigee_protobuf_c_out_of_memory_default() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"Out Of Memory!!!\0A\00"
define void @Apigee_protobuf_c_out_of_memory_default() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ X509;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int ASN1_item_i2d(int /*<<< orphan*/ *, unsigned char **, int /*<<< orphan*/ *);
int /*<<< orphan*/ X509_it;
int i2d_X509(X509 *a, unsigned char **out) {
  return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_it);
}


x86 assembly (clang, -O0):
<i2d_X509>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2eb9(%rip),%rdx
call   1030 <ASN1_item_i2d@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2d_X509>:
mov    0x2ed1(%rip),%rdx
jmp    1030 <ASN1_item_i2d@plt>

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

LLVM IR (-O2):
@X509_it = global i32 0
define i32 @i2d_X509(i32* %0, i8** %1) {
%3 = tail call i32 @ASN1_item_i2d(i32* %0, i8** %1, i32* @X509_it)
ret i32 %3
}
/* Variables and functions */
int EOF;
int getchar();
void supprimerSuite(char caractereRecherche) {
  int caractere;
  while ((caractere = getchar()) != caractereRecherche && caractere != EOF) {
  }
}


x86 assembly (clang, -O0):
<supprimerSuite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,%ecx
mov    %ecx,-0x8(%rbp)
movsbl -0x1(%rbp),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x9(%rbp)
je     114d <supprimerSuite+0x3d>
mov    -0x8(%rbp),%eax
mov    0x2ea3(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    115d <supprimerSuite+0x4d>
jmp    1162 <supprimerSuite+0x52>
jmp    111e <supprimerSuite+0xe>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<supprimerSuite>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2ecb(%rip),%r14
nopl   (%rax)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    %ebx,%eax
je     1130 <supprimerSuite+0x20>
cmp    (%r14),%eax
jne    1120 <supprimerSuite+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i32 0
define void @supprimerSuite(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
br label %4
4: ; preds = %15, %1
%5 = call i32 (...) @getchar()
store i32 %5, i32* %3
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %5, %7
br i1 %8, label %9, label %13
9: ; preds = %4
%10 = load i32, i32* %3
%11 = load i32, i32* @EOF
%12 = icmp ne i32 %10, %11
br label %13
13: ; preds = %9, %4
%14 = phi i1 [ false, %4 ], [ %12, %9 ]
br i1 %14, label %15, label %16
15: ; preds = %13
br label %4
16: ; preds = %13
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @supprimerSuite(i8 signext %0) {
%2 = sext i8 %0 to i32
br label %3
3: ; preds = %3, %1
%4 = tail call i32 (...) @getchar()
%5 = icmp ne i32 %4, %2
%6 = load i32, i32* @EOF
%7 = icmp ne i32 %4, %6
%8 = select i1 %5, i1 %7, i1 false
br i1 %8, label %3, label %9
9: ; preds = %3
ret void
}
int sys_sync() {}


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

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

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

LLVM IR (-O2):
define i32 @sys_sync() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ stop_timers();
void c_stop_timers() { stop_timers(); }


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

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

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

LLVM IR (-O2):
define void @c_stop_timers() {
%1 = tail call i32 (...) @stop_timers()
ret void
}
/* Type definitions */
struct utsname {
  char *machine;
};

/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ uname(struct utsname *);
int main(void) {
  struct utsname utsbuf;
  if (uname(&utsbuf)) {
    perror("arch");
    return 1;
  }
  printf("%s\n", utsbuf.machine);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
call   1040 <uname@plt>
cmp    $0x0,%rax
je     116a <main+0x3a>
lea    0xea7(%rip),%rdi
call   1050 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1181 <main+0x51>
mov    -0x10(%rbp),%rsi
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rdi
call   1040 <uname@plt>
test   %rax,%rax
jne    1152 <main+0x22>
mov    (%rsp),%rsi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xea7(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.utsname = type { i8* }
@.str = [5 x i8] c"arch\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.utsname
store i32 0, i32* %1
%3 = call i64 @uname(%struct.utsname* %2)
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %1
br label %11
7: ; preds = %0
%8 = getelementptr inbounds %struct.utsname, %struct.utsname* %2, i32 0, i32 0
%9 = load i8*, i8** %8
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %9)
store i32 0, i32* %1
br label %11
11: ; preds = %7, %5
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
%struct.utsname = type { i8* }
@.str = [5 x i8] c"arch\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca %struct.utsname
%2 = bitcast %struct.utsname* %1 to i8*
%3 = call i64 @uname(%struct.utsname* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %11
7: ; preds = %0
%8 = getelementptr inbounds %struct.utsname, %struct.utsname* %1, i64 0, i32 0
%9 = load i8*, i8** %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %7, %5
%12 = phi i32 [ 1, %5 ], [ 0, %7 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverse(char *, int /*<<< orphan*/, scalar_t__);
scalar_t__ strlen(char *);
int main() {
  char test[] = "test";
  reverse(test, 0, strlen(test) - 1);
  printf("%s\n", test);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xebb(%rip),%eax
mov    %eax,-0x9(%rbp)
mov    0xeb6(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0x9(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x9(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %rax,%rdx
sub    $0x1,%rdx
xor    %esi,%esi
call   1030 <reverse@plt>
lea    -0x9(%rbp),%rsi
lea    0xe86(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movb   $0x0,0xc(%rsp)
movl   $0x74736574,0x8(%rsp)
74
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    -0x1(%rax),%rdx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <reverse@plt>
lea    0xea1(%rip),%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.test = [5 x i8] c"test\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i8]
store i32 0, i32* %1
%3 = bitcast [5 x i8]* %2 to i8*
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%6 = call i64 @strlen(i8* %5)
%7 = sub nsw i64 %6, 1
%8 = call i32 @reverse(i8* %4, i32 0, i64 %7)
%9 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.test = [5 x i8] c"test\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = call i64 @strlen(i8* %2)
%4 = add nsw i64 %3, -1
%5 = call i32 @reverse(i8* %2, i32 0, i64 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ ppuSetNameTblHorizontal();
int /*<<< orphan*/ ppuSetNameTblVertical();
void m65setParams9001(uint16_t addr, uint8_t val) {
  (void)addr;
  if (val & 0x80)
    ppuSetNameTblHorizontal();
  else
    ppuSetNameTblVertical();
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     114b <m65setParams9001+0x2b>
mov    $0x0,%al
call   1030 <ppuSetNameTblHorizontal@plt>
jmp    1152 <m65setParams9001+0x32>
mov    $0x0,%al
call   1040 <ppuSetNameTblVertical@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
xor    %eax,%eax
test   $0x80,%sil
jne    112d <m65setParams9001+0xd>
jmp    1040 <ppuSetNameTblVertical@plt>
jmp    1030 <ppuSetNameTblHorizontal@plt>

LLVM IR (-O0):
define void @m65setParams9001(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 = and i32 %6, 128
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 (...) @ppuSetNameTblHorizontal()
br label %13
11: ; preds = %2
%12 = call i32 (...) @ppuSetNameTblVertical()
br label %13
13: ; preds = %11, %9
ret void
}

LLVM IR (-O2):
define void @m65setParams9001(i32 %0, i32 %1) {
%3 = and i32 %1, 128
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 (...) @ppuSetNameTblHorizontal()
br label %9
7: ; preds = %2
%8 = tail call i32 (...) @ppuSetNameTblVertical()
br label %9
9: ; preds = %7, %5
ret void
}
/* Variables and functions */
int f(char *);
int main() { return f("hi bob"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"hi bob\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @f(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}

LLVM IR (-O2):
@.str = [7 x i8] c"hi bob\00"
define i32 @main() {
%1 = tail call i32 @f(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
void RCC_IRQHandler() {}


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

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

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

LLVM IR (-O2):
define void @RCC_IRQHandler() {
ret void
}
/* Variables and functions */
int f121(int *);
int f122(int *p) { return f121(p); }


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

x86 assembly (clang, -O2):
<f122>:
jmp    1030 <f121@plt>

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

LLVM IR (-O2):
define i32 @f122(i32* %0) {
%2 = tail call i32 @f121(i32* %0)
ret i32 %2
}
/* Type definitions */
typedef int u_int8_t;

/* Variables and functions */
u_int8_t ipsec_spi_size(u_int8_t proto) { return 4; }


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

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

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

LLVM IR (-O2):
define i32 @ipsec_spi_size(i32 %0) {
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ out_char(int /*<<< orphan*/);
void out_string(const char *str) {
  while (*str)
    out_char(*str++);
}


x86 assembly (clang, -O0):
<out_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <out_string+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <out_char@plt>
jmp    111c <out_string+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<out_string>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <out_string+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <out_char@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <out_string+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @out_string(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %7, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %2
%10 = load i8, i8* %8
%11 = sext i8 %10 to i32
%12 = call i32 @out_char(i32 %11)
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @out_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @out_char(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ swap(size_t *, size_t *, int);
int main(int argc, const char **argv) {
  size_t a = 42;
  size_t b = 89;
  swap(&a, &b, sizeof(size_t));
  if (b == 42 && a == 89) {
    return EXIT_SUCCESS;
  }
  return EXIT_FAILURE;
}


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)
movq   $0x2a,-0x18(%rbp)
movq   $0x59,-0x20(%rbp)
lea    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x8,%edx
call   1030 <swap@plt>
cmpq   $0x2a,-0x20(%rbp)
jne    116f <main+0x5f>
cmpq   $0x59,-0x18(%rbp)
jne    116f <main+0x5f>
mov    0x2e73(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    117b <main+0x6b>
mov    0x2e6a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movq   $0x2a,0x10(%rsp)
movq   $0x59,0x8(%rsp)
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
mov    $0x8,%edx
call   1030 <swap@plt>
mov    0x8(%rsp),%rax
xor    $0x2a,%rax
mov    0x10(%rsp),%rcx
xor    $0x59,%rcx
or     %rax,%rcx
jne    115a <main+0x4a>
mov    0x2e80(%rip),%rax
jmp    1161 <main+0x51>
mov    0x2e7f(%rip),%rax
mov    (%rax),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 42, i64* %6
store i64 89, i64* %7
%8 = call i32 @swap(i64* %6, i64* %7, i32 8)
%9 = load i64, i64* %7
%10 = icmp eq i64 %9, 42
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i64, i64* %6
%13 = icmp eq i64 %12, 89
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = load i32, i32* @EXIT_SUCCESS
store i32 %15, i32* %3
br label %18
16: ; preds = %11, %2
%17 = load i32, i32* @EXIT_FAILURE
store i32 %17, i32* %3
br label %18
18: ; preds = %16, %14
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i64
%4 = alloca i64
%5 = bitcast i64* %3 to i8*
store i64 42, i64* %3
%6 = bitcast i64* %4 to i8*
store i64 89, i64* %4
%7 = call i32 @swap(i64* %3, i64* %4, i32 8)
%8 = load i64, i64* %4
%9 = icmp eq i64 %8, 42
%10 = load i64, i64* %3
%11 = icmp eq i64 %10, 89
%12 = select i1 %9, i1 %11, i1 false
%13 = load i32, i32* @EXIT_SUCCESS
%14 = load i32, i32* @EXIT_FAILURE
%15 = select i1 %12, i32 %13, i32 %14
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ IF_fctD_1(int /*<<< orphan*/);
int /*<<< orphan*/ j0;
void IF_j0(void) { IF_fctD_1(j0); }


x86 assembly (clang, -O0):
<IF_j0>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <IF_fctD_1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<IF_j0>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <IF_fctD_1@plt>

LLVM IR (-O0):
@j0 = global i32 0
define void @IF_j0() {
%1 = load i32, i32* @j0
%2 = call i32 @IF_fctD_1(i32 %1)
ret void
}

LLVM IR (-O2):
@j0 = global i32 0
define void @IF_j0() {
%1 = load i32, i32* @j0
%2 = tail call i32 @IF_fctD_1(i32 %1)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t pif_ram_address(uint32_t address) {
  return ((address & 0xfffc) - 0x7c0);
}


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

x86 assembly (clang, -O2):
<pif_ram_address>:
and    $0xfffc,%edi
lea    -0x7c0(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @pif_ram_address(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65532
%5 = sub nsw i32 %4, 1984
ret i32 %5
}

LLVM IR (-O2):
define i32 @pif_ram_address(i32 %0) {
%2 = and i32 %0, 65532
%3 = add nsw i32 %2, -1984
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b, i;
  int c[1100 * 1024] = {0};
  scanf("%d %d", &a, &b);
  printf("%d\n", a + b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x44c010,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x44c010(%rbp),%rdi
xor    %esi,%esi
mov    $0x44c000,%edx
call   1040 <memset@plt>
lea    0xea4(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x8(%rbp),%esi
add    -0xc(%rbp),%esi
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x44c010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    (%rsp),%esi
add    0x4(%rsp),%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [1126400 x i32]
store i32 0, i32* %1
%6 = bitcast [1126400 x i32]* %5 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = add nsw i32 %8, %9
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, %6
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
int ceil(double);
double dpercentile_ordered(const double *v, int len, double percentile) {
  if (len == 1) {
    return v[0];
  }
  int rank = ceil(percentile * len) - 1;
  return v[rank];
}


x86 assembly (clang, -O0):
<dpercentile_ordered>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movsd  %xmm0,-0x20(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    1140 <dpercentile_ordered+0x30>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    116b <dpercentile_ordered+0x5b>
movsd  -0x20(%rbp),%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <ceil@plt>
sub    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dpercentile_ordered>:
push   %rbx
mov    %rdi,%rbx
cmp    $0x1,%esi
je     1134 <dpercentile_ordered+0x24>
cvtsi2sd %esi,%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <ceil@plt>
cltq
lea    (%rbx,%rax,8),%rbx
add    $0xfffffffffffffff8,%rbx
movsd  (%rbx),%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @dpercentile_ordered(double* %0, i32 %1, double %2) {
%4 = alloca double
%5 = alloca double*
%6 = alloca i32
%7 = alloca double
%8 = alloca i32
store double* %0, double** %5
store i32 %1, i32* %6
store double %2, double* %7
%9 = load i32, i32* %6
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %15
11: ; preds = %3
%12 = load double*, double** %5
%13 = getelementptr inbounds double, double* %12, i64 0
%14 = load double, double* %13
store double %14, double* %4
br label %27
15: ; preds = %3
%16 = load double, double* %7
%17 = load i32, i32* %6
%18 = sitofp i32 %17 to double
%19 = fmul double %16, %18
%20 = call i32 @ceil(double %19)
%21 = sub nsw i32 %20, 1
store i32 %21, i32* %8
%22 = load double*, double** %5
%23 = load i32, i32* %8
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds double, double* %22, i64 %24
%26 = load double, double* %25
store double %26, double* %4
br label %27
27: ; preds = %15, %11
%28 = load double, double* %4
ret double %28
}

LLVM IR (-O2):
define double @dpercentile_ordered(double* nocapture %0, i32 %1, double %2) {
%4 = icmp eq i32 %1, 1
br i1 %4, label %12, label %5
5: ; preds = %3
%6 = sitofp i32 %1 to double
%7 = fmul double %6, %2
%8 = tail call i32 @ceil(double %7)
%9 = add nsw i32 %8, -1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds double, double* %0, i64 %10
br label %12
12: ; preds = %3, %5
%13 = phi double* [ %11, %5 ], [ %0, %3 ]
%14 = load double, double* %13
ret double %14
}
/* Variables and functions */
int /*<<< orphan*/ WriteInstruction(char *);
void CR_Restart(void) {
  WriteInstruction("ld hl,restfl");
  WriteInstruction("ld (hl),h");
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"ld hl,restfl\00"
@.str.1 = [10 x i8] c"ld (hl),h\00"
define void @CR_Restart() {
%1 = call i32 @WriteInstruction(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @WriteInstruction(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"ld hl,restfl\00"
@.str.1 = [10 x i8] c"ld (hl),h\00"
define void @CR_Restart() {
%1 = tail call i32 @WriteInstruction(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @WriteInstruction(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int scale_color(int c, double scale, int shift) {
  int nonzeroscale = (scale != 0) ? 1 : 0;
  return (c == 0) ? 0 : ((c >> shift) * scale) + nonzeroscale;
}


x86 assembly (clang, -O0):
<scale_color>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
xor    %eax,%eax
mov    $0x1,%ecx
ucomisd %xmm1,%xmm0
setp   %sil
setne  %dl
or     %sil,%dl
cmovne %ecx,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1149 <scale_color+0x49>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    116c <scale_color+0x6c>
mov    -0x4(%rbp),%eax
mov    -0x14(%rbp),%ecx
sar    %cl,%eax
cvtsi2sd %eax,%xmm0
movsd  -0x10(%rbp),%xmm2
cvtsi2sdl -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scale_color>:
test   %edi,%edi
je     112e <scale_color+0x2e>
mov    %esi,%ecx
sar    %cl,%edi
cvtsi2sd %edi,%xmm1
xorpd  %xmm2,%xmm2
cmpneqsd %xmm0,%xmm2
movsd  0xee3(%rip),%xmm3
andpd  %xmm2,%xmm3
mulsd  %xmm0,%xmm1
addsd  %xmm3,%xmm1
cvttsd2si %xmm1,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @scale_color(i32 %0, double %1, i32 %2) {
%4 = alloca i32
%5 = alloca double
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store double %1, double* %5
store i32 %2, i32* %6
%8 = load double, double* %5
%9 = fcmp une double %8, 0.000000e+00
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 1, i32 0
store i32 %11, i32* %7
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %3
br label %24
15: ; preds = %3
%16 = load i32, i32* %4
%17 = load i32, i32* %6
%18 = ashr i32 %16, %17
%19 = sitofp i32 %18 to double
%20 = load double, double* %5
%21 = load i32, i32* %7
%22 = sitofp i32 %21 to double
%23 = call double @llvm.fmuladd.f64(double %19, double %20, double %22)
br label %24
24: ; preds = %15, %14
%25 = phi double [ 0.000000e+00, %14 ], [ %23, %15 ]
%26 = fptosi double %25 to i32
ret i32 %26
}

LLVM IR (-O2):
define i32 @scale_color(i32 %0, double %1, i32 %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %12, label %5
5: ; preds = %3
%6 = fcmp une double %1, 0.000000e+00
%7 = ashr i32 %0, %2
%8 = sitofp i32 %7 to double
%9 = uitofp i1 %6 to double
%10 = tail call double @llvm.fmuladd.f64(double %8, double %1, double %9)
%11 = fptosi double %10 to i32
br label %12
12: ; preds = %3, %5
%13 = phi i32 [ %11, %5 ], [ 0, %3 ]
ret i32 %13
}
/* Variables and functions */
long long strtoimax(char const *, char **, int);
long long strtoll(const char *nptr, char **endptr, int base) {
  return strtoimax(nptr, endptr, base);
}


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

x86 assembly (clang, -O2):
<strtoll>:
jmp    1030 <strtoimax@plt>

LLVM IR (-O0):
define i64 @strtoll(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
%10 = call i64 @strtoimax(i8* %7, i8** %8, i32 %9)
ret i64 %10
}

LLVM IR (-O2):
define i64 @strtoll(i8* %0, i8** %1, i32 %2) {
%4 = tail call i64 @strtoimax(i8* %0, i8** %1, i32 %2)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int g(int *p) {
  printf("p=%d\n", *p);
  *p = 10;
  return 0;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movl   $0xa,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%esi
lea    0xee3(%rip),%rdi
call   1030 <printf@plt>
movl   $0xa,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"p=%d\0A\00"
define i32 @g(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %2)
store i32 10, i32* %0
ret i32 0
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int getsockname(int, struct sockaddr *, int /*<<< orphan*/ *);
int INET_getsockname(int socket, struct sockaddr_in *address,
                     int *address_len) {
  return getsockname(socket, (struct sockaddr *)address,
                     (socklen_t *)address_len);
}


x86 assembly (clang, -O0):
<INET_getsockname>:
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 <getsockname@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<INET_getsockname>:
jmp    1030 <getsockname@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @INET_getsockname(i32 %0, %struct.sockaddr_in* %1, i32* %2) {
%4 = alloca i32
%5 = alloca %struct.sockaddr_in*
%6 = alloca i32*
store i32 %0, i32* %4
store %struct.sockaddr_in* %1, %struct.sockaddr_in** %5
store i32* %2, i32** %6
%7 = load i32, i32* %4
%8 = load %struct.sockaddr_in*, %struct.sockaddr_in** %5
%9 = bitcast %struct.sockaddr_in* %8 to %struct.sockaddr*
%10 = load i32*, i32** %6
%11 = call i32 @getsockname(i32 %7, %struct.sockaddr* %9, i32* %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @INET_getsockname(i32 %0, %struct.sockaddr_in* %1, i32* %2) {
%4 = bitcast %struct.sockaddr_in* %1 to %struct.sockaddr*
%5 = tail call i32 @getsockname(i32 %0, %struct.sockaddr* %4, i32* %2)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *, char *);
char *strerror(int);
void printErrMsg(char *str, int err) {
  printf("%s:%s\n", str, strerror(err));
  exit(1);
}


x86 assembly (clang, -O0):
<printErrMsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <strerror@plt>
mov    -0x18(%rbp),%rsi
mov    %rax,%rdx
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<printErrMsg>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1050 <strerror@plt>
lea    0xebe(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%s:%s\0A\00"
define void @printErrMsg(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
%6 = load i32, i32* %4
%7 = call i8* @strerror(i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %7)
%9 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s:%s\0A\00"
define void @printErrMsg(i8* %0, i32 %1) {
%3 = tail call i8* @strerror(i32 %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %3)
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ sort_chem_pot_2d();
void init_chemical_potential(int dim) {
  if (dim == 2)
    sort_chem_pot_2d();
}


x86 assembly (clang, -O0):
<init_chemical_potential>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jne    112c <init_chemical_potential+0x1c>
mov    $0x0,%al
call   1030 <sort_chem_pot_2d@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_chemical_potential>:
cmp    $0x2,%edi
jne    111c <init_chemical_potential+0xc>
xor    %eax,%eax
jmp    1030 <sort_chem_pot_2d@plt>
ret

LLVM IR (-O0):
define void @init_chemical_potential(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 2
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @sort_chem_pot_2d()
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @init_chemical_potential(i32 %0) {
%2 = icmp eq i32 %0, 2
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @sort_chem_pot_2d()
br label %5
5: ; preds = %3, %1
ret void
}
/* Type definitions */
struct token {
  int dummy;
};

/* Variables and functions */
struct token *get_buf_end(struct token *tok, size_t size) {
  return (struct token *)((void *)tok + size);
}


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

x86 assembly (clang, -O2):
<get_buf_end>:
lea    (%rdi,%rsi,1),%rax
ret

LLVM IR (-O0):
%struct.token = type { i32 }
define %struct.token* @get_buf_end(%struct.token* %0, i64 %1) {
%3 = alloca %struct.token*
%4 = alloca i64
store %struct.token* %0, %struct.token** %3
store i64 %1, i64* %4
%5 = load %struct.token*, %struct.token** %3
%6 = bitcast %struct.token* %5 to i8*
%7 = load i64, i64* %4
%8 = getelementptr i8, i8* %6, i64 %7
%9 = bitcast i8* %8 to %struct.token*
ret %struct.token* %9
}

LLVM IR (-O2):
%struct.token = type { i32 }
define %struct.token* @get_buf_end(%struct.token* readnone %0, i64 %1) {
%3 = bitcast %struct.token* %0 to i8*
%4 = getelementptr i8, i8* %3, i64 %1
%5 = bitcast i8* %4 to %struct.token*
ret %struct.token* %5
}
/* Variables and functions */
int function_A(int, int);
int main(int argc, char *argv[]) {
  int a = function_A(1, 7);
  return a;
}


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    $0x1,%edi
mov    $0x7,%esi
call   1030 <function_A@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%edi
mov    $0x7,%esi
jmp    1030 <function_A@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @function_A(i32 1, i32 7)
ret i32 %3
}
void foo283(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo283(i32 %0) {
ret void
}
/* Variables and functions */
char const *is_ctor_called();
const char *is_ctor_called_irelative() { return is_ctor_called(); }


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

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

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

LLVM IR (-O2):
define i8* @is_ctor_called_irelative() {
%1 = tail call i8* (...) @is_ctor_called()
ret i8* %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int /*<<< orphan*/ AT_FDCWD;
int /*<<< orphan*/ AT_SYMLINK_NOFOLLOW;
int fchownat(int /*<<< orphan*/, char const *, int /*<<< orphan*/,
             int /*<<< orphan*/, int /*<<< orphan*/);
int lchown(const char *path, uid_t uid, gid_t gid) {
  return fchownat(AT_FDCWD, path, uid, gid, AT_SYMLINK_NOFOLLOW);
}


x86 assembly (clang, -O0):
<lchown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    0x2ea4(%rip),%rax
mov    (%rax),%r8d
call   1030 <fchownat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lchown>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
mov    0x2eb9(%rip),%rax
mov    (%rax),%r8d
jmp    1030 <fchownat@plt>

LLVM IR (-O0):
@AT_FDCWD = global i32 0
@AT_SYMLINK_NOFOLLOW = global i32 0
define i32 @lchown(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* @AT_FDCWD
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i32, i32* @AT_SYMLINK_NOFOLLOW
%12 = call i32 @fchownat(i32 %7, i8* %8, i32 %9, i32 %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
@AT_FDCWD = global i32 0
@AT_SYMLINK_NOFOLLOW = global i32 0
define i32 @lchown(i8* %0, i32 %1, i32 %2) {
%4 = load i32, i32* @AT_FDCWD
%5 = load i32, i32* @AT_SYMLINK_NOFOLLOW
%6 = tail call i32 @fchownat(i32 %4, i8* %0, i32 %1, i32 %2, i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ I2CMasterBaseValid(unsigned long);
void I2CMasterEnable(unsigned long ulBase) {
  DEBUG_ASSERT(I2CMasterBaseValid(ulBase));
  (*((volatile unsigned long *)(ulBase + 0x00000020))) |= 0x00000010;
}


x86 assembly (clang, -O0):
<I2CMasterEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <I2CMasterBaseValid@plt>
mov    %eax,%edi
call   1040 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%rcx
or     $0x10,%rcx
mov    %rcx,0x20(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CMasterEnable>:
push   %rbx
mov    %rdi,%rbx
call   1030 <I2CMasterBaseValid@plt>
mov    %eax,%edi
call   1040 <DEBUG_ASSERT@plt>
orq    $0x10,0x20(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @I2CMasterEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @I2CMasterBaseValid(i64 %3)
%5 = call i32 @DEBUG_ASSERT(i32 %4)
%6 = load i64, i64* %2
%7 = add i64 %6, 32
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, 16
store volatile i64 %10, i64* %8
ret void
}

LLVM IR (-O2):
define void @I2CMasterEnable(i64 %0) {
%2 = tail call i32 @I2CMasterBaseValid(i64 %0)
%3 = tail call i32 @DEBUG_ASSERT(i32 %2)
%4 = add i64 %0, 32
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = or i64 %6, 16
store volatile i64 %7, i64* %5
ret void
}
double level1_saturation(double x1, double x2, double x3, double c1,
                         double c2) {
  double T1 = x1 - x3;
  return c2 * (x2 - x3 - c1 - T1 * 0.5) * T1;
}


x86 assembly (clang, -O0):
<level1_saturation>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
subsd  -0x18(%rbp),%xmm2
subsd  -0x20(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xe9c(%rip),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mulsd  -0x30(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<level1_saturation>:
subsd  %xmm2,%xmm0
subsd  %xmm2,%xmm1
subsd  %xmm3,%xmm1
movsd  0xeec(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
mulsd  %xmm4,%xmm2
mulsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @level1_saturation(double %0, double %1, double %2, double %3, double %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%12 = load double, double* %6
%13 = load double, double* %8
%14 = fsub double %12, %13
store double %14, double* %11
%15 = load double, double* %10
%16 = load double, double* %7
%17 = load double, double* %8
%18 = fsub double %16, %17
%19 = load double, double* %9
%20 = fsub double %18, %19
%21 = load double, double* %11
%22 = fneg double %21
%23 = call double @llvm.fmuladd.f64(double %22, double 5.000000e-01, double %20)
%24 = fmul double %15, %23
%25 = load double, double* %11
%26 = fmul double %24, %25
ret double %26
}

LLVM IR (-O2):
define double @level1_saturation(double %0, double %1, double %2, double %3, double %4) {
%6 = fsub double %0, %2
%7 = fsub double %1, %2
%8 = fsub double %7, %3
%9 = fneg double %6
%10 = tail call double @llvm.fmuladd.f64(double %9, double 5.000000e-01, double %8)
%11 = fmul double %10, %4
%12 = fmul double %6, %11
ret double %12
}
int do_768() { return 768; }


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

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

LLVM IR (-O0):
define i32 @do_768() {
ret i32 768
}

LLVM IR (-O2):
define i32 @do_768() {
ret i32 768
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
scalar_t__ malloc(size_t);
int64_t *sorter_sort_new_buffer(size_t size) {
  return (int64_t *)malloc(size * sizeof(int64_t));
}


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

x86 assembly (clang, -O2):
<sorter_sort_new_buffer>:
shl    $0x2,%rdi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i32* @sorter_sort_new_buffer(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul i64 %3, 4
%5 = call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i32*
ret i32* %6
}

LLVM IR (-O2):
define i32* @sorter_sort_new_buffer(i64 %0) {
%2 = shl i64 %0, 2
%3 = tail call i64 @malloc(i64 %2)
%4 = inttoptr i64 %3 to i32*
ret i32* %4
}
int f_ne_mm2(float *a1, float *a2) { return !(((*a1) != (*a2))); }


x86 assembly (clang, -O0):
<f_ne_mm2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
ucomiss (%rax),%xmm0
setne  %al
setp   %cl
or     %cl,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_ne_mm2>:
movss  (%rsi),%xmm0
cmpeqss (%rdi),%xmm0
movd   %xmm0,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @f_ne_mm2(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = load float, float* %5
%7 = load float*, float** %4
%8 = load float, float* %7
%9 = fcmp une float %6, %8
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @f_ne_mm2(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
%5 = fcmp oeq float %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}