xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ dealloc_uivector(unsigned int *, unsigned int);
int /*<<< orphan*/ free(char *);
void dealloc_uimatrix(unsigned int **v, unsigned int n2h, unsigned int nh) {
  for (unsigned int i = 1; i <= n2h; i++) {
    dealloc_uivector(v[i], nh);
  }
  free((char *)v);
}


x86 assembly (clang, -O0):
<dealloc_uimatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
ja     1166 <dealloc_uimatrix+0x46>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    (%rax,%rcx,8),%rdi
mov    -0x10(%rbp),%esi
call   1040 <dealloc_uivector@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1139 <dealloc_uimatrix+0x19>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dealloc_uimatrix>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r15
test   %esi,%esi
je     1155 <dealloc_uimatrix+0x35>
mov    %edx,%r14d
mov    %esi,%ebp
mov    $0x1,%ebx
nopl   0x0(%rax,%rax,1)
mov    %ebx,%eax
mov    (%r15,%rax,8),%rdi
mov    %r14d,%esi
call   1040 <dealloc_uivector@plt>
add    $0x1,%ebx
cmp    %ebp,%ebx
jbe    1140 <dealloc_uimatrix+0x20>
mov    %r15,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @dealloc_uimatrix(i32** nocapture %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, 0
br i1 %4, label %5, label %8
5: ; preds = %8, %3
%6 = bitcast i32** %0 to i8*
%7 = tail call i32 @free(i8* %6)
ret void
8: ; preds = %3, %8
%9 = phi i32 [ %14, %8 ], [ 1, %3 ]
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds i32*, i32** %0, i64 %10
%12 = load i32*, i32** %11
%13 = tail call i32 @dealloc_uivector(i32* %12, i32 %2)
%14 = add i32 %9, 1
%15 = icmp ugt i32 %14, %1
br i1 %15, label %5, label %8
}
/* Variables and functions */
int /*<<< orphan*/ run_shout_lace_tool_pipem_callback(int, int, char const *);
void run_shout(int in_fd, int out_fd, void *voidarg) {
  run_shout_lace_tool_pipem_callback(in_fd, out_fd, (const char *)voidarg);
}


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

x86 assembly (clang, -O2):
<run_shout>:
jmp    1030 <run_shout_lace_tool_pipem_callback@plt>

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

LLVM IR (-O2):
define void @run_shout(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 @run_shout_lace_tool_pipem_callback(i32 %0, i32 %1, i8* %2)
ret void
}
void updateCachedTime(void) {
  _serverPanic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/"
               "heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c",
               132, "Function '%s' is disabled.", __func__);
}


