xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ nosound();
int /*<<< orphan*/ sound(int);
void thump(void) {
  int i;
  for (i = 1; i < 2; i++) {
    int freq = 20 + i * 3;
    sound(20 + i * 3);
    delay(1);
    nosound();
  }
  delay(400);
}


x86 assembly (clang, -O0):
<thump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    117e <thump+0x4e>
imul   $0x3,-0x4(%rbp),%eax
add    $0x14,%eax
mov    %eax,-0x8(%rbp)
imul   $0x3,-0x4(%rbp),%edi
add    $0x14,%edi
call   1030 <sound@plt>
mov    $0x1,%edi
call   1040 <delay@plt>
mov    $0x0,%al
call   1050 <nosound@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    113f <thump+0xf>
mov    $0x190,%edi
call   1040 <delay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thump>:
push   %rax
mov    $0x17,%edi
call   1030 <sound@plt>
mov    $0x1,%edi
call   1040 <delay@plt>
xor    %eax,%eax
call   1050 <nosound@plt>
mov    $0x190,%edi
pop    %rax
jmp    1040 <delay@plt>

LLVM IR (-O0):
define void @thump() {
%1 = alloca i32
%2 = alloca i32
store i32 1, i32* %1
br label %3
3: ; preds = %16, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 2
br i1 %5, label %6, label %19
6: ; preds = %3
%7 = load i32, i32* %1
%8 = mul nsw i32 %7, 3
%9 = add nsw i32 20, %8
store i32 %9, i32* %2
%10 = load i32, i32* %1
%11 = mul nsw i32 %10, 3
%12 = add nsw i32 20, %11
%13 = call i32 @sound(i32 %12)
%14 = call i32 @delay(i32 1)
%15 = call i32 (...) @nosound()
br label %16
16: ; preds = %6
%17 = load i32, i32* %1
%18 = add nsw i32 %17, 1
store i32 %18, i32* %1
br label %3
19: ; preds = %3
%20 = call i32 @delay(i32 400)
ret void
}

LLVM IR (-O2):
define void @thump() {
%1 = tail call i32 @sound(i32 23)
%2 = tail call i32 @delay(i32 1)
%3 = tail call i32 (...) @nosound()
%4 = tail call i32 @delay(i32 400)
ret void
}
int dobro(int i) { return (i * 2); }


