xunge/DecIR huggingface dataset:
unsigned char music_sheet_play_next(struct music_sheet *self,
                                    struct music_sheet_iter *iter,
                                    struct synth *synth) {
  return 0;
}


x86 assembly (clang, -O0):
<music_sheet_play_next>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.music_sheet = type opaque
%struct.music_sheet_iter = type opaque
%struct.synth = type opaque
define zeroext i8 @music_sheet_play_next(%struct.music_sheet* %0, %struct.music_sheet_iter* %1, %struct.synth* %2) {
%4 = alloca %struct.music_sheet*
%5 = alloca %struct.music_sheet_iter*
%6 = alloca %struct.synth*
store %struct.music_sheet* %0, %struct.music_sheet** %4
store %struct.music_sheet_iter* %1, %struct.music_sheet_iter** %5
store %struct.synth* %2, %struct.synth** %6
ret i8 0
}

LLVM IR (-O2):
%struct.music_sheet = type opaque
%struct.music_sheet_iter = type opaque
%struct.synth = type opaque
define zeroext i8 @music_sheet_play_next(%struct.music_sheet* nocapture readnone %0, %struct.music_sheet_iter* nocapture readnone %1, %struct.synth* nocapture readnone %2) {
ret i8 0
}
/* Type definitions */
struct tcb {
  int dummy;
};

/* Variables and functions */
scalar_t__ exiting(struct tcb *);
int trace_syscall_entering(struct tcb *);
int trace_syscall_exiting(struct tcb *);
int trace_syscall(struct tcb *tcp) {
  return exiting(tcp) ? trace_syscall_exiting(tcp)
                      : trace_syscall_entering(tcp);
}


x86 assembly (clang, -O0):
<trace_syscall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <exiting@plt>
cmp    $0x0,%rax
je     1160 <trace_syscall+0x30>
mov    -0x8(%rbp),%rdi
call   1030 <trace_syscall_exiting@plt>
mov    %eax,-0xc(%rbp)
jmp    116c <trace_syscall+0x3c>
mov    -0x8(%rbp),%rdi
call   1040 <trace_syscall_entering@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trace_syscall>:
push   %rbx
mov    %rdi,%rbx
call   1050 <exiting@plt>
mov    %rbx,%rdi
test   %rax,%rax
je     1147 <trace_syscall+0x17>
pop    %rbx
jmp    1030 <trace_syscall_exiting@plt>
pop    %rbx
jmp    1040 <trace_syscall_entering@plt>