x86 assembly (clang, -O0):
<updateCachedTime>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x84,%esi
lea    0xf79(%rip),%rdx
lea    0xf8d(%rip),%rcx
mov    $0x0,%al
call   1030 <_serverPanic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<updateCachedTime>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x84,%esi
xor    %eax,%eax
jmp    1030 <_serverPanic@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.updateCachedTime = [17 x i8] c"updateCachedTime\00"
define void @updateCachedTime() {
%1 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 132, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__func__.updateCachedTime, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.updateCachedTime = [17 x i8] c"updateCachedTime\00"
define void @updateCachedTime() {
%1 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 132, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__func__.updateCachedTime, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void d(void) { printf("d() called\n"); }


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

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

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

LLVM IR (-O2):
@str = [11 x i8] c"d() called\00"
define void @d() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret void
}
int fb_ConsoleGetY(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @fb_ConsoleGetY() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ dump_stylesheet(char const *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main(int argc, const char *argv[]) {
  if (argc != 2) {
    printf("Usage: css_dump <CSS filename>.\n");
    exit(0);
  }
  dump_stylesheet(argv[1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1163 <main+0x33>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <dump_stylesheet@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1143 <main+0x13>
mov    0x8(%rsi),%rdi
call   1040 <dump_stylesheet@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xeb6(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"Usage: css_dump <CSS filename>.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 0)
unreachable
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @dump_stylesheet(i8* %14)
ret i32 0
}

LLVM IR (-O2):
@str = [32 x i8] c"Usage: css_dump <CSS filename>.\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @dump_stylesheet(i8* %9)
ret i32 0
}
void ResDetach(int a) {}


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

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

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

LLVM IR (-O2):
define void @ResDetach(i32 %0) {
ret void
}
void gdk_window_clear_area() {}


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

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

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

LLVM IR (-O2):
define void @gdk_window_clear_area() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AUDIO_SET_MUTE;
scalar_t__ ioctl(int, int /*<<< orphan*/, int);
int /*<<< orphan*/ perror(char *);
int audioSetMute(int fd, int state) {
  int ans;
  if ((ans = ioctl(fd, AUDIO_SET_MUTE, state) < 0)) {
    perror("AUDIO SET MUTE: ");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<audioSetMute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%edx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
setl   %al
mov    %al,%cl
and    $0x1,%cl
movzbl %cl,%ecx
mov    %ecx,-0x10(%rbp)
test   $0x1,%al
jne    1161 <audioSetMute+0x41>
jmp    1179 <audioSetMute+0x59>
lea    0xe98(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1180 <audioSetMute+0x60>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<audioSetMute>:
push   %rax
mov    %esi,%edx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
call   1030 <ioctl@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
js     113d <audioSetMute+0x1d>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@AUDIO_SET_MUTE = global i32 0
@.str = [17 x i8] c"AUDIO SET MUTE: \00"
define i32 @audioSetMute(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = load i32, i32* @AUDIO_SET_MUTE
%9 = load i32, i32* %5
%10 = call i64 @ioctl(i32 %7, i32 %8, i32 %9)
%11 = icmp slt i64 %10, 0
%12 = zext i1 %11 to i32
store i32 %12, i32* %6
br i1 %11, label %13, label %15
13: ; preds = %2
%14 = call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %16
15: ; preds = %2
store i32 0, i32* %3
br label %16
16: ; preds = %15, %13
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@AUDIO_SET_MUTE = global i32 0
@.str = [17 x i8] c"AUDIO SET MUTE: \00"
define i32 @audioSetMute(i32 %0, i32 %1) {
%3 = load i32, i32* @AUDIO_SET_MUTE
%4 = tail call i64 @ioctl(i32 %0, i32 %3, i32 %1)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ -1, %6 ], [ 0, %2 ]
ret i32 %9
}
/* Variables and functions */
int btshasp_strntoupper(char *, char *, int);
int btshasp_strtoupper(char *dst, char *src) {
  return (btshasp_strntoupper(dst, src, 1 << 16));
}


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

x86 assembly (clang, -O2):
<btshasp_strtoupper>:
mov    $0x10000,%edx
jmp    1030 <btshasp_strntoupper@plt>

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

LLVM IR (-O2):
define i32 @btshasp_strtoupper(i8* %0, i8* %1) {
%3 = tail call i32 @btshasp_strntoupper(i8* %0, i8* %1, i32 65536)
ret i32 %3
}
int is_bmode_supported(struct net_device *bond_dev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.net_device = type opaque
define i32 @is_bmode_supported(%struct.net_device* nocapture readnone %0) {
ret i32 0
}
char *xstrdup(string) const char *string;
{ return strcpy(xmalloc(strlen(string) + 1), string); }


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
mov    $0x0,%al
call   1050 <xmalloc@plt>
movslq %eax,%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
xor    %eax,%eax
call   1050 <xmalloc@plt>
movslq %eax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strlen(i8* %3)
%5 = add i64 %4, 1
%6 = call i32 (i64, ...) bitcast (i32 (...)* @xmalloc to i32 (i64, ...)*)(i64 %5)
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i8*
%9 = load i8*, i8** %2
%10 = call i8* @strcpy(i8* %8, i8* %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @xstrdup(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i32 (i64, ...) bitcast (i32 (...)* @xmalloc to i32 (i64, ...)*)(i64 %3)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
%7 = tail call i8* @strcpy(i8* dereferenceable(1) %6, i8* dereferenceable(1) %0)
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ atol(char *);
int /*<<< orphan*/ atoll(char *);
void uninitvar_atol(void) {
  char *c;
  (void)atoi(c);
  (void)atol(c);
  (void)atoll(c);
}


x86 assembly (clang, -O0):
<uninitvar_atol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x8(%rbp),%rdi
call   1050 <atoi@plt>
mov    -0x8(%rbp),%rdi
call   1040 <atol@plt>
mov    -0x8(%rbp),%rdi
call   1030 <atoll@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @uninitvar_atol() {
%1 = alloca i8*
%2 = load i8*, i8** %1
%3 = call i32 @atoi(i8* %2)
%4 = load i8*, i8** %1
%5 = call i32 @atol(i8* %4)
%6 = load i8*, i8** %1
%7 = call i32 @atoll(i8* %6)
ret void
}

LLVM IR (-O2):
define void @uninitvar_atol() {
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ hd44780_command(int);
void lcd_goto(uint8_t line, uint8_t pos) {
  hd44780_command((0x80 | ((line == 0 ? pos : 80 - 16 + pos) & 0x7f)));
}


x86 assembly (clang, -O0):
<lcd_goto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1138 <lcd_goto+0x28>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1144 <lcd_goto+0x34>
mov    -0x10(%rbp),%rax
add    $0x40,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
and    $0x7f,%rax
or     $0x80,%rax
mov    %eax,%edi
call   1030 <hd44780_command@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_goto>:
lea    0x40(%rsi),%eax
test   %rdi,%rdi
cmove  %esi,%eax
or     $0x80,%eax
movzbl %al,%edi
jmp    1030 <hd44780_command@plt>

LLVM IR (-O0):
define void @lcd_goto(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = load i64, i64* %4
br label %12
9: ; preds = %2
%10 = load i64, i64* %4
%11 = add nsw i64 64, %10
br label %12
12: ; preds = %9, %7
%13 = phi i64 [ %8, %7 ], [ %11, %9 ]
%14 = and i64 %13, 127
%15 = or i64 128, %14
%16 = trunc i64 %15 to i32
%17 = call i32 @hd44780_command(i32 %16)
ret void
}

LLVM IR (-O2):
define void @lcd_goto(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 0
%4 = add nsw i64 %1, 64
%5 = select i1 %3, i64 %1, i64 %4
%6 = trunc i64 %5 to i32
%7 = and i32 %6, 127
%8 = or i32 %7, 128
%9 = tail call i32 @hd44780_command(i32 %8)
ret void
}
/* Type definitions */
struct statfs {
  int dummy;
};

/* Variables and functions */
int __fstatfs64(int, int, struct statfs *);
int fstatfs(int fd, struct statfs *stat) {
  return __fstatfs64(fd, sizeof(struct statfs), stat);
}


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

x86 assembly (clang, -O2):
<fstatfs>:
mov    %rsi,%rdx
mov    $0x4,%esi
jmp    1030 <__fstatfs64@plt>

LLVM IR (-O0):
%struct.statfs = type { i32 }
define i32 @fstatfs(i32 %0, %struct.statfs* %1) {
%3 = alloca i32
%4 = alloca %struct.statfs*
store i32 %0, i32* %3
store %struct.statfs* %1, %struct.statfs** %4
%5 = load i32, i32* %3
%6 = load %struct.statfs*, %struct.statfs** %4
%7 = call i32 @__fstatfs64(i32 %5, i32 4, %struct.statfs* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.statfs = type { i32 }
define i32 @fstatfs(i32 %0, %struct.statfs* %1) {
%3 = tail call i32 @__fstatfs64(i32 %0, i32 4, %struct.statfs* %1)
ret i32 %3
}
int __attribute__((no, noclone)) different(int val) {
  val++;
  e(val, val);
  asm("breakhere_different:");
  return val;
}


x86 assembly (clang, -O0):
<different>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    $0x0,%al
call   1030 <e@plt>

x86 assembly (clang, -O2):
<different>:
push   %rbx
lea    0x1(%rdi),%ebx
mov    %ebx,%edi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <e@plt>

LLVM IR (-O0):
define i32 @different(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = call i32 (i32, i32, ...) bitcast (i32 (...)* @e to i32 (i32, i32, ...)*)(i32 %5, i32 %6)
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @different(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @e to i32 (i32, i32, ...)*)(i32 %2, i32 %2)
tail call void asm sideeffect "breakhere_different:", "~{dirflag},~{fpsr},~{flags}"()
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
size_t write_FD_BE(int, int /*<<< orphan*/ const *, int);
size_t int64WriteToFD(int fd, const int64_t *data) {
  return write_FD_BE(fd, data, sizeof(int64_t));
}


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

x86 assembly (clang, -O2):
<int64WriteToFD>:
mov    $0x4,%edx
jmp    1030 <write_FD_BE@plt>

LLVM IR (-O0):
define i64 @int64WriteToFD(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 i64 @write_FD_BE(i32 %5, i32* %6, i32 4)
ret i64 %7
}

LLVM IR (-O2):
define i64 @int64WriteToFD(i32 %0, i32* %1) {
%3 = tail call i64 @write_FD_BE(i32 %0, i32* %1, i32 4)
ret i64 %3
}
void ff_h264chroma_init_ppc() {}


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

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

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

LLVM IR (-O2):
define void @ff_h264chroma_init_ppc() {
ret void
}
/* Variables and functions */
double FLT_MAX;
float DoubleToFloatClamp(double val) {
  if (val >= FLT_MAX)
    return FLT_MAX;
  if (val <= -FLT_MAX)
    return -FLT_MAX;
  return (float)val;
}


x86 assembly (clang, -O0):
<DoubleToFloatClamp>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    0x2ed3(%rip),%rax
ucomisd (%rax),%xmm0
jb     1138 <DoubleToFloatClamp+0x38>
mov    0x2ec2(%rip),%rax
movsd  (%rax),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    11a7 <DoubleToFloatClamp+0xa7>
movsd  -0x10(%rbp),%xmm1
mov    0x2ea4(%rip),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
ucomisd %xmm1,%xmm0
jb     1199 <DoubleToFloatClamp+0x99>
mov    0x2e78(%rip),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    11a7 <DoubleToFloatClamp+0xa7>
movsd  -0x10(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoubleToFloatClamp>:
mov    0x2ee1(%rip),%rax
movsd  (%rax),%xmm1
movapd 0xeed(%rip),%xmm2
xorpd  %xmm1,%xmm2
movapd %xmm0,%xmm3
cmplesd %xmm2,%xmm3
andpd  %xmm3,%xmm2
andnpd %xmm0,%xmm3
orpd   %xmm2,%xmm3
movapd %xmm1,%xmm2
cmpnlesd %xmm0,%xmm2
andpd  %xmm2,%xmm3
andnpd %xmm1,%xmm2
orpd   %xmm3,%xmm2
xorps  %xmm0,%xmm0
cvtsd2ss %xmm2,%xmm0
ret

LLVM IR (-O0):
@FLT_MAX = global double 0.000000e+00
define float @DoubleToFloatClamp(double %0) {
%2 = alloca float
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = load double, double* @FLT_MAX
%6 = fcmp oge double %4, %5
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load double, double* @FLT_MAX
%9 = fptrunc double %8 to float
store float %9, float* %2
br label %22
10: ; preds = %1
%11 = load double, double* %3
%12 = load double, double* @FLT_MAX
%13 = fneg double %12
%14 = fcmp ole double %11, %13
br i1 %14, label %15, label %19
15: ; preds = %10
%16 = load double, double* @FLT_MAX
%17 = fneg double %16
%18 = fptrunc double %17 to float
store float %18, float* %2
br label %22
19: ; preds = %10
%20 = load double, double* %3
%21 = fptrunc double %20 to float
store float %21, float* %2
br label %22
22: ; preds = %19, %15, %7
%23 = load float, float* %2
ret float %23
}

LLVM IR (-O2):
@FLT_MAX = global double 0.000000e+00
define float @DoubleToFloatClamp(double %0) {
%2 = load double, double* @FLT_MAX
%3 = fcmp ugt double %2, %0
%4 = fneg double %2
%5 = fcmp oge double %4, %0
%6 = select i1 %5, double %4, double %0
%7 = select i1 %3, double %6, double %2
%8 = fptrunc double %7 to float
ret float %8
}
unsigned char gfMult2(unsigned char x) {
  if (x & 0x80)
    return ((x << 1) ^ 0x1B);
  return (x << 1);
}


x86 assembly (clang, -O0):
<gfMult2>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     112e <gfMult2+0x2e>
movzbl -0x2(%rbp),%eax
shl    $0x1,%eax
xor    $0x1b,%eax
mov    %al,-0x1(%rbp)
jmp    1138 <gfMult2+0x38>
movzbl -0x2(%rbp),%eax
shl    $0x1,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gfMult2>:
lea    (%rdi,%rdi,1),%eax
movzbl %al,%ecx
xor    $0x1b,%al
test   %dil,%dil
movzbl %al,%eax
cmovns %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i8 @gfMult2(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 128
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 1
%12 = xor i32 %11, 27
%13 = trunc i32 %12 to i8
store i8 %13, i8* %2
br label %19
14: ; preds = %1
%15 = load i8, i8* %3
%16 = zext i8 %15 to i32
%17 = shl i32 %16, 1
%18 = trunc i32 %17 to i8
store i8 %18, i8* %2
br label %19
19: ; preds = %14, %8
%20 = load i8, i8* %2
ret i8 %20
}

LLVM IR (-O2):
define zeroext i8 @gfMult2(i8 zeroext %0) {
%2 = icmp sgt i8 %0, -1
%3 = shl i8 %0, 1
%4 = xor i8 %3, 27
%5 = select i1 %2, i8 %3, i8 %4
ret i8 %5
}
/* Variables and functions */
long SwapLong(long);
int /*<<< orphan*/ assert(int);
double SwapDouble(double data) {
  assert(sizeof(double) == 2 * sizeof(long));
  char *p = (char *)&data;
  long l1 = *((long *)(p + 0)), l2 = *((long *)(p + sizeof(long)));
  *((long *)(p + 0)) = SwapLong(l2);
  *((long *)(p + sizeof(long))) = SwapLong(l1);
  return data;
}


x86 assembly (clang, -O0):
<SwapDouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
xor    %edi,%edi
call   1030 <assert@plt>
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <SwapLong@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rdi
call   1040 <SwapLong@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x8(%rax)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SwapDouble>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
xor    %edi,%edi
call   1030 <assert@plt>
movq   0x8(%rsp),%xmm0
movq   %xmm0,%rbx
call   1040 <SwapLong@plt>
mov    %rax,0x8(%rsp)
mov    %rbx,%rdi
call   1040 <SwapLong@plt>
movsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @SwapDouble(double %0) {
%2 = alloca double
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store double %0, double* %2
%6 = call i32 @assert(i32 0)
%7 = bitcast double* %2 to i8*
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 0
%10 = bitcast i8* %9 to i64*
%11 = load i64, i64* %10
store i64 %11, i64* %4
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 8
%14 = bitcast i8* %13 to i64*
%15 = load i64, i64* %14
store i64 %15, i64* %5
%16 = load i64, i64* %5
%17 = call i64 @SwapLong(i64 %16)
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i64 0
%20 = bitcast i8* %19 to i64*
store i64 %17, i64* %20
%21 = load i64, i64* %4
%22 = call i64 @SwapLong(i64 %21)
%23 = load i8*, i8** %3
%24 = getelementptr inbounds i8, i8* %23, i64 8
%25 = bitcast i8* %24 to i64*
store i64 %22, i64* %25
%26 = load double, double* %2
ret double %26
}

LLVM IR (-O2):
define double @SwapDouble(double %0) {
%2 = tail call i32 @assert(i32 0)
%3 = bitcast double %0 to i64
%4 = tail call i64 @SwapLong(i64 poison)
%5 = bitcast i64 %4 to double
%6 = tail call i64 @SwapLong(i64 %3)
ret double %5
}
float glmMax2f(float a, float b) {
  if (a > b)
    return a;
  return b;
}


x86 assembly (clang, -O0):
<glmMax2f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    112c <glmMax2f+0x2c>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1136 <glmMax2f+0x36>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmMax2f>:
maxss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @glmMax2f(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ e_sbc();
int /*<<< orphan*/ e_zp();
void e_sbc_zp() {
  e_zp();
  e_sbc();
}


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

x86 assembly (clang, -O2):
<e_sbc_zp>:
push   %rax
xor    %eax,%eax
call   1030 <e_zp@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <e_sbc@plt>

LLVM IR (-O0):
define void @e_sbc_zp() {
%1 = call i32 (...) @e_zp()
%2 = call i32 (...) @e_sbc()
ret void
}

LLVM IR (-O2):
define void @e_sbc_zp() {
%1 = tail call i32 (...) @e_zp()
%2 = tail call i32 (...) @e_sbc()
ret void
}
const char *__progname(const char *name) {
  const char *tmp = strrchr(name, '/');
  return tmp != ((void *)0) ? tmp + 1 : name;
}


x86 assembly (clang, -O0):
<__progname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114a <__progname+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1152 <__progname+0x42>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__progname>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @__progname(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i32 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
br label %13
11: ; preds = %1
%12 = load i8*, i8** %2
br label %13
13: ; preds = %11, %8
%14 = phi i8* [ %10, %8 ], [ %12, %11 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @__progname(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i32 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char *, char *, int *);
int stringToInt(char str[]) {
  int result;
  sscanf(str, "%d", &result);
  return result;
}


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

x86 assembly (clang, -O2):
<stringToInt>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1030 <sscanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @stringToInt(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
ret i32 %5
}
int has_colors(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @has_colors() {
ret i32 1
}

LLVM IR (-O2):
define i32 @has_colors() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ lseek(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ read(int, int *, int);
int fileGetSize(int fd) {
  int size;
  lseek(fd, 0, SEEK_SET);
  read(fd, &size, sizeof(int));
  return size;
}


x86 assembly (clang, -O0):
<fileGetSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <lseek@plt>
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1040 <read@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fileGetSize>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
mov    0x2eb2(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <lseek@plt>
lea    0xc(%rsp),%rsi
mov    %ebx,%edi
mov    $0x4,%edx
call   1040 <read@plt>
mov    0xc(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@SEEK_SET = global i32 0
define i32 @fileGetSize(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @SEEK_SET
%6 = call i32 @lseek(i32 %4, i32 0, i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @read(i32 %7, i32* %3, i32 4)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define i32 @fileGetSize(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @SEEK_SET
%5 = tail call i32 @lseek(i32 %0, i32 0, i32 %4)
%6 = call i32 @read(i32 %0, i32* %2, i32 4)
%7 = load i32, i32* %2
ret i32 %7
}
int ditherPixel(int x, int y, float r, float g, float b) {
  return (r + g + b > 1.5);
}


x86 assembly (clang, -O0):
<ditherPixel>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
addss  -0x10(%rbp),%xmm0
addss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xecc(%rip),%xmm1
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ditherPixel>:
addss  %xmm1,%xmm0
addss  %xmm2,%xmm0
xor    %eax,%eax
ucomiss 0xeef(%rip),%xmm0
seta   %al
ret

LLVM IR (-O0):
define i32 @ditherPixel(i32 %0, i32 %1, float %2, float %3, float %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca float
%9 = alloca float
%10 = alloca float
store i32 %0, i32* %6
store i32 %1, i32* %7
store float %2, float* %8
store float %3, float* %9
store float %4, float* %10
%11 = load float, float* %8
%12 = load float, float* %9
%13 = fadd float %11, %12
%14 = load float, float* %10
%15 = fadd float %13, %14
%16 = fpext float %15 to double
%17 = fcmp ogt double %16, 1.500000e+00
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @ditherPixel(i32 %0, i32 %1, float %2, float %3, float %4) {
%6 = fadd float %2, %3
%7 = fadd float %6, %4
%8 = fcmp ogt float %7, 1.500000e+00
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
void free(void *);
void xfree(void *ptr) { return free(ptr); }


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

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

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

LLVM IR (-O2):
define void @xfree(i8* nocapture %0) {
tail call void @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ count_lines();
int main() { count_lines(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @count_lines()
ret i32 0
}
void glUniform4i(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glUniform4i() {
ret void
}
void multi_i() {
  register int out0 = 0;
  asm("foo %1,%0" : "=r,r"(out0) : "r,i"(1));
}


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

LLVM IR (-O0):
LLVM IR (-O2):
define void @multi_i() {
%1 = tail call i32 asm "foo $1,$0", "=r|r,r|i,~{dirflag},~{fpsr},~{flags}"(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_246() {
  Assert_real((isqrt(246) == 15),
              "/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/stdlib/isqrt.c",
              1235, ("Integer square root of 246 should be 15"));
}


x86 assembly (clang, -O0):
<t_sqrt_246>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf6,%edi
call   1030 <isqrt@plt>
cmp    $0xf,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x4d3,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_246>:
push   %rax
mov    $0xf6,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xf,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x4d3,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 246 should be 15\00"
define void @t_sqrt_246() {
%1 = call i32 @isqrt(i32 246)
%2 = icmp eq i32 %1, 15
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1235, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 246 should be 15\00"
define void @t_sqrt_246() {
%1 = tail call i32 @isqrt(i32 246)
%2 = icmp eq i32 %1, 15
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1235, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void bar(const int *const x) { __asm__ __volatile__("" ::"m"(*x)); }


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

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

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

LLVM IR (-O2):
define void @bar(i32* %0) {
tail call void asm sideeffect "", "*m,~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
struct tm *getLocalTime() {
  struct tm *local_time;
  time_t time_ = time(0);
  time(&time_);
  local_time = localtime(&time_);
  return local_time;
}


x86 assembly (clang, -O0):
<getLocalTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <time@plt>
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getLocalTime>:
push   %rbx
sub    $0x10,%rsp
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <time@plt>
mov    %rbx,%rdi
call   1030 <localtime@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define %struct.tm* @getLocalTime() {
%1 = alloca %struct.tm*
%2 = alloca i32
%3 = call i32 @time(i32* null)
store i32 %3, i32* %2
%4 = call i32 @time(i32* %2)
%5 = call %struct.tm* @localtime(i32* %2)
store %struct.tm* %5, %struct.tm** %1
%6 = load %struct.tm*, %struct.tm** %1
ret %struct.tm* %6
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define %struct.tm* @getLocalTime() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call i32 @time(i32* %1)
%5 = call %struct.tm* @localtime(i32* %1)
ret %struct.tm* %5
}
/* Variables and functions */
int /*<<< orphan*/ sleep(unsigned int);
void os_sleep(unsigned int Sec) { sleep(Sec); }


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

x86 assembly (clang, -O2):
<os_sleep>:
jmp    1030 <sleep@plt>

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

LLVM IR (-O2):
define void @os_sleep(i32 %0) {
%2 = tail call i32 @sleep(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void newline(void) { putchar('\n'); }


x86 assembly (clang, -O0):
<newline>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1030 <putchar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<newline>:
mov    $0xa,%edi
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @newline() {
%1 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @newline() {
%1 = tail call i32 @putchar(i8 signext 10)
ret void
}
float *vec3_scale(float *result, float *a, float scalar) {
  result[0] = a[0] * scalar;
  result[1] = a[1] * scalar;
  result[2] = a[2] * scalar;
  return result;
}


x86 assembly (clang, -O0):
<vec3_scale>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mulss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
mulss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
mulss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec3_scale>:
mov    %rdi,%rax
movss  (%rsi),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,(%rdi)
movss  0x4(%rsi),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,0x4(%rdi)
mulss  0x8(%rsi),%xmm0
movss  %xmm0,0x8(%rdi)
ret

LLVM IR (-O0):
define float* @vec3_scale(float* %0, float* %1, float %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float
store float* %0, float** %4
store float* %1, float** %5
store float %2, float* %6
%7 = load float*, float** %5
%8 = getelementptr inbounds float, float* %7, i64 0
%9 = load float, float* %8
%10 = load float, float* %6
%11 = fmul float %9, %10
%12 = load float*, float** %4
%13 = getelementptr inbounds float, float* %12, i64 0
store float %11, float* %13
%14 = load float*, float** %5
%15 = getelementptr inbounds float, float* %14, i64 1
%16 = load float, float* %15
%17 = load float, float* %6
%18 = fmul float %16, %17
%19 = load float*, float** %4
%20 = getelementptr inbounds float, float* %19, i64 1
store float %18, float* %20
%21 = load float*, float** %5
%22 = getelementptr inbounds float, float* %21, i64 2
%23 = load float, float* %22
%24 = load float, float* %6
%25 = fmul float %23, %24
%26 = load float*, float** %4
%27 = getelementptr inbounds float, float* %26, i64 2
store float %25, float* %27
%28 = load float*, float** %4
ret float* %28
}

LLVM IR (-O2):
define float* @vec3_scale(float* returned writeonly %0, float* nocapture %1, float %2) {
%4 = load float, float* %1
%5 = fmul float %4, %2
store float %5, float* %0
%6 = getelementptr inbounds float, float* %1, i64 1
%7 = load float, float* %6
%8 = fmul float %7, %2
%9 = getelementptr inbounds float, float* %0, i64 1
store float %8, float* %9
%10 = getelementptr inbounds float, float* %1, i64 2
%11 = load float, float* %10
%12 = fmul float %11, %2
%13 = getelementptr inbounds float, float* %0, i64 2
store float %12, float* %13
ret float* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int pthread_attr_getstack(const pthread_attr_t *a, void **b, size_t *c) {
  assert(0);
}


x86 assembly (clang, -O0):
<pthread_attr_getstack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
xor    %edi,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_attr_getstack>:
xor    %edi,%edi
jmp    1030 <assert@plt>

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

LLVM IR (-O2):
define i32 @pthread_attr_getstack(i32* nocapture readnone %0, i8** nocapture readnone %1, i64* nocapture readnone %2) {
%4 = tail call i32 @assert(i32 0)
ret i32 undef
}
int main(void) {
  int i = ({
    static int i = 3;
    i + 5;
  });
  return i;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0x2f0f(%rip),%eax
add    $0x5,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@main.i = internal global i32 3
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = load i32, i32* @main.i
%5 = add nsw i32 %4, 5
store i32 %5, i32* %3
%6 = load i32, i32* %3
store i32 %6, i32* %2
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
define i32 @main() {
ret i32 8
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void handle_fatal_error(char *msg) {
  perror(msg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<handle_fatal_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<handle_fatal_error>:
push   %rax
call   1030 <perror@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @handle_fatal_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @handle_fatal_error(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}