xunge/DecIR huggingface dataset:
/* Variables and functions */
float fabs(float);
int apsort(const void *a, const void *b) {
  float f1 = fabs(**(float **)a);
  float f2 = fabs(**(float **)b);
  return (f1 < f2) - (f1 > f2);
}


x86 assembly (clang, -O0):
<apsort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movss  (%rax),%xmm0
call   1030 <fabs@plt>
movss  %xmm0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movss  (%rax),%xmm0
call   1030 <fabs@plt>
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm1
movss  -0x18(%rbp),%xmm0
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
movss  -0x14(%rbp),%xmm0
ucomiss -0x18(%rbp),%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<apsort>:
mov    (%rdi),%rax
movss  (%rax),%xmm0
movaps 0xef2(%rip),%xmm1
andps  %xmm1,%xmm0
mov    (%rsi),%rax
movss  (%rax),%xmm2
andps  %xmm1,%xmm2
xor    %eax,%eax
ucomiss %xmm0,%xmm2
seta   %al
xor    %ecx,%ecx
ucomiss %xmm2,%xmm0
seta   %cl
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @apsort(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca float
%6 = alloca float
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to float**
%9 = load float*, float** %8
%10 = load float, float* %9
%11 = call float @fabs(float %10)
store float %11, float* %5
%12 = load i8*, i8** %4
%13 = bitcast i8* %12 to float**
%14 = load float*, float** %13
%15 = load float, float* %14
%16 = call float @fabs(float %15)
store float %16, float* %6
%17 = load float, float* %5
%18 = load float, float* %6
%19 = fcmp olt float %17, %18
%20 = zext i1 %19 to i32
%21 = load float, float* %5
%22 = load float, float* %6
%23 = fcmp ogt float %21, %22
%24 = zext i1 %23 to i32
%25 = sub nsw i32 %20, %24
ret i32 %25
}