LLVM IR (-O0):
%struct.tcb = type { i32 }
define i32 @trace_syscall(%struct.tcb* %0) {
%2 = alloca %struct.tcb*
store %struct.tcb* %0, %struct.tcb** %2
%3 = load %struct.tcb*, %struct.tcb** %2
%4 = call i64 @exiting(%struct.tcb* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load %struct.tcb*, %struct.tcb** %2
%8 = call i32 @trace_syscall_exiting(%struct.tcb* %7)
br label %12
9: ; preds = %1
%10 = load %struct.tcb*, %struct.tcb** %2
%11 = call i32 @trace_syscall_entering(%struct.tcb* %10)
br label %12
12: ; preds = %9, %6
%13 = phi i32 [ %8, %6 ], [ %11, %9 ]
ret i32 %13
}

LLVM IR (-O2):
%struct.tcb = type { i32 }
define i32 @trace_syscall(%struct.tcb* %0) {
%2 = tail call i64 @exiting(%struct.tcb* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @trace_syscall_exiting(%struct.tcb* %0)
br label %8
6: ; preds = %1
%7 = tail call i32 @trace_syscall_entering(%struct.tcb* %0)
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ %5, %4 ], [ %7, %6 ]
ret i32 %9
}
/* Type definitions */
struct sCC1101PhyInfo {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CC1101Write(struct sCC1101PhyInfo *, unsigned char,
                               unsigned char *, unsigned char);
void CC1101WriteRegisters(struct sCC1101PhyInfo *phyInfo, unsigned char address,
                          unsigned char *buffer, unsigned char count) {
  CC1101Write(phyInfo, address, buffer, count);
}


x86 assembly (clang, -O0):
<CC1101WriteRegisters>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %al,-0x19(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x9(%rbp),%al
mov    -0x18(%rbp),%rdx
movzbl %al,%esi
movzbl -0x19(%rbp),%ecx
call   1030 <CC1101Write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CC1101WriteRegisters>:
jmp    1030 <CC1101Write@plt>

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

LLVM IR (-O2):
%struct.sCC1101PhyInfo = type { i32 }
define void @CC1101WriteRegisters(%struct.sCC1101PhyInfo* %0, i8 zeroext %1, i8* %2, i8 zeroext %3) {
%5 = tail call i32 @CC1101Write(%struct.sCC1101PhyInfo* %0, i8 zeroext %1, i8* %2, i8 zeroext %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
unsigned int shiftrt(int, int);
int main() {
  unsigned a = shiftrt(0x100000000ULL, 1);
  if ((a >> 31) != ((a >> 30) & 1))
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <shiftrt@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x1f,%eax
mov    -0x8(%rbp),%ecx
shr    $0x1e,%ecx
and    $0x1,%ecx
cmp    %ecx,%eax
je     115c <main+0x3c>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <shiftrt@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
shr    $0x1e,%eax
and    $0x1,%eax
cmp    %eax,%ecx
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @shiftrt(i32 0, i32 1)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = lshr i32 %4, 31
%6 = load i32, i32* %2
%7 = lshr i32 %6, 30
%8 = and i32 %7, 1
%9 = icmp ne i32 %5, %8
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 (...) @abort()
unreachable
12: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @shiftrt(i32 0, i32 1)
%2 = lshr i32 %1, 31
%3 = lshr i32 %1, 30
%4 = and i32 %3, 1
%5 = icmp eq i32 %2, %4
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %0
ret i32 0
}
int jac_chain_nm2_n_out(void) { return 2; }


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

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

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

LLVM IR (-O2):
define i32 @jac_chain_nm2_n_out() {
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ asprintf(char **, char *, int /*<<< orphan*/);
int /*<<< orphan*/ iso_time();
char *event_string() {
  char *event_json;
  asprintf(&event_json,
           "{\"Event\":{\"occurrenceTime\":\"%s\",\"hostname\":\"domain."
           "localhost.cz\",\"type\":\"org.linux.cron.Started\",\"application\":"
           "\"Cron\",\"process\":\"proc_cron "
           "NAme\",\"processId\":\"id005\",\"severity\":5,\"priority\":4,"
           "\"Payload\":{\"schema\":null,\"schemaVersion\":null,\"value\":4648,"
           "\"value2\":\"aax4x46aeEF\"}}}\n",
           iso_time());
  return event_json;
}


x86 assembly (clang, -O0):
<event_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <iso_time@plt>
mov    %eax,%edx
lea    -0x8(%rbp),%rdi
lea    0xec4(%rip),%rsi
call   1030 <asprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<event_string>:
push   %rax
xor    %eax,%eax
call   1040 <iso_time@plt>
lea    0xed1(%rip),%rsi
mov    %rsp,%rdi
mov    %eax,%edx
call   1030 <asprintf@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [277 x i8] c"{\22Event\22:{\22occurrenceTime\22:\22%s\22,\22hostname\22:\22domain.localhost.cz\22,\22type\22:\22org.linux.cron.Started\22,\22application\22:\22Cron\22,\22process\22:\22proc_cron NAme\22,\22processId\22:\22id005\22,\22severity\22:5,\22priority\22:4,\22Payload\22:{\22schema\22:null,\22schemaVersion\22:null,\22value\22:4648,\22value2\22:\22aax4x46aeEF\22}}}\0A\00"
define i8* @event_string() {
%1 = alloca i8*
%2 = call i32 (...) @iso_time()
%3 = call i32 @asprintf(i8** %1, i8* getelementptr inbounds ([277 x i8], [277 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i8*, i8** %1
ret i8* %4
}

LLVM IR (-O2):
@.str = [277 x i8] c"{\22Event\22:{\22occurrenceTime\22:\22%s\22,\22hostname\22:\22domain.localhost.cz\22,\22type\22:\22org.linux.cron.Started\22,\22application\22:\22Cron\22,\22process\22:\22proc_cron NAme\22,\22processId\22:\22id005\22,\22severity\22:5,\22priority\22:4,\22Payload\22:{\22schema\22:null,\22schemaVersion\22:null,\22value\22:4648,\22value2\22:\22aax4x46aeEF\22}}}\0A\00"
define i8* @event_string() {
%1 = alloca i8*
%2 = bitcast i8** %1 to i8*
%3 = tail call i32 (...) @iso_time()
%4 = call i32 @asprintf(i8** %1, i8* getelementptr inbounds ([277 x i8], [277 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i8*, i8** %1
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int, char *);
int /*<<< orphan*/ stderr;
void l_assert(int line, char *file, char *expr) {
  fprintf(stderr, "Assertion failed: %s %d \"%s\"\n", file, line, expr);
  abort();
}


x86 assembly (clang, -O0):
<l_assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x4(%rbp),%ecx
mov    -0x18(%rbp),%r8
lea    0xeb2(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<l_assert>:
push   %rax
mov    %rdx,%r8
mov    %rsi,%rdx
mov    %edi,%ecx
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xec7(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [30 x i8] c"Assertion failed: %s %d \22%s\22\0A\00"
define void @l_assert(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %5
%9 = load i32, i32* %4
%10 = load i8*, i8** %6
%11 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %9, i8* %10)
%12 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"Assertion failed: %s %d \22%s\22\0A\00"
define void @l_assert(i32 %0, i8* %1, i8* %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %0, i8* %2)
%6 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ FlightStatsHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void FlightStatsRequestUpdate() { UAVObjRequestUpdate(FlightStatsHandle()); }


x86 assembly (clang, -O0):
<FlightStatsRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <FlightStatsHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<FlightStatsRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <FlightStatsHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @FlightStatsRequestUpdate() {
%1 = call i32 (...) @FlightStatsHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @FlightStatsRequestUpdate() {
%1 = tail call i32 (...) @FlightStatsHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ libpd_init();
int libpd_safe_init() {
  static int initialized = 0;
  if (initialized)
    return 0;
  initialized = 1;
  libpd_init();
  return 1;
}


x86 assembly (clang, -O0):
<libpd_safe_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpl   $0x0,0x2f0d(%rip)
je     1131 <libpd_safe_init+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1149 <libpd_safe_init+0x39>
movl   $0x1,0x2ef1(%rip)
mov    $0x0,%al
call   1030 <libpd_init@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libpd_safe_init>:
push   %rax
xor    %eax,%eax
cmpb   $0x0,0x2f12(%rip)
jne    112f <libpd_safe_init+0x1f>
movb   $0x1,0x2f09(%rip)
xor    %eax,%eax
call   1030 <libpd_init@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@libpd_safe_init.initialized = internal global i32 0
define i32 @libpd_safe_init() {
%1 = alloca i32
%2 = load i32, i32* @libpd_safe_init.initialized
%3 = icmp ne i32 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 0, i32* %1
br label %7
5: ; preds = %0
store i32 1, i32* @libpd_safe_init.initialized
%6 = call i32 (...) @libpd_init()
store i32 1, i32* %1
br label %7
7: ; preds = %5, %4
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@libpd_safe_init.initialized = internal unnamed_addr global i1 false
define i32 @libpd_safe_init() {
%1 = load i1, i1* @libpd_safe_init.initialized
br i1 %1, label %4, label %2
2: ; preds = %0
store i1 true, i1* @libpd_safe_init.initialized
%3 = tail call i32 (...) @libpd_init()
br label %4
4: ; preds = %0, %2
%5 = phi i32 [ 1, %2 ], [ 0, %0 ]
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ scanForArrays();
int updateSoftRaid(void) {
  scanForArrays();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @updateSoftRaid() {
%1 = call i32 (...) @scanForArrays()
ret i32 0
}

LLVM IR (-O2):
define i32 @updateSoftRaid() {
%1 = tail call i32 (...) @scanForArrays()
ret i32 0
}
long double test_huge_vall(void) { return __builtin_huge_vall(); }


x86 assembly (clang, -O0):
<test_huge_vall>:
push   %rbp
mov    %rsp,%rbp
flds   0xef6(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_huge_vall>:
flds   0xefa(%rip)
ret

LLVM IR (-O0):
define x86_fp80 @test_huge_vall() {
ret x86_fp80 0xK7FFF8000000000000000
}

LLVM IR (-O2):
define x86_fp80 @test_huge_vall() {
ret x86_fp80 0xK7FFF8000000000000000
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x9d() {
  Assert_real((ispunct(157) == 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",
              790, ("ispunct should be 0 for 0x9d"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0x9d>:
push   %rax
mov    $0x9d,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x316,%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 0x9d\00"
define void @t_ispunct_0x9d() {
%1 = call i64 @ispunct(i32 157)
%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 790, 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 0x9d\00"
define void @t_ispunct_0x9d() {
%1 = tail call i64 @ispunct(i32 157)
%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 790, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int len_str(char *);
scalar_t__ malloc(int);
char *strdup(char *str) {
  char *ret, *d;
  ret = (char *)malloc(sizeof(char) * (len_str(str) + 1));
  for (d = ret; (*d = *str); d++, str++) {
  }
  return (ret);
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <len_str@plt>
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    -0x18(%rbp),%rcx
mov    %al,(%rcx)
cmp    $0x0,%al
je     1187 <strdup+0x67>
jmp    116a <strdup+0x4a>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1151 <strdup+0x31>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %rbx
mov    %rdi,%rbx
call   1030 <len_str@plt>
lea    0x1(%rax),%edi
call   1040 <malloc@plt>
mov    (%rbx),%cl
mov    %cl,(%rax)
test   %cl,%cl
je     114f <strdup+0x2f>
mov    $0x1,%ecx
xchg   %ax,%ax
movzbl (%rbx,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1140 <strdup+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i32 @len_str(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = load i8, i8* %0
store i8 %6, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %15, label %8
8: ; preds = %1, %8
%9 = phi i8* [ %11, %8 ], [ %5, %1 ]
%10 = phi i8* [ %12, %8 ], [ %0, %1 ]
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = getelementptr inbounds i8, i8* %10, i64 1
%13 = load i8, i8* %12
store i8 %13, i8* %11
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %8
15: ; preds = %8, %1
ret i8* %5
}
int do_714() { return 714; }


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

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

LLVM IR (-O0):
define i32 @do_714() {
ret i32 714
}

LLVM IR (-O2):
define i32 @do_714() {
ret i32 714
}
double double_max1(double a, double b) { return ((a) > (b) ? (a) : (b)); }


x86 assembly (clang, -O0):
<double_max1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112d <double_max1+0x2d>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1137 <double_max1+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_max1>:
maxsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @double_max1(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp ogt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @double_max1(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
unsigned int hash_str(unsigned int buckets, void *key) {
  char *num = (char *)key;
  unsigned int index = 0;
  while (*num) {
    index = *num + 4 * index;
    num++;
  }
  return index % buckets;
}


x86 assembly (clang, -O0):
<hash_str>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     114a <hash_str+0x4a>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
mov    -0x1c(%rbp),%ecx
shl    $0x2,%ecx
add    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111a <hash_str+0x1a>
mov    -0x1c(%rbp),%eax
xor    %edx,%edx
divl   -0x4(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_str>:
mov    (%rsi),%cl
test   %cl,%cl
je     1123 <hash_str+0x23>
add    $0x1,%rsi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
lea    (%rcx,%rax,4),%eax
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <hash_str+0x10>
jmp    1125 <hash_str+0x25>
xor    %eax,%eax
xor    %edx,%edx
div    %edi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_str(i32 %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i32 [ %11, %5 ], [ 0, %2 ]
%8 = phi i8* [ %12, %5 ], [ %1, %2 ]
%9 = sext i8 %6 to i32
%10 = shl i32 %7, 2
%11 = add i32 %10, %9
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ 0, %2 ], [ %11, %5 ]
%17 = urem i32 %16, %0
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ NRerror(char *);
scalar_t__ malloc(size_t);
double *dvector(long nl, long nh) {
  double *v;
  v = (double *)malloc((size_t)((nh - nl + 1 + 1) * sizeof(double)));
  if (!v)
    NRerror("allocation failure in dvector()");
  return v - nl + 1;
}


x86 assembly (clang, -O0):
<dvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
sub    -0x8(%rbp),%rdi
add    $0x1,%rdi
add    $0x1,%rdi
shl    $0x3,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1164 <dvector+0x44>
lea    0xea1(%rip),%rdi
call   1030 <NRerror@plt>
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
sub    -0x8(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
add    $0x8,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dvector>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
sub    %rdi,%rsi
lea    0x10(,%rsi,8),%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114b <dvector+0x2b>
lea    0xeba(%rip),%rdi
call   1030 <NRerror@plt>
shl    $0x3,%r14
sub    %r14,%rbx
add    $0x8,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [32 x i8] c"allocation failure in dvector()\00"
define double* @dvector(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca double*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = sub nsw i64 %6, %7
%9 = add nsw i64 %8, 1
%10 = add nsw i64 %9, 1
%11 = mul i64 %10, 8
%12 = call i64 @malloc(i64 %11)
%13 = inttoptr i64 %12 to double*
store double* %13, double** %5
%14 = load double*, double** %5
%15 = icmp ne double* %14, null
br i1 %15, label %18, label %16
16: ; preds = %2
%17 = call i32 @NRerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %16, %2
%19 = load double*, double** %5
%20 = load i64, i64* %3
%21 = sub i64 0, %20
%22 = getelementptr inbounds double, double* %19, i64 %21
%23 = getelementptr inbounds double, double* %22, i64 1
ret double* %23
}

LLVM IR (-O2):
@.str = [32 x i8] c"allocation failure in dvector()\00"
define double* @dvector(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = shl i64 %3, 3
%5 = add i64 %4, 16
%6 = tail call i64 @malloc(i64 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @NRerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = inttoptr i64 %6 to double*
%12 = sub i64 0, %0
%13 = getelementptr inbounds double, double* %11, i64 %12
%14 = getelementptr inbounds double, double* %13, i64 1
ret double* %14
}
/* Variables and functions */
long syscall(int, int, int, int *);
long syscnt_s(int sctype, int pid) {
  if (sctype == 0)
    return -1;
  return syscall(323, sctype, pid, (int *)NULL);
}


x86 assembly (clang, -O0):
<syscnt_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1135 <syscnt_s+0x25>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    114d <syscnt_s+0x3d>
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    $0x143,%edi
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <syscall@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscnt_s>:
test   %edi,%edi
je     1124 <syscnt_s+0x14>
mov    %esi,%edx
mov    %edi,%esi
mov    $0x143,%edi
xor    %ecx,%ecx
jmp    1030 <syscall@plt>
mov    $0xffffffffffffffff,%rax
ret

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

LLVM IR (-O2):
define i64 @syscnt_s(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i64 @syscall(i32 323, i32 %0, i32 %1, i32* null)
br label %6
6: ; preds = %2, %4
%7 = phi i64 [ %5, %4 ], [ -1, %2 ]
ret i64 %7
}
void free_dmatrix(double **m) {
  free(m[0]);
  free(m);
}


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

x86 assembly (clang, -O2):
<free_dmatrix>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_dmatrix(double** nocapture %0) {
%2 = bitcast double** %0 to i8**
%3 = load i8*, i8** %2
tail call void @free(i8* %3)
%4 = bitcast double** %0 to i8*
tail call void @free(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int *);
void afunc(void) {
  static int long level = 0;
  int stack_var;
  if (++level == 5) {
    return;
  }
  printf("stack_var is at:%p\n", &stack_var);
  afunc();
}


x86 assembly (clang, -O0):
<afunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2f09(%rip),%rax
add    $0x1,%rax
mov    %rax,0x2efe(%rip)
cmp    $0x5,%rax
jne    1149 <afunc+0x29>
jmp    115e <afunc+0x3e>
lea    0xeb0(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <printf@plt>
call   1030 <afunc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<afunc>:
push   %rax
mov    0x2f10(%rip),%rax
add    $0x1,%rax
mov    %rax,0x2f05(%rip)
cmp    $0x5,%rax
je     114f <afunc+0x2f>
lea    0xec0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <printf@plt>
call   1030 <afunc@plt>
pop    %rax
ret

LLVM IR (-O0):
@afunc.level = internal global i64 0
@.str = [20 x i8] c"stack_var is at:%p\0A\00"
define void @afunc() {
%1 = alloca i32
%2 = load i64, i64* @afunc.level
%3 = add nsw i64 %2, 1
store i64 %3, i64* @afunc.level
%4 = icmp eq i64 %3, 5
br i1 %4, label %5, label %6
5: ; preds = %0
br label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32* %1)
br label %8
8: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
@afunc.level = internal unnamed_addr global i64 0
@.str = [20 x i8] c"stack_var is at:%p\0A\00"
define void @afunc() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = load i64, i64* @afunc.level
%4 = add nsw i64 %3, 1
store i64 %4, i64* @afunc.level
%5 = icmp eq i64 %4, 5
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32* %1)
br label %8
8: ; preds = %0, %6
ret void
}
int test_imm_3Duint8_mem(unsigned char *val) {
  return ((*val) & (-0x3D << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_3Duint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -61
%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_3Duint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -61
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void glutBitmapString(void *fontface, const char *str) {}


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

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

LLVM IR (-O0):
define void @glutBitmapString(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @glutBitmapString(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Type definitions */
struct ioop {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(struct ioop *);
void ioop_uninit(struct ioop *self) { assert(self); }


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

x86 assembly (clang, -O2):
<ioop_uninit>:
jmp    1030 <assert@plt>

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

LLVM IR (-O2):
%struct.ioop = type { i32 }
define void @ioop_uninit(%struct.ioop* %0) {
%2 = tail call i32 @assert(%struct.ioop* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void ksft_print_header(void) { printf("TAP version 13\n"); }


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

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

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

LLVM IR (-O2):
@str = [15 x i8] c"TAP version 13\00"
define void @ksft_print_header() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret void
}
int f1() { return (int)2147483648.0f; }


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

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

LLVM IR (-O0):
define i32 @f1() {
ret i32 poison
}

LLVM IR (-O2):
define i32 @f1() {
ret i32 poison
}
void r128_disable_vblank(struct drm_device *dev, int crtc) {
  if (crtc != 0)
    DRM_ERROR("%s:  bad crtc %d\n", __FUNCTION__, crtc);
}


x86 assembly (clang, -O0):
<r128_disable_vblank>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1141 <r128_disable_vblank+0x31>
mov    -0xc(%rbp),%edx
lea    0xecd(%rip),%rdi
lea    0xed8(%rip),%rsi
mov    $0x0,%al
call   1030 <DRM_ERROR@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r128_disable_vblank>:
test   %esi,%esi
je     112b <r128_disable_vblank+0x1b>
mov    %esi,%edx
lea    0xee3(%rip),%rdi
lea    0xeee(%rip),%rsi
xor    %eax,%eax
jmp    1030 <DRM_ERROR@plt>
ret

LLVM IR (-O0):
%struct.drm_device = type opaque
@.str = [18 x i8] c"%s: bad crtc %d\0A\00"
@__FUNCTION__.r128_disable_vblank = [20 x i8] c"r128_disable_vblank\00"
define void @r128_disable_vblank(%struct.drm_device* %0, i32 %1) {
%3 = alloca %struct.drm_device*
%4 = alloca i32
store %struct.drm_device* %0, %struct.drm_device** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %4
%9 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @DRM_ERROR to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__FUNCTION__.r128_disable_vblank, i64 0, i64 0), i32 %8)
br label %10
10: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
%struct.drm_device = type opaque
@.str = [18 x i8] c"%s: bad crtc %d\0A\00"
@__FUNCTION__.r128_disable_vblank = [20 x i8] c"r128_disable_vblank\00"
define void @r128_disable_vblank(%struct.drm_device* nocapture readnone %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @DRM_ERROR to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__FUNCTION__.r128_disable_vblank, i64 0, i64 0), i32 %1)
br label %6
6: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ nums;

/* Variables and functions */
int /*<<< orphan*/ print(int *, int);
int /*<<< orphan*/ shell_sort(int *, int);
int main() {
  int nums[] = {2, 10, 3, 14, 15, 6, 3, 9};
  int n = sizeof(nums) / sizeof(nums[0]);
  shell_sort(nums, n);
  print(nums, n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec1(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x8,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1040 <shell_sort@plt>
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1030 <print@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xee4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x8,%esi
call   1040 <shell_sort@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1030 <print@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.nums = [8 x i32] [i32 2, i32 10, i32 3, i32 14, i32 15, i32 6, i32 3, i32 9]
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [8 x i32]* %2 to i8*
store i32 8, i32* %3
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* %3
%7 = call i32 @shell_sort(i32* %5, i32 %6)
%8 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%9 = load i32, i32* %3
%10 = call i32 @print(i32* %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.nums = [8 x i32] [i32 2, i32 10, i32 3, i32 14, i32 15, i32 6, i32 3, i32 9]
define i32 @main() {
%1 = alloca [8 x i32]
%2 = bitcast [8 x i32]* %1 to i8*
%3 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%4 = call i32 @shell_sort(i32* %3, i32 8)
%5 = call i32 @print(i32* %3, i32 8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exec(char **);
int /*<<< orphan*/ quit();
void quitdaemon() {
  char *stopdaemon[3] = {"mmusicd", "stop", NULL};
  quit();
  exec(stopdaemon);
}


x86 assembly (clang, -O0):
<quitdaemon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2cd1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2cce(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0x2ccb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <quit@plt>
lea    -0x20(%rbp),%rdi
call   1040 <exec@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quitdaemon>:
sub    $0x18,%rsp
mov    0x2ce5(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0x2cc9(%rip),%xmm0
movaps %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <quit@plt>
mov    %rsp,%rdi
call   1040 <exec@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"mmusicd\00"
@.str.1 = [5 x i8] c"stop\00"
@__const.quitdaemon.stopdaemon = [3 x i8*] [i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i32 0, i32 0), i8* null]
define void @quitdaemon() {
%1 = alloca [3 x i8*]
%2 = bitcast [3 x i8*]* %1 to i8*
%3 = call i32 (...) @quit()
%4 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 0
%5 = call i32 @exec(i8** %4)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"mmusicd\00"
@.str.1 = [5 x i8] c"stop\00"
@__const.quitdaemon.stopdaemon = [3 x i8*] [i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i32 0, i32 0), i8* null]
define void @quitdaemon() {
%1 = alloca [3 x i8*]
%2 = bitcast [3 x i8*]* %1 to i8*
%3 = tail call i32 (...) @quit()
%4 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 0
%5 = call i32 @exec(i8** %4)
ret void
}
/* Variables and functions */
int memcmp(char *, char *, int);
int uwsgi_strncmp(char *src, int slen, char *dst, int dlen) {
  if (slen != dlen)
    return 1;
  return memcmp(src, dst, dlen);
}


x86 assembly (clang, -O0):
<uwsgi_strncmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x24(%rbp),%eax
je     113e <uwsgi_strncmp+0x2e>
movl   $0x1,-0x4(%rbp)
jmp    1151 <uwsgi_strncmp+0x41>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
call   1030 <memcmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uwsgi_strncmp>:
cmp    %ecx,%esi
jne    1120 <uwsgi_strncmp+0x10>
mov    %esi,%eax
mov    %rdx,%rsi
mov    %eax,%edx
jmp    1030 <memcmp@plt>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @uwsgi_strncmp(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = icmp eq i32 %1, %3
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 @memcmp(i8* %0, i8* %2, i32 %1)
br label %8
8: ; preds = %4, %6
%9 = phi i32 [ %7, %6 ], [ 1, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello PolyU!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello PolyU!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello PolyU!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
void *memset(void *, int, size_t);
void *am_memset(void *s, int c, size_t n) { return memset(s, c, n); }


x86 assembly (clang, -O0):
<am_memset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    %rdi,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x18(%rbp),%rdx
movzbl %al,%esi
call   1030 <memset@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<am_memset>:
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define i8* @am_memset(i8* returned writeonly %0, i32 %1, i64 %2) {
%4 = trunc i32 %1 to i8
tail call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 %4, i64 %2, i1 false)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ orgfx_wait(int);
void orgfx_srcrect(unsigned int x0, unsigned int y0, unsigned int x1,
                   unsigned int y1) {
  orgfx_wait(4);
  *((volatile unsigned int *)((0xB8000000 + 0x28))) = x0;
  *((volatile unsigned int *)((0xB8000000 + 0x2c))) = y0;
  *((volatile unsigned int *)((0xB8000000 + 0x30))) = x1;
  *((volatile unsigned int *)((0xB8000000 + 0x34))) = y1;
}


x86 assembly (clang, -O0):
<orgfx_srcrect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    $0x4,%edi
call   1030 <orgfx_wait@plt>
mov    -0x4(%rbp),%ecx
mov    $0xb8000028,%eax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%ecx
mov    $0xb800002c,%eax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
mov    $0xb8000030,%eax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%ecx
mov    $0xb8000034,%eax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<orgfx_srcrect>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x4,%edi
call   1030 <orgfx_wait@plt>
mov    $0xb8000028,%eax
mov    %ebp,(%rax)
mov    %ebx,0x4(%rax)
mov    %r15d,0x8(%rax)
mov    %r14d,0xc(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @orgfx_srcrect(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = call i32 @orgfx_wait(i32 4)
%10 = load i32, i32* %5
store volatile i32 %10, i32* inttoptr (i64 3087007784 to i32*)
%11 = load i32, i32* %6
store volatile i32 %11, i32* inttoptr (i64 3087007788 to i32*)
%12 = load i32, i32* %7
store volatile i32 %12, i32* inttoptr (i64 3087007792 to i32*)
%13 = load i32, i32* %8
store volatile i32 %13, i32* inttoptr (i64 3087007796 to i32*)
ret void
}

LLVM IR (-O2):
define void @orgfx_srcrect(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @orgfx_wait(i32 4)
store volatile i32 %0, i32* inttoptr (i64 3087007784 to i32*)
store volatile i32 %1, i32* inttoptr (i64 3087007788 to i32*)
store volatile i32 %2, i32* inttoptr (i64 3087007792 to i32*)
store volatile i32 %3, i32* inttoptr (i64 3087007796 to i32*)
ret void
}
/* Variables and functions */
size_t strlcpy(void *, char const *, size_t);
size_t convert_str_in(const char *value, void *res, size_t len) {
  return strlcpy(res, value, len);
}


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

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

LLVM IR (-O0):
define i64 @convert_str_in(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %5
%8 = load i8*, i8** %4
%9 = load i64, i64* %6
%10 = call i64 @strlcpy(i8* %7, i8* %8, i64 %9)
ret i64 %10
}

LLVM IR (-O2):
define i64 @convert_str_in(i8* %0, i8* %1, i64 %2) {
%4 = tail call i64 @strlcpy(i8* %1, i8* %0, i64 %2)
ret i64 %4
}