xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Error(char *);
int /*<<< orphan*/ SwapDetect();
int /*<<< orphan*/ lmp2pcx();
int main(int argc, char **argv) {
  if (argc != 1)
    Error("lmp2pcx v1.02 by Forest \"LordHavoc\" Hale\nconverts all .lmp and "
          ".wad files in current directory to pcx files and tga files\nno "
          "commandline options\n");
  SwapDetect();
  lmp2pcx();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     115c <main+0x2c>
lea    0xea9(%rip),%rdi
call   1040 <Error@plt>
mov    $0x0,%al
call   1030 <SwapDetect@plt>
mov    $0x0,%al
call   1050 <lmp2pcx@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
je     1142 <main+0x12>
lea    0xec3(%rip),%rdi
call   1040 <Error@plt>
xor    %eax,%eax
call   1030 <SwapDetect@plt>
xor    %eax,%eax
call   1050 <lmp2pcx@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [146 x i8] c"lmp2pcx v1.02 by Forest \22LordHavoc\22 Hale\0Aconverts all .lmp and .wad files in current directory to pcx files and tga files\0Ano commandline options\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @Error(i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = call i32 (...) @SwapDetect()
%12 = call i32 (...) @lmp2pcx()
ret i32 0
}

LLVM IR (-O2):
@.str = [146 x i8] c"lmp2pcx v1.02 by Forest \22LordHavoc\22 Hale\0Aconverts all .lmp and .wad files in current directory to pcx files and tga files\0Ano commandline options\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @Error(i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %2
%7 = tail call i32 (...) @SwapDetect()
%8 = tail call i32 (...) @lmp2pcx()
ret i32 0
}
long profile_pc(struct pt_regs *regs) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.pt_regs = type opaque
define i64 @profile_pc(%struct.pt_regs* nocapture readnone %0) {
ret i64 0
}
/* Variables and functions */
scalar_t__ checkPerfectNumber(int);
int /*<<< orphan*/ printf(char *);
int main(void) {
  if (checkPerfectNumber(28)) {
    printf("yea");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1c,%edi
call   1040 <checkPerfectNumber@plt>
cmp    $0x0,%rax
je     114f <main+0x2f>
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1c,%edi
call   1040 <checkPerfectNumber@plt>
test   %rax,%rax
je     113c <main+0x1c>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"yea\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @checkPerfectNumber(i32 28)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
@.str = [4 x i8] c"yea\00"
define i32 @main() {
%1 = tail call i64 @checkPerfectNumber(i32 28)
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ MUP_catch_system_error();
void MFprocCatchError() { MUP_catch_system_error(); }


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

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

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

LLVM IR (-O2):
define void @MFprocCatchError() {
%1 = tail call i32 (...) @MUP_catch_system_error()
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ memcpy(char *, char *, int);
char *copybytes(char *start, char *end) {
  char *copy;
  copy = (char *)malloc(end - start + 1);
  memcpy(copy, start, end - start);
  copy[end - start] = 0;
  return copy;
}


x86 assembly (clang, -O0):
<copybytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
add    $0x1,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rdx
sub    %rdx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copybytes>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
sub    %rdi,%rbx
lea    0x1(%rbx),%edi
call   1040 <malloc@plt>
mov    %rax,%r15
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1030 <memcpy@plt>
movb   $0x0,(%r15,%rbx,1)
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @copybytes(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = load i8*, i8** %3
%8 = ptrtoint i8* %6 to i64
%9 = ptrtoint i8* %7 to i64
%10 = sub i64 %8, %9
%11 = add nsw i64 %10, 1
%12 = trunc i64 %11 to i32
%13 = call i64 @malloc(i32 %12)
%14 = inttoptr i64 %13 to i8*
store i8* %14, i8** %5
%15 = load i8*, i8** %5
%16 = load i8*, i8** %3
%17 = load i8*, i8** %4
%18 = load i8*, i8** %3
%19 = ptrtoint i8* %17 to i64
%20 = ptrtoint i8* %18 to i64
%21 = sub i64 %19, %20
%22 = trunc i64 %21 to i32
%23 = call i32 @memcpy(i8* %15, i8* %16, i32 %22)
%24 = load i8*, i8** %5
%25 = load i8*, i8** %4
%26 = load i8*, i8** %3
%27 = ptrtoint i8* %25 to i64
%28 = ptrtoint i8* %26 to i64
%29 = sub i64 %27, %28
%30 = getelementptr inbounds i8, i8* %24, i64 %29
store i8 0, i8* %30
%31 = load i8*, i8** %5
ret i8* %31
}

LLVM IR (-O2):
define i8* @copybytes(i8* %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = ptrtoint i8* %0 to i64
%5 = sub i64 %3, %4
%6 = trunc i64 %5 to i32
%7 = add i32 %6, 1
%8 = tail call i64 @malloc(i32 %7)
%9 = inttoptr i64 %8 to i8*
%10 = tail call i32 @memcpy(i8* %9, i8* %0, i32 %6)
%11 = getelementptr inbounds i8, i8* %9, i64 %5
store i8 0, i8* %11
ret i8* %9
}
void check_logfs_je_journal_ec(void) { ; }


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

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

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

LLVM IR (-O2):
define void @check_logfs_je_journal_ec() {
ret void
}
/* Variables and functions */
float Activator_Sigmoid(float);
float Activator_DTanSigmoid(float Input) {
  return Activator_Sigmoid(Input) * (1.0f - Activator_Sigmoid(Input)) * 2.0f;
}


x86 assembly (clang, -O0):
<Activator_DTanSigmoid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <Activator_Sigmoid@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <Activator_Sigmoid@plt>
movaps %xmm0,%xmm2
movss  -0x8(%rbp),%xmm0
movss  0xebe(%rip),%xmm1
subss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  0xeaa(%rip),%xmm1
mulss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Activator_DTanSigmoid>:
push   %rax
movss  %xmm0,(%rsp)
call   1030 <Activator_Sigmoid@plt>
movss  %xmm0,0x4(%rsp)
movss  (%rsp),%xmm0
call   1030 <Activator_Sigmoid@plt>
movss  0xecd(%rip),%xmm1
subss  %xmm0,%xmm1
mulss  0x4(%rsp),%xmm1
addss  %xmm1,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @Activator_DTanSigmoid(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @Activator_Sigmoid(float %3)
%5 = load float, float* %2
%6 = call float @Activator_Sigmoid(float %5)
%7 = fsub float 1.000000e+00, %6
%8 = fmul float %4, %7
%9 = fmul float %8, 2.000000e+00
ret float %9
}

LLVM IR (-O2):
define float @Activator_DTanSigmoid(float %0) {
%2 = tail call float @Activator_Sigmoid(float %0)
%3 = tail call float @Activator_Sigmoid(float %0)
%4 = fsub float 1.000000e+00, %3
%5 = fmul float %2, %4
%6 = fmul float %5, 2.000000e+00
ret float %6
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ sprintf(char *, char *, char);
char *strstr(char *, char *);
int tamanhoChaveHeader(char *header) {
  header = strstr(header, "chaves");
  header = strstr(header, "=");
  char *temp;
  sprintf(temp, "%c", header[1]);
  return atoi(temp);
}


x86 assembly (clang, -O0):
<tamanhoChaveHeader>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1050 <strstr@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeac(%rip),%rsi
call   1050 <strstr@plt>
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rax
lea    0xe96(%rip),%rsi
movsbl 0x1(%rax),%edx
call   1040 <sprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <atoi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
@.str = [7 x i8] c"chaves\00"
@.str.1 = [2 x i8] c"=\00"
@.str.2 = [3 x i8] c"%c\00"
define i32 @tamanhoChaveHeader(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strstr(i8* %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = call i8* @strstr(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %7, i8** %2
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8 signext %11)
%13 = load i8*, i8** %3
%14 = call i32 @atoi(i8* %13)
ret i32 %14
}

LLVM IR (-O2):
/* Variables and functions */
int strlen(const char *s) {
  int len = 0;
  if (s == NULL)
    return -1;
  while (*s != '\0') {
    len++;
    s++;
  }
  return len;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1126 <strlen+0x26>
movl   $0xffffffff,-0x4(%rbp)
jmp    115b <strlen+0x5b>
jmp    112b <strlen+0x2b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1155 <strlen+0x55>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    112b <strlen+0x2b>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
test   %rdi,%rdi
je     111c <strlen+0x1c>
cmpb   $0x0,(%rdi)
je     1122 <strlen+0x22>
xor    %eax,%eax
nopl   0x0(%rax)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret
mov    $0xffffffff,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i32 [ %9, %6 ], [ 0, %3 ]
%8 = phi i8* [ %10, %6 ], [ %0, %3 ]
%9 = add nuw nsw i32 %7, 1
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %3, %1
%14 = phi i32 [ -1, %1 ], [ 0, %3 ], [ %9, %6 ]
ret i32 %14
}
/* Variables and functions */
int diminuto_ipcl_stream_consumer_generic(char const *, char *);
int diminuto_ipcl_stream_consumer(const char *path) {
  return diminuto_ipcl_stream_consumer_generic(path, "");
}


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

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @diminuto_ipcl_stream_consumer(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @diminuto_ipcl_stream_consumer_generic(i8* %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @diminuto_ipcl_stream_consumer(i8* %0) {
%2 = tail call i32 @diminuto_ipcl_stream_consumer_generic(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ register_dip_function_list();
void dip_init() { register_dip_function_list(); }


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

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

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

LLVM IR (-O2):
define void @dip_init() {
%1 = tail call i32 (...) @register_dip_function_list()
ret void
}
/* Type definitions */
struct nsupdate_req {
  int dummy;
};
struct in6_addr {
  int dummy;
};
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ AF_INET6;
int /*<<< orphan*/ LOG_INFO;
int /*<<< orphan*/ inet_ntop(int /*<<< orphan*/, struct in6_addr *, char *,
                             int);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, char *);
void delete_address(struct in6_addr *a, int prefixlen) {
  char buf[128];
  struct nsupdate_req *req;
  inet_ntop(AF_INET6, a, buf, sizeof(buf));
  syslog(LOG_INFO, "delete address %s", buf);
}


x86 assembly (clang, -O0):
<delete_address>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
lea    -0x90(%rbp),%rdx
mov    $0x80,%ecx
call   1030 <inet_ntop@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
lea    -0x90(%rbp),%rdx
lea    0xe99(%rip),%rsi
call   1040 <syslog@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delete_address>:
push   %rbx
sub    $0x80,%rsp
mov    %rdi,%rsi
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rbx
mov    %rbx,%rdx
mov    $0x80,%ecx
call   1030 <inet_ntop@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
lea    0xeac(%rip),%rsi
mov    %rbx,%rdx
call   1040 <syslog@plt>
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.in6_addr = type { i32 }
%struct.nsupdate_req = type { i32 }
@AF_INET6 = global i32 0
@LOG_INFO = global i32 0
@.str = [18 x i8] c"delete address %s\00"
define void @delete_address(%struct.in6_addr* %0, i32 %1) {
%3 = alloca %struct.in6_addr*
%4 = alloca i32
%5 = alloca [128 x i8]
%6 = alloca %struct.nsupdate_req*
store %struct.in6_addr* %0, %struct.in6_addr** %3
store i32 %1, i32* %4
%7 = load i32, i32* @AF_INET6
%8 = load %struct.in6_addr*, %struct.in6_addr** %3
%9 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%10 = call i32 @inet_ntop(i32 %7, %struct.in6_addr* %8, i8* %9, i32 128)
%11 = load i32, i32* @LOG_INFO
%12 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%13 = call i32 @syslog(i32 %11, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %12)
ret void
}

LLVM IR (-O2):
%struct.in6_addr = type { i32 }
%struct.nsupdate_req = type { i32 }
@AF_INET6 = global i32 0
@LOG_INFO = global i32 0
@.str = [18 x i8] c"delete address %s\00"
define void @delete_address(%struct.in6_addr* %0, i32 %1) {
%3 = alloca [128 x i8]
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* @AF_INET6
%6 = call i32 @inet_ntop(i32 %5, %struct.in6_addr* %0, i8* %4, i32 128)
%7 = load i32, i32* @LOG_INFO
%8 = call i32 @syslog(i32 %7, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int,
                           char const *, int);
int /*<<< orphan*/ stderr;
void ErrorAbort(char const *msg, int rv, char const *file, int line) {
  fprintf(stderr, "File %s, line %d: %s, errno %d\n", file, line, msg, rv);
  exit(1);
}


x86 assembly (clang, -O0):
<ErrorAbort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x8(%rbp),%r8
mov    -0xc(%rbp),%r9d
lea    0xeab(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<ErrorAbort>:
push   %rax
mov    %esi,%r9d
mov    %rdi,%r8
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"File %s, line %d: %s, errno %d\0A\00"
define void @ErrorAbort(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %7
%11 = load i32, i32* %8
%12 = load i8*, i8** %5
%13 = load i32, i32* %6
%14 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %10, i32 %11, i8* %12, i32 %13)
%15 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"File %s, line %d: %s, errno %d\0A\00"
define void @ErrorAbort(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %3, i8* %0, i32 %1)
%7 = tail call i32 @exit(i32 1)
unreachable
}
void y(void) {}


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

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

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

LLVM IR (-O2):
define void @y() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ escolha_simb(char *, char *);
int /*<<< orphan*/ printf(char *, char, char);
int main() {
  char jog1 = 0, jog2 = 0;
  printf("jog1: %c jog2: %c", jog1, jog2);
  escolha_simb(&jog1, &jog2);
  printf("depois\njog1: %c jog2: %c", jog1, jog2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
movb   $0x0,-0x2(%rbp)
mov    -0x1(%rbp),%al
lea    0xecd(%rip),%rdi
movsbl %al,%esi
movsbl -0x2(%rbp),%edx
call   1030 <printf@plt>
lea    -0x1(%rbp),%rdi
lea    -0x2(%rbp),%rsi
call   1040 <escolha_simb@plt>
mov    -0x1(%rbp),%al
lea    0xea3(%rip),%rdi
movsbl %al,%esi
movsbl -0x2(%rbp),%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movb   $0x0,0x7(%rsp)
movb   $0x0,0x6(%rsp)
lea    0xed5(%rip),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <printf@plt>
lea    0x7(%rsp),%rdi
lea    0x6(%rsp),%rsi
call   1040 <escolha_simb@plt>
movsbl 0x7(%rsp),%esi
movsbl 0x6(%rsp),%edx
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"jog1: %c jog2: %c\00"
@.str.1 = [25 x i8] c"depois\0Ajog1: %c jog2: %c\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca i8
store i8 0, i8* %1
store i8 0, i8* %2
%3 = load i8, i8* %1
%4 = load i8, i8* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8 signext %3, i8 signext %4)
%6 = call i32 @escolha_simb(i8* %1, i8* %2)
%7 = load i8, i8* %1
%8 = load i8, i8* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8 signext %7, i8 signext %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"jog1: %c jog2: %c\00"
@.str.1 = [25 x i8] c"depois\0Ajog1: %c jog2: %c\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca i8
store i8 0, i8* %1
store i8 0, i8* %2
%3 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8 signext 0, i8 signext 0)
%4 = call i32 @escolha_simb(i8* %1, i8* %2)
%5 = load i8, i8* %1
%6 = load i8, i8* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8 signext %5, i8 signext %6)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;
typedef int /*<<< orphan*/ tmp;
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int /*<<< orphan*/ ivory_serialize_pack_prim_2_le(int /*<<< orphan*/ *,
                                                  int /*<<< orphan*/ *);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ **, int /*<<< orphan*/ const *,
                          int);
void ivory_serialize_pack_int16_le(uint8_t *dst, uint32_t offs,
                                   const int16_t *src) {
  uint8_t tmp[2] = {0};
  memcpy(&tmp, src, sizeof(tmp));
  ivory_serialize_pack_prim_2_le(dst + offs, tmp);
}


x86 assembly (clang, -O0):
<ivory_serialize_pack_int16_le>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
lea    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x8,%edx
call   1050 <memcpy@plt>
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
lea    -0x20(%rbp),%rsi
call   1030 <ivory_serialize_pack_prim_2_le@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ivory_serialize_pack_int16_le>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
mov    %rdi,%r14
movq   $0x0,0x8(%rsp)
lea    0x8(%rsp),%r15
mov    %r15,%rdi
mov    %rdx,%rsi
mov    $0x8,%edx
call   1040 <memcpy@plt>
movslq %ebx,%rax
lea    (%r14,%rax,4),%rdi
mov    %r15,%rsi
call   1030 <ivory_serialize_pack_prim_2_le@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @ivory_serialize_pack_int16_le(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca [2 x i32]
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%8 = bitcast [2 x i32]* %7 to i8*
%9 = bitcast [2 x i32]* %7 to i32**
%10 = load i32*, i32** %6
%11 = call i32 @memcpy(i32** %9, i32* %10, i32 8)
%12 = load i32*, i32** %4
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%17 = call i32 @ivory_serialize_pack_prim_2_le(i32* %15, i32* %16)
ret void
}

LLVM IR (-O2):
define void @ivory_serialize_pack_int16_le(i32* %0, i32 %1, i32* %2) {
%4 = alloca i64
%5 = bitcast i64* %4 to i8*
store i64 0, i64* %4
%6 = bitcast i64* %4 to i32**
%7 = call i32 @memcpy(i32** %6, i32* %2, i32 8)
%8 = sext i32 %1 to i64
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = bitcast i64* %4 to i32*
%11 = call i32 @ivory_serialize_pack_prim_2_le(i32* %9, i32* %10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
scalar_t__ strncmp(char *, char *, int);
void strncmp_constant_and_var_1() {
  char *x = "123";
  clang_analyzer_eval(strncmp("123", x, 3) == 0);
}


x86 assembly (clang, -O0):
<strncmp_constant_and_var_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec2(%rip),%rdi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncmp_constant_and_var_1>:
push   %rax
lea    0xed8(%rip),%rdi
mov    %rdi,%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
pop    %rax
jmp    1040 <clang_analyzer_eval@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"123\00"
define void @strncmp_constant_and_var_1() {
%1 = alloca i8*
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = call i64 @strncmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2, i32 3)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @clang_analyzer_eval(i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"123\00"
define void @strncmp_constant_and_var_1() {
%1 = tail call i64 @strncmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @clang_analyzer_eval(i32 %3)
ret void
}
/* Variables and functions */
int STC31xx_Read(int, int, unsigned char *);
int STC31xx_ReadWord16(int RegAddress) {
  int value;
  unsigned char data[2];
  int res;
  res = STC31xx_Read(2, RegAddress, data);
  if (res >= 0) {
    value = data[1];
    value = (value << 8) + data[0];
  } else
    value = 0;
  return (value);
}


x86 assembly (clang, -O0):
<STC31xx_ReadWord16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    -0xa(%rbp),%rdx
mov    $0x2,%edi
call   1030 <STC31xx_Read@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1154 <STC31xx_ReadWord16+0x44>
movzbl -0x9(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x8,%eax
movzbl -0xa(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
jmp    115b <STC31xx_ReadWord16+0x4b>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<STC31xx_ReadWord16>:
push   %rax
mov    %edi,%esi
lea    0x6(%rsp),%rdx
mov    $0x2,%edi
call   1030 <STC31xx_Read@plt>
movzwl 0x6(%rsp),%edx
xor    %ecx,%ecx
test   %eax,%eax
cmovns %edx,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @STC31xx_ReadWord16(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [2 x i8]
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
%8 = call i32 @STC31xx_Read(i32 2, i32 %6, i8* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %21
11: ; preds = %1
%12 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 1
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
store i32 %14, i32* %3
%15 = load i32, i32* %3
%16 = shl i32 %15, 8
%17 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = add nsw i32 %16, %19
store i32 %20, i32* %3
br label %22
21: ; preds = %1
store i32 0, i32* %3
br label %22
22: ; preds = %21, %11
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @STC31xx_ReadWord16(i32 %0) {
%2 = alloca [2 x i8]
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%4 = call i32 @STC31xx_Read(i32 2, i32 %0, i8* %3)
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 8
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = or i32 %8, %10
%12 = icmp slt i32 %4, 0
%13 = select i1 %12, i32 0, i32 %11
ret i32 %13
}
void addOneP(int *input) { *input = *input + 1; }


x86 assembly (clang, -O0):
<addOneP>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<addOneP>:
addl   $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @addOneP(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = add nsw i32 %4, 1
%6 = load i32*, i32** %2
store i32 %5, i32* %6
ret void
}

LLVM IR (-O2):
define void @addOneP(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add nsw i32 %2, 1
store i32 %3, i32* %0
ret void
}
/* Type definitions */
struct utsname {
  int /*<<< orphan*/ release;
};

/* Variables and functions */
scalar_t__ strncmp(int /*<<< orphan*/, char *, int);
int uname(struct utsname *);
int IsBadKernel() {
  struct utsname info;
  if (uname(&info) == -1)
    return 1;
  if (strncmp(info.release, "2.6.16", sizeof("2.6.16") - 1) == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<IsBadKernel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
call   1040 <uname@plt>
cmp    $0xffffffff,%eax
jne    1146 <IsBadKernel+0x26>
movl   $0x1,-0x4(%rbp)
jmp    1177 <IsBadKernel+0x57>
mov    -0x8(%rbp),%edi
lea    0xeb0(%rip),%rsi
mov    $0x6,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1170 <IsBadKernel+0x50>
movl   $0x1,-0x4(%rbp)
jmp    1177 <IsBadKernel+0x57>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsBadKernel>:
push   %rax
mov    %rsp,%rdi
call   1040 <uname@plt>
cmp    $0xffffffff,%eax
je     114f <IsBadKernel+0x2f>
mov    (%rsp),%edi
lea    0xec8(%rip),%rsi
mov    $0x6,%edx
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rcx
ret
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.utsname = type { i32 }
@.str = [7 x i8] c"2.6.16\00"
define i32 @IsBadKernel() {
%1 = alloca %struct.utsname
%2 = bitcast %struct.utsname* %1 to i8*
%3 = call i32 @uname(%struct.utsname* %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %11, label %5
5: ; preds = %0
%6 = getelementptr inbounds %struct.utsname, %struct.utsname* %1, i64 0, i32 0
%7 = load i32, i32* %6
%8 = tail call i64 @strncmp(i32 %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
%9 = icmp eq i64 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %5, %0
%12 = phi i32 [ 1, %0 ], [ %10, %5 ]
ret i32 %12
}
char tohex(unsigned int val) {
  if (val <= 9)
    return val + '0';
  return val + 'A' - 10;
}


x86 assembly (clang, -O0):
<tohex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x9,-0x8(%rbp)
ja     111f <tohex+0x1f>
mov    -0x8(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    112b <tohex+0x2b>
mov    -0x8(%rbp),%eax
add    $0x41,%eax
sub    $0xa,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tohex>:
cmp    $0xa,%edi
mov    $0x30,%ecx
mov    $0x37,%eax
cmovb  %ecx,%eax
add    %dil,%al
ret

LLVM IR (-O0):
define signext i8 @tohex(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ule i32 %4, 9
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = add i32 %7, 48
%9 = trunc i32 %8 to i8
store i8 %9, i8* %2
br label %15
10: ; preds = %1
%11 = load i32, i32* %3
%12 = add i32 %11, 65
%13 = sub i32 %12, 10
%14 = trunc i32 %13 to i8
store i8 %14, i8* %2
br label %15
15: ; preds = %10, %6
%16 = load i8, i8* %2
ret i8 %16
}

LLVM IR (-O2):
define signext i8 @tohex(i32 %0) {
%2 = icmp ult i32 %0, 10
%3 = trunc i32 %0 to i8
%4 = select i1 %2, i8 48, i8 55
%5 = add i8 %4, %3
ret i8 %5
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x, y;
  x = __VERIFIER_nondet_int();
  y = __VERIFIER_nondet_int();
  while (x > 0) {
    x = x - 2 * y;
    y = y + 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1159 <main+0x49>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <main+0x23>
xor    %eax,%eax
add    $0x10,%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
store i32 0, i32* %1
%4 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %4, i32* %2
%5 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %5, i32* %3
br label %6
6: ; preds = %9, %0
%7 = load i32, i32* %2
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %6
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = mul nsw i32 2, %11
%13 = sub nsw i32 %10, %12
store i32 %13, i32* %2
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %6
16: ; preds = %6
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 */
int /*<<< orphan*/ abort();
int *consumer();
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ init();
int *malloc(int);
int /*<<< orphan*/ produce(int *);
int main() {
  init();
  for (;;) {
    int *x = malloc(1 * sizeof(int));
    if (x == 0)
      abort();
    produce(x);
    int *y = consumer();
    free(y);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <init@plt>
mov    $0x4,%edi
call   1070 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1196 <main+0x36>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x10(%rbp),%rdi
call   1050 <produce@plt>
mov    $0x0,%al
call   1080 <consumer@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
jmp    1176 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <init@plt>
nopl   0x0(%rax,%rax,1)
mov    $0x4,%edi
call   1070 <malloc@plt>
test   %rax,%rax
je     1198 <main+0x38>
mov    %rax,%rdi
call   1050 <produce@plt>
xor    %eax,%eax
call   1080 <consumer@plt>
mov    %rax,%rdi
call   1030 <free@plt>
jmp    1170 <main+0x10>
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
store i32 0, i32* %1
%4 = call i32 (...) @init()
br label %5
5: ; preds = %11, %0
%6 = call i32* @malloc(i32 4)
store i32* %6, i32** %2
%7 = load i32*, i32** %2
%8 = icmp eq i32* %7, null
br i1 %8, label %9, label %11
9: ; preds = %5
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %5
%12 = load i32*, i32** %2
%13 = call i32 @produce(i32* %12)
%14 = call i32* (...) @consumer()
store i32* %14, i32** %3
%15 = load i32*, i32** %3
%16 = call i32 @free(i32* %15)
br label %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @init()
%2 = tail call i32* @malloc(i32 4)
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %6
4: ; preds = %6, %0
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %0, %6
%7 = phi i32* [ %11, %6 ], [ %2, %0 ]
%8 = tail call i32 @produce(i32* %7)
%9 = tail call i32* (...) @consumer()
%10 = tail call i32 @free(i32* %9)
%11 = tail call i32* @malloc(i32 4)
%12 = icmp eq i32* %11, null
br i1 %12, label %4, label %6
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, size_t);
void endian_copy(void *dest, void *src, size_t destsize, size_t srcsize) {
  memcpy(dest, src, destsize);
}


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

x86 assembly (clang, -O2):
<endian_copy>:
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @endian_copy(i8* %0, i8* %1, i64 %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i64, i64* %7
%12 = call i32 @memcpy(i8* %9, i8* %10, i64 %11)
ret void
}

LLVM IR (-O2):
define void @endian_copy(i8* %0, i8* %1, i64 %2, i64 %3) {
%5 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Msp430TimerCapComP__1__Compare__default__fired();
void Msp430TimerCapComP__1__Compare__fired(void) {
  Msp430TimerCapComP__1__Compare__default__fired();
}


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

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

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

LLVM IR (-O2):
define void @Msp430TimerCapComP__1__Compare__fired() {
%1 = tail call i32 (...) @Msp430TimerCapComP__1__Compare__default__fired()
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ close(int);
int stat(char *, struct stat *);
void close_duet_dev(int duet_fd) {
  int ret;
  struct stat st;
  ret = stat("/dev/duet", &st);
  if (ret < 0)
    return;
  close(duet_fd);
}


x86 assembly (clang, -O0):
<close_duet_dev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <stat@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    114d <close_duet_dev+0x2d>
jmp    1155 <close_duet_dev+0x35>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_duet_dev>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
lea    0xed2(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1040 <stat@plt>
test   %eax,%eax
js     1148 <close_duet_dev+0x28>
mov    %ebx,%edi
add    $0x10,%rsp
pop    %rbx
jmp    1030 <close@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [10 x i8] c"/dev/duet\00"
define void @close_duet_dev(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.stat
store i32 %0, i32* %2
%5 = call i32 @stat(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), %struct.stat* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
br label %12
9: ; preds = %1
%10 = load i32, i32* %2
%11 = call i32 @close(i32 %10)
br label %12
12: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [10 x i8] c"/dev/duet\00"
define void @close_duet_dev(i32 %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), %struct.stat* %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @close(i32 %0)
br label %8
8: ; preds = %1, %6
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ print(char const *, int);
int strlen(char const *);
int fputs_overriden(const char *s, FILE *f) {
  int len = strlen(s);
  if (len > 0) {
    print(s, len);
  }
  return 0;
}


x86 assembly (clang, -O0):
<fputs_overriden>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1152 <fputs_overriden+0x32>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <print@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fputs_overriden>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
jle    1137 <fputs_overriden+0x17>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <print@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @fputs_overriden(i8* %0, i32* nocapture readnone %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @print(i8* %0, i32 %3)
br label %7
7: ; preds = %5, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ curs_set(int);
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int);
void onsig(int n) {
  curs_set(1);
  endwin();
  exit(1);
}


x86 assembly (clang, -O0):
<onsig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
call   1050 <curs_set@plt>
mov    $0x0,%al
call   1030 <endwin@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<onsig>:
push   %rax
mov    $0x1,%edi
call   1050 <curs_set@plt>
xor    %eax,%eax
call   1030 <endwin@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @onsig(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @curs_set(i32 1)
%4 = call i32 (...) @endwin()
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @onsig(i32 %0) {
%2 = tail call i32 @curs_set(i32 1)
%3 = tail call i32 (...) @endwin()
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct hle_t {
  int dummy;
};

/* Variables and functions */
void MP3ADDY(struct hle_t *UNUSED_hle __attribute__((__unused__)),
             uint32_t UNUSED_w1 __attribute__((__unused__)),
             uint32_t UNUSED_w2 __attribute__((__unused__))) {}


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

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

LLVM IR (-O0):
%struct.hle_t = type { i32 }
define void @MP3ADDY(%struct.hle_t* %0, i32 %1, i32 %2) {
%4 = alloca %struct.hle_t*
%5 = alloca i32
%6 = alloca i32
store %struct.hle_t* %0, %struct.hle_t** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
%struct.hle_t = type { i32 }
define void @MP3ADDY(%struct.hle_t* nocapture %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
int main(void) {
  write(1, "a", 1);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edx
lea    0xed5(%rip),%rsi
mov    %edx,%edi
call   1030 <write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rcx
ret

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

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


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

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

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

LLVM IR (-O2):
define void @nrf_802154_temperature_deinit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sum(int, int, int, int, int, int);
int main() {
  int s1, s2;
  s1 = sum(5, 1, 2, 3, 4, 5);
  printf("%d\n", s1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%r9d
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
mov    %r9d,%edi
call   1040 <sum@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
mov    $0x5,%r9d
call   1040 <sum@plt>
lea    0xeb3(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @sum(i32 5, i32 1, i32 2, i32 3, i32 4, i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}