LLVM IR (-O2):
define i32 @apsort(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float**
%4 = load float*, float** %3
%5 = load float, float* %4
%6 = tail call float @llvm.fabs.f32(float %5)
%7 = bitcast i8* %1 to float**
%8 = load float*, float** %7
%9 = load float, float* %8
%10 = tail call float @llvm.fabs.f32(float %9)
%11 = fcmp olt float %6, %10
%12 = zext i1 %11 to i32
%13 = fcmp ogt float %6, %10
%14 = sext i1 %13 to i32
%15 = add nsw i32 %14, %12
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ SSD1780_send_cmd(int);
void KaDisp_scroll_on_off(unsigned char enable) {
  if (enable == 0)
    SSD1780_send_cmd(0x2E);
  else
    SSD1780_send_cmd(0x2F);
}


x86 assembly (clang, -O0):
<KaDisp_scroll_on_off>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x0,%eax
jne    113a <KaDisp_scroll_on_off+0x2a>
mov    $0x2e,%edi
call   1030 <SSD1780_send_cmd@plt>
jmp    1144 <KaDisp_scroll_on_off+0x34>
mov    $0x2f,%edi
call   1030 <SSD1780_send_cmd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<KaDisp_scroll_on_off>:
cmp    $0x1,%edi
mov    $0x2f,%edi
sbb    $0x0,%edi
jmp    1030 <SSD1780_send_cmd@plt>

LLVM IR (-O0):
define void @KaDisp_scroll_on_off(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @SSD1780_send_cmd(i32 46)
br label %10
8: ; preds = %1
%9 = call i32 @SSD1780_send_cmd(i32 47)
br label %10
10: ; preds = %8, %6
ret void
}

LLVM IR (-O2):
define void @KaDisp_scroll_on_off(i8 zeroext %0) {
%2 = icmp eq i8 %0, 0
%3 = select i1 %2, i32 46, i32 47
%4 = tail call i32 @SSD1780_send_cmd(i32 %3)
ret void
}
void TestExpectNearFail(void) {
  TestExpect("fabsf((10.0f) - (10.2f)) < (0.1f)",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/google/makani/refs/heads/master/"
             "avionics/firmware/test/test_test.c",
             __func__, 182, fabsf((10.0f) - (10.2f)) < (0.1f));
}


x86 assembly (clang, -O0):
<TestExpectNearFail>:
push   %rbp
mov    %rsp,%rbp
movss  0xee8(%rip),%xmm1
movss  0xedc(%rip),%xmm0
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%r8d
lea    0xed1(%rip),%rdi
lea    0xeec(%rip),%rsi
lea    0xf82(%rip),%rdx
mov    $0xb6,%ecx
mov    $0x0,%al
call   1030 <TestExpect@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TestExpectNearFail>:
lea    0xee9(%rip),%rdi
lea    0xf04(%rip),%rsi
lea    0xf9a(%rip),%rdx
mov    $0xb6,%ecx
xor    %r8d,%r8d
xor    %eax,%eax
jmp    1030 <TestExpect@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"fabsf((10.0f) - (10.2f)) < (0.1f)\00"
@.str.1 = [157 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/google/makani/refs/heads/master/avionics/firmware/test/test_test.c\00"
@__func__.TestExpectNearFail = [19 x i8] c"TestExpectNearFail\00"
define void @TestExpectNearFail() {
%1 = call float @llvm.fabs.f32(float 0xBFC9999800000000)
%2 = fcmp olt float %1, 0x3FB99999A0000000
%3 = zext i1 %2 to i32
%4 = call i32 (i8*, i8*, i8*, i32, i32, ...) bitcast (i32 (...)* @TestExpect to i32 (i8*, i8*, i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__func__.TestExpectNearFail, i64 0, i64 0), i32 182, i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"fabsf((10.0f) - (10.2f)) < (0.1f)\00"
@.str.1 = [157 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/google/makani/refs/heads/master/avionics/firmware/test/test_test.c\00"
@__func__.TestExpectNearFail = [19 x i8] c"TestExpectNearFail\00"
define void @TestExpectNearFail() {
%1 = tail call i32 (i8*, i8*, i8*, i32, i32, ...) bitcast (i32 (...)* @TestExpect to i32 (i8*, i8*, i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__func__.TestExpectNearFail, i64 0, i64 0), i32 182, i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fwrite(char *, int, int, int /*<<< orphan*/ *);
void save_buf(char *filename, char *buf, int size) {
  FILE *fp;
  fp = fopen(filename, "wb");
  fwrite(buf, 1, size, fp);
  fclose(fp);
  return;
}


x86 assembly (clang, -O0):
<save_buf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb2(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    $0x1,%esi
call   1050 <fwrite@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<save_buf>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
lea    0xebf(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %r14d,%edx
mov    %rax,%rcx
call   1050 <fwrite@plt>
mov    %rbp,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"wb\00"
define void @save_buf(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = call i32* @fopen(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %9, i32** %7
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = load i32*, i32** %7
%13 = call i32 @fwrite(i8* %10, i32 1, i32 %11, i32* %12)
%14 = load i32*, i32** %7
%15 = call i32 @fclose(i32* %14)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"wb\00"
define void @save_buf(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @fwrite(i8* %1, i32 1, i32 %2, i32* %4)
%6 = tail call i32 @fclose(i32* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x43() {
  Assert_real((isascii(67)),
              "/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_isascii.c",
              340, ("isascii should be 1 for C"));
}


x86 assembly (clang, -O0):
<t_isascii_0x43>:
push   %rbp
mov    %rsp,%rbp
mov    $0x43,%edi
call   1030 <isascii@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x154,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isascii_0x43>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0x154,%edx
jmp    1030 <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_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for C\00"
define void @t_isascii_0x43() {
%1 = call i32 @isascii(i32 67)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 340, i8* getelementptr inbounds ([26 x i8], [26 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_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for C\00"
define void @t_isascii_0x43() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 340, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FD_CLOEXEC;
int /*<<< orphan*/ F_SETFD;
int /*<<< orphan*/ die(char *);
scalar_t__ fcntl(int, int /*<<< orphan*/, int /*<<< orphan*/);
void fd_cloexec(int fd) {
  if (fcntl(fd, F_SETFD, FD_CLOEXEC) < 0)
    die("unable to set FD_CLOEXEC\n");
}


x86 assembly (clang, -O0):
<fd_cloexec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
mov    0x2e9a(%rip),%rax
mov    (%rax),%edx
call   1030 <fcntl@plt>
cmp    $0x0,%rax
jge    115b <fd_cloexec+0x3b>
lea    0xeaa(%rip),%rdi
call   1040 <die@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fd_cloexec>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
mov    0x2ea7(%rip),%rax
mov    (%rax),%edx
call   1030 <fcntl@plt>
test   %rax,%rax
js     113f <fd_cloexec+0x1f>
pop    %rax
ret
lea    0xeba(%rip),%rdi
pop    %rax
jmp    1040 <die@plt>

LLVM IR (-O0):
@F_SETFD = global i32 0
@FD_CLOEXEC = global i32 0
@.str = [26 x i8] c"unable to set FD_CLOEXEC\0A\00"
define void @fd_cloexec(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @F_SETFD
%5 = load i32, i32* @FD_CLOEXEC
%6 = call i64 @fcntl(i32 %3, i32 %4, i32 %5)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @die(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
@F_SETFD = global i32 0
@FD_CLOEXEC = global i32 0
@.str = [26 x i8] c"unable to set FD_CLOEXEC\0A\00"
define void @fd_cloexec(i32 %0) {
%2 = load i32, i32* @F_SETFD
%3 = load i32, i32* @FD_CLOEXEC
%4 = tail call i64 @fcntl(i32 %0, i32 %2, i32 %3)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @die(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void perror(const char *str) {
  fputs(str, stderr);
  fputs(": ", stderr);
  fputs(strerror(errno), stderr);
  fputc('\n', stderr);
}


x86 assembly (clang, -O0):
<perror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%esi
lea    0xea2(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2e6e(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %rax,%rdi
mov    0x2e65(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    0x2e57(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1040 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<perror>:
push   %rbx
mov    0x2ea8(%rip),%rbx
mov    (%rbx),%esi
call   1030 <fputs@plt>
mov    (%rbx),%esi
lea    0xeb8(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    (%rbx),%esi
mov    %rax,%rdi
call   1030 <fputs@plt>
mov    (%rbx),%esi
mov    $0xa,%edi
pop    %rbx
jmp    1040 <fputc@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [3 x i8] c": \00"
@errno = global i32 0
define void @perror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @stderr
%5 = call i32 @fputs(i8* %3, i32 %4)
%6 = load i32, i32* @stderr
%7 = call i32 @fputs(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* @errno
%9 = call i8* @strerror(i32 %8)
%10 = load i32, i32* @stderr
%11 = call i32 @fputs(i8* %9, i32 %10)
%12 = load i32, i32* @stderr
%13 = call i32 @fputc(i8 signext 10, i32 %12)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c": \00"
@errno = global i32 0
define void @perror(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fputs(i8* %0, i32 %2)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fputs(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* @errno
%7 = tail call i8* @strerror(i32 %6)
%8 = load i32, i32* @stderr
%9 = tail call i32 @fputs(i8* %7, i32 %8)
%10 = load i32, i32* @stderr
%11 = tail call i32 @fputc(i8 signext 10, i32 %10)
ret void
}
int test_imm_64int64_lowword_mem(long long *val) {
  return ((*val) & (0x64 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_64int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 100
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ sse4_test();
int /*<<< orphan*/ sse_test();
int /*<<< orphan*/ ssse3_test();
int main() {
  sse_test();
  ssse3_test();
  sse4_test();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @sse_test()
%2 = tail call i32 (...) @ssse3_test()
%3 = tail call i32 (...) @sse4_test()
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ chg_first;
};
typedef TYPE_1__ XIMPreeditDrawCallbackStruct;

/* Variables and functions */
int get_XIMPreeditDrawCallbackStruct_chg_first(void *_p) {
  return (int)((XIMPreeditDrawCallbackStruct *)_p)->chg_first;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XIMPreeditDrawCallbackStruct_chg_first(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
uint64_t addp12345(uint64_t x) { return x + 12345; }


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

x86 assembly (clang, -O2):
<addp12345>:
lea    0x3039(%rdi),%rax
ret

LLVM IR (-O0):
define i64 @addp12345(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 12345
ret i64 %4
}

LLVM IR (-O2):
define i64 @addp12345(i64 %0) {
%2 = add nsw i64 %0, 12345
ret i64 %2
}
int new_integer() {
  int newInt = 222;
  return newInt;
}


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

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

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

LLVM IR (-O2):
define i32 @new_integer() {
ret i32 222
}
void XSharpPCFDestroy(void *dpy, void *renderer) {}


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

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

LLVM IR (-O0):
define void @XSharpPCFDestroy(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 @XSharpPCFDestroy(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void *threadfunc(void *arg) {
  printf("in threadfunc\n");
  return NULL;
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"in threadfunc\0A\00"
define i8* @threadfunc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@str = [14 x i8] c"in threadfunc\00"
define noalias i8* @threadfunc(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ unlink(char *);
void onexit(void) { unlink("/var/run/jail-cmdd.pid"); }


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"/var/run/jail-cmdd.pid\00"
define void @onexit() {
%1 = call i32 @unlink(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"/var/run/jail-cmdd.pid\00"
define void @onexit() {
%1 = tail call i32 @unlink(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ curve25519_scalarmult(int *, int const *, int const *);
void curve25519_scalarmult_base(uint8_t *q, const uint8_t *n) {
  static const uint8_t base[32] = {0x09};
  curve25519_scalarmult(q, n, base);
}


x86 assembly (clang, -O0):
<curve25519_scalarmult_base>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    0xed1(%rip),%rdx
call   1030 <curve25519_scalarmult@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<curve25519_scalarmult_base>:
lea    0xee9(%rip),%rdx
jmp    1030 <curve25519_scalarmult@plt>

LLVM IR (-O0):
@curve25519_scalarmult_base.base = internal constant <{ i32, [31 x i32] }> <{ i32 9, [31 x i32] zeroinitializer }>
define void @curve25519_scalarmult_base(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = load i32*, i32** %4
%7 = call i32 @curve25519_scalarmult(i32* %5, i32* %6, i32* getelementptr inbounds ([32 x i32], [32 x i32]* bitcast (<{ i32, [31 x i32] }>* @curve25519_scalarmult_base.base to [32 x i32]*), i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@curve25519_scalarmult_base.base = internal constant <{ i32, [31 x i32] }> <{ i32 9, [31 x i32] zeroinitializer }>
define void @curve25519_scalarmult_base(i32* %0, i32* %1) {
%3 = tail call i32 @curve25519_scalarmult(i32* %0, i32* %1, i32* getelementptr inbounds (<{ i32, [31 x i32] }>, <{ i32, [31 x i32] }>* @curve25519_scalarmult_base.base, i64 0, i32 0))
ret void
}
int register_partial_resume(struct partial_resume *handler) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.partial_resume = type opaque
define i32 @register_partial_resume(%struct.partial_resume* nocapture readnone %0) {
ret i32 0
}
int isRouting(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @isRouting() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char *, char *);
int get_hotplug2_event_action(char *action) {
  if (!strcmp(action, "add"))
    return 0;
  if (!strcmp(action, "remove"))
    return 1;
  return -1;
}


x86 assembly (clang, -O0):
<get_hotplug2_event_action>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1141 <get_hotplug2_event_action+0x31>
movl   $0x0,-0x4(%rbp)
jmp    116d <get_hotplug2_event_action+0x5d>
mov    -0x10(%rbp),%rdi
lea    0xeb8(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1166 <get_hotplug2_event_action+0x56>
movl   $0x1,-0x4(%rbp)
jmp    116d <get_hotplug2_event_action+0x5d>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_hotplug2_event_action>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     113c <get_hotplug2_event_action+0x2c>
lea    0xed9(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
neg    %eax
sbb    %eax,%eax
or     $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"add\00"
@.str.1 = [7 x i8] c"remove\00"
define i32 @get_hotplug2_event_action(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @strcmp(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = icmp ne i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %1
store i32 0, i32* %2
br label %14
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i32 @strcmp(i8* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp ne i32 %10, 0
br i1 %11, label %13, label %12
12: ; preds = %8
store i32 1, i32* %2
br label %14
13: ; preds = %8
store i32 -1, i32* %2
br label %14
14: ; preds = %13, %12, %7
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@.str = [4 x i8] c"add\00"
@.str.1 = [7 x i8] c"remove\00"
define i32 @get_hotplug2_event_action(i8* nocapture %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i32 1, i32 -1
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ mill_sleep(scalar_t__);
scalar_t__ now();
int /*<<< orphan*/ printf(char *, ...);
__attribute__((no)) void dot(int *done) {
  char c = '.';
  while (!*done) {
    printf("%c", c);
    mill_sleep(now() + 1);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<dot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0x2e,-0x9(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1159 <dot+0x29>
jmp    1183 <dot+0x53>
movsbl -0x9(%rbp),%esi
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <now@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1040 <mill_sleep@plt>
jmp    1140 <dot+0x10>
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dot>:
push   %rbx
cmpl   $0x0,(%rdi)
jne    115f <dot+0x2f>
mov    %rdi,%rbx
nopl   0x0(%rax)
mov    $0x2e,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1050 <now@plt>
lea    0x1(%rax),%rdi
call   1040 <mill_sleep@plt>
cmpl   $0x0,(%rbx)
je     1140 <dot+0x10>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @dot(i32* %0) {
%2 = alloca i32*
%3 = alloca i8
store i32* %0, i32** %2
store i8 46, i8* %3
br label %4
4: ; preds = %9, %1
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
br i1 %8, label %9, label %16
9: ; preds = %4
%10 = load i8, i8* %3
%11 = sext i8 %10 to i32
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = call i64 (...) @now()
%14 = add nsw i64 %13, 1
%15 = call i32 @mill_sleep(i64 %14)
br label %4
16: ; preds = %4
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @dot(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1, %4
%5 = tail call i32 @putchar(i32 46)
%6 = tail call i64 (...) @now()
%7 = add nsw i64 %6, 1
%8 = tail call i32 @mill_sleep(i64 %7)
%9 = load i32, i32* %0
%10 = icmp eq i32 %9, 0
br i1 %10, label %4, label %11
11: ; preds = %4, %1
%12 = tail call i32 @putchar(i32 10)
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int label_cmp(const void *a, const void *b) {
  uint32_t aa = *((const uint32_t *)a);
  uint32_t bb = *((const uint32_t *)b);
  return (aa < bb) ? 1 : (aa > bb) ? -1 : 0;
}


x86 assembly (clang, -O0):
<label_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jge    113d <label_cmp+0x3d>
mov    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1155 <label_cmp+0x55>
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rsi
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    %rsi,%rdx
cmovg  %ecx,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<label_cmp>:
mov    (%rdi),%rax
mov    (%rsi),%rcx
xor    %edx,%edx
cmp    %rcx,%rax
setg   %dl
neg    %edx
cmp    %rcx,%rax
mov    $0x1,%eax
cmovge %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @label_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp slt i64 %4, %6
%8 = icmp sgt i64 %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ lookNarray(char *, unsigned int);
void lookcomplex4array(void *x, int n) {
  lookNarray((char *)x, (unsigned int)(n * 4));
}


x86 assembly (clang, -O0):
<lookcomplex4array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
shl    $0x2,%esi
call   1030 <lookNarray@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lookcomplex4array>:
shl    $0x2,%esi
jmp    1030 <lookNarray@plt>

LLVM IR (-O0):
define void @lookcomplex4array(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 = mul nsw i32 %6, 4
%8 = call i32 @lookNarray(i8* %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @lookcomplex4array(i8* %0, i32 %1) {
%3 = shl nsw i32 %1, 2
%4 = tail call i32 @lookNarray(i8* %0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DI_Set_Irq_Enable(unsigned int);
int di_irq_enable(unsigned int enable) {
  DI_Set_Irq_Enable(enable);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @di_irq_enable(i32 %0) {
%2 = tail call i32 @DI_Set_Irq_Enable(i32 %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
char prompt_bread(void) {
  char temp_value = '\0';
  printf("What type of Bread (w = White, s = Sweet) ?");
  scanf(" %c", &temp_value);
  return temp_value;
}


x86 assembly (clang, -O0):
<prompt_bread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
lea    0xeed(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prompt_bread>:
push   %rax
movb   $0x0,0x7(%rsp)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
lea    0xef3(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x7(%rsp),%al
pop    %rcx
ret

LLVM IR (-O0):
@.str = [44 x i8] c"What type of Bread (w = White, s = Sweet) ?\00"
@.str.1 = [4 x i8] c" %c\00"
define signext i8 @prompt_bread() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%4 = load i8, i8* %1
ret i8 %4
}

LLVM IR (-O2):
@.str = [44 x i8] c"What type of Bread (w = White, s = Sweet) ?\00"
@.str.1 = [4 x i8] c" %c\00"
define signext i8 @prompt_bread() {
%1 = alloca i8
store i8 0, i8* %1
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%4 = load i8, i8* %1
ret i8 %4
}
/* Variables and functions */
int bma222_write_reg(unsigned char, unsigned char *, int);
int bma222_write_reg_byte(unsigned char adr, unsigned char val) {
  return bma222_write_reg(adr, &val, 1);
}


x86 assembly (clang, -O0):
<bma222_write_reg_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
lea    -0x2(%rbp),%rsi
mov    $0x1,%edx
movzbl -0x1(%rbp),%edi
call   1030 <bma222_write_reg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bma222_write_reg_byte>:
push   %rax
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <bma222_write_reg@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @bma222_write_reg_byte(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = call i32 @bma222_write_reg(i8 zeroext %5, i8* %4, i32 1)
ret i32 %6
}

LLVM IR (-O2):
define i32 @bma222_write_reg_byte(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
store i8 %1, i8* %3
%4 = call i32 @bma222_write_reg(i8 zeroext %0, i8* %3, i32 1)
ret i32 %4
}
/* Variables and functions */
int Pidentifier();
PformalNameDef() {
  int b = -1;
  ;
  b = Pidentifier();
  return (b);
}


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

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

LLVM IR (-O0):
define i32 @PformalNameDef() {
%1 = alloca i32
store i32 -1, i32* %1
%2 = call i32 (...) @Pidentifier()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @PformalNameDef() {
%1 = tail call i32 (...) @Pidentifier()
ret i32 %1
}
/* Type definitions */
struct rusage {
  int dummy;
};
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ __NR_wait4;
int syscall(int /*<<< orphan*/, int /*<<< orphan*/, int *, int,
            struct rusage *);
int f_wait4(pid_t pid, int *wstatus, int options, struct rusage *rusage) {
  return syscall(__NR_wait4, pid, wstatus, options, rusage);
}


x86 assembly (clang, -O0):
<f_wait4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_wait4>:
mov    %rcx,%r8
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.rusage = type { i32 }
@__NR_wait4 = global i32 0
define i32 @f_wait4(i32 %0, i32* %1, i32 %2, %struct.rusage* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
%8 = alloca %struct.rusage*
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store %struct.rusage* %3, %struct.rusage** %8
%9 = load i32, i32* @__NR_wait4
%10 = load i32, i32* %5
%11 = load i32*, i32** %6
%12 = load i32, i32* %7
%13 = load %struct.rusage*, %struct.rusage** %8
%14 = call i32 @syscall(i32 %9, i32 %10, i32* %11, i32 %12, %struct.rusage* %13)
ret i32 %14
}

LLVM IR (-O2):
%struct.rusage = type { i32 }
@__NR_wait4 = global i32 0
define i32 @f_wait4(i32 %0, i32* %1, i32 %2, %struct.rusage* %3) {
%5 = load i32, i32* @__NR_wait4
%6 = tail call i32 @syscall(i32 %5, i32 %0, i32* %1, i32 %2, %struct.rusage* %3)
ret i32 %6
}
int div16(int x) {
  int bias = (x >> 31) & 0xF;
  return (x + bias) >> 4;
}


x86 assembly (clang, -O0):
<div16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
and    $0xf,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
sar    $0x4,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<div16>:
mov    %edi,%eax
sar    $0x1f,%eax
and    $0xf,%eax
add    %edi,%eax
sar    $0x4,%eax
ret

LLVM IR (-O0):
define i32 @div16(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 31
%6 = and i32 %5, 15
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = add nsw i32 %7, %8
%10 = ashr i32 %9, 4
ret i32 %10
}

LLVM IR (-O2):
define i32 @div16(i32 %0) {
%2 = icmp slt i32 %0, 0
%3 = select i1 %2, i32 15, i32 0
%4 = add nsw i32 %3, %0
%5 = ashr i32 %4, 4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_pipe_array(int max, char **array) {
  int i;
  for (i = 0; i < max; ++i)
    free(array[i]);
}


x86 assembly (clang, -O0):
<free_pipe_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1151 <free_pipe_array+0x41>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <free_pipe_array+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_pipe_array>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
jle    1142 <free_pipe_array+0x32>
mov    %rsi,%r14
mov    %edi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_pipe_array+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @free_pipe_array(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @free(i8* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
void swShort(unsigned char *buf, unsigned short val) {
  buf[0] = (val & 0xff00) >> 8UL;
  buf[1] = (val & 0x00ff);
}


x86 assembly (clang, -O0):
<swShort>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
and    $0xff00,%eax
sar    $0x8,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
movzwl -0xa(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swShort>:
rol    $0x8,%si
mov    %si,(%rdi)
ret

LLVM IR (-O0):
define void @swShort(i8* %0, i16 zeroext %1) {
%3 = alloca i8*
%4 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = zext i16 %5 to i32
%7 = and i32 %6, 65280
%8 = ashr i32 %7, 8
%9 = trunc i32 %8 to i8
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 0
store i8 %9, i8* %11
%12 = load i16, i16* %4
%13 = zext i16 %12 to i32
%14 = and i32 %13, 255
%15 = trunc i32 %14 to i8
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 1
store i8 %15, i8* %17
ret void
}

LLVM IR (-O2):
define void @swShort(i8* nocapture writeonly %0, i16 zeroext %1) {
%3 = lshr i16 %1, 8
%4 = trunc i16 %3 to i8
store i8 %4, i8* %0
%5 = trunc i16 %1 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
ret void
}
call6k() {}


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

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

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

LLVM IR (-O2):
define i32 @call6k() {
ret i32 undef
}
makehimask(nbuf, ng) char *nbuf, *ng;
{
  if (!findex(nbuf, ng)) {
    ngcat(nbuf);
    strcat(nbuf, "!");
    strcat(nbuf, ng);
    ngcat(nbuf);
  }
}


x86 assembly (clang, -O0):
<makehimask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1050 <findex@plt>
cmp    $0x0,%eax
jne    118b <makehimask+0x5b>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <ngcat@plt>
mov    -0x10(%rbp),%rdi
lea    0xe92(%rip),%rsi
call   1040 <strcat@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcat@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <ngcat@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makehimask>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1060 <findex@plt>
test   %eax,%eax
jne    1182 <makehimask+0x42>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <ngcat@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
movw   $0x21,(%rbx,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <strcat@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <ngcat@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c"!\00"
define i32 @makehimask(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = load i8*, i8** %5
%8 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @findex to i32 (i8*, i8*, ...)*)(i8* %6, i8* %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %20, label %10
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = call i32 (i8*, ...) bitcast (i32 (...)* @ngcat to i32 (i8*, ...)*)(i8* %11)
%13 = load i8*, i8** %4
%14 = call i8* @strcat(i8* %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%15 = load i8*, i8** %4
%16 = load i8*, i8** %5
%17 = call i8* @strcat(i8* %15, i8* %16)
%18 = load i8*, i8** %4
%19 = call i32 (i8*, ...) bitcast (i32 (...)* @ngcat to i32 (i8*, ...)*)(i8* %18)
br label %20
20: ; preds = %10, %2
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @makehimask(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @findex to i32 (i8*, i8*, ...)*)(i8* %0, i8* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %2
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ngcat to i32 (i8*, ...)*)(i8* %0)
%7 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%8 = getelementptr i8, i8* %0, i64 %7
%9 = bitcast i8* %8 to i16*
store i16 33, i16* %9
%10 = tail call i8* @strcat(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%11 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ngcat to i32 (i8*, ...)*)(i8* %0)
br label %12
12: ; preds = %5, %2
ret i32 undef
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ random_test();
void random_tests(uint32_t n) {
  while (n > 0) {
    random_test();
    n--;
  }
}


x86 assembly (clang, -O0):
<random_tests>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jle    113f <random_tests+0x2f>
mov    $0x0,%al
call   1030 <random_test@plt>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <random_tests+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_tests>:
push   %rbx
test   %rdi,%rdi
jle    1131 <random_tests+0x21>
mov    %rdi,%rbx
add    $0x1,%rbx
nopl   (%rax)
xor    %eax,%eax
call   1030 <random_test@plt>
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rbx
ja     1120 <random_tests+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @random_tests(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
br label %3
3: ; preds = %6, %1
%4 = load i64, i64* %2
%5 = icmp sgt i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = call i32 (...) @random_test()
%8 = load i64, i64* %2
%9 = add nsw i64 %8, -1
store i64 %9, i64* %2
br label %3
10: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @random_tests(i64 %0) {
%2 = icmp sgt i64 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i64 [ %6, %3 ], [ %0, %1 ]
%5 = tail call i32 (...) @random_test()
%6 = add nsw i64 %4, -1
%7 = icmp ugt i64 %4, 1
br i1 %7, label %3, label %8
8: ; preds = %3, %1
ret void
}
void high_level() {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<high_level>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <high_level+0x9>
jmp    1109 <high_level+0x9>

x86 assembly (clang, -O2):
<high_level>:
jmp    1100 <high_level>

LLVM IR (-O0):
define void @high_level() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @high_level() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ PlotSeekAd(int);
void PlotSingleSeekAd(int i) { PlotSeekAd(i); }


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

x86 assembly (clang, -O2):
<PlotSingleSeekAd>:
jmp    1030 <PlotSeekAd@plt>

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

LLVM IR (-O2):
define void @PlotSingleSeekAd(i32 %0) {
%2 = tail call i32 @PlotSeekAd(i32 %0)
ret void
}
void g_pattern_spec_equal() {}


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

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

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

LLVM IR (-O2):
define void @g_pattern_spec_equal() {
ret void
}