xunge/DecIR huggingface dataset:
int is_triplet(int a, int b, int c) {
  return 0 < a && a < b && b < c && a * a + b * b == c * c;
}


x86 assembly (clang, -O0):
<is_triplet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
xor    %eax,%eax
xor    %ecx,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0xd(%rbp)
jge    115e <is_triplet+0x5e>
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
cmp    -0x8(%rbp),%ecx
mov    %al,-0xd(%rbp)
jge    115e <is_triplet+0x5e>
mov    -0x8(%rbp),%ecx
xor    %eax,%eax
cmp    -0xc(%rbp),%ecx
mov    %al,-0xd(%rbp)
jge    115e <is_triplet+0x5e>
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    %ecx,%eax
mov    -0xc(%rbp),%ecx
imul   -0xc(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_triplet>:
xor    %eax,%eax
test   %edi,%edi
jle    1120 <is_triplet+0x20>
cmp    %esi,%edi
jge    1120 <is_triplet+0x20>
cmp    %edx,%esi
jge    1120 <is_triplet+0x20>
imul   %edi,%edi
imul   %esi,%esi
add    %edi,%esi
imul   %edx,%edx
xor    %eax,%eax
cmp    %edx,%esi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_triplet(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, 0
%5 = icmp slt i32 %0, %1
%6 = and i1 %4, %5
%7 = icmp slt i32 %1, %2
%8 = and i1 %6, %7
br i1 %8, label %9, label %16
9: ; preds = %3
%10 = mul nsw i32 %0, %0
%11 = mul nsw i32 %1, %1
%12 = add nuw nsw i32 %11, %10
%13 = mul nsw i32 %2, %2
%14 = icmp eq i32 %12, %13
%15 = zext i1 %14 to i32
br label %16
16: ; preds = %9, %3
%17 = phi i32 [ 0, %3 ], [ %15, %9 ]
ret i32 %17
}
void pinHigh(int pin) { ; }


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

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

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

LLVM IR (-O2):
define void @pinHigh(i32 %0) {
ret void
}
/* Type definitions */
struct ifaddrs {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int getifaddrs(struct ifaddrs **ifap) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<getifaddrs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getifaddrs>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.ifaddrs = type { i32 }
@ENOSYS = global i32 0
define i32 @getifaddrs(%struct.ifaddrs** %0) {
%2 = alloca %struct.ifaddrs**
store %struct.ifaddrs** %0, %struct.ifaddrs*** %2
%3 = load i32, i32* @ENOSYS
%4 = call i32 @__set_errno(i32 %3)
ret i32 -1
}

LLVM IR (-O2):
%struct.ifaddrs = type { i32 }
@ENOSYS = global i32 0
define i32 @getifaddrs(%struct.ifaddrs** nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
%3 = tail call i32 @__set_errno(i32 %2)
ret i32 -1
}
void completed_function(char arg1, int arg2, double arg3) {
  (void)arg1;
  (void)arg2;
  (void)arg3;
  return;
}


x86 assembly (clang, -O0):
<completed_function>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @completed_function(i8 signext %0, i32 %1, double %2) {
ret void
}
unsigned long getBuildNumber(void) { return (unsigned)2398; }


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

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

LLVM IR (-O0):
define i64 @getBuildNumber() {
ret i64 2398
}

LLVM IR (-O2):
define i64 @getBuildNumber() {
ret i64 2398
}
DrawPiece(loc) short loc;
{}


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

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

LLVM IR (-O0):
define i32 @DrawPiece(i32 %0) {
%2 = alloca i32
%3 = alloca i16
%4 = trunc i32 %0 to i16
store i16 %4, i16* %3
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
define i32 @DrawPiece(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_bad() { printf("[BAD]\n"); }


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"[BAD]\00"
define void @print_bad() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stdout;
void printTestResult(char *testName, int passed) {
  if (passed) {
    fprintf(stdout, "%s - %s\n\n", "[PASSED]", testName);
  } else {
    fprintf(stdout, "%s - %s\n\n", "[FAILED]", testName);
  }
}


x86 assembly (clang, -O0):
<printTestResult>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     114e <printTestResult+0x3e>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rcx
lea    0xec3(%rip),%rsi
lea    0xec6(%rip),%rdx
call   1030 <fprintf@plt>
jmp    116e <printTestResult+0x5e>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rcx
lea    0xe9e(%rip),%rsi
lea    0xeaa(%rip),%rdx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printTestResult>:
mov    %rdi,%rcx
test   %esi,%esi
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
lea    0xeee(%rip),%rax
lea    0xede(%rip),%rdx
cmove  %rax,%rdx
lea    0xec9(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [10 x i8] c"%s - %s\0A\0A\00"
@.str.1 = [9 x i8] c"[PASSED]\00"
@.str.2 = [9 x i8] c"[FAILED]\00"
define void @printTestResult(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i32, i32* @stdout
%9 = load i8*, i8** %3
%10 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %9)
br label %15
11: ; preds = %2
%12 = load i32, i32* @stdout
%13 = load i8*, i8** %3
%14 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %13)
br label %15
15: ; preds = %11, %7
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [10 x i8] c"%s - %s\0A\0A\00"
@.str.1 = [9 x i8] c"[PASSED]\00"
@.str.2 = [9 x i8] c"[FAILED]\00"
define void @printTestResult(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = load i32, i32* @stdout
%5 = select i1 %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0)
%6 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, void *);
int main() {
  int students;
  int *studentsp;
  students = 12;
  studentsp = &students;
  printf("students:  %d\n", students);
  printf("studentsp: %p\n", (void *)studentsp);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xc,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movslq -0x8(%rbp),%rsi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0xc,0x4(%rsp)
lea    0xee0(%rip),%rdi
mov    $0xc,%esi
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"students: %d\0A\00"
@.str.1 = [15 x i8] c"studentsp: %p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 12, i32* %1
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* inttoptr (i64 12 to i8*))
%4 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
void backreference2named_back_reference() {}


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

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

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

LLVM IR (-O2):
define void @backreference2named_back_reference() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i;
  for (i = 0; i < 60; i++) {
    printf("Number: %d\n", i);
  }
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3c,-0x8(%rbp)
jge    115d <main+0x3d>
mov    -0x8(%rbp),%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xed3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x3c,%ebx
jne    1130 <main+0x10>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Number: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %9, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 60
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %6
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
br label %3
12: ; preds = %3
%13 = call i32 (...) @getchar()
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@.str = [12 x i8] c"Number: %d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 60
br i1 %5, label %6, label %1
6: ; preds = %1
%7 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SCR_UpdateScoreboardMessage(int /*<<< orphan*/);
int /*<<< orphan*/ trap_Cmd_Argv(int);
void CG_SC_Scoreboard(void) { SCR_UpdateScoreboardMessage(trap_Cmd_Argv(1)); }


x86 assembly (clang, -O0):
<CG_SC_Scoreboard>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1040 <trap_Cmd_Argv@plt>
mov    %eax,%edi
call   1030 <SCR_UpdateScoreboardMessage@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CG_SC_Scoreboard>:
push   %rax
mov    $0x1,%edi
call   1040 <trap_Cmd_Argv@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <SCR_UpdateScoreboardMessage@plt>

LLVM IR (-O0):
define void @CG_SC_Scoreboard() {
%1 = call i32 @trap_Cmd_Argv(i32 1)
%2 = call i32 @SCR_UpdateScoreboardMessage(i32 %1)
ret void
}

LLVM IR (-O2):
define void @CG_SC_Scoreboard() {
%1 = tail call i32 @trap_Cmd_Argv(i32 1)
%2 = tail call i32 @SCR_UpdateScoreboardMessage(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  typedef enum { NORTH, EAST, WEST, SOUTH } directions;
  directions a, b, c, d;
  a = EAST;
  b = WEST;
  printf("%d, %d\n", a, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"%d, %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 1, i32 2)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void display_date_time() {
  printf("\n");
  time_t timer;
  char buffer[26];
  struct tm *tm_info;
  time(&timer);
  tm_info = localtime(&timer);
  strftime(buffer, 26, "%Y-%m-%d %H:%M:%S", tm_info);
  puts(buffer);
}


x86 assembly (clang, -O0):
<display_date_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    0xea1(%rip),%rdi
call   1050 <printf@plt>
lea    -0x4(%rbp),%rdi
call   1060 <time@plt>
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x28(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rcx
mov    $0x1a,%esi
lea    0xe74(%rip),%rdx
call   1070 <strftime@plt>
lea    -0x20(%rbp),%rdi
call   1040 <puts@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_date_time>:
push   %rbx
sub    $0x30,%rsp
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1060 <time@plt>
mov    %rbx,%rdi
call   1040 <localtime@plt>
lea    0xe85(%rip),%rdx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x1a,%esi
mov    %rax,%rcx
call   1070 <strftime@plt>
mov    %rbx,%rdi
call   1050 <puts@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [2 x i8] c"\0A\00"
@.str.1 = [18 x i8] c"%Y-%m-%d %H:%M:%S\00"
define void @display_date_time() {
%1 = alloca i32
%2 = alloca [26 x i8]
%3 = alloca %struct.tm*
%4 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @time(i32* %1)
%6 = call %struct.tm* @localtime(i32* %1)
store %struct.tm* %6, %struct.tm** %3
%7 = getelementptr inbounds [26 x i8], [26 x i8]* %2, i64 0, i64 0
%8 = load %struct.tm*, %struct.tm** %3
%9 = call i32 @strftime(i8* %7, i32 26, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), %struct.tm* %8)
%10 = getelementptr inbounds [26 x i8], [26 x i8]* %2, i64 0, i64 0
%11 = call i32 @puts(i8* %10)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str.1 = [18 x i8] c"%Y-%m-%d %H:%M:%S\00"
define void @display_date_time() {
%1 = alloca i32
%2 = alloca [26 x i8]
%3 = tail call i32 @putchar(i32 10)
%4 = bitcast i32* %1 to i8*
%5 = getelementptr inbounds [26 x i8], [26 x i8]* %2, i64 0, i64 0
%6 = call i32 @time(i32* %1)
%7 = call %struct.tm* @localtime(i32* %1)
%8 = call i32 @strftime(i8* %5, i32 26, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), %struct.tm* %7)
%9 = call i32 @puts(i8* %5)
ret void
}
void test_10(unsigned char *x, unsigned short *y) {
  x[1] = y[1];
  x[2] = y[2];
}


x86 assembly (clang, -O0):
<test_10>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2(%rax),%ax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%ax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_10>:
mov    0x2(%rsi),%al
mov    %al,0x1(%rdi)
mov    0x4(%rsi),%al
mov    %al,0x2(%rdi)
ret

LLVM IR (-O0):
define void @test_10(i8* %0, i16* %1) {
%3 = alloca i8*
%4 = alloca i16*
store i8* %0, i8** %3
store i16* %1, i16** %4
%5 = load i16*, i16** %4
%6 = getelementptr inbounds i16, i16* %5, i64 1
%7 = load i16, i16* %6
%8 = trunc i16 %7 to i8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
store i8 %8, i8* %10
%11 = load i16*, i16** %4
%12 = getelementptr inbounds i16, i16* %11, i64 2
%13 = load i16, i16* %12
%14 = trunc i16 %13 to i8
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 2
store i8 %14, i8* %16
ret void
}

LLVM IR (-O2):
define void @test_10(i8* nocapture writeonly %0, i16* nocapture %1) {
%3 = getelementptr inbounds i16, i16* %1, i64 1
%4 = load i16, i16* %3
%5 = trunc i16 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
%7 = getelementptr inbounds i16, i16* %1, i64 2
%8 = load i16, i16* %7
%9 = trunc i16 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %9, i8* %10
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ selection;
};
typedef TYPE_1__ XSelectionRequestEvent;

/* Variables and functions */
unsigned long get_XSelectionRequestEvent_selection(void *_p) {
  return (unsigned long)((XSelectionRequestEvent *)_p)->selection;
}


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

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

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

LLVM IR (-O2):
define i64 @get_XSelectionRequestEvent_selection(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
unsigned long ulen(unsigned long i, unsigned base) {
  int count = 0;
  if (i == 0)
    return 1;
  for (; i > 0; ++count)
    i /= base;
  return count;
}


x86 assembly (clang, -O0):
<ulen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    112a <ulen+0x2a>
movq   $0x1,-0x8(%rbp)
jmp    1162 <ulen+0x62>
jmp    112f <ulen+0x2f>
cmpq   $0x0,-0x10(%rbp)
jbe    115a <ulen+0x5a>
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
xor    %edx,%edx
div    %rcx
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112f <ulen+0x2f>
movslq -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ulen>:
test   %rdi,%rdi
je     1139 <ulen+0x39>
mov    %esi,%esi
xor    %ecx,%ecx
jmp    1124 <ulen+0x24>
nopl   0x0(%rax,%rax,1)
mov    %rdi,%rax
xor    %edx,%edx
div    %rsi
add    $0x1,%rcx
cmp    %rsi,%rdi
mov    %rax,%rdi
jb     1135 <ulen+0x35>
mov    %rdi,%rax
shr    $0x20,%rax
jne    1110 <ulen+0x10>
mov    %edi,%eax
xor    %edx,%edx
div    %esi
jmp    1118 <ulen+0x18>
mov    %rcx,%rax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i64 @ulen(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
store i64 %0, i64* %4
store i32 %1, i32* %5
store i32 0, i32* %6
%7 = load i64, i64* %4
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
store i64 1, i64* %3
br label %25
10: ; preds = %2
br label %11
11: ; preds = %19, %10
%12 = load i64, i64* %4
%13 = icmp ugt i64 %12, 0
br i1 %13, label %14, label %22
14: ; preds = %11
%15 = load i32, i32* %5
%16 = zext i32 %15 to i64
%17 = load i64, i64* %4
%18 = udiv i64 %17, %16
store i64 %18, i64* %4
br label %19
19: ; preds = %14
%20 = load i32, i32* %6
%21 = add nsw i32 %20, 1
store i32 %21, i32* %6
br label %11
22: ; preds = %11
%23 = load i32, i32* %6
%24 = sext i32 %23 to i64
store i64 %24, i64* %3
br label %25
25: ; preds = %22, %9
%26 = load i64, i64* %3
ret i64 %26
}

LLVM IR (-O2):
define i64 @ulen(i64 %0, i32 %1) {
%3 = icmp eq i64 %0, 0
br i1 %3, label %14, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i32 [ 0, %4 ], [ %10, %6 ]
%8 = phi i64 [ %0, %4 ], [ %9, %6 ]
%9 = udiv i64 %8, %5
%10 = add nuw nsw i32 %7, 1
%11 = icmp ult i64 %8, %5
br i1 %11, label %12, label %6
12: ; preds = %6
%13 = zext i32 %10 to i64
br label %14
14: ; preds = %2, %12
%15 = phi i64 [ %13, %12 ], [ 1, %2 ]
ret i64 %15
}
void setup_sym_set(void) {}


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

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

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

LLVM IR (-O2):
define void @setup_sym_set() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CRYPTO_free(void *, char const *, int);
int /*<<< orphan*/ OPENSSL_cleanse(void *, size_t);
void CRYPTO_secure_clear_free(void *ptr, size_t num, const char *file,
                              int line) {
  if (ptr == NULL)
    return;
  OPENSSL_cleanse(ptr, num);
  CRYPTO_free(ptr, file, line);
}


x86 assembly (clang, -O0):
<CRYPTO_secure_clear_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1147 <CRYPTO_secure_clear_free+0x27>
jmp    1164 <CRYPTO_secure_clear_free+0x44>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <OPENSSL_cleanse@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <CRYPTO_free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CRYPTO_secure_clear_free>:
test   %rdi,%rdi
je     1149 <CRYPTO_secure_clear_free+0x29>
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %rdx,%rbx
mov    %rdi,%rbp
call   1040 <OPENSSL_cleanse@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <CRYPTO_free@plt>
ret

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

LLVM IR (-O2):
define void @CRYPTO_secure_clear_free(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = icmp eq i8* %0, null
br i1 %5, label %9, label %6
6: ; preds = %4
%7 = tail call i32 @OPENSSL_cleanse(i8* %0, i64 %1)
%8 = tail call i32 @CRYPTO_free(i8* %0, i8* %2, i32 %3)
br label %9
9: ; preds = %4, %6
ret void
}
/* Type definitions */
struct object {
  int dummy;
};

/* Variables and functions */
struct object *car(struct object *);
struct object *prim_car(struct object *args) {
  return (car(car((args))));
}


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

x86 assembly (clang, -O2):
<prim_car>:
push   %rax
call   1030 <car@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <car@plt>

LLVM IR (-O0):
%struct.object = type { i32 }
define %struct.object* @prim_car(%struct.object* %0) {
%2 = alloca %struct.object*
store %struct.object* %0, %struct.object** %2
%3 = load %struct.object*, %struct.object** %2
%4 = call %struct.object* @car(%struct.object* %3)
%5 = call %struct.object* @car(%struct.object* %4)
ret %struct.object* %5
}

LLVM IR (-O2):
%struct.object = type { i32 }
define %struct.object* @prim_car(%struct.object* %0) {
%2 = tail call %struct.object* @car(%struct.object* %0)
%3 = tail call %struct.object* @car(%struct.object* %2)
ret %struct.object* %3
}
/* Type definitions */
struct option {
  int dummy;
};

/* Variables and functions */
int _getopt_internal(int, char *const *, char const *, struct option const *,
                     int *, int /*<<< orphan*/, int /*<<< orphan*/);
int getopt_long(int argc, char *const *argv, const char *options,
                const struct option *long_options, int *opt_index) {
  return _getopt_internal(argc, argv, options, long_options, opt_index, 0, 0);
}


x86 assembly (clang, -O0):
<getopt_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
xor    %r9d,%r9d
movl   $0x0,(%rsp)
call   1030 <_getopt_internal@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getopt_long>:
push   %rax
movl   $0x0,(%rsp)
xor    %r9d,%r9d
call   1030 <_getopt_internal@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.option = type { i32 }
define i32 @getopt_long(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8*
%9 = alloca %struct.option*
%10 = alloca i32*
store i32 %0, i32* %6
store i8** %1, i8*** %7
store i8* %2, i8** %8
store %struct.option* %3, %struct.option** %9
store i32* %4, i32** %10
%11 = load i32, i32* %6
%12 = load i8**, i8*** %7
%13 = load i8*, i8** %8
%14 = load %struct.option*, %struct.option** %9
%15 = load i32*, i32** %10
%16 = call i32 @_getopt_internal(i32 %11, i8** %12, i8* %13, %struct.option* %14, i32* %15, i32 0, i32 0)
ret i32 %16
}

LLVM IR (-O2):
%struct.option = type { i32 }
define i32 @getopt_long(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4) {
%6 = tail call i32 @_getopt_internal(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4, i32 0, i32 0)
ret i32 %6
}
int test_imm_08uint16_mem(unsigned short *val) {
  return ((*val) & (0x08 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_08uint16_mem>:
testb  $0x8,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_08uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 8
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
long calc_stat_bar_line_n();
long get_stat_bar_row(void) { return calc_stat_bar_line_n(); }


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

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

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

LLVM IR (-O2):
define i64 @get_stat_bar_row() {
%1 = tail call i64 (...) @calc_stat_bar_line_n()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void f17(long j) {
  if ((j & ((1UL << (17)) - 1)) >= ((1UL << ((17) - 1)) + 2))
    abort();
}


x86 assembly (clang, -O0):
<f17>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x1ffff,%rax
cmp    $0x10002,%rax
jb     1139 <f17+0x29>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f17>:
and    $0x1fffe,%edi
cmp    $0x10002,%edi
jae    111f <f17+0xf>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @f17(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 131071
%5 = icmp uge i64 %4, 65538
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @f17(i64 %0) {
%2 = and i64 %0, 131070
%3 = icmp ugt i64 %2, 65537
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CreateTargetUDPInterface(void *);
void CreateUDPInterface(void *hl) { CreateTargetUDPInterface(hl); }


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

x86 assembly (clang, -O2):
<CreateUDPInterface>:
jmp    1030 <CreateTargetUDPInterface@plt>

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

LLVM IR (-O2):
define void @CreateUDPInterface(i8* %0) {
%2 = tail call i32 @CreateTargetUDPInterface(i8* %0)
ret void
}
/* Variables and functions */
void *ft_memset(void *b, int c, size_t len) {
  size_t index;
  unsigned char *ptr;
  index = 0;
  ptr = (unsigned char *)b;
  while (index < len) {
    ptr[index] = (unsigned char)c;
    index++;
  }
  return (b);
}


x86 assembly (clang, -O0):
<ft_memset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    114e <ft_memset+0x4e>
mov    -0xc(%rbp),%eax
mov    %al,%dl
mov    -0x28(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    111f <ft_memset+0x1f>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_memset>:
push   %rbx
mov    %rdi,%rbx
test   %rdx,%rdx
je     1121 <ft_memset+0x11>
mov    %rbx,%rdi
call   1030 <memset@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @ft_memset(i8* returned writeonly %0, i32 %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = trunc i32 %1 to i8
br label %7
7: ; preds = %5, %3
ret i8* %0
}
int mycompare(void *a, void *b) {
  int aa = *(int *)a;
  int bb = *(int *)b;
  if (aa == bb)
    return 0;
  else if (aa > bb)
    return 1;
  else
    return -1;
}


x86 assembly (clang, -O0):
<mycompare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jne    1136 <mycompare+0x36>
movl   $0x0,-0x4(%rbp)
jmp    1155 <mycompare+0x55>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    114e <mycompare+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1155 <mycompare+0x55>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mycompare>:
mov    (%rdi),%eax
xor    %ecx,%ecx
xor    %edx,%edx
cmp    (%rsi),%eax
setg   %dl
lea    -0x1(%rdx,%rdx,1),%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @mycompare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp eq i32 %4, %6
%8 = icmp sgt i32 %4, %6
%9 = select i1 %8, i32 1, i32 -1
%10 = select i1 %7, i32 0, i32 %9
ret i32 %10
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ green;
};
typedef TYPE_1__ XColor;

/* Variables and functions */
unsigned short get_XColor_green(void *_p) {
  return (unsigned short)((XColor *)_p)->green;
}


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

x86 assembly (clang, -O2):
<get_XColor_green>:
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define zeroext i16 @get_XColor_green(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i16
ret i16 %7
}

LLVM IR (-O2):
define zeroext i16 @get_XColor_green(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i16
ret i16 %4
}
void I2COwnAddress2Config(unsigned long ulBase, unsigned long ulDual,
                          unsigned char ucAddress) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x0000000C))) =
      ulDual | (ucAddress << 1);
}


x86 assembly (clang, -O0):
<I2COwnAddress2Config>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rcx
movzbl -0x11(%rbp),%eax
shl    $0x1,%eax
cltq
or     %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2COwnAddress2Config>:
mov    %edx,%eax
add    %rax,%rax
or     %rsi,%rax
mov    %rax,0xc(%rdi)
ret

LLVM IR (-O0):
define void @I2COwnAddress2Config(i64 %0, i64 %1, i8 zeroext %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8
store i64 %0, i64* %4
store i64 %1, i64* %5
store i8 %2, i8* %6
%7 = load i64, i64* %5
%8 = load i8, i8* %6
%9 = zext i8 %8 to i32
%10 = shl i32 %9, 1
%11 = sext i32 %10 to i64
%12 = or i64 %7, %11
%13 = load i64, i64* %4
%14 = add i64 %13, 12
%15 = inttoptr i64 %14 to i64*
store volatile i64 %12, i64* %15
ret void
}

LLVM IR (-O2):
define void @I2COwnAddress2Config(i64 %0, i64 %1, i8 zeroext %2) {
%4 = zext i8 %2 to i64
%5 = shl nuw nsw i64 %4, 1
%6 = or i64 %5, %1
%7 = add i64 %0, 12
%8 = inttoptr i64 %7 to i64*
store volatile i64 %6, i64* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void common() { printf("Prebuilt library test\n"); }


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"Prebuilt library test\0A\00"
define void @common() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [22 x i8] c"Prebuilt library test\00"
define void @common() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret void
}
void warn(const char *fmt, ...) {}


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

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

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

LLVM IR (-O2):
define void @warn(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main(void) {
  char name[40];
  printf("What's your name?\n");
  scanf("%s", name);
  printf("Hello, %s. %s\n", name, "What a super marvelous name!");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x30(%rbp),%rsi
lea    0xecb(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x30(%rbp),%rsi
lea    0xebe(%rip),%rdi
lea    0xec6(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
lea    0xef3(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb8(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
lea    0xea9(%rip),%rdi
lea    0xeb1(%rip),%rdx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"What's your name?\0A\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [15 x i8] c"Hello, %s. %s\0A\00"
@.str.3 = [29 x i8] c"What a super marvelous name!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [40 x i8]
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* %6, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [15 x i8] c"Hello, %s. %s\0A\00"
@.str.3 = [29 x i8] c"What a super marvelous name!\00"
@str = [18 x i8] c"What's your name?\00"
define i32 @main() {
%1 = alloca [40 x i8]
%2 = getelementptr inbounds [40 x i8], [40 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* %2, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ draw_bg();
int /*<<< orphan*/ draw_mouse_position();
int /*<<< orphan*/ draw_mouse_position_marker();
void draw_bg_and_mouse_position() {
  draw_bg();
  draw_mouse_position();
  draw_mouse_position_marker();
}


x86 assembly (clang, -O0):
<draw_bg_and_mouse_position>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <draw_bg@plt>
mov    $0x0,%al
call   1040 <draw_mouse_position@plt>
mov    $0x0,%al
call   1030 <draw_mouse_position_marker@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_bg_and_mouse_position>:
push   %rax
xor    %eax,%eax
call   1050 <draw_bg@plt>
xor    %eax,%eax
call   1040 <draw_mouse_position@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <draw_mouse_position_marker@plt>

LLVM IR (-O0):
define void @draw_bg_and_mouse_position() {
%1 = call i32 (...) @draw_bg()
%2 = call i32 (...) @draw_mouse_position()
%3 = call i32 (...) @draw_mouse_position_marker()
ret void
}

LLVM IR (-O2):
define void @draw_bg_and_mouse_position() {
%1 = tail call i32 (...) @draw_bg()
%2 = tail call i32 (...) @draw_mouse_position()
%3 = tail call i32 (...) @draw_mouse_position_marker()
ret void
}
int foonegsi(int a) { return a ? 30 : -30; }


x86 assembly (clang, -O0):
<foonegsi>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0xffffffe2,%eax
mov    $0x1e,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foonegsi>:
test   %edi,%edi
mov    $0xffffffe2,%ecx
mov    $0x1e,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @foonegsi(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 30, i32 -30
ret i32 %6
}

LLVM IR (-O2):
define i32 @foonegsi(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i32 -30, i32 30
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct xdg_popup {
  int dummy;
};
struct wl_proxy {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_marshal(struct wl_proxy *, int, int /*<<< orphan*/);
void xdg_popup_pong(struct xdg_popup *xdg_popup, uint32_t serial) {
  wl_proxy_marshal((struct wl_proxy *)xdg_popup, 1, serial);
}


x86 assembly (clang, -O0):
<xdg_popup_pong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    $0x1,%esi
call   1030 <wl_proxy_marshal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdg_popup_pong>:
mov    %esi,%edx
mov    $0x1,%esi
jmp    1030 <wl_proxy_marshal@plt>

LLVM IR (-O0):
%struct.xdg_popup = type { i32 }
%struct.wl_proxy = type { i32 }
define void @xdg_popup_pong(%struct.xdg_popup* %0, i32 %1) {
%3 = alloca %struct.xdg_popup*
%4 = alloca i32
store %struct.xdg_popup* %0, %struct.xdg_popup** %3
store i32 %1, i32* %4
%5 = load %struct.xdg_popup*, %struct.xdg_popup** %3
%6 = bitcast %struct.xdg_popup* %5 to %struct.wl_proxy*
%7 = load i32, i32* %4
%8 = call i32 @wl_proxy_marshal(%struct.wl_proxy* %6, i32 1, i32 %7)
ret void
}

LLVM IR (-O2):
%struct.xdg_popup = type { i32 }
%struct.wl_proxy = type { i32 }
define void @xdg_popup_pong(%struct.xdg_popup* %0, i32 %1) {
%3 = bitcast %struct.xdg_popup* %0 to %struct.wl_proxy*
%4 = tail call i32 @wl_proxy_marshal(%struct.wl_proxy* %3, i32 1, i32 %1)
ret void
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ _exit(int);
__attribute__((weak)) int kill(pid_t pid, int sig) {
  if (pid == 1) {
    _exit(sig);
  }
  return 0;
}


x86 assembly (clang, -O0):
<kill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1130 <kill+0x20>
mov    -0x8(%rbp),%edi
call   1030 <_exit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kill>:
cmp    $0x1,%edi
je     1118 <kill+0x8>
xor    %eax,%eax
ret
push   %rax
mov    %esi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define weak i32 @kill(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %4
%9 = call i32 @_exit(i32 %8)
unreachable
10: ; preds = %2
ret i32 0
}

LLVM IR (-O2):
define weak i32 @kill(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @_exit(i32 %1)
unreachable
6: ; preds = %2
ret i32 0
}
/* Type definitions */
struct forf_env {
  int dummy;
};

/* Variables and functions */
long forf_pop_num(struct forf_env *);
int /*<<< orphan*/ forf_push_num(struct forf_env *, long);
void forf_proc_inv(struct forf_env *env) {
  long a = forf_pop_num(env);
  forf_push_num(env, ~a);
}


x86 assembly (clang, -O0):
<forf_proc_inv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <forf_pop_num@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    $0xffffffffffffffff,%rsi
call   1040 <forf_push_num@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<forf_proc_inv>:
push   %rbx
mov    %rdi,%rbx
call   1030 <forf_pop_num@plt>
not    %rax
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1040 <forf_push_num@plt>

LLVM IR (-O0):
%struct.forf_env = type { i32 }
define void @forf_proc_inv(%struct.forf_env* %0) {
%2 = alloca %struct.forf_env*
%3 = alloca i64
store %struct.forf_env* %0, %struct.forf_env** %2
%4 = load %struct.forf_env*, %struct.forf_env** %2
%5 = call i64 @forf_pop_num(%struct.forf_env* %4)
store i64 %5, i64* %3
%6 = load %struct.forf_env*, %struct.forf_env** %2
%7 = load i64, i64* %3
%8 = xor i64 %7, -1
%9 = call i32 @forf_push_num(%struct.forf_env* %6, i64 %8)
ret void
}

LLVM IR (-O2):
%struct.forf_env = type { i32 }
define void @forf_proc_inv(%struct.forf_env* %0) {
%2 = tail call i64 @forf_pop_num(%struct.forf_env* %0)
%3 = xor i64 %2, -1
%4 = tail call i32 @forf_push_num(%struct.forf_env* %0, i64 %3)
ret void
}