xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void foo(int bar) {
  printf("%d", bar);
  return;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @foo(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int d_ble_rc2(double a1) { return !(__builtin_islessequal(a1, 100)); }


x86 assembly (clang, -O0):
<d_ble_rc2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
setae  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_ble_rc2>:
movsd  0xef8(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
setb   %al
ret

LLVM IR (-O0):
define i32 @d_ble_rc2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ole double %3, 1.000000e+02
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @d_ble_rc2(double %0) {
%2 = fcmp ugt double %0, 1.000000e+02
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
struct cli_def {
  int dummy;
};

/* Variables and functions */
int cli_disable(struct cli_def *, char const *, char **, int);
int cli_int_disable(struct cli_def *cli,
                    const char *command __attribute__((unused)),
                    char *argv[] __attribute__((unused)),
                    int argc __attribute__((unused))) {
  return cli_disable(cli, command, argv, argc);
}


x86 assembly (clang, -O0):
<cli_int_disable>:
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
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <cli_disable@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cli_int_disable>:
jmp    1030 <cli_disable@plt>

LLVM IR (-O0):
%struct.cli_def = type { i32 }
define i32 @cli_int_disable(%struct.cli_def* %0, i8* %1, i8** %2, i32 %3) {
%5 = alloca %struct.cli_def*
%6 = alloca i8*
%7 = alloca i8**
%8 = alloca i32
store %struct.cli_def* %0, %struct.cli_def** %5
store i8* %1, i8** %6
store i8** %2, i8*** %7
store i32 %3, i32* %8
%9 = load %struct.cli_def*, %struct.cli_def** %5
%10 = load i8*, i8** %6
%11 = load i8**, i8*** %7
%12 = load i32, i32* %8
%13 = call i32 @cli_disable(%struct.cli_def* %9, i8* %10, i8** %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.cli_def = type { i32 }
define i32 @cli_int_disable(%struct.cli_def* %0, i8* %1, i8** %2, i32 %3) {
%5 = tail call i32 @cli_disable(%struct.cli_def* %0, i8* %1, i8** %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
float makeAnglePosNeg(float);
float differenceBetweenAngles(float angle1, float angle2) {
  return makeAnglePosNeg(angle1 - angle2);
}


x86 assembly (clang, -O0):
<differenceBetweenAngles>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
call   1030 <makeAnglePosNeg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<differenceBetweenAngles>:
subss  %xmm1,%xmm0
jmp    1030 <makeAnglePosNeg@plt>

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

LLVM IR (-O2):
define float @differenceBetweenAngles(float %0, float %1) {
%3 = fsub float %0, %1
%4 = tail call float @makeAnglePosNeg(float %3)
ret float %4
}
void mgsl_isr_null(struct mgsl_struct *info) {
  { return; }
}


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

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

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

LLVM IR (-O2):
%struct.mgsl_struct = type opaque
define void @mgsl_isr_null(%struct.mgsl_struct* nocapture %0) {
ret void
}
void *__(void *_, void *__) { return _; }


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

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

LLVM IR (-O0):
define i8* @__(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
ret i8* %5
}

LLVM IR (-O2):
define i8* @__(i8* readnone returned %0, i8* nocapture readnone %1) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ defword();
int /*<<< orphan*/ ol(char *);
void zclibcallop() {
  ol("rst\t8");
  defword();
}


x86 assembly (clang, -O0):
<zclibcallop>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <ol@plt>
mov    $0x0,%al
call   1030 <defword@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<zclibcallop>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <ol@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <defword@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"rst\098\00"
define void @zclibcallop() {
%1 = call i32 @ol(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @defword()
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"rst\098\00"
define void @zclibcallop() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @defword()
ret void
}
/* Type definitions */
struct timespec {
  int /*<<< orphan*/ tv_nsec;
  int /*<<< orphan*/ tv_sec;
};
struct event_loop {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/, int /*<<< orphan*/);
long print_callback(struct event_loop *loop, void *evdata) {
  struct timespec t;
  clock_gettime(CLOCK_MONOTONIC, &t);
  printf("%ld %ld\n", t.tv_sec, t.tv_nsec);
  return 2000;
}


x86 assembly (clang, -O0):
<print_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
lea    -0x18(%rbp),%rsi
call   1030 <clock_gettime@plt>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
mov    $0x7d0,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_callback>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
mov    (%rsp),%edx
mov    0x4(%rsp),%esi
lea    0xec0(%rip),%rdi
call   1040 <printf@plt>
mov    $0x7d0,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.event_loop = type { i32 }
%struct.timespec = type { i32, i32 }
@CLOCK_MONOTONIC = global i32 0
@.str = [9 x i8] c"%ld %ld\0A\00"
define i64 @print_callback(%struct.event_loop* %0, i8* %1) {
%3 = alloca %struct.event_loop*
%4 = alloca i8*
%5 = alloca %struct.timespec
store %struct.event_loop* %0, %struct.event_loop** %3
store i8* %1, i8** %4
%6 = load i32, i32* @CLOCK_MONOTONIC
%7 = call i32 @clock_gettime(i32 %6, %struct.timespec* %5)
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 1
%9 = load i32, i32* %8
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 0
%11 = load i32, i32* %10
%12 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %11)
ret i64 2000
}

LLVM IR (-O2):
%struct.event_loop = type { i32 }
%struct.timespec = type { i32, i32 }
@CLOCK_MONOTONIC = global i32 0
@.str = [9 x i8] c"%ld %ld\0A\00"
define i64 @print_callback(%struct.event_loop* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = alloca %struct.timespec
%4 = bitcast %struct.timespec* %3 to i8*
%5 = load i32, i32* @CLOCK_MONOTONIC
%6 = call i32 @clock_gettime(i32 %5, %struct.timespec* %3)
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i64 0, i32 1
%8 = load i32, i32* %7
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i64 0, i32 0
%10 = load i32, i32* %9
%11 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %10)
ret i64 2000
}
int omap_cfg_reg(const char *mux_name) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @omap_cfg_reg(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int clock();
int /*<<< orphan*/ elibcls();
int /*<<< orphan*/ printf(char *);
int elibStart(void) {
  printf("(C)opyright 2013 Evan Vik");
  int Time = clock();
  while (clock() - Time < 2000)
    elibcls();
}


x86 assembly (clang, -O0):
<elibStart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <clock@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <clock@plt>
sub    -0x8(%rbp),%eax
cmp    $0x7d0,%eax
jge    116f <elibStart+0x3f>
mov    $0x0,%al
call   1030 <elibcls@plt>
jmp    114e <elibStart+0x1e>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<elibStart>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1040 <clock@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <clock@plt>
sub    %ebx,%eax
cmp    $0x7cf,%eax
jg     1177 <elibStart+0x47>
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <elibcls@plt>
xor    %eax,%eax
call   1040 <clock@plt>
sub    %ebx,%eax
cmp    $0x7d0,%eax
jl     1160 <elibStart+0x30>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"(C)opyright 2013 Evan Vik\00"
define i32 @elibStart() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @clock()
store i32 %4, i32* %2
br label %5
5: ; preds = %10, %0
%6 = call i32 (...) @clock()
%7 = load i32, i32* %2
%8 = sub nsw i32 %6, %7
%9 = icmp slt i32 %8, 2000
br i1 %9, label %10, label %12
10: ; preds = %5
%11 = call i32 (...) @elibcls()
br label %5
12: ; preds = %5
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@.str = [26 x i8] c"(C)opyright 2013 Evan Vik\00"
define i32 @elibStart() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @clock()
%3 = tail call i32 (...) @clock()
%4 = sub nsw i32 %3, %2
%5 = icmp slt i32 %4, 2000
br i1 %5, label %6, label %11
6: ; preds = %0, %6
%7 = tail call i32 (...) @elibcls()
%8 = tail call i32 (...) @clock()
%9 = sub nsw i32 %8, %2
%10 = icmp slt i32 %9, 2000
br i1 %10, label %6, label %11
11: ; preds = %6, %0
ret i32 undef
}
/* Type definitions */
struct epoll_event {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ EPOLL_CTL_ADD;
int /*<<< orphan*/ EXIT_FAILURE;
int epoll_ctl(int const, int /*<<< orphan*/, int const, struct epoll_event *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void addEpollSocket(const int epollfd, const int sock, struct epoll_event *ev) {
  if (epoll_ctl(epollfd, EPOLL_CTL_ADD, sock, ev) == -1) {
    perror("epoll_ctl");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<addEpollSocket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e9c(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%rcx
call   1030 <epoll_ctl@plt>
cmp    $0xffffffff,%eax
jne    117d <addEpollSocket+0x4d>
lea    0xe96(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e62(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addEpollSocket>:
push   %rax
mov    %rdx,%rcx
mov    %esi,%edx
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
call   1030 <epoll_ctl@plt>
cmp    $0xffffffff,%eax
je     114b <addEpollSocket+0x1b>
pop    %rax
ret
lea    0xeae(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.epoll_event = type { i32 }
@EPOLL_CTL_ADD = global i32 0
@.str = [10 x i8] c"epoll_ctl\00"
@EXIT_FAILURE = global i32 0
define void @addEpollSocket(i32 %0, i32 %1, %struct.epoll_event* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.epoll_event*
store i32 %0, i32* %4
store i32 %1, i32* %5
store %struct.epoll_event* %2, %struct.epoll_event** %6
%7 = load i32, i32* %4
%8 = load i32, i32* @EPOLL_CTL_ADD
%9 = load i32, i32* %5
%10 = load %struct.epoll_event*, %struct.epoll_event** %6
%11 = call i32 @epoll_ctl(i32 %7, i32 %8, i32 %9, %struct.epoll_event* %10)
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %17
13: ; preds = %3
%14 = call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%15 = load i32, i32* @EXIT_FAILURE
%16 = call i32 @exit(i32 %15)
unreachable
17: ; preds = %3
ret void
}

LLVM IR (-O2):
%struct.epoll_event = type { i32 }
@EPOLL_CTL_ADD = global i32 0
@.str = [10 x i8] c"epoll_ctl\00"
@EXIT_FAILURE = global i32 0
define void @addEpollSocket(i32 %0, i32 %1, %struct.epoll_event* %2) {
%4 = load i32, i32* @EPOLL_CTL_ADD
%5 = tail call i32 @epoll_ctl(i32 %0, i32 %4, i32 %1, %struct.epoll_event* %2)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = tail call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @EXIT_FAILURE
%10 = tail call i32 @exit(i32 %9)
unreachable
11: ; preds = %3
ret void
}
/* Variables and functions */
int i2c_smbus_write_byte(int, int);
int radxaI2CWrite(int fd, int data) { return i2c_smbus_write_byte(fd, data); }


x86 assembly (clang, -O0):
<radxaI2CWrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <i2c_smbus_write_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<radxaI2CWrite>:
jmp    1030 <i2c_smbus_write_byte@plt>

LLVM IR (-O0):
define i32 @radxaI2CWrite(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 @i2c_smbus_write_byte(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @radxaI2CWrite(i32 %0, i32 %1) {
%3 = tail call i32 @i2c_smbus_write_byte(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
scalar_t__ TRUE;
int getch();
void curTest(void) {
  do {
    int c = getch();
    break;
  } while (TRUE);
}


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

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

LLVM IR (-O0):
@TRUE = global i64 0
define void @curTest() {
%1 = alloca i32
br label %2
2: ; preds = %4, %0
%3 = call i32 (...) @getch()
store i32 %3, i32* %1
br label %7
4: ; No predecessors!
%5 = load i64, i64* @TRUE
%6 = icmp ne i64 %5, 0
br i1 %6, label %2, label %7
7: ; preds = %4, %2
ret void
}

LLVM IR (-O2):
@TRUE = global i64 0
define void @curTest() {
%1 = tail call i32 (...) @getch()
ret void
}
/* Variables and functions */
unsigned int get_random_int();
int rand(void) {
  unsigned int tmp;
  tmp = get_random_int();
  tmp <<= 1;
  tmp >>= 1;
  return tmp;
}


x86 assembly (clang, -O0):
<rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <get_random_int@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand>:
push   %rax
xor    %eax,%eax
call   1030 <get_random_int@plt>
and    $0x7fffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rand() {
%1 = alloca i32
%2 = call i32 (...) @get_random_int()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = shl i32 %3, 1
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = lshr i32 %5, 1
store i32 %6, i32* %1
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @rand() {
%1 = tail call i32 (...) @get_random_int()
%2 = and i32 %1, 2147483647
ret i32 %2
}
void get_signal_sync() {}


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

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

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

LLVM IR (-O2):
define void @get_signal_sync() {
ret void
}
int phred33ToPhred(char p) { return ((int)p) - 33; }


x86 assembly (clang, -O0):
<phred33ToPhred>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x21,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<phred33ToPhred>:
lea    -0x21(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @phred33ToPhred(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 33
ret i32 %5
}

LLVM IR (-O2):
define i32 @phred33ToPhred(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -33
ret i32 %3
}
/* Type definitions */
struct ibv_rwq_ind_table_init_attr {
  int dummy;
};
struct ibv_rwq_ind_table {
  int dummy;
};
struct ibv_context {
  int dummy;
};

/* Variables and functions */
struct ibv_rwq_ind_table *
ibv_create_rwq_ind_table(struct ibv_context *,
                         struct ibv_rwq_ind_table_init_attr *);
struct ibv_rwq_ind_table *
mlx4_glue_create_rwq_ind_table(struct ibv_context *context,
                               struct ibv_rwq_ind_table_init_attr *init_attr) {
  return ibv_create_rwq_ind_table(context, init_attr);
}


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

x86 assembly (clang, -O2):
<mlx4_glue_create_rwq_ind_table>:
jmp    1030 <ibv_create_rwq_ind_table@plt>

LLVM IR (-O0):
%struct.ibv_rwq_ind_table = type { i32 }
%struct.ibv_context = type { i32 }
%struct.ibv_rwq_ind_table_init_attr = type { i32 }
define %struct.ibv_rwq_ind_table* @mlx4_glue_create_rwq_ind_table(%struct.ibv_context* %0, %struct.ibv_rwq_ind_table_init_attr* %1) {
%3 = alloca %struct.ibv_context*
%4 = alloca %struct.ibv_rwq_ind_table_init_attr*
store %struct.ibv_context* %0, %struct.ibv_context** %3
store %struct.ibv_rwq_ind_table_init_attr* %1, %struct.ibv_rwq_ind_table_init_attr** %4
%5 = load %struct.ibv_context*, %struct.ibv_context** %3
%6 = load %struct.ibv_rwq_ind_table_init_attr*, %struct.ibv_rwq_ind_table_init_attr** %4
%7 = call %struct.ibv_rwq_ind_table* @ibv_create_rwq_ind_table(%struct.ibv_context* %5, %struct.ibv_rwq_ind_table_init_attr* %6)
ret %struct.ibv_rwq_ind_table* %7
}

LLVM IR (-O2):
%struct.ibv_rwq_ind_table = type { i32 }
%struct.ibv_context = type { i32 }
%struct.ibv_rwq_ind_table_init_attr = type { i32 }
define %struct.ibv_rwq_ind_table* @mlx4_glue_create_rwq_ind_table(%struct.ibv_context* %0, %struct.ibv_rwq_ind_table_init_attr* %1) {
%3 = tail call %struct.ibv_rwq_ind_table* @ibv_create_rwq_ind_table(%struct.ibv_context* %0, %struct.ibv_rwq_ind_table_init_attr* %1)
ret %struct.ibv_rwq_ind_table* %3
}
void ClearExtensionVars(void) {}


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

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

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

LLVM IR (-O2):
define void @ClearExtensionVars() {
ret void
}
int main() { static int a, b, c; }


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

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

LLVM IR (-O0):
@main.a = internal global i32 0
@main.b = internal global i32 0
@main.c = internal global i32 0
define i32 @main() {
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void g(void *p) {}


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

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

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

LLVM IR (-O2):
define void @g(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ transtemp();
int main(int argc, char const *argv[]) {
  transtemp();
  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   1030 <transtemp@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <transtemp@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 (...) @transtemp()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @transtemp()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void CloseAudioDevice(int *audio_device_fd) {
  if (*audio_device_fd == 0)
    return;
  close(*audio_device_fd);
  *audio_device_fd = -1;
}


x86 assembly (clang, -O0):
<CloseAudioDevice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
jne    112e <CloseAudioDevice+0x1e>
jmp    1143 <CloseAudioDevice+0x33>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <close@plt>
mov    -0x8(%rbp),%rax
movl   $0xffffffff,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CloseAudioDevice>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
test   %edi,%edi
je     1125 <CloseAudioDevice+0x15>
call   1030 <close@plt>
movl   $0xffffffff,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @CloseAudioDevice(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @close(i32 %2)
store i32 -1, i32* %0
br label %6
6: ; preds = %1, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ write(int, char *, int);
int main(void) {
  write(1, "Hello\n", sizeof("Hello\n"));
  write(1, "world!\n", sizeof("world!\n"));
  exit(5);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
lea    0xec5(%rip),%rsi
mov    $0x7,%edx
call   1030 <write@plt>
mov    $0x1,%edi
lea    0xeb6(%rip),%rsi
mov    $0x8,%edx
call   1030 <write@plt>
mov    $0x5,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x1,%edi
mov    $0x7,%edx
call   1030 <write@plt>
lea    0xec9(%rip),%rsi
mov    $0x1,%edi
mov    $0x8,%edx
call   1030 <write@plt>
mov    $0x5,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"Hello\0A\00"
@.str.1 = [8 x i8] c"world!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @write(i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 7)
%3 = call i32 @write(i32 1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 8)
%4 = call i32 @exit(i32 5)
unreachable
}

LLVM IR (-O2):
@.str = [7 x i8] c"Hello\0A\00"
@.str.1 = [8 x i8] c"world!\0A\00"
define i32 @main() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 7)
%2 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 8)
%3 = tail call i32 @exit(i32 5)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ UPnPResponse_AVTransport_Pause(void *);
int /*<<< orphan*/ printf(char *, unsigned int);
void UPnPAVTransport_Pause(void *upnptoken, unsigned int InstanceID) {
  printf("Invoke: UPnPAVTransport_Pause(%u);\r\n", InstanceID);
  UPnPResponse_AVTransport_Pause(upnptoken);
}


x86 assembly (clang, -O0):
<UPnPAVTransport_Pause>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <UPnPResponse_AVTransport_Pause@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UPnPAVTransport_Pause>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <UPnPResponse_AVTransport_Pause@plt>

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

LLVM IR (-O2):
@.str = [37 x i8] c"Invoke: UPnPAVTransport_Pause(%u);\0D\0A\00"
define void @UPnPAVTransport_Pause(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %1)
%4 = tail call i32 @UPnPResponse_AVTransport_Pause(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int pgmWrite(const char **header, const int **pixels, int numRows, int numCols,
             FILE *out) {}


x86 assembly (clang, -O0):
<pgmWrite>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @pgmWrite(i8** nocapture readnone %0, i32** nocapture readnone %1, i32 %2, i32 %3, i32* nocapture readnone %4) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ PF_INET6;
int /*<<< orphan*/ SOCK_DGRAM;
int /*<<< orphan*/ exit(int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int main(int argc, char **argv) {
  if (socket(PF_INET6, SOCK_DGRAM, 0) == -1) {
    exit(1);
  } else {
    exit(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    0x2eab(%rip),%rax
mov    (%rax),%edi
mov    0x2e9a(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1040 <socket@plt>
cmp    $0xffffffff,%eax
jne    1162 <main+0x42>
mov    $0x1,%edi
call   1030 <exit@plt>
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1040 <socket@plt>
cmp    $0xffffffff,%eax
jne    1149 <main+0x29>
mov    $0x1,%edi
call   1030 <exit@plt>
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@PF_INET6 = global i32 0
@SOCK_DGRAM = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* @PF_INET6
%7 = load i32, i32* @SOCK_DGRAM
%8 = call i32 @socket(i32 %6, i32 %7, i32 0)
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %2
%13 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@PF_INET6 = global i32 0
@SOCK_DGRAM = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @PF_INET6
%4 = load i32, i32* @SOCK_DGRAM
%5 = tail call i32 @socket(i32 %3, i32 %4, i32 0)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
%10 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
scalar_t__ strcmp(char *, char *);
int equal_string(void *s1, void *s2) {
  char *str1 = (char *)s1;
  char *str2 = (char *)s2;
  printf("equal_string: str1:%s, str2:%s\n", str1, str2);
  if (strcmp(str1, str2)) {
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<equal_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     1177 <equal_string+0x57>
movl   $0x0,-0x4(%rbp)
jmp    117e <equal_string+0x5e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<equal_string>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [32 x i8] c"equal_string: str1:%s, str2:%s\0A\00"
define i32 @equal_string(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
store i8* %8, i8** %6
%9 = load i8*, i8** %5
store i8* %9, i8** %7
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11)
%13 = load i8*, i8** %6
%14 = load i8*, i8** %7
%15 = call i64 @strcmp(i8* %13, i8* %14)
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 0, i32* %3
br label %19
18: ; preds = %2
store i32 1, i32* %3
br label %19
19: ; preds = %18, %17
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@.str = [32 x i8] c"equal_string: str1:%s, str2:%s\0A\00"
define i32 @equal_string(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%4 = tail call i64 @strcmp(i8* %0, i8* %1)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
struct bitpack__clump {
  int dummy;
};

/* Variables and functions */
int encode_big_endian(char *, struct bitpack__clump *);
int encode_little_endian(char *, struct bitpack__clump *);
int bitpack__encode(char *target, struct bitpack__clump *source,
                    int little_endian) {
  if (little_endian)
    return encode_little_endian(target, source);
  else
    return encode_big_endian(target, source);
}


x86 assembly (clang, -O0):
<bitpack__encode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1152 <bitpack__encode+0x32>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <encode_little_endian@plt>
mov    %eax,-0x4(%rbp)
jmp    1162 <bitpack__encode+0x42>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <encode_big_endian@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitpack__encode>:
test   %edx,%edx
je     1129 <bitpack__encode+0x9>
jmp    1040 <encode_little_endian@plt>
jmp    1030 <encode_big_endian@plt>

LLVM IR (-O0):
%struct.bitpack__clump = type { i32 }
define i32 @bitpack__encode(i8* %0, %struct.bitpack__clump* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca %struct.bitpack__clump*
%7 = alloca i32
store i8* %0, i8** %5
store %struct.bitpack__clump* %1, %struct.bitpack__clump** %6
store i32 %2, i32* %7
%8 = load i32, i32* %7
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load i8*, i8** %5
%12 = load %struct.bitpack__clump*, %struct.bitpack__clump** %6
%13 = call i32 @encode_little_endian(i8* %11, %struct.bitpack__clump* %12)
store i32 %13, i32* %4
br label %18
14: ; preds = %3
%15 = load i8*, i8** %5
%16 = load %struct.bitpack__clump*, %struct.bitpack__clump** %6
%17 = call i32 @encode_big_endian(i8* %15, %struct.bitpack__clump* %16)
store i32 %17, i32* %4
br label %18
18: ; preds = %14, %10
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
%struct.bitpack__clump = type { i32 }
define i32 @bitpack__encode(i8* %0, %struct.bitpack__clump* %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @encode_little_endian(i8* %0, %struct.bitpack__clump* %1)
br label %9
7: ; preds = %3
%8 = tail call i32 @encode_big_endian(i8* %0, %struct.bitpack__clump* %1)
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
ret i32 %10
}
void charcopy(char *cpfrom, char *cpto) {
  while ((*cpto = *cpfrom) != '\0') {
    cpto++;
    cpfrom++;
  }
}


x86 assembly (clang, -O0):
<charcopy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    -0x10(%rbp),%rcx
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     1141 <charcopy+0x41>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <charcopy+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<charcopy>:
mov    (%rdi),%al
mov    %al,(%rsi)
test   %al,%al
je     111f <charcopy+0x1f>
mov    $0x1,%eax
nopl   (%rax)
movzbl (%rdi,%rax,1),%ecx
mov    %cl,(%rsi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <charcopy+0x10>
ret

LLVM IR (-O0):
define void @charcopy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %11, %2
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = load i8*, i8** %4
store i8 %7, i8* %8
%9 = sext i8 %7 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %5
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %4
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %3
br label %5
16: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @charcopy(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
store i8 %3, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %8, %5 ], [ %1, %2 ]
%7 = phi i8* [ %9, %5 ], [ %0, %2 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = load i8, i8* %9
store i8 %10, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %2
ret void
}
void chaz_ConfWriterPython_add_global_typedef(const char *type,
                                              const char *alias) {
  (void)type;
  (void)alias;
}


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

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

LLVM IR (-O0):
define void @chaz_ConfWriterPython_add_global_typedef(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 = load i8*, i8** %4
ret void
}

LLVM IR (-O2):
define void @chaz_ConfWriterPython_add_global_typedef(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
unsigned int __blsr_u32(unsigned int);
unsigned int test__blsr_u32(unsigned int __X) { return __blsr_u32(__X); }


x86 assembly (clang, -O0):
<test__blsr_u32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <__blsr_u32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test__blsr_u32>:
jmp    1030 <__blsr_u32@plt>

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

LLVM IR (-O2):
define i32 @test__blsr_u32(i32 %0) {
%2 = tail call i32 @__blsr_u32(i32 %0)
ret i32 %2
}
int ffs(int i) {
  int j;
  if (i == 0)
    return 0;
  for (j = 1; (i & 1) == 0; j++)
    i >>= 1;
  return j;
}


x86 assembly (clang, -O0):
<ffs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <ffs+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1150 <ffs+0x50>
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    114a <ffs+0x4a>
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <ffs+0x24>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffs>:
test   %edi,%edi
je     112e <ffs+0x2e>
mov    $0x1,%eax
test   $0x1,%dil
jne    112d <ffs+0x2d>
mov    $0x1,%eax
mov    %edi,%ecx
cs nopw 0x0(%rax,%rax,1)
sar    %ecx
add    $0x1,%eax
test   $0x2,%dil
mov    %ecx,%edi
je     1120 <ffs+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ffs(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = and i32 %0, 1
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %3, %6
%7 = phi i32 [ %10, %6 ], [ 1, %3 ]
%8 = phi i32 [ %9, %6 ], [ %0, %3 ]
%9 = ashr i32 %8, 1
%10 = add nuw nsw i32 %7, 1
%11 = and i32 %8, 2
%12 = icmp eq i32 %11, 0
br i1 %12, label %6, label %13
13: ; preds = %6, %3, %1
%14 = phi i32 [ 0, %1 ], [ 1, %3 ], [ %10, %6 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int const);
int /*<<< orphan*/ puts(char *);
void array_print(int const *array, size_t count) {
  size_t i;
  for (i = 0; i < count; i++)
    printf("%d ", array[i]);
  puts("");
}


x86 assembly (clang, -O0):
<array_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    116e <array_print+0x4e>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1138 <array_print+0x18>
lea    0xe8e(%rip),%rdi
call   1030 <puts@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_print>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1155 <array_print+0x35>
mov    %rsi,%r12
mov    %rdi,%r14
xor    %ebx,%ebx
lea    0xec4(%rip),%r15
nopl   0x0(%rax)
mov    (%r14,%rbx,4),%esi
mov    %r15,%rdi
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <array_print+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [1 x i8] zeroinitializer
define void @array_print(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %16, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i64, i64* %5
%13 = getelementptr inbounds i32, i32* %11, i64 %12
%14 = load i32, i32* %13
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
br label %16
16: ; preds = %10
%17 = load i64, i64* %5
%18 = add i64 %17, 1
store i64 %18, i64* %5
br label %6
19: ; preds = %6
%20 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @array_print(i32* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %9, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = add nuw i64 %5, 1
%10 = icmp eq i64 %9, %1
br i1 %10, label %11, label %4
11: ; preds = %4, %2
%12 = tail call i32 @putchar(i32 10)
ret void
}
/* Type definitions */
struct dict_iter {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct dict_iter *);
void dict_iter_free(struct dict_iter *iter) { free(iter); }


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

x86 assembly (clang, -O2):
<dict_iter_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.dict_iter = type { i32 }
define void @dict_iter_free(%struct.dict_iter* %0) {
%2 = alloca %struct.dict_iter*
store %struct.dict_iter* %0, %struct.dict_iter** %2
%3 = load %struct.dict_iter*, %struct.dict_iter** %2
%4 = call i32 @free(%struct.dict_iter* %3)
ret void
}

LLVM IR (-O2):
%struct.dict_iter = type { i32 }
define void @dict_iter_free(%struct.dict_iter* nocapture %0) {
%2 = tail call i32 @free(%struct.dict_iter* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int age = 10;
  int height;
  printf("I am %d years old\n");
  printf("I am %d inches tall\n", height);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [19 x i8] c"I am %d years old\0A\00"
@.str.1 = [21 x i8] c"I am %d inches tall\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 undef)
ret i32 0
}
int test_imm_9Cint8_mem(signed char *val) {
  return ((*val) & (0x9C << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_9Cint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -100
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int rmdir(char *);
int idris2_removeDir(char *path) { return rmdir(path); }


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

x86 assembly (clang, -O2):
<idris2_removeDir>:
jmp    1030 <rmdir@plt>

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

LLVM IR (-O2):
define i32 @idris2_removeDir(i8* nocapture %0) {
%2 = tail call i32 @rmdir(i8* %0)
ret i32 %2
}
/* Type definitions */
typedef scalar_t__ volatile uint8_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
void GPIODMATriggerEnable(uint32_t ui32Port, uint8_t ui8Pins) {
  ;
  (*((volatile uint32_t *)(ui32Port + 0x00000534))) |= ui8Pins;
}


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

x86 assembly (clang, -O2):
<GPIODMATriggerEnable>:
mov    %rsi,-0x8(%rsp)
mov    -0x8(%rsp),%rax
or     %rax,0x534(%rdi)
ret

LLVM IR (-O0):
define void @GPIODMATriggerEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = load i64, i64* %3
%7 = add nsw i64 %6, 1332
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %5
store volatile i64 %10, i64* %8
ret void
}

LLVM IR (-O2):
define void @GPIODMATriggerEnable(i64 %0, i64 %1) {
%3 = alloca i64
store volatile i64 %1, i64* %3
%4 = load volatile i64, i64* %3
%5 = add nsw i64 %0, 1332
%6 = inttoptr i64 %5 to i64*
%7 = load volatile i64, i64* %6
%8 = or i64 %7, %4
store volatile i64 %8, i64* %6
ret void
}
float dummyf(float x) { return x; }


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

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

LLVM IR (-O0):
define float @dummyf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
ret float %3
}

LLVM IR (-O2):
define float @dummyf(float returned %0) {
ret float %0
}