xunge/DecIR huggingface dataset:
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ ss_flags;
  int /*<<< orphan*/ ss_size;
  int /*<<< orphan*/ ss_sp;
};
typedef TYPE_1__ stack_t;

/* Variables and functions */
int /*<<< orphan*/ test_msg(char *, char *, int /*<<< orphan*/,
                            int /*<<< orphan*/, int /*<<< orphan*/);
void show_ss(char *prefix, stack_t *s) {
  test_msg("%20s: at %p (size %#8x flags %#2x)\n", prefix, s->ss_sp, s->ss_size,
           s->ss_flags);
}


x86 assembly (clang, -O0):
<show_ss>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%edx
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x10(%rbp),%rax
mov    (%rax),%r8d
lea    0xec0(%rip),%rdi
call   1030 <test_msg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_ss>:
mov    %rdi,%rax
mov    0x8(%rsi),%edx
mov    (%rsi),%r8d
mov    0x4(%rsi),%ecx
lea    0xedd(%rip),%rdi
mov    %rax,%rsi
jmp    1030 <test_msg@plt>

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32, i32, i32 }
@.str = [36 x i8] c"%20s: at %p (size %x flags %x)\0A\00"
define void @show_ss(i8* %0, %struct.TYPE_3__* %1) {
%3 = alloca i8*
%4 = alloca %struct.TYPE_3__*
store i8* %0, i8** %3
store %struct.TYPE_3__* %1, %struct.TYPE_3__** %4
%5 = load i8*, i8** %3
%6 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%7 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %6, i32 0, i32 2
%8 = load i32, i32* %7
%9 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%10 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %9, i32 0, i32 1
%11 = load i32, i32* %10
%12 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%13 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %12, i32 0, i32 0
%14 = load i32, i32* %13
%15 = call i32 @test_msg(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %8, i32 %11, i32 %14)
ret void
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32, i32, i32 }
@.str = [36 x i8] c"%20s: at %p (size %x flags %x)\0A\00"
define void @show_ss(i8* %0, %struct.TYPE_3__* nocapture %1) {
%3 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 2
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 1
%6 = load i32, i32* %5
%7 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i32 @test_msg(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %4, i32 %6, i32 %8)
ret void
}
void mvebu_pwm_resume(struct mvebu_gpio_chip *mvchip) {}


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

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

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

LLVM IR (-O2):
%struct.mvebu_gpio_chip = type opaque
define void @mvebu_pwm_resume(%struct.mvebu_gpio_chip* nocapture %0) {
ret void
}
void example_stack(int i) {
  int array_in_stack[2];
  array_in_stack[0 - i] = i;
}


x86 assembly (clang, -O0):
<example_stack>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
sub    -0x4(%rbp),%eax
cltq
mov    %ecx,-0xc(%rbp,%rax,4)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @example_stack(i32 %0) {
%2 = alloca i32
%3 = alloca [2 x i32]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = sub nsw i32 0, %5
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 %7
store i32 %4, i32* %8
ret void
}

LLVM IR (-O2):
define void @example_stack(i32 %0) {
ret void
}
int htable_hash2(char *str, int multi, int items) {
  unsigned int h_ = 0;
  for (; *str; str++)
    h_ = multi * h_ + *str;
  return h_ % items;
}


