xunge/DecIR huggingface dataset:
main(argc, argv) int argc;
char *argv[];
{
  int i, err = 0;
  for (i = 1; --argc; ++i)
    err |= touch(argv[i]);
  return err;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     116d <main+0x5d>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    $0x0,%al
call   1030 <touch@plt>
or     -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1134 <main+0x24>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    $0x1,%edi
je     1148 <main+0x38>
mov    %rsi,%r14
mov    %edi,%r15d
mov    $0x1,%ebx
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rdi
xor    %eax,%eax
call   1030 <touch@plt>
or     %eax,%ebp
add    $0x1,%rbx
cmp    %ebx,%r15d
jne    1130 <main+0x20>
jmp    114a <main+0x3a>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = add nsw i32 %0, -1
%4 = icmp eq i32 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %13, %5 ], [ 1, %2 ]
%7 = phi i32 [ %14, %5 ], [ %3, %2 ]
%8 = phi i32 [ %12, %5 ], [ 0, %2 ]
%9 = getelementptr inbounds i8*, i8** %1, i64 %6
%10 = load i8*, i8** %9
%11 = tail call i32 (i8*, ...) bitcast (i32 (...)* @touch to i32 (i8*, ...)*)(i8* %10)
%12 = or i32 %11, %8
%13 = add nuw nsw i64 %6, 1
%14 = add nsw i32 %7, -1
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %2
%17 = phi i32 [ 0, %2 ], [ %12, %5 ]
ret i32 %17
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ chars_matched;
};
typedef TYPE_1__ XComposeStatus;

/* Variables and functions */
int get_XComposeStatus_chars_matched(void *_p) {
  return (int)((XComposeStatus *)_p)->chars_matched;
}


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

