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

/* Variables and functions */
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
int /*<<< orphan*/ *opendir(char *);
int pfan_isdir(char *path) {
  DIR *dir = opendir(path);
  if (dir) {
    closedir(dir);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<pfan_isdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <opendir@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1159 <pfan_isdir+0x39>
mov    -0x18(%rbp),%rdi
call   1040 <closedir@plt>
movl   $0x1,-0x4(%rbp)
jmp    1160 <pfan_isdir+0x40>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pfan_isdir>:
push   %rax
call   1030 <opendir@plt>
test   %rax,%rax
je     113a <pfan_isdir+0x1a>
mov    %rax,%rdi
call   1040 <closedir@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @pfan_isdir(i8* nocapture %0) {
%2 = tail call i32* @opendir(i8* %0)
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @closedir(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int decode(char *, int, char *);
int /*<<< orphan*/ exit(int);
int sscanf(char *, char *, int *, char *);
int strlen(char *);
int do_decode(char *input, char *output, char *outfilename) {
  int mode, namelen;
  if (sscanf(input, "begin %o %s \n", &mode, outfilename) == 2) {
    namelen = strlen(outfilename);
    return decode(input, namelen + 12, output);
  }
  exit(1);
}


x86 assembly (clang, -O0):
<do_decode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rcx
lea    0xe9d(%rip),%rsi
lea    -0x1c(%rbp),%rdx
call   1040 <sscanf@plt>
cmp    $0x2,%eax
jne    119a <do_decode+0x5a>
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%esi
add    $0xc,%esi
mov    -0x10(%rbp),%rdx
call   1050 <decode@plt>
add    $0x20,%rsp
pop    %rbp
ret
mov    $0x1,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<do_decode>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
lea    0xea7(%rip),%rsi
lea    0xc(%rsp),%rdx
mov    %rbx,%rcx
call   1040 <sscanf@plt>
cmp    $0x2,%eax
jne    118b <do_decode+0x4b>
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xc(%rax),%esi
mov    %r15,%rdi
mov    %r14,%rdx
call   1050 <decode@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"begin %o %s \0A\00"
define i32 @do_decode(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%9 = load i8*, i8** %4
%10 = load i8*, i8** %6
%11 = call i32 @sscanf(i8* %9, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32* %7, i8* %10)
%12 = icmp eq i32 %11, 2
br i1 %12, label %13, label %21
13: ; preds = %3
%14 = load i8*, i8** %6
%15 = call i32 @strlen(i8* %14)
store i32 %15, i32* %8
%16 = load i8*, i8** %4
%17 = load i32, i32* %8
%18 = add nsw i32 %17, 12
%19 = load i8*, i8** %5
%20 = call i32 @decode(i8* %16, i32 %18, i8* %19)
ret i32 %20
21: ; preds = %3
%22 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [14 x i8] c"begin %o %s \0A\00"
define i32 @do_decode(i8* %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32* %4, i8* %2)
%7 = icmp eq i32 %6, 2
br i1 %7, label %8, label %12
8: ; preds = %3
%9 = call i32 @strlen(i8* %2)
%10 = add nsw i32 %9, 12
%11 = call i32 @decode(i8* %0, i32 %10, i8* %1)
ret i32 %11
12: ; preds = %3
%13 = call i32 @exit(i32 1)
unreachable
}
short primeira_fase(semente)
unsigned char *semente;
{
  unsigned char buffer[32];
  short somatoria;
  somatoria = dobra_semente(semente, buffer);
  mistura(semente, buffer);
  return somatoria;
}


x86 assembly (clang, -O0):
<primeira_fase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x0,%al
call   1040 <dobra_semente@plt>
mov    %ax,-0x32(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x0,%al
call   1030 <mistura@plt>
movswl -0x32(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<primeira_fase>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <dobra_semente@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <mistura@plt>
mov    %ebp,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define signext i16 @primeira_fase(i8* %0) {
%2 = alloca i8*
%3 = alloca [32 x i8]
%4 = alloca i16
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%7 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @dobra_semente to i32 (i8*, i8*, ...)*)(i8* %5, i8* %6)
%8 = trunc i32 %7 to i16
store i16 %8, i16* %4
%9 = load i8*, i8** %2
%10 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%11 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @mistura to i32 (i8*, i8*, ...)*)(i8* %9, i8* %10)
%12 = load i16, i16* %4
ret i16 %12
}

LLVM IR (-O2):
define signext i16 @primeira_fase(i8* %0) {
%2 = alloca [32 x i8]
%3 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%4 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @dobra_semente to i32 (i8*, i8*, ...)*)(i8* %0, i8* %3)
%5 = trunc i32 %4 to i16
%6 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @mistura to i32 (i8*, i8*, ...)*)(i8* %0, i8* %3)
ret i16 %5
}
/* Variables and functions */
int /*<<< orphan*/ AbsoluteIndirectLong(int);
int /*<<< orphan*/ S9xSetPCBase(int /*<<< orphan*/);
void OpDC(void) { S9xSetPCBase(AbsoluteIndirectLong(5)); }


x86 assembly (clang, -O0):
<OpDC>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
call   1030 <AbsoluteIndirectLong@plt>
mov    %eax,%edi
call   1040 <S9xSetPCBase@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<OpDC>:
push   %rax
mov    $0x5,%edi
call   1030 <AbsoluteIndirectLong@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <S9xSetPCBase@plt>

LLVM IR (-O0):
define void @OpDC() {
%1 = call i32 @AbsoluteIndirectLong(i32 5)
%2 = call i32 @S9xSetPCBase(i32 %1)
ret void
}

LLVM IR (-O2):
define void @OpDC() {
%1 = tail call i32 @AbsoluteIndirectLong(i32 5)
%2 = tail call i32 @S9xSetPCBase(i32 %1)
ret void
}
/* Variables and functions */
char *concatenate(char *, char *, int, char const *);
char *get_job_work_directory(const char *job_dir) {
  return concatenate("%s/work", "job work", 1, job_dir);
}


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

x86 assembly (clang, -O2):
<get_job_work_directory>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
lea    0xee7(%rip),%rsi
mov    $0x1,%edx
jmp    1030 <concatenate@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%s/work\00"
@.str.1 = [9 x i8] c"job work\00"
define i8* @get_job_work_directory(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @concatenate(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 1, i8* %3)
ret i8* %4
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s/work\00"
@.str.1 = [9 x i8] c"job work\00"
define i8* @get_job_work_directory(i8* %0) {
%2 = tail call i8* @concatenate(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 1, i8* %0)
ret i8* %2
}
void null_refresh() {}


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

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

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

LLVM IR (-O2):
define void @null_refresh() {
ret void
}
int main(void) {
  printf('Hello, I am Happy!');
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x70707921,%edi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* inttoptr (i64 1886419233 to i8*))
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* inttoptr (i64 1886419233 to i8*))
ret i32 0
}
unsigned short zig_zag_fixs(short inp) {
  return ((((unsigned short)(inp) >> ((sizeof(unsigned short) << 3) - 1))
               ? ((~(unsigned short)(inp)) << 1)
               : ((unsigned short)(inp) << 1)) ^
          ((unsigned short)(inp) >> ((sizeof(unsigned short) << 3) - 1)));
}


x86 assembly (clang, -O0):
<zig_zag_fixs>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0xf,%eax
cmp    $0x0,%eax
je     112d <zig_zag_fixs+0x2d>
movzwl -0x2(%rbp),%eax
xor    $0xffffffff,%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1137 <zig_zag_fixs+0x37>
movzwl -0x2(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movzwl -0x2(%rbp),%ecx
sar    $0xf,%ecx
xor    %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zig_zag_fixs>:
mov    %edi,%eax
sar    $0xf,%eax
xor    %edi,%eax
shld   $0x1,%di,%ax
ret

LLVM IR (-O0):
define zeroext i16 @zig_zag_fixs(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = ashr i32 %4, 15
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i16, i16* %2
%9 = zext i16 %8 to i32
%10 = xor i32 %9, -1
%11 = shl i32 %10, 1
br label %16
12: ; preds = %1
%13 = load i16, i16* %2
%14 = zext i16 %13 to i32
%15 = shl i32 %14, 1
br label %16
16: ; preds = %12, %7
%17 = phi i32 [ %11, %7 ], [ %15, %12 ]
%18 = load i16, i16* %2
%19 = zext i16 %18 to i32
%20 = ashr i32 %19, 15
%21 = xor i32 %17, %20
%22 = trunc i32 %21 to i16
ret i16 %22
}

LLVM IR (-O2):
define zeroext i16 @zig_zag_fixs(i16 signext %0) {
%2 = ashr i16 %0, 15
%3 = xor i16 %2, %0
%4 = tail call i16 @llvm.fshl.i16(i16 %3, i16 %0, i16 1)
ret i16 %4
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int);
int /*<<< orphan*/ writeLog(char *, char *, char *);
void logOK(char *ip, char *get, int iWrote, int iTotal) {
  char buf[40];
  sprintf(buf, "200 OK %d/%d", iWrote, iTotal);
  writeLog(ip, get, buf);
}


x86 assembly (clang, -O0):
<logOK>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
lea    0xeb9(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x40(%rbp),%rdx
call   1030 <writeLog@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logOK>:
push   %r15
push   %r14
push   %rbx
sub    $0x30,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xeca(%rip),%rsi
mov    %rsp,%r15
mov    %r15,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <writeLog@plt>
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [13 x i8] c"200 OK %d/%d\00"
define void @logOK(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca [40 x i8]
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = getelementptr inbounds [40 x i8], [40 x i8]* %9, i64 0, i64 0
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12)
%14 = load i8*, i8** %5
%15 = load i8*, i8** %6
%16 = getelementptr inbounds [40 x i8], [40 x i8]* %9, i64 0, i64 0
%17 = call i32 @writeLog(i8* %14, i8* %15, i8* %16)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"200 OK %d/%d\00"
define void @logOK(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca [40 x i8]
%6 = getelementptr inbounds [40 x i8], [40 x i8]* %5, i64 0, i64 0
%7 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
%8 = call i32 @writeLog(i8* %0, i8* %1, i8* %6)
ret void
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
void *memdup(const void *d, size_t len) {
  void *p = malloc(len);
  if (!p)
    return p;
  memcpy(p, d, len);
  return p;
}


x86 assembly (clang, -O0):
<memdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1155 <memdup+0x35>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116e <memdup+0x4e>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memdup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsi,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1149 <memdup+0x29>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @memdup(i8* %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @memcpy(i8* %3, i8* %0, i64 %1)
br label %7
7: ; preds = %2, %5
ret i8* %3
}
/* Variables and functions */
bool nrf91_errata_24(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf91_errata_24() {
ret i32 0
}
void gtk_text_buffer_create_child_anchor() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_buffer_create_child_anchor() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ assume(int);
int main() {
  int i;
  int k;
  int n;
  assume(i == 0 && k == 0);
  while (i < n) {
    i++;
    k++;
  }
  assert(k >= n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
jne    1148 <main+0x28>
cmpl   $0x0,-0xc(%rbp)
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assume@plt>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1178 <main+0x58>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1155 <main+0x35>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <assume@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 0
br label %10
10: ; preds = %7, %0
%11 = phi i1 [ false, %0 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @assume(i32 %12)
br label %14
14: ; preds = %18, %10
%15 = load i32, i32* %2
%16 = load i32, i32* %4
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %23
18: ; preds = %14
%19 = load i32, i32* %2
%20 = add nsw i32 %19, 1
store i32 %20, i32* %2
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %14
23: ; preds = %14
%24 = load i32, i32* %3
%25 = load i32, i32* %4
%26 = icmp sge i32 %24, %25
%27 = zext i1 %26 to i32
%28 = call i32 @assert(i32 %27)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assume(i32 0)
%2 = tail call i32 @assert(i32 1)
ret i32 0
}
void f(int z) {
  int x, y;
#pragma omp task depend(out : x)
  { x = 3; }
#pragma omp task depend(in : x) depend(out : y)
  { y = x + 1; }
#pragma omp taskwait
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f(i32 %0) {
ret void
}
/* Type definitions */
typedef int wchar_t;

/* Variables and functions */
wchar_t test24(void) { return L'\x3'; }


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

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

LLVM IR (-O0):
define i32 @test24() {
ret i32 3
}

LLVM IR (-O2):
define i32 @test24() {
ret i32 3
}
/* Variables and functions */
int /*<<< orphan*/ T_init(int, int, int /*<<< orphan*/);
int /*<<< orphan*/ getchar();
int main(void) {
  int frame = 0;
  T_init(2021, 1, 0);
  while (1) {
    getchar();
    ;
    frame++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x7e5,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1040 <T_init@plt>
mov    $0x0,%al
call   1030 <getchar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    %eax,-0x8(%rbp)
jmp    1147 <main+0x27>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x7e5,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1040 <T_init@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <getchar@plt>
jmp    1140 <main+0x20>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 @T_init(i32 2021, i32 1, i32 0)
br label %4
4: ; preds = %0, %4
%5 = call i32 (...) @getchar()
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 1
store i32 %7, i32* %2
br label %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @T_init(i32 2021, i32 1, i32 0)
br label %2
2: ; preds = %2, %0
%3 = tail call i32 (...) @getchar()
br label %2
}
/* Variables and functions */
__attribute__((weak)) void rgblight_decrease_hue(void) {}


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

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

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

LLVM IR (-O2):
define weak void @rgblight_decrease_hue() {
ret void
}
void h_cmee(char *name, int argc, char **argv, void *user_data) {
  printf("Called: %s\n", __FUNCTION__);
}


x86 assembly (clang, -O0):
<h_cmee>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    0xed2(%rip),%rdi
lea    0xed7(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h_cmee>:
lea    0xee9(%rip),%rdi
lea    0xeee(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Called: %s\0A\00"
@__FUNCTION__.h_cmee = [7 x i8] c"h_cmee\00"
define void @h_cmee(i8* %0, i32 %1, i8** %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
store i8* %3, i8** %8
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__FUNCTION__.h_cmee, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Called: %s\0A\00"
@__FUNCTION__.h_cmee = [7 x i8] c"h_cmee\00"
define void @h_cmee(i8* nocapture readnone %0, i32 %1, i8** nocapture readnone %2, i8* nocapture readnone %3) {
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__FUNCTION__.h_cmee, i64 0, i64 0))
ret void
}
/* Variables and functions */
float Si1132_I2C_read16(int);
int /*<<< orphan*/ usleep(int);
float Si1132_readUV() {
  usleep(10000);
  return Si1132_I2C_read16(0x2c);
}


x86 assembly (clang, -O0):
<Si1132_readUV>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2710,%edi
call   1040 <usleep@plt>
mov    $0x2c,%edi
call   1030 <Si1132_I2C_read16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Si1132_readUV>:
push   %rax
mov    $0x2710,%edi
call   1040 <usleep@plt>
mov    $0x2c,%edi
pop    %rax
jmp    1030 <Si1132_I2C_read16@plt>

LLVM IR (-O0):
define float @Si1132_readUV() {
%1 = call i32 @usleep(i32 10000)
%2 = call float @Si1132_I2C_read16(i32 44)
ret float %2
}

LLVM IR (-O2):
define float @Si1132_readUV() {
%1 = tail call i32 @usleep(i32 10000)
%2 = tail call float @Si1132_I2C_read16(i32 44)
ret float %2
}
/* Variables and functions */
double log(double);
double To_dB(double arg, double zero_db_level) {
  return 10.0 * log(arg / zero_db_level);
}


x86 assembly (clang, -O0):
<To_dB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  0xec4(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<To_dB>:
push   %rax
divsd  %xmm1,%xmm0
call   1030 <log@plt>
mulsd  0xede(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @To_dB(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fdiv double %5, %6
%8 = call double @log(double %7)
%9 = fmul double 1.000000e+01, %8
ret double %9
}

LLVM IR (-O2):
define double @To_dB(double %0, double %1) {
%3 = fdiv double %0, %1
%4 = tail call double @log(double %3)
%5 = fmul double %4, 1.000000e+01
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *argv0) {
  fprintf(stderr,
          "Usage: %s thread_count child_threads c_t_ratio\n\n"
          "Exactly two argument required:\n"
          "    thread_count: Total number of threads to create.\n"
          "    child_threads: The number of threads simulating children.\n"
          "    c_t_ratio: The allowed ratio of children to teachers.\n\n",
          argv0);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [254 x i8] c"Usage: %s thread_count child_threads c_t_ratio\0A\0AExactly two argument required:\0A thread_count: Total number of threads to create.\0A child_threads: The number of threads simulating children.\0A c_t_ratio: The allowed ratio of children to teachers.\0A\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([254 x i8], [254 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [254 x i8] c"Usage: %s thread_count child_threads c_t_ratio\0A\0AExactly two argument required:\0A thread_count: Total number of threads to create.\0A child_threads: The number of threads simulating children.\0A c_t_ratio: The allowed ratio of children to teachers.\0A\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([254 x i8], [254 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
int main(void) { return 2 + 2; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int strlen(char const *);
int write(int, char const *, int);
int serial_write(int fd, const char *str) {
  int len = strlen(str);
  int n = write(fd, str, len);
  if (n != len) {
    perror("serial_write: couldn't write whole string\n");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<serial_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
je     1181 <serial_write+0x51>
lea    0xe90(%rip),%rdi
call   1050 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1188 <serial_write+0x58>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_write>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%r14d
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %eax,%ebp
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ebp,%ecx
jne    115e <serial_write+0x2e>
pop    %rbx
pop    %r14
pop    %rbp
ret
lea    0xe9b(%rip),%rdi
call   1050 <perror@plt>
mov    $0xffffffff,%eax
jmp    1159 <serial_write+0x29>

LLVM IR (-O0):
@.str = [43 x i8] c"serial_write: couldn't write whole string\0A\00"
define i32 @serial_write(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
%8 = load i8*, i8** %5
%9 = call i32 @strlen(i8* %8)
store i32 %9, i32* %6
%10 = load i32, i32* %4
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = call i32 @write(i32 %10, i8* %11, i32 %12)
store i32 %13, i32* %7
%14 = load i32, i32* %7
%15 = load i32, i32* %6
%16 = icmp ne i32 %14, %15
br i1 %16, label %17, label %19
17: ; preds = %2
%18 = call i32 @perror(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %20
19: ; preds = %2
store i32 0, i32* %3
br label %20
20: ; preds = %19, %17
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
@.str = [43 x i8] c"serial_write: couldn't write whole string\0A\00"
define i32 @serial_write(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %3)
%5 = icmp eq i32 %4, %3
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @perror(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ -1, %6 ], [ 0, %2 ]
ret i32 %9
}
/* Variables and functions */
int tracepoint_probe_unregister(char *, void *);
__attribute__((always_)) int
unregister_trace_module_load(void (*probe)(struct module *mod)) {
  return tracepoint_probe_unregister("module_load", (void *)probe);
}


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

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

LLVM IR (-O0):
%struct.module = type opaque
@.str = [12 x i8] c"module_load\00"
define i32 @unregister_trace_module_load(void (%struct.module*)* %0) {
%2 = alloca void (%struct.module*)*
store void (%struct.module*)* %0, void (%struct.module*)** %2
%3 = load void (%struct.module*)*, void (%struct.module*)** %2
%4 = bitcast void (%struct.module*)* %3 to i8*
%5 = call i32 @tracepoint_probe_unregister(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.module = type opaque
@.str = [12 x i8] c"module_load\00"
define i32 @unregister_trace_module_load(void (%struct.module*)* %0) {
%2 = bitcast void (%struct.module*)* %0 to i8*
%3 = tail call i32 @tracepoint_probe_unregister(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, char *, int);
int main() {
  char *x = "#include <stdio.h>%cint main(){char* "
            "x=%c%s%c;printf(x,10,34,x,34);return 0;}";
  printf(x, 10, 34, x, 34);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0xa,%esi
mov    $0x22,%r8d
mov    %r8d,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rcx
mov    %rcx,%rdi
mov    $0xa,%esi
mov    $0x22,%edx
mov    $0x22,%r8d
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [78 x i8] c"#include <stdio.h>%cint main(){char* x=%c%s%c;printf(x,10,34,x,34);return 0;}\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* %3, i32 10, i32 34, i8* %4, i32 34)
ret i32 0
}

LLVM IR (-O2):
@.str = [78 x i8] c"#include <stdio.h>%cint main(){char* x=%c%s%c;printf(x,10,34,x,34);return 0;}\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0), i32 10, i32 34, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0), i32 34)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int werase(WINDOW *w) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @werase(i32* nocapture readnone %0) {
ret i32 0
}
long long uzzz() { return 0x7fff000000000000LL; }


x86 assembly (clang, -O0):
<uzzz>:
push   %rbp
mov    %rsp,%rbp
movabs $0x7fff000000000000,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uzzz>:
movabs $0x7fff000000000000,%rax
ret

LLVM IR (-O0):
define i64 @uzzz() {
ret i64 9223090561878065152
}

LLVM IR (-O2):
define i64 @uzzz() {
ret i64 9223090561878065152
}
/* Type definitions */
typedef int /*<<< orphan*/ size;

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_SNDBUF;
int api_error_translate(int /*<<< orphan*/);
int /*<<< orphan*/ errno;
scalar_t__ setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int *, int);
int api_socket_send_buffer_size(int fd, int size) {
  if (0 == setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &size, sizeof(size)))
    return 0;
  return api_error_translate(errno);
}


x86 assembly (clang, -O0):
<api_socket_send_buffer_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
mov    0x2e9f(%rip),%rax
mov    (%rax),%edx
lea    -0xc(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    116c <api_socket_send_buffer_size+0x4c>
movl   $0x0,-0x4(%rbp)
jmp    117d <api_socket_send_buffer_size+0x5d>
mov    0x2e5d(%rip),%rax
mov    (%rax),%edi
call   1040 <api_error_translate@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<api_socket_send_buffer_size>:
push   %rax
mov    %esi,0x4(%rsp)
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
mov    0x2eab(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
test   %rax,%rax
je     115c <api_socket_send_buffer_size+0x3c>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1040 <api_error_translate@plt>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_SNDBUF = global i32 0
@errno = global i32 0
define i32 @api_socket_send_buffer_size(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* @SOL_SOCKET
%8 = load i32, i32* @SO_SNDBUF
%9 = call i64 @setsockopt(i32 %6, i32 %7, i32 %8, i32* %5, i32 4)
%10 = icmp eq i64 0, %9
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 0, i32* %3
br label %15
12: ; preds = %2
%13 = load i32, i32* @errno
%14 = call i32 @api_error_translate(i32 %13)
store i32 %14, i32* %3
br label %15
15: ; preds = %12, %11
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_SNDBUF = global i32 0
@errno = global i32 0
define i32 @api_socket_send_buffer_size(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = load i32, i32* @SOL_SOCKET
%5 = load i32, i32* @SO_SNDBUF
%6 = call i64 @setsockopt(i32 %0, i32 %4, i32 %5, i32* %3, i32 4)
%7 = icmp eq i64 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i32, i32* @errno
%10 = call i32 @api_error_translate(i32 %9)
br label %11
11: ; preds = %2, %8
%12 = phi i32 [ %10, %8 ], [ 0, %2 ]
ret i32 %12
}
/* Type definitions */
struct cmd_arg {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void cmdExitCli(int cmdType, struct cmd_arg *pCmdArg) { exit(0); }


x86 assembly (clang, -O0):
<cmdExitCli>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<cmdExitCli>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
%struct.cmd_arg = type { i32 }
define void @cmdExitCli(i32 %0, %struct.cmd_arg* %1) {
%3 = alloca i32
%4 = alloca %struct.cmd_arg*
store i32 %0, i32* %3
store %struct.cmd_arg* %1, %struct.cmd_arg** %4
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
%struct.cmd_arg = type { i32 }
define void @cmdExitCli(i32 %0, %struct.cmd_arg* nocapture readnone %1) {
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
int splitCharArray(char **source, char *dest, int length) {
  memcpy(dest, *source, length);
  dest[length - 1] = 0;
  (*source) += length;
  return 0;
}


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

x86 assembly (clang, -O2):
<splitCharArray>:
push   %r15
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rdi,%r15
mov    (%rdi),%rsi
mov    %r14,%rdi
call   1030 <memcpy@plt>
movslq %ebx,%rax
movb   $0x0,-0x1(%rax,%r14,1)
add    %rax,(%r15)
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @splitCharArray(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** %5
%8 = load i8**, i8*** %4
%9 = load i8*, i8** %8
%10 = load i32, i32* %6
%11 = call i32 @memcpy(i8* %7, i8* %9, i32 %10)
%12 = load i8*, i8** %5
%13 = load i32, i32* %6
%14 = sub nsw i32 %13, 1
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %12, i64 %15
store i8 0, i8* %16
%17 = load i32, i32* %6
%18 = load i8**, i8*** %4
%19 = load i8*, i8** %18
%20 = sext i32 %17 to i64
%21 = getelementptr inbounds i8, i8* %19, i64 %20
store i8* %21, i8** %18
ret i32 0
}

LLVM IR (-O2):
define i32 @splitCharArray(i8** nocapture %0, i8* %1, i32 %2) {
%4 = load i8*, i8** %0
%5 = tail call i32 @memcpy(i8* %1, i8* %4, i32 %2)
%6 = add nsw i32 %2, -1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %1, i64 %7
store i8 0, i8* %8
%9 = load i8*, i8** %0
%10 = sext i32 %2 to i64
%11 = getelementptr inbounds i8, i8* %9, i64 %10
store i8* %11, i8** %0
ret i32 0
}
void av_format_set_control_message_cb() {}


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

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

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

LLVM IR (-O2):
define void @av_format_set_control_message_cb() {
ret void
}
int int_abs(int x) { return ((x < 0) ? -x : x); }


x86 assembly (clang, -O0):
<int_abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111e <int_abs+0x1e>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <int_abs+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @int_abs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 0, %6
br label %10
8: ; preds = %1
%9 = load i32, i32* %2
br label %10
10: ; preds = %8, %5
%11 = phi i32 [ %7, %5 ], [ %9, %8 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @int_abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ RadioAlarmP__0__Alarm__fired();
void AtmegaCompareP__1__Alarm__fired(void) { RadioAlarmP__0__Alarm__fired(); }


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

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

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

LLVM IR (-O2):
define void @AtmegaCompareP__1__Alarm__fired() {
%1 = tail call i32 (...) @RadioAlarmP__0__Alarm__fired()
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned long serial;
};
struct TYPE_4__ {
  TYPE_1__ xbutton;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xbutton_serial(void *_p, unsigned long _v) {
  ((XEvent *)_p)->xbutton.serial = (unsigned long)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xbutton_serial>:
mov    %rsi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XEvent_xbutton_serial(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, char *);
void input(char *input_array) {
  puts("Enter the card name: ");
  scanf("%2s", input_array);
}


x86 assembly (clang, -O0):
<input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%rsi
lea    0xed3(%rip),%rdi
call   1040 <scanf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<input>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
lea    0xedf(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <scanf@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Enter the card name: \00"
@.str.1 = [4 x i8] c"%2s\00"
define void @input(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @puts(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Enter the card name: \00"
@.str.1 = [4 x i8] c"%2s\00"
define void @input(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
void do_frozen_tests() {
  struct {
    int i;
    struct {
      int j;
      int k;
    } nested;
  } v1 = {1, {2, 3}};
  int v2 = 4;
  v2 = 5;
  v2 = 6;
  v1.i = 7;
  v1.nested.j = 8;
  v1.nested.k = 9;
  v1.i = 10;
  v1.nested.j = 11;
  v1.nested.k = 12;
}


x86 assembly (clang, -O0):
<do_frozen_tests>:
push   %rbp
mov    %rsp,%rbp
mov    0xef5(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xef3(%rip),%eax
mov    %eax,-0x8(%rbp)
movl   $0x4,-0x14(%rbp)
movl   $0x5,-0x14(%rbp)
movl   $0x6,-0x14(%rbp)
movl   $0x7,-0x10(%rbp)
movl   $0x8,-0xc(%rbp)
movl   $0x9,-0x8(%rbp)
movl   $0xa,-0x10(%rbp)
movl   $0xb,-0xc(%rbp)
movl   $0xc,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.anon = type { i32, %struct.anon.0 }
%struct.anon.0 = type { i32, i32 }
@__const.do_frozen_tests.v1 = %struct.anon { i32 1, %struct.anon.0 { i32 2, i32 3 } }
define void @do_frozen_tests() {
%1 = alloca %struct.anon
%2 = alloca i32
%3 = bitcast %struct.anon* %1 to i8*
store i32 4, i32* %2
store i32 5, i32* %2
store i32 6, i32* %2
%4 = getelementptr inbounds %struct.anon, %struct.anon* %1, i32 0, i32 0
store i32 7, i32* %4
%5 = getelementptr inbounds %struct.anon, %struct.anon* %1, i32 0, i32 1
%6 = getelementptr inbounds %struct.anon.0, %struct.anon.0* %5, i32 0, i32 0
store i32 8, i32* %6
%7 = getelementptr inbounds %struct.anon, %struct.anon* %1, i32 0, i32 1
%8 = getelementptr inbounds %struct.anon.0, %struct.anon.0* %7, i32 0, i32 1
store i32 9, i32* %8
%9 = getelementptr inbounds %struct.anon, %struct.anon* %1, i32 0, i32 0
store i32 10, i32* %9
%10 = getelementptr inbounds %struct.anon, %struct.anon* %1, i32 0, i32 1
%11 = getelementptr inbounds %struct.anon.0, %struct.anon.0* %10, i32 0, i32 0
store i32 11, i32* %11
%12 = getelementptr inbounds %struct.anon, %struct.anon* %1, i32 0, i32 1
%13 = getelementptr inbounds %struct.anon.0, %struct.anon.0* %12, i32 0, i32 1
store i32 12, i32* %13
ret void
}

LLVM IR (-O2):
define void @do_frozen_tests() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ str_permutations_aux(char *, int /*<<< orphan*/,
                                        int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void str_permutations(char *str) { str_permutations_aux(str, strlen(str), 0); }


x86 assembly (clang, -O0):
<str_permutations>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
xor    %edx,%edx
call   1030 <str_permutations_aux@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_permutations>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %edx,%edx
pop    %rbx
jmp    1030 <str_permutations_aux@plt>

LLVM IR (-O0):
define void @str_permutations(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @str_permutations_aux(i8* %3, i32 %5, i32 0)
ret void
}

LLVM IR (-O2):
define void @str_permutations(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @str_permutations_aux(i8* %0, i32 %2, i32 0)
ret void
}