x86 assembly (clang, -O0):
<htable_hash2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1146 <htable_hash2+0x46>
mov    -0xc(%rbp),%eax
imul   -0x14(%rbp),%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1115 <htable_hash2+0x15>
mov    -0x14(%rbp),%eax
xor    %edx,%edx
divl   -0x10(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<htable_hash2>:
mov    %edx,%ecx
mov    (%rdi),%dl
test   %dl,%dl
je     1125 <htable_hash2+0x25>
add    $0x1,%rdi
xor    %eax,%eax
xchg   %ax,%ax
imul   %esi,%eax
movsbl %dl,%edx
add    %edx,%eax
movzbl (%rdi),%edx
add    $0x1,%rdi
test   %dl,%dl
jne    1110 <htable_hash2+0x10>
jmp    1127 <htable_hash2+0x27>
xor    %eax,%eax
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @htable_hash2(i8* nocapture %0, i32 %1, i32 %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %16, label %6
6: ; preds = %3, %6
%7 = phi i8 [ %14, %6 ], [ %4, %3 ]
%8 = phi i32 [ %12, %6 ], [ 0, %3 ]
%9 = phi i8* [ %13, %6 ], [ %0, %3 ]
%10 = mul i32 %8, %1
%11 = sext i8 %7 to i32
%12 = add i32 %10, %11
%13 = getelementptr inbounds i8, i8* %9, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %6
16: ; preds = %6, %3
%17 = phi i32 [ 0, %3 ], [ %12, %6 ]
%18 = urem i32 %17, %2
ret i32 %18
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_size;
};
typedef int /*<<< orphan*/ ssize_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fileno(int /*<<< orphan*/ *);
int /*<<< orphan*/ fstat(int /*<<< orphan*/, struct stat *);
ssize_t getFileSize(FILE *fd) {
  if (NULL == fd)
    return 0;
  struct stat stat;
  fstat(fileno(fd), &stat);
  return stat.st_size;
}


x86 assembly (clang, -O0):
<getFileSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    1144 <getFileSize+0x24>
movl   $0x0,-0x4(%rbp)
jmp    115e <getFileSize+0x3e>
mov    -0x10(%rbp),%rdi
call   1030 <fileno@plt>
mov    %eax,%edi
lea    -0x18(%rbp),%rsi
call   1040 <fstat@plt>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFileSize>:
test   %rdi,%rdi
je     113d <getFileSize+0x1d>
push   %rax
call   1030 <fileno@plt>
mov    %rsp,%rsi
mov    %eax,%edi
call   1040 <fstat@plt>
mov    (%rsp),%eax
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @getFileSize(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca %struct.stat
store i32* %0, i32** %3
%5 = load i32*, i32** %3
%6 = icmp eq i32* null, %5
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %14
8: ; preds = %1
%9 = load i32*, i32** %3
%10 = call i32 @fileno(i32* %9)
%11 = call i32 @fstat(i32 %10, %struct.stat* %4)
%12 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%13 = load i32, i32* %12
store i32 %13, i32* %2
br label %14
14: ; preds = %8, %7
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @getFileSize(i32* %0) {
%2 = alloca %struct.stat
%3 = icmp eq i32* %0, null
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = bitcast %struct.stat* %2 to i8*
%6 = tail call i32 @fileno(i32* %0)
%7 = call i32 @fstat(i32 %6, %struct.stat* %2)
%8 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%9 = load i32, i32* %8
br label %10
10: ; preds = %1, %4
%11 = phi i32 [ %9, %4 ], [ 0, %1 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
long strtol(char const *, char **, int);
long int wcstol(const wchar_t *nptr, wchar_t **endptr, int base) {
  return strtol((const char *)nptr, (char **)endptr, base);
}


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

x86 assembly (clang, -O2):
<wcstol>:
jmp    1030 <strtol@plt>

LLVM IR (-O0):
define i64 @wcstol(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 = bitcast i32* %7 to i8*
%9 = load i32**, i32*** %5
%10 = bitcast i32** %9 to i8**
%11 = load i32, i32* %6
%12 = call i64 @strtol(i8* %8, i8** %10, i32 %11)
ret i64 %12
}

LLVM IR (-O2):
define i64 @wcstol(i32* %0, i32** nocapture %1, i32 %2) {
%4 = bitcast i32* %0 to i8*
%5 = bitcast i32** %1 to i8**
%6 = tail call i64 @strtol(i8* %4, i8** %5, i32 %2)
ret i64 %6
}
/* Variables and functions */
long long expmod(long long, long long, long long);
int fermat_test(long long n, long long a) { return expmod(a, n, n) == a; }


x86 assembly (clang, -O0):
<fermat_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x8(%rbp),%rdx
call   1030 <expmod@plt>
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fermat_test>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rdx
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1030 <expmod@plt>
xor    %ecx,%ecx
cmp    %rbx,%rax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @fermat_test(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %3
%8 = call i64 @expmod(i64 %5, i64 %6, i64 %7)
%9 = load i64, i64* %4
%10 = icmp eq i64 %8, %9
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @fermat_test(i64 %0, i64 %1) {
%3 = tail call i64 @expmod(i64 %1, i64 %0, i64 %0)
%4 = icmp eq i64 %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ do_test();
int main() {
  do_test();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @do_test()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int test_for();
int main(int argc, char *argv[]) { printf("sum:%d\n", test_for()); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <test_for@plt>
mov    %eax,%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test_for@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"sum:%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_for()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, long, int /*<<< orphan*/);
long ftell(int /*<<< orphan*/ *);
long GetInputSize(FILE *infile) {
  long currentPos;
  long fileSize;
  currentPos = ftell(infile);
  fseek(infile, 0, SEEK_END);
  fileSize = ftell(infile);
  fseek(infile, currentPos, SEEK_SET);
  return fileSize;
}


x86 assembly (clang, -O0):
<GetInputSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea4(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1040 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2e6d(%rip),%rax
mov    (%rax),%edx
call   1040 <fseek@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetInputSize>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1030 <ftell@plt>
mov    %rax,%r14
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %rbx,%rdi
call   1030 <ftell@plt>
mov    %rax,%r15
mov    0x2e83(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <fseek@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i64 @GetInputSize(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
%4 = alloca i64
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call i64 @ftell(i32* %5)
store i64 %6, i64* %3
%7 = load i32*, i32** %2
%8 = load i32, i32* @SEEK_END
%9 = call i32 @fseek(i32* %7, i64 0, i32 %8)
%10 = load i32*, i32** %2
%11 = call i64 @ftell(i32* %10)
store i64 %11, i64* %4
%12 = load i32*, i32** %2
%13 = load i64, i64* %3
%14 = load i32, i32* @SEEK_SET
%15 = call i32 @fseek(i32* %12, i64 %13, i32 %14)
%16 = load i64, i64* %4
ret i64 %16
}

LLVM IR (-O2):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i64 @GetInputSize(i32* nocapture %0) {
%2 = tail call i64 @ftell(i32* %0)
%3 = load i32, i32* @SEEK_END
%4 = tail call i32 @fseek(i32* %0, i64 0, i32 %3)
%5 = tail call i64 @ftell(i32* %0)
%6 = load i32, i32* @SEEK_SET
%7 = tail call i32 @fseek(i32* %0, i64 %2, i32 %6)
ret i64 %5
}
void rop3_30_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D | S;
  stk1 = T ^ stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


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

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

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

LLVM IR (-O2):
define void @rop3_30_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ output(int);
int main() {
  int y;
  y = 11;
  output(y);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @output(i32 11)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
unsigned long be32(unsigned long);
int write_cksum(unsigned long *, int, int /*<<< orphan*/ *);
int be32_write(FILE *fp, unsigned long value) {
  value = be32(value);
  return write_cksum(&value, 4, fp);
}


x86 assembly (clang, -O0):
<be32_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <be32@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
lea    -0x10(%rbp),%rdi
mov    $0x4,%esi
call   1030 <write_cksum@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<be32_write>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <be32@plt>
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
mov    $0x4,%esi
mov    %rbx,%rdx
call   1030 <write_cksum@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @be32_write(i32* %0, i64 %1) {
%3 = alloca i64
%4 = tail call i64 @be32(i64 %1)
store i64 %4, i64* %3
%5 = call i32 @write_cksum(i64* %3, i32 4, i32* %0)
ret i32 %5
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
unsigned get_time(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return tv.tv_sec * 1000000 + tv.tv_usec;
}


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x8(%rbp),%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,(%rsp),%eax
add    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @get_time() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 1000000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = add nsw i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @get_time() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
ret i32 %9
}
int isspace(int c) {
  return c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '\f' ||
         c == '\v';
}


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0x9,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0xd,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0xc,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
cmpl   $0xb,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
cmp    $0x20,%edi
ja     111d <isspace+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x100003600,%rdx
bt     %rcx,%rdx
jae    111d <isspace+0x1d>
ret
xor    %eax,%eax
cmp    $0xb,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %5
i32 13, label %5
i32 12, label %5
i32 10, label %5
i32 9, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 11
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int f422(int *);
int f423(int *p) { return f422(p); }


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

x86 assembly (clang, -O2):
<f423>:
jmp    1030 <f422@plt>

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

LLVM IR (-O2):
define i32 @f423(i32* %0) {
%2 = tail call i32 @f422(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ LOCK_UN;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ flock(int, int /*<<< orphan*/);
void freeLock(int lockFile_) {
  if (lockFile_ != -1) {
    flock(lockFile_, LOCK_UN);
    close(lockFile_);
  }
}


x86 assembly (clang, -O0):
<freeLock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
je     114e <freeLock+0x2e>
mov    -0x4(%rbp),%edi
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
call   1040 <flock@plt>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeLock>:
cmp    $0xffffffff,%edi
je     113e <freeLock+0x1e>
push   %rbx
mov    %edi,%ebx
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
call   1040 <flock@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <close@plt>
ret

LLVM IR (-O0):
@LOCK_UN = global i32 0
define void @freeLock(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, -1
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = load i32, i32* @LOCK_UN
%8 = call i32 @flock(i32 %6, i32 %7)
%9 = load i32, i32* %2
%10 = call i32 @close(i32 %9)
br label %11
11: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@LOCK_UN = global i32 0
define void @freeLock(i32 %0) {
%2 = icmp eq i32 %0, -1
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = load i32, i32* @LOCK_UN
%5 = tail call i32 @flock(i32 %0, i32 %4)
%6 = tail call i32 @close(i32 %0)
br label %7
7: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef scalar_t__ uid_t;
typedef scalar_t__ gid_t;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned long,
                           unsigned long);
scalar_t__ getegid();
scalar_t__ geteuid();
int /*<<< orphan*/ stderr;
void do_evil_stuff(void) {
  uid_t e_uid;
  gid_t e_gid;
  e_uid = geteuid();
  e_gid = getegid();
  fprintf(stderr, "Doing evil stuff as UID: %lu, GID: %lu!\n",
          (unsigned long int)e_uid, (unsigned long int)e_gid);
}


x86 assembly (clang, -O0):
<do_evil_stuff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <geteuid@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <getegid@plt>
mov    %rax,-0x10(%rbp)
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe9a(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_evil_stuff>:
push   %rbx
xor    %eax,%eax
call   1030 <geteuid@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <getegid@plt>
mov    0x2e97(%rip),%rcx
mov    (%rcx),%edi
lea    0xeae(%rip),%rsi
mov    %rbx,%rdx
mov    %rax,%rcx
pop    %rbx
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [41 x i8] c"Doing evil stuff as UID: %lu, GID: %lu!\0A\00"
define void @do_evil_stuff() {
%1 = alloca i64
%2 = alloca i64
%3 = call i64 (...) @geteuid()
store i64 %3, i64* %1
%4 = call i64 (...) @getegid()
store i64 %4, i64* %2
%5 = load i32, i32* @stderr
%6 = load i64, i64* %1
%7 = load i64, i64* %2
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i64 %6, i64 %7)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [41 x i8] c"Doing evil stuff as UID: %lu, GID: %lu!\0A\00"
define void @do_evil_stuff() {
%1 = tail call i64 (...) @geteuid()
%2 = tail call i64 (...) @getegid()
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i64 %1, i64 %2)
ret void
}
int test_imm_67uint16_reg(unsigned short val) {
  return ((val) & (0x67 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_67uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x67,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_67uint16_reg>:
test   $0x67,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_67uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 103
%6 = icmp ne i32 %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_67uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 103
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int usage(int argc, char **argv) {
  printf("usage: %s <CLIENT|SERVER> <address> <port> <number of pings> <size "
         "of a ping>\n",
         argv[0]);
  return -1;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    (%rsi),%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [79 x i8] c"usage: %s <CLIENT|SERVER> <address> <port> <number of pings> <size of a ping>\0A\00"
define i32 @usage(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 0
%7 = load i8*, i8** %6
%8 = call i32 @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0), i8* %7)
ret i32 -1
}

LLVM IR (-O2):
@.str = [79 x i8] c"usage: %s <CLIENT|SERVER> <address> <port> <number of pings> <size of a ping>\0A\00"
define i32 @usage(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 -1
}
void cleanupcwcycle(void) {}


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

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

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

LLVM IR (-O2):
define void @cleanupcwcycle() {
ret void
}
/* Type definitions */
struct Value {
  int dummy;
};
struct ParseState {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ProgramFail(struct ParseState *, char *);
void StdlibAbort(struct ParseState *Parser, struct Value *ReturnValue,
                 struct Value **Param, int NumArgs) {
  ProgramFail(Parser, "abort");
}


x86 assembly (clang, -O0):
<StdlibAbort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xece(%rip),%rsi
call   1030 <ProgramFail@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ParseState = type { i32 }
%struct.Value = type { i32 }
@.str = [6 x i8] c"abort\00"
define void @StdlibAbort(%struct.ParseState* %0, %struct.Value* %1, %struct.Value** %2, i32 %3) {
%5 = alloca %struct.ParseState*
%6 = alloca %struct.Value*
%7 = alloca %struct.Value**
%8 = alloca i32
store %struct.ParseState* %0, %struct.ParseState** %5
store %struct.Value* %1, %struct.Value** %6
store %struct.Value** %2, %struct.Value*** %7
store i32 %3, i32* %8
%9 = load %struct.ParseState*, %struct.ParseState** %5
%10 = call i32 @ProgramFail(%struct.ParseState* %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.ParseState = type { i32 }
%struct.Value = type { i32 }
@.str = [6 x i8] c"abort\00"
define void @StdlibAbort(%struct.ParseState* %0, %struct.Value* nocapture readnone %1, %struct.Value** nocapture readnone %2, i32 %3) {
%5 = tail call i32 @ProgramFail(%struct.ParseState* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
int dgesv(int N, int NRHS, double *A, int LDA, int *IPIV, double *B, int LDB,
          int *INFO) {
  extern int dgesv_(int *N, int *NRHS, double *A, int *LDA, int *IPIV,
                    double *B, int *LDB, int *INFO);
  return dgesv_(&N, &NRHS, A, &LDA, IPIV, B, &LDB, INFO);
}


x86 assembly (clang, -O0):
<dgesv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    0x18(%rbp),%rax
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x14(%rbp),%rcx
lea    0x10(%rbp),%r10
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <dgesv_@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dgesv>:
sub    $0x18,%rsp
mov    0x28(%rsp),%r10
mov    %edi,0x14(%rsp)
mov    %esi,0x10(%rsp)
mov    %ecx,0xc(%rsp)
lea    0x20(%rsp),%rax
lea    0x14(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rcx
push   %r10
push   %rax
call   1030 <dgesv_@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @dgesv(i32 %0, i32 %1, double* %2, i32 %3, i32* %4, double* %5, i32 %6, i32* %7) {
%9 = alloca i32
%10 = alloca i32
%11 = alloca double*
%12 = alloca i32
%13 = alloca i32*
%14 = alloca double*
%15 = alloca i32
%16 = alloca i32*
store i32 %0, i32* %9
store i32 %1, i32* %10
store double* %2, double** %11
store i32 %3, i32* %12
store i32* %4, i32** %13
store double* %5, double** %14
store i32 %6, i32* %15
store i32* %7, i32** %16
%17 = load double*, double** %11
%18 = load i32*, i32** %13
%19 = load double*, double** %14
%20 = load i32*, i32** %16
%21 = call i32 @dgesv_(i32* %9, i32* %10, double* %17, i32* %12, i32* %18, double* %19, i32* %15, i32* %20)
ret i32 %21
}

LLVM IR (-O2):
define i32 @dgesv(i32 %0, i32 %1, double* %2, i32 %3, i32* %4, double* %5, i32 %6, i32* %7) {
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %9
store i32 %1, i32* %10
store i32 %3, i32* %11
store i32 %6, i32* %12
%13 = call i32 @dgesv_(i32* %9, i32* %10, double* %2, i32* %11, i32* %4, double* %5, i32* %12, i32* %7)
ret i32 %13
}
/* Variables and functions */
char const *__bsd_iconv_canonicalize(char const *);
const char *iconv_canonicalize_compat(const char *a) {
  return __bsd_iconv_canonicalize(a);
}


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

x86 assembly (clang, -O2):
<iconv_canonicalize_compat>:
jmp    1030 <__bsd_iconv_canonicalize@plt>

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

LLVM IR (-O2):
define i8* @iconv_canonicalize_compat(i8* %0) {
%2 = tail call i8* @__bsd_iconv_canonicalize(i8* %0)
ret i8* %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void UARTDisable(uint32_t ui32Base) {
  ;
  while ((*((volatile uint32_t *)(ui32Base + 0x00000018))) & 0x00000008) {
  }
  (*((volatile uint32_t *)(ui32Base + 0x0000002C))) &= ~(0x00000010);
  (*((volatile uint32_t *)(ui32Base + 0x00000030))) &=
      ~(0x00000001 | 0x00000100 | 0x00000200);
}


x86 assembly (clang, -O0):
<UARTDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x18,%eax
cltq
mov    (%rax),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     1122 <UARTDisable+0x22>
jmp    1107 <UARTDisable+0x7>
mov    -0x4(%rbp),%eax
add    $0x2c,%eax
cltq
mov    (%rax),%ecx
and    $0xffffffef,%ecx
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
add    $0x30,%eax
cltq
mov    (%rax),%ecx
and    $0xfffffcfe,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTDisable>:
movslq %edi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
testl  $0x8,0x18(%rax)
jne    1110 <UARTDisable+0x10>
andl   $0xffffffef,0x2c(%rax)
andl   $0xfffffcfe,0x30(%rax)
ret

LLVM IR (-O0):
define void @UARTDisable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %11, %1
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 24
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
%9 = and i32 %8, 8
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %3
br label %3
12: ; preds = %3
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 44
%15 = sext i32 %14 to i64
%16 = inttoptr i64 %15 to i32*
%17 = load volatile i32, i32* %16
%18 = and i32 %17, -17
store volatile i32 %18, i32* %16
%19 = load i32, i32* %2
%20 = add nsw i32 %19, 48
%21 = sext i32 %20 to i64
%22 = inttoptr i64 %21 to i32*
%23 = load volatile i32, i32* %22
%24 = and i32 %23, -770
store volatile i32 %24, i32* %22
ret void
}

LLVM IR (-O2):
define void @UARTDisable(i32 %0) {
%2 = add nsw i32 %0, 24
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
br label %5
5: ; preds = %5, %1
%6 = load volatile i32, i32* %4
%7 = and i32 %6, 8
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %5
9: ; preds = %5
%10 = add nsw i32 %0, 44
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
%13 = load volatile i32, i32* %12
%14 = and i32 %13, -17
store volatile i32 %14, i32* %12
%15 = add nsw i32 %0, 48
%16 = sext i32 %15 to i64
%17 = inttoptr i64 %16 to i32*
%18 = load volatile i32, i32* %17
%19 = and i32 %18, -770
store volatile i32 %19, i32* %17
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ logcat(char *, int /*<<< orphan*/);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
int uart_open_dev(char *dev) {
  int fd = open(dev, O_RDWR);
  if (-1 == fd) {
    logcat("serial port open error: %s\n", strerror(errno));
    return -1;
  } else {
    return fd;
  }
}


x86 assembly (clang, -O0):
<uart_open_dev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
mov    %eax,-0x14(%rbp)
mov    $0xffffffff,%eax
cmp    -0x14(%rbp),%eax
jne    1187 <uart_open_dev+0x57>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %eax,%esi
lea    0xe8a(%rip),%rdi
call   1030 <logcat@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    118d <uart_open_dev+0x5d>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_open_dev>:
push   %rbx
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
jne    1162 <uart_open_dev+0x32>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xea5(%rip),%rdi
mov    %eax,%esi
call   1030 <logcat@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@O_RDWR = global i32 0
@.str = [28 x i8] c"serial port open error: %s\0A\00"
@errno = global i32 0
define i32 @uart_open_dev(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = load i32, i32* @O_RDWR
%7 = call i32 @open(i8* %5, i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp eq i32 -1, %8
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = load i32, i32* @errno
%12 = call i32 @strerror(i32 %11)
%13 = call i32 @logcat(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %12)
store i32 -1, i32* %2
br label %16
14: ; preds = %1
%15 = load i32, i32* %4
store i32 %15, i32* %2
br label %16
16: ; preds = %14, %10
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
@O_RDWR = global i32 0
@.str = [28 x i8] c"serial port open error: %s\0A\00"
@errno = global i32 0
define i32 @uart_open_dev(i8* nocapture %0) {
%2 = load i32, i32* @O_RDWR
%3 = tail call i32 @open(i8* %0, i32 %2)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* @errno
%7 = tail call i32 @strerror(i32 %6)
%8 = tail call i32 @logcat(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %1, %5
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int _pthread_set_state(int /*<<< orphan*/ *, int, int);
int pthread_attr_setinheritsched(pthread_attr_t *a, int flag) {
  return _pthread_set_state(a, 0x08, flag);
}


x86 assembly (clang, -O0):
<pthread_attr_setinheritsched>:
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    $0x8,%esi
call   1030 <_pthread_set_state@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_attr_setinheritsched>:
mov    %esi,%edx
mov    $0x8,%esi
jmp    1030 <_pthread_set_state@plt>

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

LLVM IR (-O2):
define i32 @pthread_attr_setinheritsched(i32* %0, i32 %1) {
%3 = tail call i32 @_pthread_set_state(i32* %0, i32 8, i32 %1)
ret i32 %3
}
int ackermanRecur(int m, int n) {
  if (m == 0) {
    return n + 1;
  }
  if (n == 0) {
    return ackermanRecur(m - 1, 1);
  } else {
    return ackermanRecur(m - 1, ackermanRecur(m, n - 1));
  }
}


x86 assembly (clang, -O0):
<ackermanRecur>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1136 <ackermanRecur+0x26>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    117c <ackermanRecur+0x6c>
cmpl   $0x0,-0xc(%rbp)
jne    1158 <ackermanRecur+0x48>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    $0x1,%esi
call   1030 <ackermanRecur@plt>
mov    %eax,-0x4(%rbp)
jmp    117c <ackermanRecur+0x6c>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <ackermanRecur@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
call   1030 <ackermanRecur@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ackermanRecur>:
push   %rbx
mov    %esi,%eax
test   %edi,%edi
je     113f <ackermanRecur+0x2f>
mov    %edi,%ebx
jmp    112a <ackermanRecur+0x1a>
nopl   0x0(%rax,%rax,1)
mov    $0x1,%eax
add    $0xffffffff,%ebx
je     113f <ackermanRecur+0x2f>
test   %eax,%eax
je     1120 <ackermanRecur+0x10>
add    $0xffffffff,%eax
mov    %ebx,%edi
mov    %eax,%esi
call   1030 <ackermanRecur@plt>
add    $0xffffffff,%ebx
jne    112a <ackermanRecur+0x1a>
add    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @ackermanRecur(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %7
4: ; preds = %11, %2
%5 = phi i32 [ %1, %2 ], [ %12, %11 ]
%6 = add nsw i32 %5, 1
ret i32 %6
7: ; preds = %2, %11
%8 = phi i32 [ %12, %11 ], [ %1, %2 ]
%9 = phi i32 [ %13, %11 ], [ %0, %2 ]
%10 = icmp eq i32 %8, 0
br i1 %10, label %11, label %15
11: ; preds = %7, %15
%12 = phi i32 [ %17, %15 ], [ 1, %7 ]
%13 = add nsw i32 %9, -1
%14 = icmp eq i32 %13, 0
br i1 %14, label %4, label %7
15: ; preds = %7
%16 = add nsw i32 %8, -1
%17 = tail call i32 @ackermanRecur(i32 %9, i32 %16)
br label %11
}
int abs(int x) { return x >= 0 ? x : -x; }


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

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

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

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Type definitions */
typedef char *uint32_t;

/* Variables and functions */
uint32_t rdrand(void) {
  uint32_t ret;
  __asm__ volatile("1: .byte 0x0f, 0xc7, 0xf0\n"
                   "jnc 1b\n"
                   : "=a"(ret)::"cc");
  return ret;
}


x86 assembly (clang, -O0):
<rdrand>:
push   %rbp
mov    %rsp,%rbp
rdrand %eax
jae    1104 <rdrand+0x4>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdrand>:
rdrand %eax
jae    1100 <rdrand>
ret

LLVM IR (-O0):
define i8* @rdrand() {
%1 = alloca i8*
%2 = call i8* asm sideeffect "1: .byte 0x0f, 0xc7, 0xf0\0Ajnc 1b\0A", "={ax},~{cc},~{dirflag},~{fpsr},~{flags}"()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
ret i8* %3
}

LLVM IR (-O2):
define i8* @rdrand() {
%1 = tail call i8* asm sideeffect "1: .byte 0x0f, 0xc7, 0xf0\0Ajnc 1b\0A", "={ax},~{cc},~{dirflag},~{fpsr},~{flags}"()
ret i8* %1
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ minor_code;
};
struct TYPE_4__ {
  TYPE_1__ xnoexpose;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xnoexpose_minor_code(void *_p) {
  return (int)((XEvent *)_p)->xnoexpose.minor_code;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XEvent_xnoexpose_minor_code(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*/ printf(char *);
void hello(void) { printf("Hello world\n"); }


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"Hello world\00"
define void @hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}