x86 assembly (clang, -O2):
<get_XComposeStatus_chars_matched>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XComposeStatus_chars_matched(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 i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XComposeStatus_chars_matched(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ backtrackSubsets(int *, int /*<<< orphan*/, int);
int /*<<< orphan*/ free(int *);
scalar_t__ malloc(int);
void generateSubsets(int n) {
  int *A = (int *)malloc(n * sizeof(int));
  backtrackSubsets(A, 0, n);
  free(A);
}


x86 assembly (clang, -O0):
<generateSubsets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
xor    %esi,%esi
call   1040 <backtrackSubsets@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generateSubsets>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%r14d
lea    0x0(,%r14,4),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %r14d,%edx
call   1040 <backtrackSubsets@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @generateSubsets(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = mul i64 %5, 4
%7 = trunc i64 %6 to i32
%8 = call i64 @malloc(i32 %7)
%9 = inttoptr i64 %8 to i32*
store i32* %9, i32** %3
%10 = load i32*, i32** %3
%11 = load i32, i32* %2
%12 = call i32 @backtrackSubsets(i32* %10, i32 0, i32 %11)
%13 = load i32*, i32** %3
%14 = call i32 @free(i32* %13)
ret void
}

LLVM IR (-O2):
define void @generateSubsets(i32 %0) {
%2 = shl i32 %0, 2
%3 = tail call i64 @malloc(i32 %2)
%4 = inttoptr i64 %3 to i32*
%5 = tail call i32 @backtrackSubsets(i32* %4, i32 0, i32 %0)
%6 = tail call i32 @free(i32* %4)
ret void
}
int Isolate_rightmost1(int reg) { return reg & (-reg); }


x86 assembly (clang, -O0):
<Isolate_rightmost1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
sub    -0x4(%rbp),%ecx
and    %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @Isolate_rightmost1(i32 %0) {
%2 = sub nsw i32 0, %0
%3 = and i32 %2, %0
ret i32 %3
}
/* Variables and functions */
char *basename2(char const *);
char *strrchr(char *, char);
const char *get_suffix(const char *filename) {
  char *p, *p2;
  if (!(p = basename2(filename)))
    p = (char *)filename;
  if (!(p2 = strrchr(p, '.')))
    p2 = "";
  if (p2 == p)
    p2 = "";
  return p2;
}


x86 assembly (clang, -O0):
<get_suffix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <basename2@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    114b <get_suffix+0x2b>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1172 <get_suffix+0x52>
lea    0xe92(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    118b <get_suffix+0x6b>
lea    0xe79(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_suffix>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <basename2@plt>
mov    %rax,%rbx
test   %rax,%rax
cmove  %r14,%rbx
mov    %rbx,%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
lea    0xeb3(%rip),%rcx
cmove  %rcx,%rax
cmp    %rbx,%rax
cmove  %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @get_suffix(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @basename2(i8* %5)
store i8* %6, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = load i8*, i8** %2
store i8* %9, i8** %3
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
%12 = call i8* @strrchr(i8* %11, i8 signext 46)
store i8* %12, i8** %4
%13 = icmp ne i8* %12, null
br i1 %13, label %15, label %14
14: ; preds = %10
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %4
br label %15
15: ; preds = %14, %10
%16 = load i8*, i8** %4
%17 = load i8*, i8** %3
%18 = icmp eq i8* %16, %17
br i1 %18, label %19, label %20
19: ; preds = %15
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %4
br label %20
20: ; preds = %19, %15
%21 = load i8*, i8** %4
ret i8* %21
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @get_suffix(i8* %0) {
%2 = tail call i8* @basename2(i8* %0)
%3 = icmp eq i8* %2, null
%4 = select i1 %3, i8* %0, i8* %2
%5 = tail call i8* @strrchr(i8* dereferenceable(1) %4, i8 signext 46)
%6 = icmp eq i8* %5, null
%7 = select i1 %6, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %5
%8 = icmp eq i8* %7, %4
%9 = select i1 %8, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %7
ret i8* %9
}
int divpwr2(int x, int n) {
  int sign = x >> 31;
  return (x + (sign & ((1 << n) - 1))) >> n;
}


x86 assembly (clang, -O0):
<divpwr2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    %ecx,-0x10(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    -0x10(%rbp),%ecx
sub    $0x1,%edx
and    %edx,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<divpwr2>:
mov    %esi,%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
not    %edx
mov    %edi,%eax
sar    $0x1f,%eax
and    %edx,%eax
add    %edi,%eax
sar    %cl,%eax
ret

LLVM IR (-O0):
define i32 @divpwr2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = ashr i32 %6, 31
store i32 %7, i32* %5
%8 = load i32, i32* %3
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = shl i32 1, %10
%12 = sub nsw i32 %11, 1
%13 = and i32 %9, %12
%14 = add nsw i32 %8, %13
%15 = load i32, i32* %4
%16 = ashr i32 %14, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @divpwr2(i32 %0, i32 %1) {
%3 = shl nsw i32 -1, %1
%4 = xor i32 %3, -1
%5 = icmp slt i32 %0, 0
%6 = select i1 %5, i32 %4, i32 0
%7 = add nsw i32 %6, %0
%8 = ashr i32 %7, %1
ret i32 %8
}
unsigned int foo(void) { return 42; }


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

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

LLVM IR (-O0):
define i32 @foo() {
ret i32 42
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 42
}
/* Variables and functions */
int O_NOCTTY;
int O_RDWR;
int open(char *, int, int /*<<< orphan*/);
int getpt(void) { return open("/dev/ptmx", O_RDWR | O_NOCTTY, 0); }


x86 assembly (clang, -O0):
<getpt>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%esi
mov    0x2eb4(%rip),%rax
or     (%rax),%esi
lea    0xed3(%rip),%rdi
xor    %edx,%edx
call   1030 <open@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<getpt>:
mov    0x2ed1(%rip),%rax
mov    0x2eba(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
lea    0xed7(%rip),%rdi
xor    %edx,%edx
jmp    1030 <open@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"/dev/ptmx\00"
@O_RDWR = global i32 0
@O_NOCTTY = global i32 0
define i32 @getpt() {
%1 = load i32, i32* @O_RDWR
%2 = load i32, i32* @O_NOCTTY
%3 = or i32 %1, %2
%4 = call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3, i32 0)
ret i32 %4
}

LLVM IR (-O2):
@.str = [10 x i8] c"/dev/ptmx\00"
@O_RDWR = global i32 0
@O_NOCTTY = global i32 0
define i32 @getpt() {
%1 = load i32, i32* @O_RDWR
%2 = load i32, i32* @O_NOCTTY
%3 = or i32 %2, %1
%4 = tail call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ callibrate_tod();
int /*<<< orphan*/ check_time();
int /*<<< orphan*/ run_timer();
int main(int arg, char *argv[]) {
  callibrate_tod();
  run_timer();
  check_time();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <callibrate_tod@plt>
mov    $0x0,%al
call   1030 <run_timer@plt>
mov    $0x0,%al
call   1040 <check_time@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @callibrate_tod()
%4 = tail call i32 (...) @run_timer()
%5 = tail call i32 (...) @check_time()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ tipoTriangulo(int, int, int);
main() {
  printf("Um triangulo com os lados medindo 5, 6 e 7 eh: ");
  tipoTriangulo(5, 6, 7);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0x5,%edi
mov    $0x6,%esi
mov    $0x7,%edx
call   1040 <tipoTriangulo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    $0x5,%edi
mov    $0x6,%esi
mov    $0x7,%edx
call   1040 <tipoTriangulo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [48 x i8] c"Um triangulo com os lados medindo 5, 6 e 7 eh: \00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @tipoTriangulo(i32 5, i32 6, i32 7)
ret i32 0
}

LLVM IR (-O2):
@.str = [48 x i8] c"Um triangulo com os lados medindo 5, 6 e 7 eh: \00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @tipoTriangulo(i32 5, i32 6, i32 7)
ret i32 0
}
void Exported() {}


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

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

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

LLVM IR (-O2):
define void @Exported() {
ret void
}
int llvm_fcmp_oge(double X, double Y) { return X >= Y; }


x86 assembly (clang, -O0):
<llvm_fcmp_oge>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<llvm_fcmp_oge>:
xor    %eax,%eax
ucomisd %xmm1,%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @llvm_fcmp_oge(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 = fcmp oge double %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @llvm_fcmp_oge(double %0, double %1) {
%3 = fcmp oge double %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
int fn2() {
  if (1)
    return 2;
}


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

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

LLVM IR (-O0):
define i32 @fn2() {
ret i32 2
}

LLVM IR (-O2):
define i32 @fn2() {
ret i32 2
}
/* Type definitions */
typedef int /*<<< orphan*/ d;

/* Variables and functions */
int /*<<< orphan*/ oled_SendCommand(unsigned char *, int);
void SetBrightness(char a) {
  unsigned char d[] = {0x82, a};
  oled_SendCommand(d, sizeof(d));
}


x86 assembly (clang, -O0):
<SetBrightness>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x82,-0x3(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x2(%rbp)
lea    -0x3(%rbp),%rdi
mov    $0x2,%esi
call   1030 <oled_SendCommand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetBrightness>:
push   %rax
movb   $0x82,0x6(%rsp)
mov    %dil,0x7(%rsp)
lea    0x6(%rsp),%rdi
mov    $0x2,%esi
call   1030 <oled_SendCommand@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @SetBrightness(i8 signext %0) {
%2 = alloca i8
%3 = alloca [2 x i8]
store i8 %0, i8* %2
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
store i8 -126, i8* %4
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %2
store i8 %6, i8* %5
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%8 = call i32 @oled_SendCommand(i8* %7, i32 2)
ret void
}

LLVM IR (-O2):
define void @SetBrightness(i8 signext %0) {
%2 = alloca [2 x i8]
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
store i8 -126, i8* %3
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
store i8 %0, i8* %4
%5 = call i32 @oled_SendCommand(i8* %3, i32 2)
ret void
}
/* Type definitions */
typedef unsigned int uint32_t;
typedef scalar_t__ int32_t;

/* Variables and functions */
uint32_t snr_sam_to_cmp(int32_t num) {
  if (num >= 0) {
    return (uint32_t)num;
  } else {
    return (((uint32_t)(~(-num))) | (1u << 31)) + 1;
  }
}


x86 assembly (clang, -O0):
<snr_sam_to_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jl     111f <snr_sam_to_cmp+0x1f>
mov    -0x10(%rbp),%rax
mov    %eax,-0x4(%rbp)
jmp    1134 <snr_sam_to_cmp+0x34>
xor    %eax,%eax
sub    -0x10(%rbp),%rax
xor    $0xffffffffffffffff,%rax
or     $0x80000000,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<snr_sam_to_cmp>:
lea    -0x1(%rdi),%eax
or     $0x80000000,%eax
add    $0x1,%eax
test   %rdi,%rdi
cmovns %edi,%eax
ret

LLVM IR (-O0):
define i32 @snr_sam_to_cmp(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp sge i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i64, i64* %3
%8 = trunc i64 %7 to i32
store i32 %8, i32* %2
br label %16
9: ; preds = %1
%10 = load i64, i64* %3
%11 = sub nsw i64 0, %10
%12 = xor i64 %11, -1
%13 = trunc i64 %12 to i32
%14 = or i32 %13, -2147483648
%15 = add i32 %14, 1
store i32 %15, i32* %2
br label %16
16: ; preds = %9, %6
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @snr_sam_to_cmp(i64 %0) {
%2 = icmp sgt i64 %0, -1
%3 = trunc i64 %0 to i32
%4 = add i32 %3, 2147483647
%5 = or i32 %4, -2147483648
%6 = add nsw i32 %5, 1
%7 = select i1 %2, i32 %3, i32 %6
ret i32 %7
}
/* Type definitions */
struct dirent {
  int dummy;
};

/* Variables and functions */
int alphasort(struct dirent const **, struct dirent const **);
int reverseSort(const struct dirent **e1, const struct dirent **e2) {
  return alphasort(e2, e1);
}


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

x86 assembly (clang, -O2):
<reverseSort>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <alphasort@plt>

LLVM IR (-O0):
%struct.dirent = type { i32 }
define i32 @reverseSort(%struct.dirent** %0, %struct.dirent** %1) {
%3 = alloca %struct.dirent**
%4 = alloca %struct.dirent**
store %struct.dirent** %0, %struct.dirent*** %3
store %struct.dirent** %1, %struct.dirent*** %4
%5 = load %struct.dirent**, %struct.dirent*** %4
%6 = load %struct.dirent**, %struct.dirent*** %3
%7 = call i32 @alphasort(%struct.dirent** %5, %struct.dirent** %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
define i32 @reverseSort(%struct.dirent** %0, %struct.dirent** %1) {
%3 = tail call i32 @alphasort(%struct.dirent** %1, %struct.dirent** %0)
ret i32 %3
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ sleep(int);
int main(int argc, char *argv[]) {
  struct timeval tv;
  while (1) {
    gettimeofday(&tv, NULL);
    printf("time %u:%u\n", tv.tv_sec, tv.tv_usec);
    sleep(2);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <gettimeofday@plt>
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1050 <sleep@plt>
jmp    1146 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    %rsp,%r14
lea    0xec2(%rip),%rbx
xchg   %ax,%ax
mov    %r14,%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
mov    (%rsp),%esi
mov    0x4(%rsp),%edx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1050 <sleep@plt>
jmp    1140 <main+0x10>

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
@.str = [12 x i8] c"time %u:%u\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.timeval
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %7
7: ; preds = %2, %7
%8 = call i32 @gettimeofday(%struct.timeval* %6, i32* null)
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 0
%10 = load i32, i32* %9
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 1
%12 = load i32, i32* %11
%13 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %12)
%14 = call i32 @sleep(i32 2)
br label %7
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
@.str = [12 x i8] c"time %u:%u\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %struct.timeval
%4 = bitcast %struct.timeval* %3 to i8*
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 0
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 1
br label %7
7: ; preds = %7, %2
%8 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
%12 = tail call i32 @sleep(i32 2)
br label %7
}
/* Type definitions */
struct lifo {
  int dummy;
};

/* Variables and functions */
double log(double);
double pop(struct lifo *);
double opr_log(struct lifo *stack) {
  double op = pop(stack);
  return log(op);
}


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

x86 assembly (clang, -O2):
<opr_log>:
push   %rax
call   1030 <pop@plt>
pop    %rax
jmp    1040 <log@plt>

LLVM IR (-O0):
%struct.lifo = type { i32 }
define double @opr_log(%struct.lifo* %0) {
%2 = alloca %struct.lifo*
%3 = alloca double
store %struct.lifo* %0, %struct.lifo** %2
%4 = load %struct.lifo*, %struct.lifo** %2
%5 = call double @pop(%struct.lifo* %4)
store double %5, double* %3
%6 = load double, double* %3
%7 = call double @log(double %6)
ret double %7
}

LLVM IR (-O2):
%struct.lifo = type { i32 }
define double @opr_log(%struct.lifo* %0) {
%2 = tail call double @pop(%struct.lifo* %0)
%3 = tail call double @log(double %2)
ret double %3
}
/* Type definitions */
struct ps_bus_event {
  int dummy;
};
struct obus_bus_event {
  int dummy;
};

/* Variables and functions */
int obus_bus_event_destroy(struct obus_bus_event *);
int ps_bus_event_destroy(struct ps_bus_event *event) {
  return obus_bus_event_destroy((struct obus_bus_event *)event);
}


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

x86 assembly (clang, -O2):
<ps_bus_event_destroy>:
jmp    1030 <obus_bus_event_destroy@plt>

LLVM IR (-O0):
%struct.ps_bus_event = type { i32 }
%struct.obus_bus_event = type { i32 }
define i32 @ps_bus_event_destroy(%struct.ps_bus_event* %0) {
%2 = alloca %struct.ps_bus_event*
store %struct.ps_bus_event* %0, %struct.ps_bus_event** %2
%3 = load %struct.ps_bus_event*, %struct.ps_bus_event** %2
%4 = bitcast %struct.ps_bus_event* %3 to %struct.obus_bus_event*
%5 = call i32 @obus_bus_event_destroy(%struct.obus_bus_event* %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.ps_bus_event = type { i32 }
%struct.obus_bus_event = type { i32 }
define i32 @ps_bus_event_destroy(%struct.ps_bus_event* %0) {
%2 = bitcast %struct.ps_bus_event* %0 to %struct.obus_bus_event*
%3 = tail call i32 @obus_bus_event_destroy(%struct.obus_bus_event* %2)
ret i32 %3
}
int uint_cmp(const void *a, const void *b) {
  return (*(unsigned int *)a) < (*(unsigned int *)b) ? -1 : 1;
}


x86 assembly (clang, -O0):
<uint_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    $0x1,%eax
mov    $0xffffffff,%ecx
cmp    %esi,%edx
cmovb  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint_cmp>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setae  %cl
lea    (%rcx,%rcx,1),%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @uint_cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = icmp ult i32 %7, %10
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 -1, i32 1
ret i32 %13
}

LLVM IR (-O2):
define i32 @uint_cmp(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 ult i32 %4, %6
%8 = select i1 %7, i32 -1, i32 1
ret i32 %8
}
/* Type definitions */
struct fdinfo {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ remove_all(int);
void destroy_all() {
  int i = 0;
  extern struct fdinfo *global_fd_list[10];
  extern int fd_count;
  while (i < fd_count) {
    remove_all(i);
    i++;
  }
}


x86 assembly (clang, -O0):
<destroy_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ec7(%rip),%rcx
cmp    (%rcx),%eax
jge    1147 <destroy_all+0x37>
mov    -0x4(%rbp),%edi
call   1030 <remove_all@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <destroy_all+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroy_all>:
push   %r14
push   %rbx
push   %rax
mov    0x2ed5(%rip),%r14
cmpl   $0x0,(%r14)
jle    113f <destroy_all+0x2f>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1030 <remove_all@plt>
add    $0x1,%ebx
cmp    (%r14),%ebx
jl     1130 <destroy_all+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@fd_count = external global i32
define void @destroy_all() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load i32, i32* %1
%4 = load i32, i32* @fd_count
%5 = icmp slt i32 %3, %4
br i1 %5, label %6, label %11
6: ; preds = %2
%7 = load i32, i32* %1
%8 = call i32 @remove_all(i32 %7)
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %2
11: ; preds = %2
ret void
}

LLVM IR (-O2):
@fd_count = external global i32
define void @destroy_all() {
%1 = load i32, i32* @fd_count
%2 = icmp sgt i32 %1, 0
br i1 %2, label %3, label %9
3: ; preds = %0, %3
%4 = phi i32 [ %6, %3 ], [ 0, %0 ]
%5 = tail call i32 @remove_all(i32 %4)
%6 = add nuw nsw i32 %4, 1
%7 = load i32, i32* @fd_count
%8 = icmp slt i32 %6, %7
br i1 %8, label %3, label %9
9: ; preds = %3, %0
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int set_dobldobl_state_to_silent(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(658, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<set_dobldobl_state_to_silent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x292,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_dobldobl_state_to_silent>:
mov    $0x292,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @set_dobldobl_state_to_silent() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 658, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @set_dobldobl_state_to_silent() {
%1 = tail call i32 @_ada_use_c2phc(i32 658, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Variables and functions */
int strcmp(char *, char *);
int SortMaps(const void *a, const void *b) {
  return strcmp(*(char **)a, *(char **)b);
}


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

x86 assembly (clang, -O2):
<SortMaps>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @SortMaps(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @SortMaps(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Variables and functions */
int passivesock(char *, char *, int);
int passiveTCP(char *service, int qlen) {
  return passivesock(service, "tcp", qlen);
}


x86 assembly (clang, -O0):
<passiveTCP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rsi
call   1030 <passivesock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<passiveTCP>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <passivesock@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"tcp\00"
define i32 @passiveTCP(i8* %0, i32 %1) {
%3 = tail call i32 @passivesock(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ pcap_list_cursor_next();
int /*<<< orphan*/ warn_text_ui(char *);
bool cmd_next(const char *arg) {
  if (arg)
    warn_text_ui("Unexpected argument for the next command");
  pcap_list_cursor_next();
  return true;
}


x86 assembly (clang, -O0):
<cmd_next>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1143 <cmd_next+0x23>
lea    0xec2(%rip),%rdi
call   1030 <warn_text_ui@plt>
mov    $0x0,%al
call   1040 <pcap_list_cursor_next@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_next>:
push   %rax
test   %rdi,%rdi
je     1132 <cmd_next+0x12>
lea    0xed3(%rip),%rdi
call   1030 <warn_text_ui@plt>
xor    %eax,%eax
call   1040 <pcap_list_cursor_next@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [41 x i8] c"Unexpected argument for the next command\00"
define i32 @cmd_next(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @warn_text_ui(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
%8 = call i32 (...) @pcap_list_cursor_next()
ret i32 1
}

LLVM IR (-O2):
@.str = [41 x i8] c"Unexpected argument for the next command\00"
define i32 @cmd_next(i8* readnone %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @warn_text_ui(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
%6 = tail call i32 (...) @pcap_list_cursor_next()
ret i32 1
}
OP(dd, c9) { op_c9(); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <op_c9@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_c9()
ret i32 undef
}
main() {
  __typeof((short(**)[][f()])g()) x;
  if (sizeof(x) != sizeof(short **))
    abort();
  if (sizeof(x) != sizeof(short **))
    abort();
  if (sizeof(short(**)[][f()]) != sizeof(short **))
    abort();
  x++;
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [0 x i16]**
store i32 0, i32* %1
%3 = call i32 (...) @f()
%4 = zext i32 %3 to i64
%5 = call i32 (...) @g()
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to [0 x i16]**
%8 = load [0 x i16]**, [0 x i16]*** %2
%9 = getelementptr inbounds [0 x i16]*, [0 x i16]** %8, i32 1
store [0 x i16]** %9, [0 x i16]*** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f()
%2 = tail call i32 (...) @g()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ flushWrite();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void linenoiseBeep(void) {
  fprintf(stdout, "\x7");
  flushWrite();
}


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

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

LLVM IR (-O0):
@stdout = global i32 0
@.str = [2 x i8] c"\07\00"
define void @linenoiseBeep() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @flushWrite()
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [2 x i8] c"\07\00"
define void @linenoiseBeep() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @flushWrite()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dc_pipemsg_send(unsigned int, int /*<<< orphan*/,
                                   int /*<<< orphan*/ *);
void dc_response_cmd(unsigned int msgId) { dc_pipemsg_send(msgId, 0, NULL); }


x86 assembly (clang, -O0):
<dc_response_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <dc_pipemsg_send@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dc_response_cmd>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <dc_pipemsg_send@plt>

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

LLVM IR (-O2):
define void @dc_response_cmd(i32 %0) {
%2 = tail call i32 @dc_pipemsg_send(i32 %0, i32 0, i32* null)
ret void
}
XSetTSOrigin() {}


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

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

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

LLVM IR (-O2):
define i32 @XSetTSOrigin() {
ret i32 undef
}
unsigned long PWMGenFaultStatus(unsigned long ulBase, unsigned long ulGen,
                                unsigned long ulGroup) {
  ;
  ;
  ;
  ;
  return ((*((volatile unsigned long *)(((ulBase) + 0x00000800 +
                                         ((ulGen)-0x00000040) * 2) +
                                        0x00000004))));
}


x86 assembly (clang, -O0):
<PWMGenFaultStatus>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x800,%rax
mov    -0x10(%rbp),%rcx
sub    $0x40,%rcx
shl    $0x1,%rcx
add    %rcx,%rax
mov    0x4(%rax),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMGenFaultStatus>:
mov    0x784(%rdi,%rsi,2),%rax
ret

LLVM IR (-O0):
define i64 @PWMGenFaultStatus(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = add i64 %7, 2048
%9 = load i64, i64* %5
%10 = sub i64 %9, 64
%11 = mul i64 %10, 2
%12 = add i64 %8, %11
%13 = add i64 %12, 4
%14 = inttoptr i64 %13 to i64*
%15 = load volatile i64, i64* %14
ret i64 %15
}

LLVM IR (-O2):
define i64 @PWMGenFaultStatus(i64 %0, i64 %1, i64 %2) {
%4 = shl i64 %1, 1
%5 = add i64 %0, 1924
%6 = add i64 %5, %4
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
ret i64 %8
}
int main() {
  int array[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
  int result[10];
  int i;
  for (i = 0; i < 10; ++i) {
    int j = array[i];
    result[i] = j * j;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xed6(%rip),%rsi
mov    $0x28,%edx
call   1030 <memcpy@plt>
movl   $0x0,-0x64(%rbp)
cmpl   $0xa,-0x64(%rbp)
jge    116d <main+0x5d>
movslq -0x64(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%eax
mov    %eax,-0x68(%rbp)
mov    -0x68(%rbp),%ecx
imul   -0x68(%rbp),%ecx
movslq -0x64(%rbp),%rax
mov    %ecx,-0x60(%rbp,%rax,4)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    113b <main+0x2b>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
hexb(x) int x;
{
  hexn(x >> 4);
  hexn(x);
}


x86 assembly (clang, -O0):
<hexb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
sar    $0x4,%edi
mov    $0x0,%al
call   1030 <hexn@plt>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1030 <hexn@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexb>:
push   %rbx
mov    %edi,%ebx
sar    $0x4,%edi
xor    %eax,%eax
call   1030 <hexn@plt>
mov    %ebx,%edi
xor    %eax,%eax
pop    %rbx
jmp    1030 <hexn@plt>

LLVM IR (-O0):
define i32 @hexb(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = ashr i32 %4, 4
%6 = call i32 (i32, ...) bitcast (i32 (...)* @hexn to i32 (i32, ...)*)(i32 %5)
%7 = load i32, i32* %3
%8 = call i32 (i32, ...) bitcast (i32 (...)* @hexn to i32 (i32, ...)*)(i32 %7)
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @hexb(i32 %0) {
%2 = ashr i32 %0, 4
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @hexn to i32 (i32, ...)*)(i32 %2)
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @hexn to i32 (i32, ...)*)(i32 %0)
ret i32 undef
}
int test_imm_E9int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xE9 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E9int64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x20,%rdx
and    $0xe9,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_E9int64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 233
%7 = icmp ne i64 %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_E9int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 1000727379968
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ die(char *, int, int);
void validatekey(int key) {
  if (key < 0 || key >= 26)
    die("Error: key %d invalid. The key must be in the range [0,%d]\n", key,
        26 - 1);
}


x86 assembly (clang, -O0):
<validatekey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     112f <validatekey+0x1f>
cmpl   $0x1a,-0x4(%rbp)
jl     1143 <validatekey+0x33>
mov    -0x4(%rbp),%esi
lea    0xec7(%rip),%rdi
mov    $0x19,%edx
call   1030 <die@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<validatekey>:
cmp    $0x1a,%edi
jb     1128 <validatekey+0x18>
mov    %edi,%esi
lea    0xee2(%rip),%rdi
mov    $0x19,%edx
jmp    1030 <die@plt>
ret

LLVM IR (-O0):
@.str = [60 x i8] c"Error: key %d invalid. The key must be in the range [0,%d]\0A\00"
define void @validatekey(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 %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sge i32 %6, 26
br i1 %7, label %8, label %11
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = call i32 @die(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i32 %9, i32 25)
br label %11
11: ; preds = %8, %5
ret void
}

LLVM IR (-O2):
@.str = [60 x i8] c"Error: key %d invalid. The key must be in the range [0,%d]\0A\00"
define void @validatekey(i32 %0) {
%2 = icmp ugt i32 %0, 25
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @die(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i32 %0, i32 25)
br label %5
5: ; preds = %1, %3
ret void
}
int HelpItem77(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem77() {
ret i32 0
}
int test_imm_E9int64_highword_reg(long long val) {
  return ((val >> 32) & (0xE9 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E9int64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x20,%rdx
and    $0xe9,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_E9int64_highword_reg>:
movabs $0xe900000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_E9int64_highword_reg(i64 %0) {
%2 = and i64 %0, 1000727379968
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int MPI_Init_thread(int *argc, char ***argv, int required, int *provided) {
  (*provided) = required;
  return 0;
}


x86 assembly (clang, -O0):
<MPI_Init_thread>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MPI_Init_thread>:
mov    %edx,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @MPI_Init_thread(i32* %0, i8*** %1, i32 %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i8***
%7 = alloca i32
%8 = alloca i32*
store i32* %0, i32** %5
store i8*** %1, i8**** %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%9 = load i32, i32* %7
%10 = load i32*, i32** %8
store i32 %9, i32* %10
ret i32 0
}

LLVM IR (-O2):
define i32 @MPI_Init_thread(i32* nocapture readnone %0, i8*** nocapture readnone %1, i32 %2, i32* nocapture writeonly %3) {
store i32 %2, i32* %3
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ GPR_IRQ_DriverIRQHandler();
__attribute__((weak)) void GPR_IRQ_IRQHandler(void) {
  GPR_IRQ_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @GPR_IRQ_IRQHandler() {
%1 = call i32 (...) @GPR_IRQ_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @GPR_IRQ_IRQHandler() {
%1 = tail call i32 (...) @GPR_IRQ_DriverIRQHandler()
ret void
}