x86 assembly (clang, -O0):
<dobro>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dobro>:
lea    (%rdi,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @dobro(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int send_recv(int, int);
int case_big(int fd) { return send_recv(fd, 100 * 1000 * 1000); }


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

x86 assembly (clang, -O2):
<case_big>:
mov    $0x5f5e100,%esi
jmp    1030 <send_recv@plt>

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

LLVM IR (-O2):
define i32 @case_big(i32 %0) {
%2 = tail call i32 @send_recv(i32 %0, i32 100000000)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t check_audio_file(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @check_audio_file() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
void regulo_strcpy_skip1(void *dest, const char *source) {
  strcpy((char *)dest, source + 1);
}


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

x86 assembly (clang, -O2):
<regulo_strcpy_skip1>:
add    $0x1,%rsi
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define void @regulo_strcpy_skip1(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
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = call i32 @strcpy(i8* %5, i8* %7)
ret void
}

LLVM IR (-O2):
define void @regulo_strcpy_skip1(i8* %0, i8* %1) {
%3 = getelementptr inbounds i8, i8* %1, i64 1
%4 = tail call i32 @strcpy(i8* %0, i8* %3)
ret void
}
unsigned rte_lcore_to_socket_id(unsigned lcore_id) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @rte_lcore_to_socket_id(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_category(int message, char *category) {
  if (message == 1) {
    printf("\n*********\n");
    printf("Test %s", category);
    printf("\n*********\n");
  }
}


x86 assembly (clang, -O0):
<print_category>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1157 <print_category+0x47>
lea    0xed0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_category>:
cmp    $0x1,%edi
jne    115b <print_category+0x3b>
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
lea    0xed5(%rip),%r14
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0xebe(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <puts@plt>
ret

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

LLVM IR (-O2):
@.str.1 = [8 x i8] c"Test %s\00"
@str.2 = [11 x i8] c"\0A*********\00"
define void @print_category(i32 %0, i8* %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.2, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.2, i64 0, i64 0))
br label %8
8: ; preds = %4, %2
ret void
}
void terminate_at_location(char *src, const int loc) { src[loc] = '\0'; }


x86 assembly (clang, -O0):
<terminate_at_location>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<terminate_at_location>:
movslq %esi,%rax
movb   $0x0,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @terminate_at_location(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
store i8 0, i8* %8
ret void
}

LLVM IR (-O2):
define void @terminate_at_location(i8* nocapture writeonly %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
store i8 0, i8* %4
ret void
}
void WRITE_STRING(const char *a, int w) { printf("%*s", w, a); }


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

x86 assembly (clang, -O2):
<WRITE_STRING>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%*s\00"
define void @WRITE_STRING(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 = load i8*, i8** %3
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%*s\00"
define void @WRITE_STRING(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int set_uid(int /*<<< orphan*/);
int setuid(uid_t n) { return set_uid(n); }


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

x86 assembly (clang, -O2):
<setuid>:
jmp    1030 <set_uid@plt>

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

LLVM IR (-O2):
define i32 @setuid(i32 %0) {
%2 = tail call i32 @set_uid(i32 %0)
ret i32 %2
}
unsigned short f1(unsigned short a) { return a >> 8 | a << 8; }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
movzwl -0x2(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
mov    %edi,%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @f1(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = ashr i32 %4, 8
%6 = load i16, i16* %2
%7 = zext i16 %6 to i32
%8 = shl i32 %7, 8
%9 = or i32 %5, %8
%10 = trunc i32 %9 to i16
ret i16 %10
}

LLVM IR (-O2):
define zeroext i16 @f1(i16 zeroext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}
/* Variables and functions */
int /*<<< orphan*/ clrtoeol();
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ refresh();
void deinit() {
  clrtoeol();
  refresh();
  endwin();
}


x86 assembly (clang, -O0):
<deinit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <clrtoeol@plt>
mov    $0x0,%al
call   1030 <refresh@plt>
mov    $0x0,%al
call   1040 <endwin@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<deinit>:
push   %rax
xor    %eax,%eax
call   1050 <clrtoeol@plt>
xor    %eax,%eax
call   1030 <refresh@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <endwin@plt>

LLVM IR (-O0):
define void @deinit() {
%1 = call i32 (...) @clrtoeol()
%2 = call i32 (...) @refresh()
%3 = call i32 (...) @endwin()
ret void
}

LLVM IR (-O2):
define void @deinit() {
%1 = tail call i32 (...) @clrtoeol()
%2 = tail call i32 (...) @refresh()
%3 = tail call i32 (...) @endwin()
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int intToReal(uint32_t *env) { return (float)(int)*(env + 1); }


x86 assembly (clang, -O0):
<intToReal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
cvtsi2ss %eax,%xmm0
cvttss2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intToReal>:
cvtsi2ssl 0x8(%rdi),%xmm0
cvttss2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @intToReal(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = getelementptr inbounds i64, i64* %3, i64 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = sitofp i32 %6 to float
%8 = fptosi float %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @intToReal(i64* nocapture %0) {
%2 = getelementptr inbounds i64, i64* %0, i64 1
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = sitofp i32 %4 to float
%6 = fptosi float %5 to i32
ret i32 %6
}
__int128 atomic_load_128_relaxed(__int128 *ptr) {
  return __atomic_load_n(ptr, 0);
}


x86 assembly (clang, -O0):
<atomic_load_128_relaxed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
mov    $0x10,%edi
lea    -0x30(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <__atomic_load@plt>
mov    -0x30(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomic_load_128_relaxed>:
sub    $0x18,%rsp
mov    %rdi,%rsi
mov    %rsp,%rdx
mov    $0x10,%edi
xor    %ecx,%ecx
call   1030 <__atomic_load@plt>
mov    (%rsp),%rax
mov    0x8(%rsp),%rdx
add    $0x18,%rsp
ret

LLVM IR (-O0):
define { i64, i64 } @atomic_load_128_relaxed(i128* %0) {
%2 = alloca i128
%3 = alloca i128*
%4 = alloca i128
store i128* %0, i128** %3
%5 = load i128*, i128** %3
%6 = bitcast i128* %5 to i8*
%7 = bitcast i128* %4 to i8*
%8 = load i128, i128* %4
store i128 %8, i128* %2
%9 = bitcast i128* %2 to { i64, i64 }*
%10 = load { i64, i64 }, { i64, i64 }* %9
ret { i64, i64 } %10
}

LLVM IR (-O2):
define { i64, i64 } @atomic_load_128_relaxed(i128* %0) {
%2 = alloca i128
%3 = bitcast i128* %0 to i8*
%4 = bitcast i128* %2 to i8*
%5 = load i128, i128* %2
%6 = trunc i128 %5 to i64
%7 = lshr i128 %5, 64
%8 = trunc i128 %7 to i64
%9 = insertvalue { i64, i64 } poison, i64 %6, 0
%10 = insertvalue { i64, i64 } %9, i64 %8, 1
ret { i64, i64 } %10
}
int test_imm_60uint16_mem(unsigned short *val) {
  return ((*val) & (0x60 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_60uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, 96
%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_60uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 96
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int lcm2nums(int, int);
int lcmnnums(int *arr, int n) {
  int lcm = arr[0];
  for (int i = 1; i < n; i++) {
    lcm = lcm2nums(arr[i], lcm);
  }
  return lcm;
}


x86 assembly (clang, -O0):
<lcmnnums>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115f <lcmnnums+0x4f>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    -0x10(%rbp),%esi
call   1030 <lcm2nums@plt>
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112f <lcmnnums+0x1f>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcmnnums>:
push   %r15
push   %r14
push   %rbx
mov    (%rdi),%eax
cmp    $0x2,%esi
jl     1144 <lcmnnums+0x34>
mov    %rdi,%r15
mov    %esi,%r14d
mov    $0x1,%ebx
nopw   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%edi
mov    %eax,%esi
call   1030 <lcm2nums@plt>
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <lcmnnums+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @lcmnnums(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = icmp sgt i32 %1, 1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = zext i32 %1 to i64
br label %9
7: ; preds = %9, %2
%8 = phi i32 [ %3, %2 ], [ %14, %9 ]
ret i32 %8
9: ; preds = %5, %9
%10 = phi i64 [ 1, %5 ], [ %15, %9 ]
%11 = phi i32 [ %3, %5 ], [ %14, %9 ]
%12 = getelementptr inbounds i32, i32* %0, i64 %10
%13 = load i32, i32* %12
%14 = tail call i32 @lcm2nums(i32 %13, i32 %11)
%15 = add nuw nsw i64 %10, 1
%16 = icmp eq i64 %15, %6
br i1 %16, label %7, label %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr,
          "usage: rs [-[csCS][x][kKgGw][N]tTeEnyjhHmz] [rows [cols]]\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [59 x i8] c"usage: rs [-[csCS][x][kKgGw][N]tTeEnyjhHmz] [rows [cols]]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [59 x i8] c"usage: rs [-[csCS][x][kKgGw][N]tTeEnyjhHmz] [rows [cols]]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void test_three(int x, int y) {
#pragma omp distribute parallel for simd collapse(1)
  for (int i = 0; i < x; i++)
    for (int i = 0; i < y; i++)
      ;
}


x86 assembly (clang, -O0):
<test_three>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1156 <test_three+0x56>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1143 <test_three+0x43>
jmp    1135 <test_three+0x35>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1124 <test_three+0x24>
jmp    1148 <test_three+0x48>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <test_three+0x11>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_three(i32 %0, i32 %1) {
ret void
}
putch(c) { putchar(c); }


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

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

LLVM IR (-O0):
define i32 @putch(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %4)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @putch(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *, int);
void test_receive(int length, void *data) {
  printk("Length got is: %d\n", length);
}


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"Length got is: %d\0A\00"
define void @test_receive(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = call i32 @printk(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"Length got is: %d\0A\00"
define void @test_receive(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32 @printk(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int iseol(char c) {
  switch (c) {
  case 10:
  case 13:
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<iseol>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0xa,%eax
je     1130 <iseol+0x30>
jmp    111f <iseol+0x1f>
mov    -0xc(%rbp),%eax
sub    $0xd,%eax
jne    113c <iseol+0x3c>
jmp    1130 <iseol+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1143 <iseol+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iseol>:
cmp    $0xa,%dil
sete   %al
cmp    $0xd,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @iseol(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %7 [
i32 10, label %6
i32 13, label %6
]
6: ; preds = %1, %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @iseol(i8 signext %0) {
%2 = icmp eq i8 %0, 10
%3 = icmp eq i8 %0, 13
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
int two(int a) { return a * a; }


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

x86 assembly (clang, -O2):
<two>:
mov    %edi,%eax
imul   %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @two(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ wipe();
void cls_command(void) { wipe(); }


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

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

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

LLVM IR (-O2):
define void @cls_command() {
%1 = tail call i32 (...) @wipe()
ret void
}
void gator_event_sampling_online(void) {}


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

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

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

LLVM IR (-O2):
define void @gator_event_sampling_online() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
void _start(void) {
  int i, j = 0xdeadbeef;
  for (i = 0; i < 1000; ++i) {
    j += 0xcafebabe;
  }
  _exit(0);
}


x86 assembly (clang, -O0):
<_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xdeadbeef,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x3e8,-0x4(%rbp)
jge    114c <_start+0x3c>
mov    -0x8(%rbp),%eax
add    $0xcafebabe,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1126 <_start+0x16>
xor    %edi,%edi
call   1030 <_exit@plt>

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

LLVM IR (-O0):
define void @_start() {
%1 = alloca i32
%2 = alloca i32
store i32 -559038737, i32* %2
store i32 0, i32* %1
br label %3
3: ; preds = %9, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 1000
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = load i32, i32* %2
%8 = add i32 %7, -889275714
store i32 %8, i32* %2
br label %9
9: ; preds = %6
%10 = load i32, i32* %1
%11 = add nsw i32 %10, 1
store i32 %11, i32* %1
br label %3
12: ; preds = %3
%13 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @_start() {
%1 = tail call i32 @_exit(i32 0)
unreachable
}
/* Type definitions */
struct flashctx {
  int dummy;
};

/* Variables and functions */
int spi_disable_blockprotect_generic(struct flashctx *, int, int, int);
int spi_disable_blockprotect_at25df(struct flashctx *flash) {
  return spi_disable_blockprotect_generic(flash, 0x0C, 1 << 7, 1 << 4);
}


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

x86 assembly (clang, -O2):
<spi_disable_blockprotect_at25df>:
mov    $0xc,%esi
mov    $0x80,%edx
mov    $0x10,%ecx
jmp    1030 <spi_disable_blockprotect_generic@plt>

LLVM IR (-O0):
%struct.flashctx = type { i32 }
define i32 @spi_disable_blockprotect_at25df(%struct.flashctx* %0) {
%2 = alloca %struct.flashctx*
store %struct.flashctx* %0, %struct.flashctx** %2
%3 = load %struct.flashctx*, %struct.flashctx** %2
%4 = call i32 @spi_disable_blockprotect_generic(%struct.flashctx* %3, i32 12, i32 128, i32 16)
ret i32 %4
}

LLVM IR (-O2):
%struct.flashctx = type { i32 }
define i32 @spi_disable_blockprotect_at25df(%struct.flashctx* %0) {
%2 = tail call i32 @spi_disable_blockprotect_generic(%struct.flashctx* %0, i32 12, i32 128, i32 16)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ r();
void warn_unlock1(void) { r(); }


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

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

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

LLVM IR (-O2):
define void @warn_unlock1() {
%1 = tail call i32 (...) @r()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  int result = 0;
  printf("Main entry point");
  return result;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [17 x i8] c"Main entry point\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ Connect();
scalar_t__ Disconnect();
int EXIT_FAILURE;
int /*<<< orphan*/ control();
int main() {
  if (Connect())
    return EXIT_FAILURE;
  control();
  if (Disconnect())
    return EXIT_FAILURE;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <Connect@plt>
cmp    $0x0,%rax
je     1161 <main+0x31>
mov    0x2e89(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1191 <main+0x61>
mov    $0x0,%al
call   1030 <control@plt>
mov    $0x0,%al
call   1040 <Disconnect@plt>
cmp    $0x0,%rax
je     118a <main+0x5a>
mov    0x2e60(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1191 <main+0x61>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <Connect@plt>
test   %rax,%rax
jne    1152 <main+0x22>
xor    %eax,%eax
call   1030 <control@plt>
xor    %eax,%eax
call   1040 <Disconnect@plt>
test   %rax,%rax
je     115b <main+0x2b>
mov    0x2e87(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @Connect()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = load i32, i32* @EXIT_FAILURE
store i32 %5, i32* %1
br label %13
6: ; preds = %0
%7 = call i32 (...) @control()
%8 = call i64 (...) @Disconnect()
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = load i32, i32* @EXIT_FAILURE
store i32 %11, i32* %1
br label %13
12: ; preds = %6
store i32 0, i32* %1
br label %13
13: ; preds = %12, %10, %4
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define i32 @main() {
%1 = tail call i64 (...) @Connect()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = load i32, i32* @EXIT_FAILURE
br label %11
5: ; preds = %0
%6 = tail call i32 (...) @control()
%7 = tail call i64 (...) @Disconnect()
%8 = icmp eq i64 %7, 0
%9 = load i32, i32* @EXIT_FAILURE
%10 = select i1 %8, i32 0, i32 %9
br label %11
11: ; preds = %5, %3
%12 = phi i32 [ %4, %3 ], [ %10, %5 ]
ret i32 %12
}
/* Variables and functions */
int f103(int *);
int f104(int *p) { return f103(p); }


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

x86 assembly (clang, -O2):
<f104>:
jmp    1030 <f103@plt>

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

LLVM IR (-O2):
define i32 @f104(i32* %0) {
%2 = tail call i32 @f103(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ verify_apparent_sun_moon();
int main() {
  verify_apparent_sun_moon();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @verify_apparent_sun_moon()
ret i32 0
}
double ml_to_cuft(int ml) { return ml / 28316.8466; }


x86 assembly (clang, -O0):
<ml_to_cuft>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xeec(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ml_to_cuft>:
cvtsi2sd %edi,%xmm0
divsd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @ml_to_cuft(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fdiv double %4, 0x40DBA7362EB1C433
ret double %5
}

LLVM IR (-O2):
define double @ml_to_cuft(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fdiv double %2, 0x40DBA7362EB1C433
ret double %3
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void volatile_fetch_add_u32(uint32_t *dest, uint32_t val) {
  *((volatile uint32_t *)dest) += val;
}


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

x86 assembly (clang, -O2):
<volatile_fetch_add_u32>:
add    %rsi,(%rdi)
ret

LLVM IR (-O0):
define void @volatile_fetch_add_u32(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 volatile i64, i64* %6
%8 = add nsw i64 %7, %5
store volatile i64 %8, i64* %6
ret void
}

LLVM IR (-O2):
define void @volatile_fetch_add_u32(i64* %0, i64 %1) {
%3 = load volatile i64, i64* %0
%4 = add nsw i64 %3, %1
store volatile i64 %4, i64* %0
ret void
}
int test1(int a) {
  switch (a % 2) {
  case 0:
    ++a;
  case 1:
    a /= 2;
  }
  return a;
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%edx
shr    $0x1f,%edx
mov    %eax,%ecx
add    %edx,%ecx
and    $0xfffffffe,%ecx
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
je     1137 <test1+0x37>
jmp    1126 <test1+0x26>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
je     1140 <test1+0x40>
jmp    114e <test1+0x4e>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
mov    %edi,%eax
mov    %edi,%edx
shr    $0x1f,%edx
add    %edi,%edx
and    $0xfffffffe,%edx
mov    %edi,%ecx
sub    %edx,%ecx
cmp    $0x1,%ecx
je     111c <test1+0x1c>
test   %ecx,%ecx
jne    1127 <test1+0x27>
add    $0x1,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 2
switch i32 %4, label %11 [
i32 0, label %5
i32 1, label %8
]
5: ; preds = %1
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 1
store i32 %7, i32* %2
br label %8
8: ; preds = %1, %5
%9 = load i32, i32* %2
%10 = sdiv i32 %9, 2
store i32 %10, i32* %2
br label %11
11: ; preds = %8, %1
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @test1(i32 %0) {
%2 = srem i32 %0, 2
switch i32 %2, label %8 [
i32 0, label %3
i32 1, label %5
]
3: ; preds = %1
%4 = add nsw i32 %0, 1
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %0, %1 ], [ %4, %3 ]
%7 = sdiv i32 %6, 2
br label %8
8: ; preds = %5, %1
%9 = phi i32 [ %0, %1 ], [ %7, %5 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0xda() {
  Assert_real((ispunct(218) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_ispunct.c",
              1095, ("ispunct should be 0 for 0xda"));
}


x86 assembly (clang, -O0):
<t_ispunct_0xda>:
push   %rbp
mov    %rsp,%rbp
mov    $0xda,%edi
call   1030 <ispunct@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x447,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_ispunct_0xda>:
push   %rax
mov    $0xda,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x447,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xda\00"
define void @t_ispunct_0xda() {
%1 = call i64 @ispunct(i32 218)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1095, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xda\00"
define void @t_ispunct_0xda() {
%1 = tail call i64 @ispunct(i32 218)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1095, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int lcp(char *str1, char *str2) {
  int i;
  for (i = 0; str1[i] != '\0' && str1[i] == str2[i]; i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<lcp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x15(%rbp)
je     114d <lcp+0x4d>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    115d <lcp+0x5d>
jmp    1170 <lcp+0x70>
jmp    1162 <lcp+0x62>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <lcp+0x13>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcp>:
mov    (%rdi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1122 <lcp+0x22>
nopl   0x0(%rax,%rax,1)
cmp    (%rsi,%rax,1),%cl
jne    1122 <lcp+0x22>
movzbl 0x1(%rdi,%rax,1),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <lcp+0x10>
ret

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

LLVM IR (-O2):
define i32 @lcp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %20, label %5
5: ; preds = %2, %12
%6 = phi i64 [ %13, %12 ], [ 0, %2 ]
%7 = phi i8 [ %16, %12 ], [ %3, %2 ]
%8 = phi i32 [ %14, %12 ], [ 0, %2 ]
%9 = getelementptr inbounds i8, i8* %1, i64 %6
%10 = load i8, i8* %9
%11 = icmp eq i8 %7, %10
br i1 %11, label %12, label %18
12: ; preds = %5
%13 = add nuw i64 %6, 1
%14 = add nuw nsw i32 %8, 1
%15 = getelementptr inbounds i8, i8* %0, i64 %13
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %20, label %5
18: ; preds = %5
%19 = trunc i64 %6 to i32
br label %20
20: ; preds = %12, %18, %2
%21 = phi i32 [ 0, %2 ], [ %19, %18 ], [ %14, %12 ]
ret i32 %21
}
void gtk_window_remove_mnemonic() {}


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

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

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

LLVM IR (-O2):
define void @gtk_window_remove_mnemonic() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, float, float);
int main() {
  float f1 = 1.0f;
  float f2 = 3.0f;
  float f3 = f1 / f2;
  printf("%.9ef ÷ %.9ef = %.9ef\n", f1, f2, f3);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  0xee4(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  0xed3(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef4(%rip),%rdi
movss  0xee0(%rip),%xmm0
movss  0xedc(%rip),%xmm1
movss  0xed8(%rip),%xmm2
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"%.9ef \C3\B7 %.9ef = %.9ef\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
store float 1.000000e+00, float* %1
store float 3.000000e+00, float* %2
%4 = load float, float* %1
%5 = load float, float* %2
%6 = fdiv float %4, %5
store float %6, float* %3
%7 = load float, float* %1
%8 = load float, float* %2
%9 = load float, float* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), float %7, float %8, float %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"%.9ef \C3\B7 %.9ef = %.9ef\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), float 1.000000e+00, float 3.000000e+00, float 0x3FD5555560000000)
ret i32 0
}
unsigned int DJBHash(const char *str) {
  unsigned int hash = 5381;
  while (*str) {
    hash += (hash << 5) + (*str++);
  }
  return (hash & 0x7FFFFFFF);
}


x86 assembly (clang, -O0):
<DJBHash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1505,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1141 <DJBHash+0x41>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <DJBHash+0xf>
mov    -0xc(%rbp),%eax
and    $0x7fffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<DJBHash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112d <DJBHash+0x2d>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
movsbl %cl,%ecx
mov    %eax,%edx
shl    $0x5,%edx
add    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <DJBHash+0x10>
and    $0x7fffffff,%eax
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i32 @DJBHash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 5381, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = sext i8 %5 to i32
%10 = mul i32 %6, 33
%11 = add i32 %10, %9
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = and i32 %11, 2147483647
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 5381, %1 ], [ %15, %14 ]
ret i32 %17
}
/* Variables and functions */
char toupper(char);
int upcase_(char *buff, int *n) {
  int i, x;
  for (x = i = 0; i++ < *n; x += 4)
    buff[x] = toupper(buff[x]);
  return 0;
}


x86 assembly (clang, -O0):
<upcase_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jge    1171 <upcase_+0x61>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x18(%rbp)
jmp    112e <upcase_+0x1e>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<upcase_>:
push   %r15
push   %r14
push   %rbx
cmpl   $0x0,(%rsi)
jle    1147 <upcase_+0x37>
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r15,%rbx,4),%edi
call   1030 <toupper@plt>
mov    %al,(%r15,%rbx,4)
add    $0x1,%rbx
cmp    (%r14),%ebx
jl     1130 <upcase_+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @upcase_(i8* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %15
5: ; preds = %2, %5
%6 = phi i64 [ %12, %5 ], [ 0, %2 ]
%7 = phi i32 [ %8, %5 ], [ 0, %2 ]
%8 = add nuw nsw i32 %7, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %6
%10 = load i8, i8* %9
%11 = tail call signext i8 @toupper(i8 signext %10)
store i8 %11, i8* %9
%12 = add nuw nsw i64 %6, 4
%13 = load i32, i32* %1
%14 = icmp slt i32 %8, %13
br i1 %14, label %5, label %15
15: ; preds = %5, %2
ret i32 0
}
int tegra11_soctherm_init(struct soctherm_platform_data *data) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.soctherm_platform_data = type opaque
define i32 @tegra11_soctherm_init(%struct.soctherm_platform_data* nocapture readnone %0) {
ret i32 0
}